cfd numerical error
TRANSCRIPT
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 123
1
AE3213 Computational Fluid Dynamics
Numerical Error and Stability1
Numerical Error and Stability
bull Contents
Define numerical error and understand how numerical schemes aresusceptible to error growth (instability)
bull Illustrate how different numerical systems display different instabilitycharacteristics
bull Describe the popular von Neumann technique for the analysis ofnumerical stability with examples
bull Discuss stability-imposed constraints and their mitigation
Analyse discretization errors and their impact upon the solution
bull Concept of modified PDE
bull Numerical dissipation and dispersion
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Differential Equation
bull This equation describes simple one-dimensional problems ofconvection and diffusion
eg propagation of a paint spill in the Thames
bull Explicit Centred-Difference Equation is
bull We can (and will) solve this difference equation to obtain thesolution u at spatial point j and time step k
We have to choose the mesh spacing ∆ x and ∆t
Example ndash Linear Burgers Equation
2
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
j uuu x
t uu
x
t cuu 11211
12
2 minus+minus+
++minus
∆
∆+minus
∆
∆minus=
micro
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 223
2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We use the example of a paint spill in the Thames
bull We are interested in the concentration of the paint spill as theriver carries it downstream
bull We want to look at the paint concentration profile u at different
points along the river rather than at different times
bull We want to see how the mean flow rate c of the Thames affects
the concentration profiles
For example in the different seasons of the year
bull We want to use the same amount of compute time in each case
The lower the mean flow rate c the larger the time step ∆t
3
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 25 ∆t = 00002
Example ndash Linear Burgers Equation
4
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 323
3
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 10 ∆t = 00005
Example ndash Linear Burgers Equation
5
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
bull Numerical Solution for case where velocity c = 098 ∆t = 00051
Example ndash Linear Burgers Equation
6
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 423
4
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 097 ∆t = 00052
983085983089983086983093983088
983085983089983086983088983088
983085983088983086983093983088
983088983086983088983088
983088983086983093983088
983089983086983088983088
983089983086983093983088
983090983086983088983088
983090983086983093983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 25 ∆t = 00002
(again)
Example ndash Linear Burgers Equation
8
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 523
5
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 50 ∆t = 00010
983085983088983086983094983088
983085983088983086983092983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983089983086983092983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We see some strange results for apparently sensiblecombinations of mean flow rate c and time step ∆t
What is going on
10
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 623
6
AE3213 Computational Fluid Dynamics
Numerical Error and Stability11
Numerical Errors
bull Numerical solutions of partial differential equations contain twotypes of errors
bull Discretization error is the summation of truncation errorsassociated with the finite differences
and similar errors in the numerical boundary conditions
bull Round-off error is due to the finite accuracy (associated with theword length) of computers
This error can in certain circumstances become unstable
We will study the basic ideas of stability using simple one-dimensional equations first qualitatively then quantitatively
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error and instability
12
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 223
2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We use the example of a paint spill in the Thames
bull We are interested in the concentration of the paint spill as theriver carries it downstream
bull We want to look at the paint concentration profile u at different
points along the river rather than at different times
bull We want to see how the mean flow rate c of the Thames affects
the concentration profiles
For example in the different seasons of the year
bull We want to use the same amount of compute time in each case
The lower the mean flow rate c the larger the time step ∆t
3
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 25 ∆t = 00002
Example ndash Linear Burgers Equation
4
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 323
3
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 10 ∆t = 00005
Example ndash Linear Burgers Equation
5
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
bull Numerical Solution for case where velocity c = 098 ∆t = 00051
Example ndash Linear Burgers Equation
6
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 423
4
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 097 ∆t = 00052
983085983089983086983093983088
983085983089983086983088983088
983085983088983086983093983088
983088983086983088983088
983088983086983093983088
983089983086983088983088
983089983086983093983088
983090983086983088983088
983090983086983093983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 25 ∆t = 00002
(again)
Example ndash Linear Burgers Equation
8
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 523
5
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 50 ∆t = 00010
983085983088983086983094983088
983085983088983086983092983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983089983086983092983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We see some strange results for apparently sensiblecombinations of mean flow rate c and time step ∆t
What is going on
10
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 623
6
AE3213 Computational Fluid Dynamics
Numerical Error and Stability11
Numerical Errors
bull Numerical solutions of partial differential equations contain twotypes of errors
bull Discretization error is the summation of truncation errorsassociated with the finite differences
and similar errors in the numerical boundary conditions
bull Round-off error is due to the finite accuracy (associated with theword length) of computers
This error can in certain circumstances become unstable
We will study the basic ideas of stability using simple one-dimensional equations first qualitatively then quantitatively
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error and instability
12
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 323
3
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 10 ∆t = 00005
Example ndash Linear Burgers Equation
5
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
bull Numerical Solution for case where velocity c = 098 ∆t = 00051
Example ndash Linear Burgers Equation
6
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 423
4
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 097 ∆t = 00052
983085983089983086983093983088
983085983089983086983088983088
983085983088983086983093983088
983088983086983088983088
983088983086983093983088
983089983086983088983088
983089983086983093983088
983090983086983088983088
983090983086983093983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 25 ∆t = 00002
(again)
Example ndash Linear Burgers Equation
8
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 523
5
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 50 ∆t = 00010
983085983088983086983094983088
983085983088983086983092983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983089983086983092983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We see some strange results for apparently sensiblecombinations of mean flow rate c and time step ∆t
What is going on
10
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 623
6
AE3213 Computational Fluid Dynamics
Numerical Error and Stability11
Numerical Errors
bull Numerical solutions of partial differential equations contain twotypes of errors
bull Discretization error is the summation of truncation errorsassociated with the finite differences
and similar errors in the numerical boundary conditions
bull Round-off error is due to the finite accuracy (associated with theword length) of computers
This error can in certain circumstances become unstable
We will study the basic ideas of stability using simple one-dimensional equations first qualitatively then quantitatively
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error and instability
12
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 423
4
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 097 ∆t = 00052
983085983089983086983093983088
983085983089983086983088983088
983085983088983086983093983088
983088983086983088983088
983088983086983093983088
983089983086983088983088
983089983086983093983088
983090983086983088983088
983090983086983093983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 25 ∆t = 00002
(again)
Example ndash Linear Burgers Equation
8
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 523
5
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 50 ∆t = 00010
983085983088983086983094983088
983085983088983086983092983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983089983086983092983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We see some strange results for apparently sensiblecombinations of mean flow rate c and time step ∆t
What is going on
10
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 623
6
AE3213 Computational Fluid Dynamics
Numerical Error and Stability11
Numerical Errors
bull Numerical solutions of partial differential equations contain twotypes of errors
bull Discretization error is the summation of truncation errorsassociated with the finite differences
and similar errors in the numerical boundary conditions
bull Round-off error is due to the finite accuracy (associated with theword length) of computers
This error can in certain circumstances become unstable
We will study the basic ideas of stability using simple one-dimensional equations first qualitatively then quantitatively
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error and instability
12
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 523
5
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Numerical Solution for case where velocity c = 50 ∆t = 00010
983085983088983086983094983088
983085983088983086983092983088
983085983088983086983090983088
983088983086983088983088
983088983086983090983088
983088983086983092983088
983088983086983094983088
983088983086983096983088
983089983086983088983088
983089983086983090983088
983089983086983092983088
983088983086983088983088 983088983086983093983088 983089983086983088983088 983089983086983093983088 983090983086983088983088
983125
983128
983116983145983150983141983137983154 983106983157983154983143983141983154983155 983109983153983157983137983156983145983151983150
983125 983137983156 983155983156983141983152 983088
983125 983137983156 983155983156983141983152 983093983088
983125 983137983156 983155983156983141983152 983089983088983088
983125 983137983156 983155983156983141983152 983089983093983088
983125 983137983156 983155983156983141983152 983090983088983088
Example ndash Linear Burgers Equation
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Example ndash Linear Burgers Equation
bull We see some strange results for apparently sensiblecombinations of mean flow rate c and time step ∆t
What is going on
10
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 623
6
AE3213 Computational Fluid Dynamics
Numerical Error and Stability11
Numerical Errors
bull Numerical solutions of partial differential equations contain twotypes of errors
bull Discretization error is the summation of truncation errorsassociated with the finite differences
and similar errors in the numerical boundary conditions
bull Round-off error is due to the finite accuracy (associated with theword length) of computers
This error can in certain circumstances become unstable
We will study the basic ideas of stability using simple one-dimensional equations first qualitatively then quantitatively
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error and instability
12
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 623
6
AE3213 Computational Fluid Dynamics
Numerical Error and Stability11
Numerical Errors
bull Numerical solutions of partial differential equations contain twotypes of errors
bull Discretization error is the summation of truncation errorsassociated with the finite differences
and similar errors in the numerical boundary conditions
bull Round-off error is due to the finite accuracy (associated with theword length) of computers
This error can in certain circumstances become unstable
We will study the basic ideas of stability using simple one-dimensional equations first qualitatively then quantitatively
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error and instability
12
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 723
7
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (1) computed solution
bull A numerical solution from a real computer with finite accuracy
13
-02
-01
0
01
02
0 02 04 06 08 1
x
U N
Numerical solution produced by a real computer with finite accuracy
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (2) exact solution
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and
14
Exact solution of difference equation
-02
-01
0
01
02
0 02 04 06 08 1
x
U D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 823
8
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Round-off error (3) computed minus exact
bull A numerical solution from a real computer with finite accuracyincludes the exact solution of the difference equation and the
round-off error
15
Round-off error εεεε = UN - UD -0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Error and Instability
bull We are interested in whether the round-off error grows or decaysas the solution is updated
bull We can examine the stability of the error by considering the effectof the numerical algorithm on the error profilehellip
Different algorithms tend to promote different types of instability
Wersquoll look in turn at dynamic and static instability
These are associated with diffusion and convection respectively
16
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 923
9
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (1)
bull Consider the one-dimensional diffusion equation
bull A numerical scheme to solve the above equation might be
(forward-time centred-space uniform grid)
17
2
2
x
u
t
u
part
part=
part
part micro
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (2)
bull We now consider the error involved in solving
bull We substitute where
u is the computed solution
D is the exact solution of the difference equation
ε is the error
to obtain
18
( ) ( )k
j
k
j
k
j
k
j
k
juuu
xt
uu112
1
2minus+
+
+minus∆
=∆
minus micro
k
j
k
j
k
j Du ε +=
( ) ( )
( ) ( )k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
k
j
x D D D
xt t
D D112112
11
22minus+minus+
++
+minus∆
++minus∆
=∆
minus+
∆
minusε ε ε
micro micro ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1023
10
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (3)
bull By definition the exact solution D satisfies the difference
equation and can be eliminated
bull The remaining terms define the development of the error
Has same form as original equation but is there another solution
bull We can write where
19
ε ε ε j
k
j
k
j
k += +
1∆
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (4)
bull Correction tends to bring back towards zero
20
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( ) ( )k
j
k
j
k
j
k
j x
t 112
2minus+
+minus∆
∆=∆ ε ε ε micro
ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1123
11
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Dynamic instability (5)
bull However if is too large the correction will overshoot and
may be greater than
bull This is dynamic instability and is related to the time step size
21
( )
micro ∆
∆
t
x2
k
jε 2
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (1)
bull Now consider the one-dimensional advection equation
bull Again using forward differences in time and central differences in
space on an equi-spaced grid the above can be approximated to
bull The corresponding error equation can be written
22
x
uc
t
u
part
partminus=
part
part
( )k
j
k
j
k
j
k
juu
x
c
t
uu11
1
2 minus+
+
minus∆
minus=∆
minus
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1223
12
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (2)
bull Correction tends to move further way from zero
23
Error at time k
-0002
-0001
0
0001
0002
0 02 04 06 08 1
x
ε εε ε
j minus 1 + 1
( )k
j
k
j
k
j x
t c11
2 minus+
minus∆
∆minus=∆ ε ε ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Static instability (3)
bull will therefore increase irrespective of the time step
bull This is static instability and can only be overcome by changing thedifference scheme used to solve the equation
24
k
jε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1323
13
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Qualitative view of numerical stability
bull Round-off errors may or may not grow with time into ldquowigglesrdquo inthe solution
In extreme cases the solution may ldquoblow uprdquo at the first iteration
bull We have used greatly simplified examples
Bad news is that it is not possible to analyse qualitatively the stabilityof a numerical approximation of the full Navier Stokes equations
Good news is that different instability types are closely related to theindividual terms in the equations representing different physicalprocesses
25
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability
bull Nor is it possible to analyse quantitatively the stability of anumerical approximation of the full Navier Stokes equations
bull However the stability of simpler linear models of theseequations can be analysed
We can define numerical stability boundaries for mesh spacing timestep size etc
bull Can also predict the form which the instability will take
bull The results of these studies can provide guidance for the stability
limits of the more complex non-linear Navier Stokes equations
26
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1423
14
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative stability analysisthe von Neumann method
27
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (1)
bull The von Neumann stability method can be used to quantify thestability of linear difference equations
bull The essence of the method is to assume that the round-off error ε can be given by a Fourier series in space and time
where
N = number of mesh intervals L = domain length
a = temporal growth rate k m= wavenumber 2π m L
28
( ) sum=
+=
2
1
N
m
xik at met xε
L
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1523
15
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Quantitative view of numerical stability (2)
bull Because the problem is linear we can consider any one term ofthe series ie forget the summation Σ
But we do need to capture the lsquoworst casersquo scenario
bull In discrete notation we write
NB donrsquot confuse time step k with spatial wavenumber k m
bull An algorithm is stable if ie for all k m
We now apply this method to the two equations we have just considered qualitatively
29
k
j
k
j ε ε le+1
11
le=+
k
j
k j
Gε
ε
( ) xik at met x +=ε
jmk xik at k
j e +
=ε
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (1)
bull We substitute into
remembering that
bull After some algebra we obtain
bull Noting that and we can write
30
2
11
12
xt
k
j
k
j
k
j
k
j
k
j
∆
+minus=
∆
minusminus+
+ ε ε ε micro
ε ε jmk
xik at k
j e +
=ε
2
2
x
u
t
u
part
part=
part
part micro
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++=== 11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1623
16
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Diffusion Eqn (2)
bull For stability we therefore require for all k m
A) Consider for all k m
This is satisfied if (always true)
B) Consider for all k m
This is satisfied if (true if )
31
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( )1
2sin41
2
2 le
∆
∆
∆minus
xk
x
t m micro
( ) 12sin41
2
2 minusge
∆
∆
∆minus
xk
x
t m micro
2
2
x
u
t
u
part
part=
part
part micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (1)
bull We substitute into
(note centred-differences in x) remembering that
bull After some algebra we obtain
bull Noting that we can write
32
jmk xik at k
j e +
=ε x
ct
k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus+
+
2
11
1 ε ε ε ε
x
uc
t
u
part
partminus=
part
part
( ) ( ) ( ) x xik at k
j
x xik at k
j
xik t t ak
j jm
k jm
k jm
k
eee ∆minus+
minus
∆++
+
+∆++===
11
1ε ε ε
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1723
17
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
vN Analysis of the Advection Eqn (2)
bull For stability we therefore require for all k m
which is satisfied if (never true)
bull Hence the forward-in-time centred-in-space approximation to theone-dimensional advection equation is unconditionally unstable
33
( ) 1sin1 le∆∆
∆minus xk
x
t ci
m
x
uc
t
u
part
partminus=
part
part
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Alternative advection algorithm
bull The forward-in-time upwind approximation to the advectionequation would be
bull This has amplification factor
bull We can show that for all k m if
This is usually called the Courant-Friedrichs-Lewy condition (CFL)and C is the Courant number
34
x
uuc
t
uu k
j
k
j
k
j
k
j
∆
minusminus=
∆
minusminus
+
1
1
( ) xk x
t c
x
t cG m∆minus
minus
∆
∆
∆
∆+= cos1121
x
uc
t
u
part
partminus=
part
part
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1823
18
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull What is the physics of advection
Transport of a property u at velocity c
bull Consider the numerics of the upwind algorithm
The shaded triangle indicates thecomputational zone which influencesthe solution at point A
bull Determined by spatial resolution andby time step
Numerics vs Physicst
x
∆t
∆ x
A
35
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
bull Does the real physical advection process which influences point A
actually pass through the shaded triangle
bull The triangular zone captures the physics of advection at velocityc1 but not the physics of advection at velocity c2
For the c2 case then the mesh amp time step will cause instability
Numerics vs Physics
∆t
∆ x
A
36
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 1923
19
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Physical explanation of stability boundaries
bull We deduce that is the stability criterion for this algorithm
This is satisfied when the numerical domain of influence includes thephysical domain of influence
ie when the numerics captures the correct flow of information withinthe flowfield
bull Consider the following cases
Advection problem using centred-differences in space
bull Unstable Advection-diffusion problem using centred-differences in space
bull Stable (conditional - which way does information travel in diffusiveproblems)
1le∆
∆
x
t c
37
AE3213 Computational Fluid Dynamics
Numerical Error and Stability38
Linear Burgersrsquo Equation
bull We can now consider the stability limits of numerical solutions ofthe linear Burgers equation
This equation represents the time-variation of a flow property U
which is both convected by a uniform stream of velocity c and
diffused by viscosity micro
bull The equation is linear but displays some realistic physics
Unsteadiness
Convection (advection)
Diffusion
2
2
x
u
x
uc
t
u
part
part=
part
part+
part
part micro
2
21
x
u
dx
dp
x
uu
t
u
part
part+minus=
part
part+
part
part
ρ
micro
ρ
1D u-momentum equation
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2023
20
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull The forward-in-time centred-in-space (FTCS) finite-difference
scheme for the Burgers equation is
bull The amplification factor for this algorithm is
(useful exercise to prove)
where and
39
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
( )( )
( )k
j
k
j
k
j
k
j
k
j
k
j
k
juuu
xuu
x
c
t
uu11211
1
22
minus+minus+
+
+minus∆
+minus∆
minus=∆
minus micro
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Von Neumann Analysis of Linear Burgersrsquo Eq
bull This equation describes an ellipse
centred at (1 - 2D) with
a semi-minor axis of C
a semi-major axis of 2 D
bull The condition for stability is met
if the ellipse stays within the unit circle
40
xk iC xk DGmm
∆minusminus∆+= sin)1(cos21
Im
Re
unit circle
G
2 D
C
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2123
21
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 1 linear Burgers FTCS scheme
41
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D C lt 1 2D lt 1 C 2 gt 2D
The ellipse is tangent to the unit circle at the right-handside where the local radius of curvature is C 2 2D
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability plot 2 linear Burgers FTCS scheme
42
C lt 1 2D gt 1 C 2 lt 2D
Im
Re
unit circle
G
2 D
C
C lt 1 2D lt 1 C 2 lt 2D
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2223
22
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull The stability limits for the FTCS approximation for the linearBurgers equation can be written
bull This can also be expressed as
where the cell Reynolds number is defined as
43
C RC x 22 lele ∆
122
ltlt DC
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Stability limits linear Burgers FTCS scheme
bull For the paint spill simulation the two limits C 2 gt 2D and 2D gt 1
affect opposite ends of the mean flow speed lsquocrsquo range
bull Replacing the centred difference of the advection term with an
upwind difference removes the stability limit on so that just one stability limit exists
However there is an impact upon accuracy and upon the second
stability limit
bull All this will be explored in the practical work
44
D
C
R x =∆
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45
8132019 CFD numerical Error
httpslidepdfcomreaderfullcfd-numerical-error 2323
AE3213 Computational Fluid Dynamics
Numerical Error and Stability
Numerical Stability Summary
bull Perturbations in a numerical solution introduced by round-off (orcoding) error may be amplified by the algorithm
Dynamic instability may be managed by reducing the time step
Static instability may be managed by changing the algorithm
bull Non-linear equations are difficult to analyse for stability but thevon Neumann technique yields quantitative stability boundariesfor linear algorithms
These may be applied with correction factors to similar schemes fornon-linear problems
bull Stability problems are related to a failure to capture theinformation flow in the physical domain
45