You are on page 1of 28

CFD LECTURE

AE 4012 NUMERICAL AERODYNAMICS

Lecture 5 : Discretization Technique

Farfield boundary

Grids /
Mesh

Body/ Solid boundary

Page 1 Moelyadi - 07.03.2012


Computational Modelling

Real Words Physics Numerical Simulation

Mathematical Discretization Resolution of


Flow Models Techniques discrete system
Model
of Equations.

Space
Steadiness Dynamic
approximation approximation discretization
Mesh definition

Spatial
approximation Equation
discretization
Definition of
Numerical schemes

Page 2 Moelyadi - 07.03.2012


Computational Solution Procedure

PDE

BC PDE and BC’s

f
f
Discretization
Consistency
x x Stability
Discretized Convergence
Equations

explicit Equation Solver


implicit (Numerical schemes)

Approximate Solution
T(x,y,z,t), etc

Page 3 Moelyadi - 07.03.2012


Review of Mathematical Models

Linear equations Non-Linear equation System equations


1. Linear convection 1. Inviscid Burgers 1. Unsteady Inviscid
compressible flow

2. Linear diffusion
(heat conduction)

3. Transport (unsteady 2. Burgers


convection-diffusion)

Where p is pressure and E


4. Laplace is total energy per unit
volume given by

5. Wave
and g is ratio of specific
heats
Page 4 Moelyadi - 07.03.2012
Boundary Conditions

1. Direchlet BC > a given value at boundary


Example : BC for viscous flow -> no slip condition (zero velocity)

Wall Temperature

2. Newmann BC > gradient of variable at boundary

Example : BC on the temperature gradient at wall

3. Robin BC > mixed BC’s

Page 5 Moelyadi - 07.03.2012


Meanings of Discretization

Discretization is the process by which a closed-


form mathematical expression, such as a function
or a differential or integral equation involving
functions, is approximated by expression which
prescribe values at only a finite number of discrete
points or volumes in the domain.

Time discretization
Transport equation

Space discretization
Laplace Equation

Page 6 Moelyadi - 07.03.2012


Road Map

Discretization Approaches

Finite Finite Finite


Difference Volume Element

Basic derivations of finite Basic derivations


differences: of finite volume
Internal and boundary, equations
order accuracy
Basic derivations
of finite difference
equations

Types of solutions: Stability


Explicit and implicit analysis
Page 7 Moelyadi - 07.03.2012
Finite Differences

Discretization Techniques

Taylor Series Expansion Polynomial

Page 8 Moelyadi - 07.03.2012


Finite Differences : Taylor Series
First Derivative
u(x)
u u(x) ≈ u (x0 + D x ) = u(x0) First guess (not very good)
? 4
x 5 u (x) u
Dx
+ add to capture slope
2
x
1 3  2 u (D x ) 2 add to account for
+ lower order curvature
x 2 2
 n u (D x ) n add to account for
x0 x0 + D x x + higher order curvature
 x n n!

Dx ui 1, j  ui , j
= -
Dx

FD representation Truncation error ( O(Dx) )

Page 9 Moelyadi - 07.03.2012


First-order forward difference
Finite Differences : Taylor Series
First Derivative
u(x)
du
? u (x) ≈ u(x0 - D x ) = u (x0)
dx 5 u(x) u
2 - x Dx
1 4

 2 u (D x ) 2
+ x 2 2

 n u (D x ) n
x0 - D x x0 x0 + D x x
-  x n n!

ui , j  ui 1, j
= +
Dx

FD representation Truncation error ( O(Dx) )

Page 10 Moelyadi - 07.03.2012


First-order backward difference
Finite Differences : Taylor Series
First Derivative
u (x)
u
?
x 5 u (x)
2
1 4

x0 - D x x0 x0 + D x x

u
D x +  u (D x ) +  u (D x ) +  u (D x )
2 2 3 3 n n
u (x) ≈ u(x0 + D x ) = u(x0)+
x x 2 2  x3 6  x n n!
u  2
u ( D x ) 2
 3
D 3  n
u ( D x ) n
u (x) ≈ u(x0 - D x ) = u(x0)- Dx + -
u ( x )
+
x x 2 2  x3 6  x n n!
(-)

ui 1  ui 1  2
u  3 u (D x ) 3
Dx  2 3
 u ui 1  ui 1
  O(Dx ) 2
x x 6 x 2Dx
Page 11 Moelyadi - 07.03.2012
Second-order central difference
Finite Differences : Taylor Series
Second Derivative
u(x)
 2u
?
x 2
5 u (x)
2
1 4

i  1, j

x0 - D x x0 x0 + D x x

u  2
D 2
 3u (D x )3
u(x) ≈ u(x0 + D x ) = u(x0) + D x u ( x )  n u (D x ) n
x + + + n
x 2 2  x3 6 x n!
u(x) ≈ u(x0 - D x ) = u(x0) - u  2
u ( D x ) 2
 3u (D x )3  n u (D x ) n
Dx + - + n
x x 2 2  x3 6 x n!
(+)
 2u  4u ( D x ) 4  2 u ui 1  2ui  ui 1
ui 1  ui 1  2ui  2 ( D x )  4
2
  O ( Dx ) 2

x  x 12  x2 ( D x)2
Page 12 Moelyadi - 07.03.2012 Second-order central difference
Finite Differences : Taylor Series
Second Derivative

