Professional Documents
Culture Documents
Numerical Solution of Fluid Flow: Nguyen Quang Khai
Numerical Solution of Fluid Flow: Nguyen Quang Khai
Numerical Solution of Fluid Flow: Nguyen Quang Khai
FUNDAMENTALS OF FDM
In FDM, derivatives are replaced by a proper difference formula based on the Taylor
series expansions of a function:
The difference formula above is of order 1 with the truncation error being
proportional to x
To obtain higher order difference formula for the first derivative, Taylor series
expansion of the function is used from both side of x
The difference formula above is of order 2 with the truncation error being
proportional to (x)2
TYPICAL DIFFERENCE FORMULAS
Forward
One – dimension (1D)
First derivatives
Backwar
d
Centered
derivatives
Second
Centered
Forward
Two – dimension (2D)
First derivatives
Backwar
d
Centered
Centered
Second
derivatives
SOLVING TIME-INDEPENDENT PDES
d2u 2
2
−u=−x 0≤ x≤1
dx
subject to the boundary conditions:
u(0) = 0 ; u(1) = 0
Solution:
1. Divide the x-domain into 4-subdomain, i.e ∆ x=0.25
∆ x=0.25
u0 u1 u2
u3 u4
2. Using the Centered difference for second derivatives (1D) we have:
d 2 u u 0−2 u1 +u2
=
d x2 ∆ x2
3. u0 =0; u 4=0
4.
u0−2 u1 +u2 2
2
−u1=−x 1
∆x
u1−2 u2 +u3 2
2
−u2=−x 2
∆x
u2−2 u3 +u4 2
2
−u 3=−x 3
∆x
−(2+∆ x 2) 1 0 u1 −x 21 ∆ x 2
( 1
0
−(2+ ∆ x2 )
1
1
−(2+∆ x 2) u3 )( ) ( )
u2 = −x 22 ∆ x 2
−x 23 ∆ x2
−2.0625 1 0 u1 −0.0039
( 1
0
−2.0625
1
1
)( ) (
u2 = −0.015625
−2.0625 u3 −0.035156 )