Professional Documents
Culture Documents
Discretization Methods
in Fluid Dynamics
Mayank Behl
B-tech. 3
rd
Year
Department of Chemical Engineering
Indian Institute of Technology Delhi
Course 1: Fluid Mechanics and Energy Conversion
Supervisor:
Dr. G.Biswas
Indian Institute of Technology
Kanpur
Indo-German Winter Academy 2
3/8/2007
OUTLINE
1. Basics of PDE
2. Mathematical Overview of fluid flow
3. Need For Computational Methods
4. Basic Discretization Methods in use
5. Finite Difference Method
6. Fluid Flow Modeling
Indo-German Winter Academy 3
3/8/2007
Partial differential equations (PDEs) are used to
formulate and solve problems related to any phenomena
that is distributed in space and time :
Heat flow
Fluid flow
propagation of sound
electrodynamics,
Elasticity.
) , ( A
2
2 2
2
2
y x G F
y
E
x
D
y
C
y x
B
x
= +
Most of the fluid and related transport phenomena
can be modeled using PDEs
Indo-German Winter Academy 4
3/8/2007
Classification of PDEs
) , ( A
2
2 2
2
2
y x G F
y
E
x
D
y
C
y x
B
x
= +
B
2
4AC<0
Elliptic equation
B.V.P.
Irrotational flows
steady Heat Transfer
B
2
4AC=0
Parabolic equation
I.B.V.P;
Unsteady viscous
flows
B
2
4AC>0
Hyperbolic equation
Vibration problems
0
2
2
2
2
=
y
x
2
2
x t
2
2
2
2
2
x t
) (
3
r
n
b a
+
Given boundary temperature
Given boundary heat flux
Boundary heat flux dependent on boundary temperature
Indo-German Winter Academy 6
3/8/2007
Equation of continuity: a differential mass balance
t z
w
y
v
x
u
[ ]
t
=
u
In vector notation:
For constant density of the fluid:
0 = u
Mathematical description of flows;
Governing Equations of Fluid Dynamics
x
z
y
(x,y,z)
Indo-German Winter Academy 7
3/8/2007
Equation of motion:
g uu u + = +
p
t
Governing Equations of Fluid Dynamics (2)
for incompressible, Newtonian Fluids , under laminar flow:
g u u u u + + =
2
p
t
Navier-Stokes Equation
Indo-German Winter Academy 8
3/8/2007
The Navier-Stokes equations
(Non linear
PDEs)
x
g
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
y
g
z
v
y
v
x
v
y
p
z
v
w
y
v
v
x
v
u
t
v
+
2
2
2
2
2
2
1
z
g
z
w
y
w
x
w
z
p
z
w
w
y
w
v
x
w
u
t
w
+
2
2
2
2
2
2
1
+
n
i
n
i
i,j
i+1,j
i-1,j
x
y
Discrete grid points
i-1,j
i,j
i+1,j
Indo-German Winter Academy 16
3/8/2007
Finite Difference Method:grids
Grids
Structured grid
all nodes have the same number
of elements around it
only for simple domains
Unstructured grid
for all geometries
irregular data structure
Indo-German Winter Academy 17
3/8/2007
Finite Difference,
approximation of the first derivative
Taylor Series Expansion: Any continuous differentiable
function, in the vicinity of x
i
, can be expressed as a Taylor
series:
( ) ( ) ( )
( ) ( ) ( )
H
x n
x x
x
x x
x
x x
x
x x x x
i
n
n
n
i
i
i
i
i
i
i i
+
+ +
+ =
!
...
! 3 ! 2
3
3
3
2
2
2
( )
H
x
x x
x
x x
x x
x
i
i i
i
i i
i i
i i
i
+
+ +
+
+
3
3
2
1
2
2
1
1
1
6 2
Higher order derivatives are unknown and can be dropped when the
distance between grid points is small X
i+1
- X
i
is small
Indo-German Winter Academy 18
3/8/2007
By writing Taylor series at different nodes, x
i-1
, x
i+1
, or both
x
i-1
and x
i+1
, we can have:
O(x)
1
1
i i
i i
i
x x x
Backward Difference Scheme-BDS
O(x)
i i
i i
i
x x x
+
+
1
1
Forward Difference Scheme-FDS
order of accuracy
O(x)
1 1
1 1
+
+
i i
i i
i
x x x
Central Difference Scheme-CDS
O(x)
Indo-German Winter Academy 19
3/8/2007
Finite Difference,
approximation of the second derivative
Geometrically, the second derivative is the slope of the line
tangent to the curve representing the first derivative.
i i
i i
i
x x
x x
x
+
+
1
1
2
2
Estimate the outer derivative by FDS, and estimate the inner
derivatives using BDS, we get
For equidistant spacing of the points:
( ) ( ) ( )
( ) ( )
1
2
1
1 1 1 1 1 1
2
2
+
+ + +
+
i i i i
i i i i i i i i i
i
x x x x
x x x x x x
x
( )
2
1 1
2
2
2
x
x
i i i
i
+
+
Higher-order approximations for the second derivative can be
derived by including more data points, such as x
i-2
, and x
i+2
, even
x
i-3
, and x
i+3
Indo-German Winter Academy 20
3/8/2007
Discretization using Explicit Method
Consider unsteady viscous flow
2
2
x t
=
( )
2
1 1
1
2
x
t
i
n
i
n
i
n n
i
n
i
+
=
+
+
+ + +
=
+ +
+
+
+
2
2
x
u
t
u
values at time n+1 computed using the unknown values at time n+1
Second order accurate in time and space
to be solved simultaneously at all the grid points as a system of
algebraic equations
Unconditionally stable
rearranging the above equation as follows.
O(t)
2
,O(x)
2
Indo-German Winter Academy 22
3/8/2007
Indo-German Winter Academy 23
3/8/2007
This generates a Tridiagonal Matrix system which can be solved
using Thomas algorithm.
However, for higher dimensional flows, matrix system obtained are
much more complex and require substantially more computer time
Ax = C
Indo-German Winter Academy 24
3/8/2007
Alternating Direction Implicit Method
(ADI) for 2-D Flows
( )
+
+
+
=
+ +
+ +
+
2
2 / 1
1 ,
2 / 1
,
2 / 1
1 ,
2
, 1 , , 1 ,
2 / 1
,
2 2
2 / y
u u u
x
u u u
t
u u
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
2
2
2
y
u
x
u
t
u
+
+
+
=
+ +
+
+
+ +
+
+ +
2
2 / 1
1 ,
2 / 1
,
2 / 1
1 ,
2
1
, 1
1
,
1
, 1
2 / 1
,
1
,
2 2
2 / y
u u u
x
u u u
t
u u
n
j i
n
j i
n
j i
n
j i
n
j i
n
j i
n
j i
n
j i
Second step
Indo-German Winter Academy 25
3/8/2007
ADI method results in Tridiagonal Equations (for 2-d flow systems)
if it is applied along the dimension that is implicit. Thus on first step it is
applied along Y axis and on second step along on X axis
First direction Y
Second direction X
Indo-German Winter Academy 26
3/8/2007
Implicit method
Advantages:
Stability can be maintained over larger time
steps
Disadvantages
More computation time per time step, every time
step requires solving a system of equations.
Truncation error is often large , since larger
time steps are employed.
Overall, a more involved procedure
Indo-German Winter Academy 27
3/8/2007
Error and Stability analysis
Numerical solution is influenced by following:
Discretization errors or Truncation errors:
Analytical Solution (A) exact Finite Difference Solution (D)
= A D
Computational Round-Off Error (e)
=Numerical Solution (N) exact Finite Difference Solution (D)
N = D +
By definition, N,D follow the Discretized Equation
Thus, should also follow the equation:
( )
2
1 1
1
2
x
t
i
n
i
n
i
n n
i
n
i
+
=
+
+
Indo-German Winter Academy 28
3/8/2007
Errors and Stability Analysis
(Cont.)
Substituting the value
of
m
(x,t) in the F.D.E.,
Indo-German Winter Academy 29
3/8/2007
For stability:
=
m
x ik
at m
t x ) , (
Von Neumann Stability Analysis :
assuming error distribution follows Fourier series in space domain and
exponential in time
Putting an individual term in FD equation and using the above stability
criteria
2
1
) (
) (
2
x
t
1
1
+
n
i
n
i
2
2
x x
u
t
u
0 =
x
u
t
u
Inviscid Burgers Equation
Indo-German Winter Academy 31
3/8/2007
Conservative Property: To maintain the integral conservation
relation of continuum in finite difference representation.
It depends on the form of continuum equation being
discretized.
Conservative form:
Non-conservative form:
Properties of Fluid Flow Equations
Effect of Finite Difference method on properties of
fluid flow equations
( )
u
x t
x
u
t
Indo-German Winter Academy 32
3/8/2007
2
) (
2
1
2
1
2
1
1 1 1 1
1
=
+ +
= =
+
I
I i
n
i
n
i
n
i
n
i
I
I i
I
I i
n
i
n
i
u u
t
x x
2 / 1 2 / 1
2 1
) ( ) (
+
=
I I
u u
x
x
u u
x
t
i
n
i
n n
i
n
i
+
+
2
) ( ) (
1 1
1
Integrating the
CONSERVATIVE FORM
I
1
I
2
Indo-German Winter Academy 33
3/8/2007
Week Conservative Form in Fluid Flow
Conservative form of advective part is of prime importance for
fluid flow modeling. Navier Stokes in week conservative form:
x
g
z
u
y
u
x
u
x
p
z
uw
y
uv
x
u
t
u
+
2
2
2
2
2
2 2
1
y
g
z
v
y
v
x
v
y
p
z
vw
y
v
x
uv
t
v
+
2
2
2
2
2
2 2
1
z
g
z
w
y
w
x
w
z
p
z
w
y
vw
x
uw
t
w
+
2
2
2
2
2
2 2
1
x
u u
t
i
n
i
n n
i
n
i
+
1
1
x
u u
t
i
n
i
n n
i
n
i
+
+
1
1
Backward Differencing Scheme for u>0
Forward Differencing Scheme for u<0
Indo-German Winter Academy 35
3/8/2007
Why use Upwind scheme
Upwind Scheme of discretization is necessary for convection
dominated flows for obtaining numerically stable results
Central Difference Scheme applied to highly convective flows
give unconditionally Unstable Results
0
2
1 1
1
=
+
+
x
u u
t
i
n
i
n n
i
n
i
CDS:
Violates
Von Neumann
Stability
Criteria
0 , 0
1
1
> =
+
+
u
x
u u
t
i
n
i
n n
i
n
i
FDS:
Indo-German Winter Academy 36
3/8/2007
Why use Upwind scheme
2
1 1
1 1
1
2
2 x x
u u
t
n
i
n
i
n
i
i
n
i
n n
i
n
i
+
=
+
+
+
CDS:
xx x
t u
u
t
= +
2
2
0
2
2
t u
0
2
1
1
x u
x
t u
x u
x
Re
0 Re *
2
1
1
C
C
2
Re
CELL Reynolds No.
For unsteady, convection-diffusion eqn.
Indo-German Winter Academy 37
3/8/2007
( )
u
x t
x
u u
t
i
n
i
n n
i
n
i
>
+
1
1
0) (u scheme upwind using
Upwind Scheme and Transportive Property
proprerty ive transport for the rationale the follows which
0
1) (m location downstream a at for Then
location m at occurs in on perturbati a let
1
1
1
th
x
u
x
u
t
n
m
n
m
+ =
+
+
+
+
At (m+1) location
region the of out ed transport being on perturbati
0
location (m) At
1
x
u
x
u
t
n
m
n
m
+
At (m) location
upstream carried on perturbati no
0
0 0
location 1) - (m At
1
1
1
=
x t
n
m
n
m
At (m-1) location
Indo-German Winter Academy 38
3/8/2007
Problems of Using Forward Time Central Space method (FTCS)
0
2 2
0
location 1) - (m At
1
1
1
x
u
x
u
t
n
m
n
m
Which indicates that Transportive Property is violated
Hence, only upwind method maintains unidirectional flow
of information.
Indo-German Winter Academy 39
3/8/2007
Upwind Method and Artificial Viscosity(1/2)
x
u u
t
i
n
i
n n
i
n
i
+
1
1
x
u u
t
i
n
i
n n
i
n
i
+
+
1
1
2
2
x x
u
t
u
u
Considering momentum equation
Indo-German Winter Academy 44
3/8/2007
Here 0<<1
For =0, above equation becomes centered in space
For =1, above equation follows full upwind
Hence, brings about an upwind bias in the difference quotient
Accuracy of the differencing scheme can be adjusted using value
Second upwind formulation possesses both
the conservative and transportive property
Indo-German Winter Academy 45
3/8/2007
Summary
Finite Difference methods discretizes the differential form of governing
equation using Taylor Series expansion.
The partial derivatives of governing PDE are replaced with finite,
algebraic differences quotients at the corresponding nodes.
Leads to linear algebraic equation system, with one algebraic equation
per grid node.
Best Suited for Structured Grids only.
Flow equation properties can be maintained using simple schemes
like upwind differencing.
Discretization methods provide more cost effective and more rapid
approach for solving Fluid Flow problems as compared to
experimental methods
Indo-German Winter Academy 46
3/8/2007
Summary
Finite Difference Approach
FD Approaches Can Be Divided Into Various
Categories Depending Upon Type of PDE Being
Solved:
1.Elliptic PDE: Algebraic System, Gauss Siedel
2.One-dimensional Parabolic PDE
A) Explicit
B) Implicit
3. Two-dimensional Parabolic PDE
ADI Method
Indo-German Winter Academy 47
3/8/2007
Acknowledgement
This lecture has been inspired by the
study material provided by Prof. G.Biswas
Indo-German Winter Academy 48
3/8/2007
References
Chapra and Canale, Numerical Methods for
Engineers,4
th
Ed., Tata McGraw-Hill.
Som and Biswas, Introduction to Fluid Mechanics and
Fluid Machines, Tata McGraw-Hill
Anderson.J; Computational Fluid Dynamics
Indo-German Winter Academy 49
3/8/2007
Thank you !