(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
lec_slides.pdf
1. Foundations of CFD
(AM5630)
Outline
What is CFD ?
Steps in CFD
Steps in CFD
Governing Equations
Tensor notation
CFD books
Richtmyer R D and Morton K W, Difference methods for
initial value problems, Inter science publishers, 1967.
Chung T J, Computational Fluid Dynamics, CUP, 2002
Anderson J, Essential Computational Fluid Dynamics
Joel H. Ferziger and Milovan Peric Computational Methods
Joel H. Ferziger and Milovan Peric Computational Methods
for Fluid Dynamics
John C. Tannehill, Dale Anderson Richard Pletcher,
Computational Fluid Mechanics and Heat Transfer, 2nd Ed.
Steps in CFD
Identify the design/ optimization/ failure analysis
problem
Identify a suitable Mathematical model
Choose the appropriate flow domain of interest.
Suitable PDE’s, IC’s and BC’s.
Suitable PDE’s, IC’s and BC’s.
Discretize the region of interest.
Develop the system of algebraic equations.
Solve the system of equations.
Perform post-processing.
Develop an engineering solution.
Continuum Hypothesis
V
m
V
V δ
δ
ρ
δ
δ *
lim
→
=
Air at STP: δV*=10-9 mm3, which contains 3x107
molecules which is sufficient to define a nearly constant
density.
Forces on a blob of fluid
force
pressure
Net
on
Accelerati
Mass .
* =
v
δ
V
r
force
pressure
Net
on
Accelerati
Mass .
* =
g
x
p
Dt
D
j
ji r
r
ρ
τ
ρ +
∂
∂
+
∇
−
= )
(
V
g
v
forces
viscous
dS
p
Dt
D
v
S
r
r
)
(
)
(
V
)
( δ
ρ
δ
ρ +
+
−
= ∫
forces
viscous
+
g
v
forces
viscous
v
p
Dt
D
v
r
r
)
(
)
(
V
)
( δ
ρ
δ
δ
ρ +
+
∇
−
=
forces
Body
+
Equations of motion
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
−
=
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
2
2
2
2
2
2
1
z
u
y
u
x
u
x
p
z
u
w
y
u
v
x
u
u
t
u
ν
ρ
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
−
=
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
2
2
2
2
2
2
1
z
v
y
v
x
v
y
p
z
v
w
y
v
v
x
v
u
t
v
ν
ρ
∂
+
∂
+
∂
+
∂
∂
−
=
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂ 2
2
2
1 w
w
w
p
w
w
w
v
w
u
w
ν
ρ
j
j
i
i
j
i
j
i
x
x
u
x
p
x
u
u
t
u
∂
∂
∂
+
∂
∂
−
=
∂
∂
+
∂
∂ 2
1
ν
ρ
0
=
∂
∂
i
i
x
u
∂
+
∂
+
∂
+
∂
−
=
∂
+
∂
+
∂
+
∂ 2
2
2
z
y
x
z
z
w
y
v
x
u
t
ν
ρ
0
=
∂
∂
+
∂
∂
+
∂
∂
z
w
y
v
x
u
Some times called suffix notation. Much of the
notation can be introduced in the context of vectors
with so called Summation convention
The rule is, if a suffix is repeated in any term, there is
an implied summation
Tensor Notation
j
i
j
x
u
u
∂
∂
3
2
1
x
u
u
x
u
u
x
u
u i
i
i
∂
∂
+
∂
∂
+
∂
∂
Range convention: If a suffix occurs just once in a
term, then it is assumed to take all of the values 1,2,3
in turn.
j is called dummy index – indicating an implied
summation.
i is called free index – indicating the eqn. above
represents 3 components of a vector eqn.
3
3
2
2
1
1
x
u
x
u
x
u
∂
+
∂
+
∂
Tensor Notation (ctd…)
)
/
(
)
.
( ρ
p
t
−∇
=
∇
+
∂
∂
u
u
u
∂
∂
−
=
∂
∂
+
∂
∂
ρ
p
x
x
u
u
t
u
i
j
i
j
i
0
u =
∇.
i
i
x
u
∂
∂
∂
∂
∂
+
∂
∂
−
=
∂
∂
+
∂
∂
j
j
i
i
j
i
j
i
x
x
u
p
x
x
u
u
t
u 2
ν
ρ
u
u
u
u 2
)
/
(
)
.
( ∇
+
−∇
=
∇
+
∂
∂
ν
ρ
p
t
Disturbance propagation in a flow
Subsonic Sonic Supersonic
0
)
1
( 2
2
2
2
2
=
∂
∂
+
∂
∂
−
y
x
M
φ
φ
1
M 1
=
M 1
M
2. PDE - classification
0
2
2
2
2
2
=
+
+
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
∂
+
∂
∂
G
F
y
E
x
D
y
C
y
x
B
x
A φ
φ
φ
φ
φ
φ
0
4
2
− AC
B
0
4
2
=
− AC
B
Elliptic
Parabolic
0
4 =
− AC
B
0
4
2
− AC
B
Parabolic
Hyperbolic
Elliptic PDE
Can be solved by specifying BC’s on a complete
contour enclosing the region.
It is a BVP
At all points in the domain Ω
Γ
0
4
2
− AC
B
An elliptic PDE has no real characteristic curves.
An elliptic PDE has no real characteristic curves.
A disturbance is propagated instantly in all
directions in the region.
0
:
2
2
2
2
=
∂
∂
+
∂
∂
y
x
Examples
φ
φ
)
,
(
2
2
2
2
y
x
f
y
x
=
∂
∂
+
∂
∂ φ
φ
Parabolic PDE
BC’s may be closed on one direction. But,
remain open at one end of the other direction.
It is a mixed BVP
At all points in the domain Ω
Γ
0
4
2
=
− AC
B
For a parabolic PDE there exists one char. line.
For a parabolic PDE there exists one char. line.
Typically, an initial distribution of dependent
variable and two sets of BC’s are required for a
complete description of the problem.
2
2
:
x
T
t
T
Examples
∂
∂
=
∂
∂
α 2
2
x
u
t
u
∂
∂
=
∂
∂
ν
Hyperbolic PDE
The eqns. can be solved by specifying the conditions
only at a portion of the boundary, the other
boundaries remain open.
It is an IVP
At all points in the domain
Ω
0
4
2
− AC
B
For a Hyperbolic PDE, two
P
A
Γ
For a Hyperbolic PDE, two
real char. exists per piont.
Typically, we need to specify conditions at one
part of the boundary in order to determine the
solution in a given region.
2
2
2
2
2
:
x
a
t
Examples
∂
∂
=
∂
∂ φ
φ
A
B C
Tensor Notation (ctd…)
( )
j
k
ijk
i
i
x
u
∂
∂
=
×
∇
= ε
ω u
u
×
∇
( )
k
j
ikj
i
i
x
u
∂
∂
=
×
∇
= ε
ω u
( )
∂
∂
−
∂
∂
=
×
∇
=
k
j
j
k
ijk
i
i
x
u
x
u
ε
ω
2
1
u
?
3
2
1 ω
ω
ω
is
what
k
i
ik
x
u
EXPAND
∂
∂
τ
j
i
i
j
j
i
x
u
x
u
x
u
EXPAND
∂
∂
∂
∂
+
∂
∂
Outline
PDE and their classification
Understanding characteristics
When do you call a PDE is well-posed ?
The problem in fact has a solution
The solution is unique
The solution is unique
The solution depends continuously on
the data given in the problem.
PDE - classification
0
2
2
2
2
2
=
+
+
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
∂
+
∂
∂
G
F
y
E
x
D
y
C
y
x
B
x
A φ
φ
φ
φ
φ
φ
Assume ϕ = ϕ(x,y) is a solution of the differential equation.
By definition, the 2nd order derivatives along the
characteristic curves are indeterminate and indeed, they
characteristic curves are indeterminate and indeed, they
may be discontinuous across the characteristics.
Thus differentials of ϕx and ϕy is which
represent changes from location (x,y) to (x+dx, y+dy)
across the characteristics may be expressed as,
However, no discontinuity of the first derivatives is
allowed i.e., they are continuous functions of x and y.
Assume ϕ = ϕ(x,y) is a solution of the differential
equation.
PDE - classification
∂
∂
∂ 2
2
2
φ
φ
φ
dy
y
dx
x
d x
x
x
∂
∂
+
∂
∂
=
φ
φ
φ dy
y
x
dx
x ∂
∂
∂
+
∂
∂
=
φ
φ 2
2
2
dy
y
dx
x
d
y
y
y
∂
∂
+
∂
∂
=
φ
φ
φ dy
y
dx
y
x 2
2
2
∂
∂
+
∂
∂
∂
=
φ
φ
H
y
C
y
x
B
x
A =
∂
∂
+
∂
∂
∂
+
∂
∂
2
2
2
2
2
φ
φ
φ
+
+
∂
∂
+
∂
∂
−
= G
F
y
E
x
D
H
Where
φ
φ
φ
The three eqns. above can be used to solve for the 2nd order
derivatives of ϕ
Using Cramer’s rule,
3. 2nd order PDE’s
dy
dx
dy
dx
C
B
A
dy
d
d
dx
C
H
A
y
x
y
x
0
0
0
0
2 φ
φ
φ
=
∂
∂
∂
Since it is possible to have
discontinuities in the 2nd order
derivatives of the dependent variable
across the characteristics, these
derivatives are indeterminate. Thus,
setting the denominator equal to zero,
0
0
0 =
dy
dx
dy
dx
C
B
A
Solving this quadratic yields the equations of the
characteristics in physical space.
This yields a quadratic equation.
0
2
=
+
−
C
dx
dy
B
dx
dy
A
?
,
=
β
α
dx
dy
Do it now !
0
)
1
(
2
2
2
=
∂
+
∂
− M
φ
φ
Classify the following equations :
0
1
;
0 2
2
≈
∂
∂
∂
∂
+
∂
∂
−
=
∂
∂
+
∂
∂
=
∂
∂
+
∂
∂
y
p
y
u
x
p
y
u
v
x
u
u
y
v
x
u
ν
ρ
0
2
2
2
2
2
=
+
+
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
∂
+
∂
∂
G
F
y
E
x
D
y
C
y
x
B
x
A φ
φ
φ
φ
φ
φ
0
)
1
( 2
2
=
∂
+
∂
−
y
x
M
Overview
Boundary conditions are a required component of the
mathematical model.
Boundaries direct motion of flow.
Specify fluxes into the computational domain, e.g.
mass, momentum, and energy.
mass, momentum, and energy.
Fluid and solid regions are represented by cell zones.
Material and source terms are assigned to cell zones.
Boundaries and internal surfaces are represented by
face zones.
Boundary data are assigned to face zones.
Boundary conditions
When solving the Navier-
Stokes equation and continuity
equation, appropriate initial
conditions and boundary
conditions need to be applied.
conditions need to be applied.
In the example here, a no-slip
boundary condition is applied at
the solid wall.
Neumann and Dirichlet boundary
conditions
When using a Dirichlet boundary condition, one prescribes
the value of a variable at the boundary, e.g. u(x) =
constant.
When using a Neumann boundary condition, one
When using a Neumann boundary condition, one
prescribes the gradient normal to the boundary of a
variable at the boundary, e.g. ∂nu(x) = constant.
When using a mixed boundary condition a function of the
form au(x)+b∂nu(x) = constant is applied.
Note that at a given boundary, different types of boundary
conditions can be used for different variables.
Outline
Discretization
Finite Differences
0
2
2
2
2
2
=
+
+
∂
∂
+
∂
∂
+
∂
∂
+
∂
∂
∂
+
∂
∂
G
F
y
E
x
D
y
C
y
x
B
x
A φ
φ
φ
φ
φ
φ
Discretization
1 i
i-1 i+1 N
i
i-1 i+1
j+1
i,j
j
j -1
Grid generation : Structured (vs) Unstructured Taylor Series
)
(
)
( i
x
x φ
φ =
i
i
x
x
x
∂
∂
−
+ 3
3
3
!
3
)
( φ
H
x
n
x
x
i
n
n
n
i
+
∂
∂
−
+
φ
!
)
(
K
i
i
x
x
x
∂
∂
−
+
φ
)
(
i
i
x
x
x
∂
∂
−
+ 2
2
2
!
2
)
( φ
Any continuous differentiable
function (ϕ), in the vicinity of xi ,
can be expressed as a Taylor
series:
i
i
i
i
i
x
x
x
x
x
∂
∂
−
+
≈ +
+
φ
φ
φ )
(
)
(
)
( 1
1
i
i
i
i
i
i
i
i
x
x
x
x
x
x
x
x
∂
∂
−
+
∂
∂
−
+
≈ +
+
+ 2
2
2
1
1
1
!
2
)
(
)
(
)
(
)
(
φ
φ
φ
φ
i
n
n
n
i
i
n x
n
x
x
TE
∂
∂
−
+
∞
=
∑
φ
!
)
(
: 1
3
i
n
n
n
i
i
n x
n
x
x
TE
∂
∂
−
+
∞
=
∑
φ
!
)
(
: 1
2
4. Do it now !
i
i
i
i
i
x
x
x
x
x
∂
∂
−
+
≈ +
+
φ
φ
φ )
(
)
(
)
( 1
1
i
i
i
i
i
x
x
x
x
x
∂
∂
−
+
≈ −
−
φ
φ
φ )
(
)
(
)
( 1
1
)
(
)
(
)
(
)
(
1
1
x
O
x
x
x
x
x i
i
i
i
i
∆
+
−
−
=
∂
∂
+
+ φ
φ
φ
)
(
)
(
)
(
)
(
1
1
x
O
x
x
x
x
x i
i
i
i
i
∆
+
−
−
=
∂
∂
−
− φ
φ
φ
)
(
)
(
)
(
)
( 1
x
O
x
x
x
x
i
i
i
∆
+
∆
−
=
∂
∂ −
φ
φ
φ
2
)
(
? x
O
x i
∆
+
=
∂
∂φ
i
i
i
i
i
x
x
x
x
x
x
x
x
∂
∂
−
+
∂
∂
−
+
≈ 2
2
2
!
2
)
(
)
(
)
(
)
(
φ
φ
φ
φ
Derivative and its approximation Validation and Verification
Are we solving the right equations ?
(vs)
Are we solving the equations right ?
Consistency
Consistency
0
→
TE
FDE
PDE
TE −
=
Do it now !
i
i
i
i
x
x
x
x
x
x
x
∂
∂
∆
+
∂
∂
∆
+
≈
∆
+ 2
2
2
!
2
)
(
)
(
)
(
)
(
φ
φ
φ
φ
)
(
?
2
2
x
O
x i
∆
+
=
∂
∂ φ )
(
)
(
2
2
1
2
2
2
x
O
x
x
i
i
i
i
∆
+
∆
+
−
=
∂
∂ +
+ φ
φ
φ
φ
2
2
2
)
(
? x
O
x i
∆
+
=
∂
∂ φ
i
i
i
i
x
x
x
x
x
x
x
∂
∂
∆
+
∂
∂
∆
+
≈
∆
+ 2
2
2
!
2
)
2
(
)
2
(
)
(
)
2
(
φ
φ
φ
φ
Outline
Discretization
Finite Differences
Explicit (vs) Implicit
Do it now !
i
i
i
i
x
x
x
x
x
x
x
∂
∂
∆
+
∂
∂
∆
+
≈
∆
+ 2
2
2
!
2
)
(
)
(
)
(
)
(
φ
φ
φ
φ
)
(
?
2
2
x
O
x i
∆
+
=
∂
∂ φ
i
i
i
i
x
x
x
x
x
x
x
∂
∂
∆
+
∂
∂
∆
+
≈
∆
+ 2
2
2
!
2
)
2
(
)
2
(
)
(
)
2
(
φ
φ
φ
φ
)
(
)
(
2
)
1
(
*
2
)
2
( 2
1
2
2
2
x
O
x
x
Eq
Eq i
i
i
i
∆
+
∆
+
−
=
∂
∂
⇒
− +
+ φ
φ
φ
φ
Do it now !
2
2
2
)
(
? x
O
x i
∆
+
=
∂
∂ φ
i
i
x
x
x
∂
∂
∂
∂
=
∂
∂
)
(
2
2
φ
φ
x
x
x i
i
∆
∂
∂
−
∂
∂
≈ +
φ
φ
1
i
i
x
∆
x
x
x
i
i
i
i
∆
∆
−
−
∆
−
≈
−
+ 1
1 φ
φ
φ
φ
( )
( )2
2
1
1 2
x
O
x
i
i
i
∆
+
∆
+
−
= −
+ φ
φ
φ
[ ]
2
2
2
)
(
,
)
(
? y
x
O
y
x i
∆
∆
+
=
∂
∂
∂ φ
Do it now !
[ ]
2
2
2
)
(
,
)
(
? y
x
O
y
x i
∆
∆
+
=
∂
∂
∂ φ
y
y j
i
j
i
∂
∂
−
∂
∂
≈
−
+ ,
1
,
1
φ
φ
( )( )
( ) ( )
[ ]
2
2
1
,
1
1
,
1
1
,
1
1
,
1
,
4
y
x
O
y
x
j
i
j
i
j
i
j
i
∆
∆
+
∆
∆
+
−
−
=
−
−
+
−
−
+
+
+ φ
φ
φ
φ
x
y
y j
i
j
i
∆
∂
∂
≈
−
+
2
,
1
,
1
Explicit (vs) Implicit
2
2
x
T
t
T
∂
∂
=
∂
∂
α
( )
2
2 T
T
T
T +
−
∂
( )
( )
t
O
t
T
T
t
T n
i
n
i
∆
+
∆
−
=
∂
∂ +1
Explicit
Implicit
( )
( )2
2
1
1
2
2
2
x
O
x
T
T
T
x
T i
i
i
∆
+
∆
+
−
=
∂
∂ −
+
( )
( )2
2
1
1 2
x
O
x
T
T
T
n
i
i
i
∆
+
∆
+
− −
+
( )
( )2
1
2
1
1 2
x
O
x
T
T
T
n
i
i
i
∆
+
∆
+
−
+
−
+
5. Outline
Explicit (vs) Implicit
Stability analysis
Explicit (vs) Implicit
2
2
x
T
t
T
∂
∂
=
∂
∂
α
( )
( )
t
O
t
T
T
t
T n
i
n
i
∆
+
∆
−
=
∂
∂ +1
1 i
i-1 i+1 N
n
n
n
T
T
T
∂
−
+ 2
1 n
n
n
x
T
t
O
t
T
T
∂
∂
=
∆
+
∆
−
+
2
2
1
)
( α
1
2
2
1
)
(
+
+
∂
∂
=
∆
+
∆
−
n
n
n
x
T
t
O
t
T
T
α
Explicit
Implicit
Explicit Scheme
( )
( )
n
i
n
i
n
i
n
i
n
i T
T
T
x
t
T
T 1
1
2
1
2 −
+
+
+
−
∆
∆
+
=
α
( )
( ) )
(
2 2
2
1
1
1
2
2
t
O
x
O
x
T
T
T
t
T
T
x
T
t
T n
i
n
i
n
i
n
n
∆
+
∆
=
∆
+
−
−
∆
−
−
∂
∂
−
∂
∂ −
+
+
α
α
Explicit
1 i
i-1 i+1
N
Time level n
i
Time level n+1
i
Time level n+1
i-1 i+1
Implicit
( )
( )
1
1
1
1
1
2
1
2 +
−
+
+
+
+
+
−
∆
∆
+
= n
i
n
i
n
i
n
i
n
i T
T
T
x
t
T
T
α
Implicit Scheme
1 i
i-1 i+1
N
Time level n
n
i
n
i
i
n
i
i
n
i
i d
T
c
T
b
T
a =
+
+ +
−
+
+
−
1
1
1
1
1 TDMA
i
Time level n+1
i-1 i+1
Implicit
( )
( )
1
1
1
1
1
2
1
2 +
−
+
+
+
+
+
−
∆
∆
+
= n
i
n
i
n
i
n
i
n
i T
T
T
x
t
T
T
α
Semi-Implicit Scheme
1 i
i-1 i+1
N
Time level n
( )
( )
( )( )
+
−
−
+
+
−
∆
∆
+
=
−
+
+
−
+
+
+
+
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
T
T
T
T
T
T
x
t
T
T
1
1
1
1
1
1
1
2
1
2
1
2
β
β
α
β formulation
( )
∆
+
−
=
∆
− −
+
−
+
2
1
1
1
1
2
2 x
T
T
T
t
T
T n
i
n
i
n
i
n
n
α Richardson’s
( )
∆
+
+
−
=
∆
−
−
−
+
+
−
+
2
1
1
1
1
1
1
2
2
2 x
T
T
T
T
t
T
T
n
i
n
i
n
i
n
i
n
n
α Dufort-
Frankel
Different Schemes
( )
∆
=
∆ 2
2 x
t
α
Frankel
( )
( )
( )
( )
∆
+
−
+
∆
+
−
=
∆
− −
+
+
−
+
+
+
+
2
1
1
2
1
1
1
1
1
1
2
2
2
1
x
T
T
T
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
α
Crank-
Nicolson
Explicit
The solution algorithm is simple to set up.
For a given ∆x, ∆t must be less than a specific limit
imposed by stability constraints. This requires many
time steps to carry out the calculations over a given
interval of time.
Implicit
Implicit
Stability can be maintained over much larger values of
∆t. Which implies, fewer time steps are needed to
carry out the calculations over a given interval.
Since matrix manipulations are usually required at
each time step, the computer time per time step is
larger than that of the explicit approach.
Discrete perturbation analysis
After m steps
i-1 i+1
m
ε
i
After m steps
1 i-1 i+1
N
m
ε
m
ε
− m
ε
−
i
ε
1 i
i-1 i+1
N
Time level n
Time level n+1
1 i
i-1 i+1 N
i
After m steps
1 i-1 i+1
N
Stability of Explicit schemes
2
2
x
T
t
T
∂
∂
=
∂
∂
α
1 i
i-1 i+1 N
Explicit : FTCS
( )2
1
1
1
2
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
∆
+
−
=
∆
− −
+
+
α
( )
x
t ∆
∆
Let us introduce a disturbance ε at
and find the influence on the grid points at higher time levels
n
i
T
( ) ( )
( )2
1
1
1
2
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
∆
+
+
−
=
∆
+
− −
+
+
ε
α
ε
6. Stability of Explicit schemes
( ) ( )
( )2
1
1
1
2
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
∆
+
+
−
=
∆
+
− −
+
+
ε
α
ε
i
T
assume n
i ∀
( )
( )2
1
0
2
0
x
t
T n
i
∆
+
−
=
∆
−
+
ε
α
ε
( )
∆
∆
−
=
+
2
1
2
1
x
t
T n
i α
ε
( )
∆
∆
= 2
x
t
d
let α
d
T n
i
2
1
1
−
=
+
ε
1
2
1
)
(
1
2
1 −
≥
−
≤
− d
or
d
1
≤
⇒ d
Stability of Explicit schemes
When the error reaches all the grid points, after many time
steps, approximately with the same magnitude,
2 possibilities may be considered :
(i) Error at time m, have the same sign
(ii) Error at time m, have alternate signs.
( )
( )2
1
2
x
t
T m
m
m
m
m
i
∆
+
−
=
∆
−
+
ε
ε
ε
α
ε
m
m
i
T ε
=
+1
No stability constraint
;
;
;
,
1
1
m
m
i
m
m
i
m
m
i
T
T
T
Let
ε
ε
ε
=
=
=
−
+
;
;
;
, 1
1
m
m
i
m
m
i
m
m
i T
T
T
Let ε
ε
ε −
=
=
−
= −
+
Under what conditions will the solution be stable, if the sign
of the error alternates ?
Stability of Explicit schemes
;
;
;
, 1
1
m
m
i
m
m
i
m
m
i T
T
T
Let ε
ε
ε −
=
=
−
= −
+
Under what conditions will the solution be stable, if the sign
of the error alternates ?
( )
m
m
m
m
m
i d
T ε
ε
ε
ε −
−
−
+
=
+
2
1
d
T
m
n
i
4
1
1
−
=
+
ε
( ) m
m
i d
T ε
4
1
1
−
=
+
Solution will be stable if, 1
4
1
)
(
1
1
≤
−
≤
+
d
or
T
m
n
i
ε
This requirement leads to,
( )2
2
1
x
t ∆
≤
∆
α
0
∂
∂
−
=
∂
∂
a
x
u
a
t
u
1 i
i-1 i+1 N
The quantity u is convected along these lines with a constant a.
A number of FD approximations can be constructed as follows :
u
u
u
u n
n
n
n
−
−
+1
Schemes for Hyperbolic Equations
( )
x
u
u
a
t
u
u n
i
n
i
n
i
n
i
∆
−
−
=
∆
− +
+
1
1
Eulers’ FTFS
Stability analysis indicates that, the method is unconditionally
unstable.
( )
x
u
u
a
t
u
u n
i
n
i
n
i
n
i
∆
−
−
=
∆
− −
+
+
2
1
1
1
Eulers’ FTCS
This explicit formulation is also unconditionally unstable.
Schemes for Hyperbolic Equations
0
∂
∂
−
=
∂
∂
a
x
u
a
t
u
1 i
i-1 i+1 N
( )
x
u
u
a
t
u
u n
i
n
i
n
i
n
i
∆
−
−
=
∆
− −
+
1
1
First order upwind
differencing
Stability analysis indicates that, this method is stable, when c ≤ 1
Stability analysis indicates that, this method is stable, when c ≤ 1
Use Forward differencing for the spatial derivative if a 0
( )
( )
x
u
u
a
t
u
u
u n
i
n
i
n
i
n
i
n
i
∆
−
−
=
∆
+
−
−
+
−
+
+
2
2
1
1
1
1
1
1
The Lax method
Stability analysis indicates that, this method is stable, when c ≤ 1.
( )
x
u
u
a
t
u
u n
i
n
i
n
i
n
i
∆
−
−
=
∆
− +
+
1
1
Sources of Error
2
2
x
T
t
T
∂
∂
=
∂
∂
α
1 i
i-1 i+1 N
Explicit : FTCS
( )2
1
1
1
2
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
∆
+
−
=
∆
− −
+
+
α
( )
x
t ∆
∆
A : Analytical Solution
D : Exact solution of the difference equation
Discretization error = A - D
N : Numerical solution on a digital computer
Round-off error = N - D
D
N
Error −
=
ε
:
Stability of Explicit schemes
( ) ( )
( )2
1
1
1
1
1
1
2
x
D
D
D
t
D
D n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
n
i
∆
+
+
+
−
+
=
∆
+
−
+ −
−
+
+
+
+
ε
ε
ε
α
ε
ε
( ) ( ) 1
1
1
2 D
D
D
D
D n
i
n
i
n
i
n
i
n
i +
−
=
− −
+
+
α
D : Exact solution of the difference equation; Hence, it exactly
satisfies the difference equation.
( ) ( )
( )2
1
1 2
x
D
D
D
t
D
D i
i
i
i
i
∆
+
−
=
∆
− −
+
α
( )
( )2
1
1
1
2
)
2
(
)
1
(
x
t
n
i
n
i
n
i
n
i
n
i
∆
+
−
=
∆
−
⇒
− −
+
+
ε
ε
ε
α
ε
ε
Error (ε) also satisfies the
difference equation; Solution is
stable, if
1
1
≤
+
n
i
n
i
ε
ε
Round-off error variation
Random variation of ε with x can be
analytically expressed as a Fourier series as
follows : x
ik
m
m
m
e
A
x ∑
=
)
(
ε
Round-off error variation
3
,
2
,
1
2
=
= m
m
L
km
π
∑
=
=
2
/
1
)
(
)
,
(
N
m
x
ik
m
m
e
t
A
t
x
ε
∑
=
=
2
/
1
)
(
N
m
x
ik
m
m
e
A
x
ε
However, we are interested in the variation of ε with time.
7. Stability of Explicit schemes
( )2
)
(
)
(
)
(
2
x
e
e
e
e
e
e
t
e
e
e
e x
x
ik
at
x
ik
at
x
x
ik
at
x
ik
at
x
ik
t
t
a m
m
m
m
m
∆
+
−
=
∆
− ∆
−
∆
+
∆
+
α
Simplify now !
x
ik
at m
e
e
by
divide ,
Use following identities :
2
)
cos(
x
ik
x
ik
m
m
m
e
e
x
k
∆
−
∆
+
=
∆
2
)
cos(
1
)
2
(
sin2 x
k
x
k m
m ∆
−
=
∆
Use following identities :
Outline
Elliptic PDE
Parabolic PDE (2-d)
Iterative Methods
1-D parabolic PDE
2
2
x
T
t
T
∂
∂
=
∂
∂
α
1 i
i-1 i+1 N
Explicit : FTCS
( )2
1
1
1
2
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
∆
+
−
=
∆
− −
+
+
α
( )
x
t ∆
∆
( ) 2
1
2
≤
∆
∆
x
t
α
Parabolic PDE Elliptic PDE
0
2
2
2
2
=
∂
∂
+
∂
∂
y
T
x
T
2
2 +
−
+
− T
T
T
T
T
T
)
,
(
2
2
2
2
y
x
f
y
T
x
T
=
∂
∂
+
∂
∂
( ) ( )
0
2
2
2
1
,
,
1
,
2
,
1
,
,
1
=
∆
+
−
+
∆
+
− −
+
−
+
y
T
T
T
x
T
T
T j
i
j
i
j
i
j
i
j
i
j
i
( )
( )
( ) 0
2
2 1
,
,
1
,
2
2
,
1
,
,
1 =
+
−
∆
∆
+
+
− −
+
−
+ j
i
j
i
j
i
j
i
j
i
j
i T
T
T
y
x
T
T
T
0
)
1
(
2 ,
2
1
,
2
1
,
2
,
1
,
1 =
+
−
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β
Parabolic PDE : FTCS
∂
∂
+
∂
∂
=
∂
∂
2
2
2
2
y
T
x
T
t
T
α
( ) ( )
∆
+
−
+
∆
+
−
=
∆
− −
+
−
+
+
2
1
,
,
1
,
2
,
1
,
,
1
,
1
, 2
2
y
T
T
T
x
T
T
T
t
T
T n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
α
( ) ( ) 2
1
2
2
≤
∆
∆
+
∆
∆
y
t
x
t α
α
,
,
1 y
x
if ∆
=
∆
=
α
( ) 4
1
2
≤
∆
∆
⇒
x
t
( )
( )
( )
( )
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i T
T
T
y
t
T
T
T
x
t
T
T ,
1
,
,
1
2
,
1
,
,
1
2
,
1
, 2
2 −
+
−
+
+
+
−
∆
∆
+
+
−
∆
∆
+
=
α
α
Stability analysis indicates, the
method is stable if,
Elliptic PDE
0
2
2
2
2
=
∂
∂
+
∂
∂
y
T
x
T
( ) ( )
0
2
2
2
1
,
,
1
,
2
,
1
,
,
1
=
∆
+
−
+
∆
+
− −
+
−
+
y
T
T
T
x
T
T
T j
i
j
i
j
i
j
i
j
i
j
i
)
,
(
2
2
2
2
y
x
f
y
T
x
T
=
∂
∂
+
∂
∂
( ) ( )
∆
∆ y
x
( )
( )
( ) 0
2
2 1
,
,
1
,
2
2
,
1
,
,
1 =
+
−
∆
∆
+
+
− −
+
−
+ j
i
j
i
j
i
j
i
j
i
j
i T
T
T
y
x
T
T
T
0
)
1
(
2 ,
2
1
,
2
1
,
2
,
1
,
1 =
+
−
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β
( )
( )
)
1
(
2 2
2
2
2
β
α
β +
−
=
∆
∆
=
y
x
Let
8. 0
,
1
,
2
1
,
2
,
1
,
1 =
+
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T α
β
β
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T 1
,
2
1
,
2
,
1
,
1
2
1
,
)
1
(
2
1
−
+
−
+
+
+
+
+
+
= β
β
β
3
T
Jacobi iterative method
1
T
2
T
4
T
The Analogy between iterative methods
( )
( )
( )
( )
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i T
T
T
y
t
T
T
T
x
t
T
T ,
1
,
,
1
2
,
1
,
,
1
2
,
1
, 2
2 −
+
−
+
+
+
−
∆
∆
+
+
−
∆
∆
+
=
α
α
( )
⇒
=
∆
∆
=
4
1
,
1 2
x
t
α ( )
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i T
T
T
T
T
T
T ,
1
,
1
,
,
1
,
1
,
1
, 4
4
1
−
+
−
+
+
+
+
−
+
+
=
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T 1
,
2
1
,
2
,
1
,
1
2
1
,
)
1
(
2
1
−
+
−
+
+
+
+
+
+
= β
β
β
( )
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i T
T
T
T
T ,
1
,
1
,
1
,
1
1
,
4
1
−
+
−
+
+
+
+
+
=
From the discretization of an Elliptic PDE,
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T 1
,
1
,
,
1
,
1
1
,
4
1
1 −
+
−
+
+
+
+
+
=
⇒
=
β
Parabolic PDE : Implicit
∂
∂
+
∂
∂
=
∂
∂
2
2
2
2
y
T
x
T
t
T
α
( ) ( )
∆
+
−
+
∆
+
−
=
∆
− +
−
+
+
+
+
−
+
+
+
+
2
1
1
,
1
,
1
1
,
2
1
,
1
1
,
1
,
1
,
1
, 2
2
y
T
T
T
x
T
T
T
t
T
T n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
α
N
n
j
i
n
j
i
y
n
j
i
y
n
j
i
y
x
n
j
i
x
n
j
i
x T
T
d
T
d
T
d
d
T
d
T
d ,
1
1
,
1
1
,
1
,
1
,
1
1
,
1 )
1
2
2
( −
=
+
+
+
+
−
+ +
−
+
+
+
+
−
+
+
n
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i f
T
e
T
d
T
c
T
b
T
a ,
1
1
,
,
1
1
,
,
1
,
,
1
,
1
,
1
,
1
, =
+
+
+
+ +
−
+
+
+
+
−
+
+
1
1
,
2
2
,
2
1
2
,
1
2
,
2
2
,
2
1
3
,
2
2
,
2
1
2
,
2
2
,
2
1
2
,
3
2
,
2
+
+
+
+
+
−
−
=
+
+ n
n
n
n
n
n
T
e
T
b
f
T
d
T
c
T
a
In a matrix form Solving a system of Equations
n
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i f
T
e
T
d
T
c
T
b
T
a ,
1
1
,
,
1
1
,
,
1
,
,
1
,
1
,
1
,
1
, =
+
+
+
+ +
−
+
+
+
+
−
+
+
Direct Methods
Cramers’ rule
Cramers’ rule
Gauss Elimination
Iterative Methods
Point iterative methods
Line iterative methods
Outline
Elliptic PDE
Parabolic PDE (2-d)
Approximate factorization
TDMA (Thomas Algorithm)
2
2
x
T
t
T
∂
∂
=
∂
∂
α
1 i
i-1 i+1 N
Implicit scheme
( )2
1
1
1
1
1
1
2
x
T
T
T
t
T
T n
i
n
i
n
i
n
i
n
i
∆
+
−
=
∆
− +
−
+
+
+
+
α
( )
x
t ∆
∆
( )
( )
1
1
1
1
1
2
1
2 +
−
+
+
+
+
+
−
∆
∆
+
= n
i
n
i
n
i
n
i
n
i T
T
T
x
t
T
T
α
n
i
n
i
i
n
i
i
n
i
i d
T
c
T
b
T
a =
+
+ +
−
+
+
−
1
1
1
1
1 TDMA
In a matrix form Gauss Elimination
Thomas Algorithm
Thomas Algorithm
This slide is only notional !
9. Elliptic PDE
0
2
2
2
2
=
∂
∂
+
∂
∂
y
T
x
T
( ) ( )
0
2
2
2
1
,
,
1
,
2
,
1
,
,
1
=
∆
+
−
+
∆
+
− −
+
−
+
y
T
T
T
x
T
T
T j
i
j
i
j
i
j
i
j
i
j
i
)
,
(
2
2
2
2
y
x
f
y
T
x
T
=
∂
∂
+
∂
∂
( ) ( )
∆
∆ y
x
( )
( )
( ) 0
2
2 1
,
,
1
,
2
2
,
1
,
,
1 =
+
−
∆
∆
+
+
− −
+
−
+ j
i
j
i
j
i
j
i
j
i
j
i T
T
T
y
x
T
T
T
0
)
1
(
2 ,
2
1
,
2
1
,
2
,
1
,
1 =
+
−
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β
( )
( )
)
1
(
2 2
2
2
2
β
α
β +
−
=
∆
∆
=
y
x
Let
In a matrix form
Parabolic PDE : Implicit
∂
∂
+
∂
∂
=
∂
∂
2
2
2
2
y
T
x
T
t
T
α
( ) ( )
∆
+
−
+
∆
+
−
=
∆
− +
−
+
+
+
+
−
+
+
+
+
2
1
1
,
1
,
1
1
,
2
1
,
1
1
,
1
,
1
,
1
, 2
2
y
T
T
T
x
T
T
T
t
T
T n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
n
j
i
α
N
n
j
i
n
j
i
y
n
j
i
y
n
j
i
y
x
n
j
i
x
n
j
i
x T
T
d
T
d
T
d
d
T
d
T
d ,
1
1
,
1
1
,
1
,
1
,
1
1
,
1 )
1
2
2
( −
=
+
+
+
+
−
+ +
−
+
+
+
+
−
+
+
n
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i f
T
e
T
d
T
c
T
b
T
a ,
1
1
,
,
1
1
,
,
1
,
,
1
,
1
,
1
,
1
, =
+
+
+
+ +
−
+
+
+
+
−
+
+
1
1
,
2
2
,
2
1
2
,
1
2
,
2
2
,
2
1
3
,
2
2
,
2
1
2
,
2
2
,
2
1
2
,
3
2
,
2
+
+
+
+
+
−
−
=
+
+ n
n
n
n
n
n
T
e
T
b
f
T
d
T
c
T
a
In a matrix form
The coefficient matrix is Pentadiagonal .
Solution procedure is very time consuming.
How to over come this inefficiency ?
ADI : Alternating Direction Implicit method Fractional Step Methods
Approximate Factorization methods
What is the order of accuracy of this scheme ?
Fractional Step Methods
Solving a system of Equations
n
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i f
T
e
T
d
T
c
T
b
T
a ,
1
1
,
,
1
1
,
,
1
,
,
1
,
1
,
1
,
1
, =
+
+
+
+ +
−
+
+
+
+
−
+
+
Direct Methods
Cramers’ rule
Cramers’ rule
Gauss Elimination
Iterative Methods
Point iterative methods
Line iterative methods
10. Outline
ADI
Fractional step methods
Approximate factorization
ADI : Alternating Direction Implicit method Fractional Step Methods
The Navier-Stokes equations
u
u
u
u 2
p
1
∇
+
∇
−
=
∇
+
∂
∂
ν
ρ
t
2
2
x
T
t
T
∂
∂
=
∂
∂
α
( )
( )
1
1
1
1
1
2
1
2 +
−
+
+
+
+
+
−
∆
∆
+
= n
i
n
i
n
i
n
i
n
i T
T
T
x
t
T
T
α
0
=
⋅
∇ u
n
2
n
n
n
n
1
n
p
1
u
u
u
u
-
u
∇
+
∇
−
∇
⋅
−
=
∆
+
ν
ρ
t
Anything wrong ?
Governing equations
n
2
n
n
n
n
1
n
p
1
u
u
u
u
-
u
∇
+
∇
−
∇
⋅
−
=
∆
+
ν
ρ
t
0
1
n
≠
⋅
∇ +
u
n
2
n
n
n
n
1
n
p u
u
u
u
u ∇
∆
+
∇
⋅
∆
−
=
∇
∆
+
+
t
t
t
ν
ρ
( )
n
2
n
n
n
1
n
2
p u
u
u
u ∇
∆
+
∇
⋅
∆
−
⋅
∇
∆
=
∇ +
t
t
t
ν
ρ
ρ
0
1
n
=
⋅
∇ +
u
Is there any problem now ?
∇
+
∇
−
∇
⋅
−
∆
+
= n
2
n
n
n
n
p
1
~ u
u
u
u
u ν
ρ
t
Operator Splitting Methods
∇
+
∇
−
∇
⋅
−
∆
+
= n
2
n
n
n
n
p
~ u
u
u
u
u ν
ρ
β
t
∇
+
∇
−
∇
⋅
−
∆
+
= +
+ n
2
1
n
n
n
n
1
n
p
1
u
u
u
u
u ν
ρ
t
∇
+
∇
−
∇
⋅
−
∆
+
= p u
u
u
u
u ν
ρ
t
( )
n
1
n
1
n
p
p
~ β
ρ
−
∇
∆
−
=
− +
+ t
u
u
φ
ρ
∇
∆
−
=
−
+ t
u
u ~
1
n
( )
n
1
n
p
p β
φ −
= +
u
~
2
⋅
∇
∆
−
=
∇
t
ρ
φ
Operator Splitting Methods
φ
∇
∆
−
=
+ t
u
u ~
1
n
u
~
2
⋅
∇
∆
−
=
∇
t
ρ
φ
φ
β +
=
+ n
1
n
p
p
( )
Γ
+
Γ
−
∆
=
∇ u
u ~
1
n
ρ
φ
t
What is a suitable BC for φ ?
φ
ρ
∇
∆
−
=
+ t
u
u ~
1
n
(1) Predict
(2) Compute
(3) Compute the new velocity and pressure field
u
~
φ
1
n
1
n
p +
+
u
Fractional step Methods
The above eqn. can be split as,
1
n
2
1
n
n
n
n
1
n
p
1 +
+
+
∇
+
∇
−
∇
⋅
−
=
∆
u
u
u
u
-
u
ν
ρ
t
0
1
n
=
⋅
∇ +
u
0
~ n
n
n
=
∇
⋅
∆
+ u
u
u
-
u t
1
n
1
n ~
~ +
+
∇
∆
−
= p
t
ρ
u
u
u
~
~
1
2
⋅
∇
∆
−
=
∇ +
t
pn ρ
0
=
∇
⋅
∆
+ u
u
u
-
u t
0
~
~
~
~
~ 2
=
∇
∆
+
= u
u
u ν
t
0
1
n
=
⋅
∇ +
u
Operator Splitting Methods
∇
+
∇
−
∇
⋅
−
∆
+
= n
2
n
n
n
n
p
~ u
u
u
u
u ν
ρ
β
t
u
~
2
⋅
∇
∆
=
∇
t
ρ
φ
φ
β +
=
+ n
1
n
p
p φ
ρ
∇
∆
−
=
+ t
u
u ~
1
n
φ
β +
= p
p
ρ
(1) Predict
(2) Compute
(3) Compute the new velocity and pressure field
u
~
φ
1
n
1
n
p +
+
u
x
v
y
u
∂
∂
−
=
∂
∂
=
ψ
ψ
∂
∂
−
∂
∂
−
=
∂
∂
+
∂
∂
y
u
x
v
y
x 2
2
2
2
ψ
ψ
11. Outline
Assignment 3 Q(3).
Iterative methods
Assignment 3 – Q(3)
0
2
2
2
2
=
∂
∂
+
∂
∂
y
T
x
T
( ) ( )
0
2
2
2
1
,
,
1
,
2
,
1
,
,
1
=
∆
+
−
+
∆
+
− −
+
−
+
y
T
T
T
x
T
T
T j
i
j
i
j
i
j
i
j
i
j
i
( )
( )
)
1
(
2 2
2
2
2
β
α
β +
−
=
∆
∆
=
y
x
If
0
)
1
(
2 ,
2
1
,
2
1
,
2
,
1
,
1 =
+
−
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β
( )
1
Jacobi Iteration
Gauss-Seidel iteration
Line Gauss-Seidel iteration
Iterative Techniques
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T 1
,
2
1
,
2
,
1
,
1
2
1
,
)
1
(
2
1
−
+
−
+
+
+
+
+
+
= β
β
β
( )
1
1
,
2
1
,
2
1
,
1
,
1
2
1
,
)
1
(
2
1 +
−
+
+
−
+
+
+
+
+
+
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
β
( )
1
1
,
1
,
2
1
,
1
1
,
2
1
,
1 )
1
(
2 +
−
+
+
+
+
+
− +
−
=
+
+
− k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
Setting up the Eqns.
( )
1
1
,
2
1
,
2
1
,
1
,
1
2
1
,
)
1
(
2
1 +
−
+
+
−
+
+
+
+
+
+
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
β
Gauss-Seidel iteration
( )
1
,
1
,
,
1
,
1
2
,
)
1
(
2
−
+
−
+ +
+
+
+
= j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β
( )
1
1
,
1
2
3
,
1
2
1
2
,
0
2
,
2
2
1
2
,
1
)
1
(
2
1 +
+
+
+
+
+
+
= k
k
k
k
k
T
T
T
T
T β
β
β
Can we accelerate the convergence ?.
( )
1
1
,
2
1
,
2
1
,
1
,
1
2
1
,
)
1
(
2
1 +
−
+
+
−
+
+
+
+
+
+
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
β
Point Successive Over Relaxation (PSOR)
RHS
on
T
subtract
add k
j
i,
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T
T
T ,
2
1
1
,
2
1
,
2
1
,
1
,
1
2
,
1
, )
1
(
2
)
1
(
2
1
β
β
β
β
+
−
+
+
+
+
+
= +
−
+
+
−
+
+
( )
( )
1
1
,
1
,
2
1
,
1
,
1
2
,
1
,
)
1
(
2
)
1
( +
−
+
+
−
+
+
+
+
+
+
+
−
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T
T β
β
ω
ω
As solution progresses, must approach
k
j
i
T,
1
,
+
k
j
i
T
Do we have an optimum, ?
ω
Optimum ω
No general guidelines.
Optimum is calculated for limited applications
Elliptic + Dirchlet BC’s
Can we accelerate the convergence ?.
Line Successive Over Relaxation (LSOR)
( )
1
1
,
1
,
2
1
,
1
1
,
2
1
,
1 )
1
(
2 +
−
+
+
+
+
+
− +
−
=
+
+
− k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
1
1
2
1
)
1
(
2 +
+
+
+
+
− k
k
k
T
T
T ω
β
ω
Do we have an optimum, ?
ω
( )
1
1
,
1
,
2
,
2
1
,
1
1
,
2
1
,
1
)
1
)(
1
(
2
)
1
(
2
+
−
+
+
+
+
+
−
+
−
−
+
=
+
+
−
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
T
T
T
T
T
T
ωβ
ω
β
ω
β
ω
LSOR can be introduced to ADI as well !
Outline
Mid Term Exam
1st March 2012 (Thursday), 8-8:50 am
(Venue : CRC 103)
Iterative Methods (ctd…)
Review for Mid-Term Exam
Solving a system of Equations
n
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i
n
j
i
j
i f
T
e
T
d
T
c
T
b
T
a ,
1
1
,
,
1
1
,
,
1
,
,
1
,
1
,
1
,
1
, =
+
+
+
+ +
−
+
+
+
+
−
+
+
Direct Methods
Cramers’ rule
Gauss Elimination
Iterative Methods
Iterative Methods
Point iterative methods
Jacobi (simplest)
Gauss-Seidel
PSOR
Line iterative methods
Line Gauss-Seidel
LSOR
12. The End
k 1
+
k
Simple Iterative solvers at a glance
0
2
2
2
2
=
∂
∂
+
∂
∂
y
T
x
T
( ) ( )
0
2
2
2
1
,
,
1
,
2
,
1
,
,
1
=
∆
+
−
+
∆
+
− −
+
−
+
y
T
T
T
x
T
T
T j
i
j
i
j
i
j
i
j
i
j
i
( )
( )2
2
2
y
x
If
∆
∆
=
β
0
)
1
(
2 ,
2
1
,
2
1
,
2
,
1
,
1 =
+
−
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β 0
)
1
(
2 ,
1
,
1
,
,
1
,
1 =
+
−
+
+
+ −
+
−
+ j
i
j
i
j
i
j
i
j
i T
T
T
T
T β
β
β
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T 1
,
2
1
,
2
,
1
,
1
2
1
,
)
1
(
2
1
−
+
−
+
+
+
+
+
+
= β
β
β
( )
1
1
,
2
1
,
2
1
,
1
,
1
2
1
,
)
1
(
2
1 +
−
+
+
−
+
+
+
+
+
+
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
β
( )
1
1
,
1
,
2
1
,
1
1
,
2
1
,
1 )
1
(
2 +
−
+
+
+
+
+
− +
−
=
+
+
− k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
Can we accelerate the convergence ?.
( )
1
1
,
2
1
,
2
1
,
1
,
1
2
1
,
)
1
(
2
1 +
−
+
+
−
+
+
+
+
+
+
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
β
Point Successive Over Relaxation (PSOR)
RHS
on
T
subtract
add k
j
i,
( )
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T
T
T ,
2
1
1
,
2
1
,
2
1
,
1
,
1
2
,
1
, )
1
(
2
)
1
(
2
1
β
β
β
β
+
−
+
+
+
+
+
= +
−
+
+
−
+
+
( )
( )
1
1
,
1
,
2
1
,
1
,
1
2
,
1
,
)
1
(
2
)
1
( +
−
+
+
−
+
+
+
+
+
+
+
−
= k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T
T β
β
ω
ω
As solution progresses, must approach
k
j
i
T,
1
,
+
k
j
i
T
Do we have an optimum, ?
ω
Optimum ω
No general guidelines are available.
Optimum is calculated for limited applications
Elliptic + Dirchlet BC’s
Can we accelerate the convergence ?.
Line Successive Over Relaxation (LSOR)
( )
1
1
,
1
,
2
1
,
1
1
,
2
1
,
1 )
1
(
2 +
−
+
+
+
+
+
− +
−
=
+
+
− k
j
i
k
j
i
k
j
i
k
j
i
k
j
i T
T
T
T
T β
β
Can you modify this by introducing ω
Do we have an optimum, ?
ω
( )
1
1
,
1
,
2
,
2
1
,
1
1
,
2
1
,
1
)
1
)(
1
(
2
)
1
(
2
+
−
+
+
+
+
+
−
+
−
−
+
=
+
+
−
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
k
j
i
T
T
T
T
T
T
ωβ
ω
β
ω
β
ω
LSOR can be introduced to ADI as well !
ADI for Parabolic PDE
ADI for Elliptic PDE
The solution procedure can be accelerated by
introducing relaxation parameter )
(ω
Outline
Streamfunction-vorticity formulations
Incorporation of upwind for
Governing equation for vorticity transport
u
u
u
u 2
1
∇
+
∇
−
=
∇
⋅
+
∂
∂
ν
ρ
p
t
∇
+
∇
−
=
∇
⋅
+
∂
∂
×
∇ u
u
u
u 2
1
ν
ρ
p
t
u
ω ×
∇
=
u)
u
2
1
u
u)
u
u ⋅
∇
+
×
×
∇
=
∇
⋅ (
(
u
ω
-
ω
u
u)
ω )
(
)
(
( ∇
⋅
∇
⋅
=
×
×
∇
0
ω =
⋅
∇
ω
u)
ω
ω 2
( ∇
=
×
×
∇
+
∂
∂
ν
t
u)
u ×
∇
∇
=
∇
×
∇ (
2
2
u
ω
-
ω
u
u)
ω )
(
)
(
( ∇
⋅
∇
⋅
=
×
×
∇
ω
u
ω
ω 2
)
( ∇
+
∇
⋅
= ν
Dt
D
13. Tracking vorticity distributions
Vorticity
Vorticity ω is governed by an evolution eqn. which is
much simpler than N-S.
Unlike u, ω can neither be created nor destroyed in
the fluid interior.
u
ω ×
∇
=
the fluid interior.
It is transported throughout the flow field by familiar
processes such as, advection and diffusion.
Localized distributions of ω remain localized, which
is not the case with velocity field.
So, an Eddy in a turbulent flow blob of vorticity
and its associated rotational and irrotational motions.
Governing Equations
Stability is governed by,
Operator Splitting Methods
∇
+
∇
−
∇
⋅
−
∆
+
= n
2
n
n
n
n
p
~ u
u
u
u
u ν
ρ
β
t
u
~
2
⋅
∇
∆
=
∇
t
ρ
φ
φ
β +
=
+ n
1
n
p
p φ
ρ
∇
∆
−
=
+ t
u
u ~
1
n
φ
β +
= p
p
ρ
(1) Predict
(2) Compute
(3) Compute the new velocity and pressure field
u
~
φ
1
n
1
n
p +
+
u
x
v
y
u
∂
∂
−
=
∂
∂
=
ψ
ψ
∂
∂
−
∂
∂
−
=
∂
∂
+
∂
∂
y
u
x
v
y
x 2
2
2
2
ψ
ψ
Governing Equations
Central difference form for the above equation,
The above difference equation numerically allows
checkerboard velocity distribution.
Discrete Checkerboard velocity
Discrete Checkerboard for pressure Governing Equations
u
u
u
u 2
p
1
∇
+
∇
−
=
∇
+
∂
∂
ν
ρ
t
0
=
⋅
∇ u
For viscous, incompressible flows :
ω
∂
In non-primitive (ψ-ω) form :
ω
u)
ω
ω 2
( ∇
=
×
×
∇
+
∂
∂
ν
t
u
ω ×
∇
=
x
v
y
u
∂
∂
−
=
∂
∂
=
ψ
ψ
;
∂
∂
+
∂
∂
=
∂
∂
+
∂
∂
+
∂
∂
2
2
2
2
y
x
y
v
x
u
t
ω
ω
ν
ω
ω
ω
∂
∂
−
∂
∂
−
=
∂
∂
+
∂
∂
y
u
x
v
y
x 2
2
2
2
ψ
ψ
MAC algorithm
Harlow and Welch (1965)
One of the earliest methods of solving N-S in
primitive variables.
Hirt and Cook (1972)
A pressure Poisson equation is formulated
A pressure Poisson equation is formulated
The momentum equations are used for the
computation of velocities.
14. Temporal Evolution MAC algorithm
Define pressure correction terms as :
MAC algorithm
Define pressure correction terms as :
Continuity equation transforms into :
Governing Equations
Central difference form for the above equation,
The above difference equation numerically allows
checkerboard velocity distribution.
Discrete Checkerboard velocity Discrete Checkerboard for pressure
Outline
Checker board pressure patterns
Staggered grids
One-Dimensional N-S
)
2
(
1
)
1
(
0
2
2
x
u
x
p
x
u
u
t
u
x
u
∂
∂
+
∂
∂
−
=
∂
∂
+
∂
∂
=
∂
∂
ν
ρ
1 i
i-1 i+1 N
1
+
n
n
)
3
(
1
1
2
2
1 +
+
∂
∂
−
∂
∂
+
∂
∂
−
=
∆
−
n
n
n
i
n
i
x
p
x
u
x
u
u
t
u
u
ρ
ν
)
4
(
~
2
2 n
n
i
i
x
u
x
u
u
t
u
u
∂
∂
+
∂
∂
−
=
∆
−
ν
∂
∂
−
=
∆
−
⇒
−
+
x
p
t
u
u i
n
i
ρ
1
~
)
4
(
)
3
(
1
One-Dimensional N-S
1 i
i-1 i+1 N
0
2
1
1
1
1
=
∆
−
=
∂
∂ +
−
+
+
x
u
u
x
u n
i
n
i
)
4
(
1
~
1
∂
∂
−
=
∆
−
−
+
x
p
t
u
u i
n
i
ρ
∆
−
−
=
∆
− −
+
+
x
p
p
t
u
u i
i
i
n
i
2
1
~
1
1
1
ρ
x
p
p
t
u
u i
i
i
n
i
∆
−
∆
−
= −
+
+
2
~ 1
1
1
ρ
?
1
1 =
+
+
n
i
u ?
1
1 =
+
−
n
i
u
1
1
2
2 ~
~
2
2
−
+
−
+
−
=
∆
+
−
∆
i
i
i
i
i
u
u
x
p
p
p
t
ρ
15. Checkerboard pressures
This delinking between velocity and pressure
at a grid point is an impediment and results in
zig-zag type checkerboard pressure values.
To avoid this, MAC algorithm introduces
Staggered grids in place of “collocated grids”.
Staggered grids in place of “collocated grids”.
One-Dimensional N-S
1 i
i-1 i+1
N
( )
0
2
/
2
1
2
/
1
1
2
/
1
=
∆
−
=
∂
∂ +
−
+
+
x
u
u
x
u n
i
n
i
i-1/2 i+1/2 i+3/2
( )
2
/
1
2
/
1
1
1 ~
~
2
−
+
−
+
−
∆
=
∆
+
−
i
i
i
i
i
u
u
t
x
p
p
p ρ
( )
∆
−
−
=
∆
− +
+
+
+
x
p
p
t
u
u i
i
i
n
i 1
2
/
1
1
2
/
1 1
~
ρ
2D - Governing Equations
Central difference form for the above equation,
The above difference equation numerically allows the
checkerboard velocity distribution.
Such a distribution is not representative of a physical
flow field.
This is NOT an issue for compressible flows, as
inclusion of density variations would wipe out
checkerboard pressure pattern.
Discrete Checkerboard velocity Discrete Checkerboard for pressure Pressure Correction schemes
The 2-D Navier-Stokes A Staggered grid Staggered grid
)
1
(
0
=
∂
∂
+
∂
∂
y
v
x
u
Write a central
Write a central
differencing expression
for the above equation,
around the grid point (i,j).
16. Staggered grid
Difference equation for
x-momentum equation
about (i+1/2,j).
Outline
Governing Equations in FM
Differential form : FDM
Integral form : FVM, FEM
Finite Volume Method
FDM regular grids
Industrial problems Complex domains
FDM coordinate transformation
Loss of computational efficiency and accuracy
FVM Integral form of eqns. (greater flexibility in
handling complex domains)
In FVM conservation laws are applied on the
elementary volumes.
1-D steady diffusion equation
)
1
(
)
(
)
(
)
(
φ
φ
φ
ρ
ρφ
S
V
t
+
∇
Γ
⋅
∇
=
⋅
∇
+
∂
∂ r
)
2
(
0
)
( =
+
∇
Γ
⋅
∇ φ
φ S
Generic transport equation for the property ϕ
)
2
(
0
)
( =
+
∇
Γ
⋅
∇ φ
φ S
)
3
(
0
)
( =
+
∇
Γ
⋅
∇ ∫
∫ CV
CV
dv
S
dv φ
φ
)
4
(
0
)
( =
+
∇
Γ ∫
∫ CV
A
dv
S
dA φ
φ
1-D steady diffusion equation
)
5
(
0
=
+
Γ S
dx
d
dx
d φ
1-D diffusion equation for the property ϕ
dT
d
)
6
(
0
=
+
S
dx
dT
k
dx
d
Discretization in FV
Physical boundary that coincides with CV boundary.
Discretization
)
5
(
0
=
+
Γ S
dx
d
dx
d φ
)
6
(
0
=
+
Γ ∫
∫ CV
CV
dv
S
dv
dx
d
dx
d φ
)
7
(
0
=
+
Γ
−
Γ dv
S
dx
d
A
dx
d
A
w
e
φ
φ
−
d φ
φ
φ =
Γ
dφ
)
8
(
−
Γ
=
Γ
PE
P
E
e
e
e x
A
dx
d
A
δ
φ
φ
φ
)
10
(
P
P
u S
S
dv
S φ
+
=
)
9
(
?
=
Γ
w
dx
d
A
φ
Substitute (8), (9) and (10) in Eqn.(7) and rearrange NOW!
Discretization
Discretized equations of the above form must be setup at
each nodal point.
Modify the discretized equation to incorporate BC.
Solve the resulting system of linear algebraic equations.
1-D Heat conduction example
At grid points 2, 3, 4 :
17. 1-D Heat conduction example
At the boundary
point 1:
?
How
dx
d
A
dx
d
A
w
e
Γ
−
Γ
φ
φ
Rearrange the above eqn. in the following form :
dx
dx w
e
1-D Heat conduction example
At the boundary
point 5:
?
How
dx
d
A
dx
d
A
w
e
Γ
−
Γ
φ
φ
Rearrange the above eqn. in the following form :
dx
dx w
e
Outline
FVM
1-D heat conduction equation
2-D diffusion equation
1-D convection-diffusion equation
1-D convection-diffusion equation
Finite Volume Method
FVM Integral form of the conservation laws are
discretized directly in the physical space.
Use a mesh (where the cell centre refers to the grid
points, while the cell faces coincide with the domain
boundaries).
FVM has great advantage that the conservative
FVM has great advantage that the conservative
discretization is automatically satisfied (by directly
using the integral form of the conservation laws).
1-D Heat conduction example
At grid points 2, 3, 4 :
E
E
W
W
P
P T
a
T
a
T
a +
=
At the boundary
point 1:
?
How
dx
d
A
dx
d
A
w
e
Γ
−
Γ
φ
φ
BC at A : Applying TA
Rearrange the above eqn. in the following form :
dx
dx w
e
BC at B : Applying TB
At the boundary
point 5:
?
How
dx
d
A
dx
d
A
w
e
Γ
−
Γ
φ
φ
Rearrange the above eqn. in the following form :
dx
dx w
e
1-D Heat conduction example
At the boundary
point 5:
?
How
dx
d
A
dx
d
A
w
e
Γ
−
Γ
φ
φ
Rearrange the above eqn. in the following form :
dx
dx w
e
Resulting algebraic equations
18. Comparison of the numerical solution FVM for 2-d Diffusion problems
When the above governing
equation is integrated over the
CV, we obtain
Flux through the CV faces
Substitute above expressions and rearrange NOW!
Formulation of algebraic expressions Four Basic Rules in FVM
Rule 1 Flux consistency across the control volume faces
in
exit q
q =
0
,
,
W
E
P a
a
a
Rule 2 Positive coefficients
0
,
,
W
E
P a
a
a
P
P
u S
S
S φ
+
=
v
S
a
a P
neighbors
P ∆
−
= ∑
Rule 4 Sum of neighboring coefficients :
Rule 3 Negative slope linearization of the source term.
Outline
FVM
1-D convection-diffusion equation
Steady 1-D convection-diffusion equation
Integrating the transport and continuity equation,
Steady 1-D convection-diffusion equation
Introduce the following variables,
1-d CDE : central differencing
F/D ratio : 1.25
19. 1-d CDE : central differencing
F/D ratio : 5
1-d CDE : upwind differencing
F/D ratio : 5
QUICK scheme 2 u/s GP + 1 d/s GP
A 2-D test case 2-D test case : Upwind differencing 2-D test case : QUICK
TVD schemes
TVD : Total Variation Diminishing
TVD is specially formulated to achieve oscillation-
free solutions.
Upwind most stable. But, introduces high level of
false diffusion.
CDE, QUICK Spurious oscillations or wiggles,
CDE, QUICK Spurious oscillations or wiggles,
when Peclet number is high
In turbulent flows, wiggles can give rise to physically
unrealistic negative values and instability.
In TVD, the tendency towards oscillation is
counteracted by adding an artificial diffusion
fragment or weighting towards upstream
contribution.
The END