i  2, j i  1, j i, j i  1, j i  2, j

Fourth-order central difference for second derivative

Page 13 Moelyadi - 07.03.2012


Finite Differences : Taylor Series

Mixed Derivative

i  1, j

Page 14 Moelyadi - 07.03.2012


PR

 f  f i  2  4 f i 1  3 f i
i  2, j
  O(Dx) 2
i  1, j i, j i  1, j i  2, j
x 2 (D x)

i  3, j i  2, j i  1, j i, j i  1, j  2 f 2 f i  5 f i 1  4 f i 2  f i 3
  O ( Dx ) 2

 x2 (D x) 2

Page 15 Moelyadi - 07.03.2012


Finite Differences : Polynomial

u (x)
u  2u
?
?  x2
x 5 u (x)

u( x)  A x 2  B x  C
2
1 4

x0 x0 + D x x0 + 2 D x x

pada titik i xi  0 ui  A xi  B xi  C  C
2

pada titik i+1


xi 1  D x ui 1  A xi 1  B xi 1  C  A(D x) 2  B(D x)  C
2

pada titik i+2 xi  2  2D x ui 2  A xi 2 2  B xi 2  C  A(2D x) 2  B(2D x)  C

Page 16 Moelyadi - 07.03.2012


Finite Differences : Polynomial

u( x)  A x 2  B x  C
 ui 2  4ui 1  3ui ui  2  2ui 1  ui
C  ui B A
2Dx 2(Dx ) 2
u u
 2Ax  B xi  0 B
x x i

u  ui 2  4ui 1  3ui

x 2Dx

 2u  2 u ui  2  2ui 1  ui
 2A 
x 2
x 2
(Dx ) 2
Page 17 Moelyadi - 07.03.2012
Discretization techniques at Boundary

First-order accuracy

3
Dy
2 Second-order accuracy
Dy
1 boundary

Page 18 Moelyadi - 07.03.2012


Difference Equations

Forward difference in Time and Central difference in Space (FTCS)

Partial Differential
Equation (PDE)

Discretized Equation (DE))

Page 19 Moelyadi - 07.03.2012 Truncation Error


Finite Difference Solution Process

Initialise Construct Finite Difference


Setup Grid dependent Analogue of PDE and BC’s
variables

For Each Interior Grid


Point evaluate Algorithm to
give ujn+1
tn+1 = tn + Dt
Adjust Boundary values
u1n+1 and ujn+1

No
e<K
Yes

Solution

Page 20 Moelyadi - 07.03.2012


Explicit Marching solution

Page 21 Moelyadi - 07.03.2012


Implicit Marching solution


Ti n1  Ti n  Ti n11  2Ti n 1  Ti n11


Dt D x 2
n 1 n 1 n 1  Dt 2 Dt
AT  BTi  ATi  Ti n
A B  1
i 1
D x 2 D x 2

Page 22 Moelyadi - 07.03.2012


Consistency, Stability, Convergence
Discretization
Governing Discretized
PDE and BC’s Consistency Equations Consistency
Discretization error → Condition on Structure of
Numerical Formulation
Round-off → The discretized equation
Stability
error should tend to the PDE to
T T which they are related when
Dt and Dx tend to zero
Analytical Convergence Approximate
Solution Solution
Stability
Consistency + Stability = Convergence → Condition on Solution of
Numerical Scheme
→ The numerical scheme

Convergence should not allow errors to


Discretization error = A - D grow indefinitely, that is, to
→ Condition on Numerical
Round-off error = e = N - D Solution
be amplified without bound,
→ The numerical solution as the iteration progress
A = analytical solution of PDE from one time step to
should approach the exact
D = exact solution of discretized eq. another
solution of the PDE at any
N = Approximate solution
point and time

Page 23 Moelyadi - 07.03.2012


Analysis of Numerical Schemes

Analysis of numerical schemes is a most fundamental step in


the development of an agorithm, and constitutes of an
essential aspect of the numerical simulation

Analysis of numerical schemes includes


1. Consistency
2. Accuracy
3. Stability
4. Convergence

Page 24 Moelyadi - 07.03.2012


Stability Analysis of Numerical Schemes

Methods uses for stability analysis of numerical schemes

1. Discrete Perturbation
2. Von Neumann method (the most popular)
3. Equivalent differential equation
4. Matrix Method

Page 25 Moelyadi - 07.03.2012


Analysis of Stability for Heat conduction
Discrete Perturbation

e = round-off error

 Stable

 Unstable

Page 26 Moelyadi - 07.03.2012


Analysis of Stability

Von Neumann Methods


Error/Galat diekspresikan dengan Fourier series

P adalah bilangan gelombang


u U e
n
i
n IP (Dx ) i

  P (Dx) uin  U ne I i

uin1  U n1e I i
uin1  U ne I ( i 1)
uin1  U ne I ( i 1)
Faktor Amplifikasi
Syarat Kestabilan

U n1  G U n G 1 stabil

G 1 Tak stabil
Page 27 Moelyadi - 07.03.2012
Analysis of Stability

Von Neumann Methods


The error is expressed analytically by Fourier series

amplitudes are exponentially varying with time

1.

The condition is always hold


2.

Page 28 Moelyadi - 07.03.2012


for Stable solution

You might also like