Professional Documents
Culture Documents
Outline
Introduction to numerical
methods
Approaches to Fluid Dynamical Problems:
Components of numerical
methods (Properties)
Consistence
1. The discretization should become exact as the grid
spacing
tends to zero
2. Truncation error: Difference between the discretized
equation
and the exact one
Components of numerical
methods (Properties, Contd)
Conservation
Boundedness:
1. Iterative methods: not diverge
2. Temporal problems: bounded solutions
3. Von Neumanns method
4. Difficulty due to boundary conditions and nonlinearities present.
Realizability: models of phenomena which are too
complex to treat directly (turbulence, combustion, or
multiphase flow) should be designed to guarantee
physically realistic solutions.
Accuracy: 1. Modeling error 2. Discretization errors 3.5
lecture)
n
2 ( x xi ) 3 3
(
x xi ) n
2 +
3 + ... +
n + H
3! x i
n! x i
x i
i +1 i xi +1 xi
x
x
x
2
i
i +1
i
2 ( xi +1 xi ) 2 3
2
3 + H
6
x i
x i
i +1 i
xi +1 xi
x i
i +1 i 1
xi +1 xi 1
x i
Forward-FDS
Central-FDS
i i 1
xi xi 1
x i
Backward-FDS
x i
xi +1xi ( xi + xi +1 )
xi = xi xi 1
i +1 i 1
i+2 i2
+
+
x
2 x
4 x
i +1
i
i 1
x i +1 x i
xi +1 xi
equation
FV defines the
control volume
boundaries while
FD define the
computational
nodes
NW
WW
node located at
the Control
Volume center
Global
conservation
automatically
satisfied
nw
w
sw
Computational
SW
NE
ne
ne E
e
y
P
s
se
SE
n
EE
j
i
equation
fdS = fdS
k
Sk
11
A1
A4
transforming the discrete IBVP back to a continuous
JIBVP.
( x ) i
LModified ( S ) = LM ( S ) = N BC : S ( xB , t ) = H Modified ( t )
i S
j
J
S = SC +
i
i! x j
N = 1 + j
j =1 i =1
IC : S ( x, t = 0) = GModified ( x )
j =1
Truncation error
12
IC : SN ( x, t = 0 ) = GModified ( x ) GM ( x )
A5
BC : SN ( xB , t ) = H Modified ( t ) H M ( t )
An IBVP for the modeling error M-T can be obtained by
subtracting A1 and A2:
LM ( M T ) = LM ( SM ) = M = LM ( T )
IC : SM ( x, t = 0) = GM ( x ) GT ( x )
BC : SM ( xB , t ) = H M ( t ) H T ( t )
A6
Adding A5 and A6
LM ( S T ) = LM ( S ) = N + M
IC : S ( x,0 ) = GModified ( x ) GT ( x )
BC : S ( xB , t ) = H Modified ( t ) H T ( t )
S = S T = SN + SM
13
A = Q
A21
.
A=
.
.
A
n1
A22
.
.
.
An 2
A23
.
.
.
An 3
.
.
.
.
.
.
A2 n
.
.
.
.
Ann
U =
0
.
.
.
0
A22
.
.
.
0
A23
.
.
.
0
.
.
.
.
.
.
A2 n
.
.
.
.
Ann
n =
i =
Qi
Ann
n
k = i +1
ik
Aii
i
i 1
A
A
APi = APi W i 1E
AP
i 1
AWi Qi*1
Q = Qi
APi 1
*
i
i +1
Qi* AEi i +1
i =
APi
16
A = Q
A = Q
n
A =
n
=
n
n residual
n Iteration error
17
18
( i = 1,2,..., n )
i 1
j =1
j =i
( i = 1,2,..., n )
i 1
j =1
j =i
( i = 1,2,..., n )
19
f ( x ) f ( x0 ) + f ( x0 )( x x0 )
'
f ( xk 1 )
xk = xk 1 '
f ( xk 1 )
21
i, j
k +1
i, j
<
i, j
ik,+j1
k
i, j
<
n
ik,+j1
i, j
12
<
The
basic problem is to find the solution
a short
23
ODEs
1. Two-Level Methods (explicit/implicit
Euler)
2. Predictor-Corrector and Multipoint
Methods
d ( t )
3. Runge-Kutta
Methods
( t0 ) = 0
= f ( t , ( t ) )
4. Other
dt methods
Equation
2
1. Explicit methods
= u
+
2. Implicit
t methods
x x 2
3. Other methods
24
explicit n +1 = n + f ( tn , n ) t
n +1 = n + f t n +1 , n +1 t implicit
t
n
f
t
,
1
n
n+
2
2
t
**
n
*
1 = +
f t 1 , 1
n+
2 n+ 2 n+ 2
2
*
= n +
**
= + tf t 1 , 1
n+ 2 n+ 2
t
n +1
n
n
*
**
*
= + f ( t n , ) + 2 f t 1 , 1 + 2 f t 1 , 1 + f ( t n +1 , n +1 )
6
n+ 2 n+ 2
n+ 2 n+ 2
*
n +1
25
n +1
i
( x )
n
i
c
c
in +1 = (1 2d ) in + d in+1 + d + in1
2
2
ut
x
n +1
i
( x )
n
i
Equations
Choice of Variable Arrangement on
the Grid
Pressure Poisson equation
Solution methods for N-S equations
28
+ u
+ v
+ w
=
+ 2 + 2 + 2
t
x
y
z
x
y
z
x
2v 2v 2v
v
v
v
v
p
+ u + v + w = + 2 + 2 + 2
t
x
y
z
y
y
z
x
2w 2w 2w
w
w
w
w
p
+ u
+ v
+ w
= + 2 + 2 + 2
t
x
y
z
z
y
z
x
Local
acceleration
Convection
Viscous terms
( u ) ( v ) ( w)
+
+
+
= 0 Continuity equation
t
x
y
z
29
Staggered
30
xi xi
xi x j
31
Equations) Algorithm:
1. Guess the pressure field p*
2. Solve the momentum equations to obtain u*,v*,w*
3. Solve the p equation (The pressure-correction equation)
4. p=p*+p
5. Calculate u, v, w from their starred values using the
velocity-correction equations
6. Solve the discretization equation for other variables,
such as
temperature, concentration, and turbulence quantities.
7. Treat the corrected pressure p as a new guessed
pressure p*,
return to step 2, and repeat the whole procedure until a
converged solution is obtained.
32
problem is a classical
problem that has wall
boundaries surrounding
the entire computational
region.
Incompressible viscous
flow in the cavity is
driven by the uniform
translation of the
moving upper lid.
the vorticity-stream
function method is used
to solve the driven
cavity problem.
u=UTOP, v=0
u=v=0
UTOP
u=v=0
y
o
x
u=v=0
33
2u 2u
u
u
u
p
+u
+v
= + 2 + 2
t
x
y
x
y
x
v u
=
x y
2v 2v
v
v
v
p
+ u + v = + 2 + 2
t
x
y
y
y
x
1 2 2
2 + 2
+u
+v
=
t
x
y Re l x
y
2
2
2
2
2
2
p p
+ 2 = 2 2 2
2
x
y
x y xy
u
( u ) ( v )
+v
=
+
x
y
x
y
=u
y
= v
x
2 2
+ 2 =
2
x
y
Ul
Re l =
34
i , NJ =
p
s
w+1 = w + n
n
2
1
2
( n ) 2
w +
2
n
2( i , NJ y i , NJ 1 )
( y ) 2
1
Re l n
ps +1, w ps 1,w
w
2s
w + o ( n )
1
Re l
3 s , w + 4 s , w+1 s , w+ 2
2n
+
2
2
x
)
(
y
)
= in, j
n 2 n + n
i +1, j
i, j
i 1, j
= 2
(x) 2
(y ) 2
in, j +1 2 in, j + in, j 1 in+1, j +1 in+1, j 1 in1, j +1 + in1, j 1
4xy
(y )
2nd order central difference scheme used for all spatial derivatives
36
37
i = NI , j = NJ
i =1, j =1
and
1
NI NJ
i = NI , j = NJ
i =1, j =1
38
0.1
25
29
13
27
21 19
17
29
15
28
25
0.2
23
27
11
27
15
0.6
11
17
13
0.4
7
0.2
0.1
0
0.3
0.2
0.1
0
0.9
1.1905
1.1754
1.1604
1.1454
1.1303
1.1153
1.1003
1.0852
1.0702
1.0552
1.0401
1.0251
1.0101
0.9950
0.9800
0.8
14
16
19
17
9
11
13
15
19
4
8
17
Level
21
21
0.7
0.6
y 0.5
0.4
0.3
0.2
21
21
0.1
0
25
24
0.3
Level
29
27
25
23
21
19
17
15
13
11
9
7
5
3
1
y 0.5
0.4
29 27
25
29
25
13
0.7
y 0.5
19
0.8
0.6
15 17 19 21 23
0.9
0.7
1.1
x
1
0.8
27 25
5
9
13
11
113
1
9
21
0.3
-0.0064
-0.0119
-0.0174
-0.0228
-0.0283
-0.0338
-0.0393
-0.0448
-0.0502
-0.0557
-0.0612
-0.0667
-0.0721
-0.0776
0.9
19
19
29
15
23 25
27
0.4
27
25
23
21
19
17
15
13
11
9
7
5
3
1
21
23
Level psi
31
0.0018
29
-0.0009
21
27
25
21 23
29
17
y 0.5
14
0.6
23
13 11
9
0.7
27
23 21
19
17
0.9
0.8
29
23
21
25
19
17
15
13 1
1
21
29
27
15
17
21 19
23
25 27
29
29
27
25
23
21
19
17
15
13
11
9
7
5
3
1
zeta
11.2711
8.3232
5.3753
2.4273
-0.5206
-3.4686
-6.4165
-9.3644
-12.3124
-15.2603
-18.2082
-21.1562
-24.1041
-27.0521
-30.0000
23
39
40