4a2 Basic Concepts
4a2 Basic Concepts
4a2 Basic Concepts
IN COMPUTATIONAL FLUID
DYNAMICS
• finite differences
• time-marching
• stability
• false diffusion
• false convection
• wiggles; cell Reynolds number
1
COMPUTATIONAL FLUID DYNAMICS
CFD is the art of simulating numerically the motion of fluid. The
key difficulty is that in reality fluid motion takes place in a
CONTINUUM described by continuous DIFFERENTIAL
EQUATIONS. A computer can only handle a limited quantity of
numbers (2Mb stores 500,000 32bit numbers) and perform basic
arithmetical operations. The art of CFD is to construct an
appropriate DISCRETE REPRESENTATION of the continuum.
This construction is governed by:
•PHYSICAL BEHAVIOUR of the continuum equations –
conservation; the possible presence of characteristics or wave-
like behaviour; whether the problem is “initial value” or
“boundary value”.
•NUMERICAL BEHAVIOUR of the discrete representation –
accuracy; stability; false diffusion false convection.
There are four main methodologies adopted in constructing the
numerical models
- finite difference - finite volume
-spectral - finite element
The main ideas can be most easily demonstrated using the finite difference approach. 2
FINITE DIFFERENCES
f f
f(x) fi
ΔX
X X
i i+1
X Xi
CONTINUUM DISCRETE
∂f
The differential might be represented by a
∂X
∂f ΔX 2 ∂ 2 f
f i+1 = f i + ΔX + + ⋅⋅⋅
∂X 2! ∂X 2 3
Thus,
f i − f i−1 ⎛ ∂f ⎞ ΔX ∂ 2 f
• ONE-SIDED DIFFERENCE =⎜ ⎟− ⋅ 2 ⋅⋅⋅
ΔX ⎝ ∂X ⎠ 2 ∂X
f i+1 − f i−1 ⎛ ∂f ⎞ ΔX 2 ∂ 3f
=⎜ ⎟+ ⋅ 3 ⋅⋅⋅
• CENTRED DIFFERENCE 2 ΔX ⎝ ∂X ⎠ 6 ∂X
It is clear that both differences are “consistent” in the sense that as ΔX→0 the desired
differential is recovered. However, for practical computations ΔX is very much finite (of
order 10-2 chord lengths!) and the two difference equations have very different properties.
The leading error term in the expansion is retained and called the “truncation error”; one-
sided differences are “first order accurate” as the truncation error is O(ΔX) whereas centred
differences are “second order accurate” as the error term is O(ΔX2).
4
Appropriate difference operators can be derived in a similar way for any required
differential. For example, a centred difference replacement for a second derivative is
f i+1 − 2f i + f i−1 ⎛ ∂ 2 f ⎞ ΔX 2 ∂ 4 f
= ⎜⎜ 2 ⎟⎟ + ⋅ 4
ΔX 2 ⎝ ∂X ⎠ 12 ∂X
f i − 2f i−1 + f i−2 ⎛ ∂ 2 f ⎞ ∂ 3f
= ⎜⎜ 2 ⎟⎟ − ΔX ⋅ 3
ΔX 2 ⎝ ∂X ⎠ ∂X
Note how the lack of symmetry in the one-sided difference has caused the truncation error
to deteriorate
5
TIME-MARCHING: INITIAL VALUE PROBLEMS & STABILITY
For the bulk of the course we will consider “initial value problems” and their solution
techniques, graphically called “time-marching”.
Consider the scalar heat conduction equation (a simple model parabolic equation; initial
value problem)
t
∂u ∂ 2u
=υ 2
∂t ∂X
X
BOUNDARY
DATA INITIAL DATA
NEW n+1
t Time, t = nΔt
OLD
i-1 i i+1 Space, X = i ΔX
n
X 6
If we use this “difference molecule” and choose a centred representation for ∂2u/∂X2 and a
one-sided representation for ∂u/∂t we have
Time level
(U n +1
i − U in ) (U − 2U i + U i−1 )
= υ i+1
n
Δt ΔX 2
Space location
This expression is “first order accurate in time and second order accurate in space”. The new
value of Ui can be found EXPLICITLY as all other references to Ui are at the old time level.
All we have to do is choose a value of Δt and “Time-March” the solution forward: see Fig 1.
7
∂u ∂ 2u
=ν 2
∂t ∂X
ν Δt
=
5 1 n +1
ui = ui +
n ν Δt
(u i+1 − 2u i + u i−1 )n
2 ν Δt 5
=
ΔX 2
11 ΔX 2 ΔX 2 9
1. 0 / x
νt
0 = 5•
νt
ΔX 2
10 x
x x
=5
ΔX 2
x x
10
u
20
x x
x x x x x x x x
x x
i i+1
0.
i=1 i = 21
ΔX X X
21 space nodes Fig. 1: 1D Heat Flow
BOUNDARY u(1) = 0
CONDITIONS u(21) = 0
MOVIE MOVIE
8
Figure 1 shows the numerical simulation of 1D heat flow for two choices of time step
5 ν
(ii) Δt = ⋅ : catastrophic instability!
9 ΔX 2
We clearly must understand the origin of time-marching instability and be able to predict over
what parameter range it is likely to occur. Hence “stability analysis”.
9
DISCRETE PERTURBATION STABILITY ANALYSIS
We imagine the finite difference solution to be composed of two parts, the exact solution, U i and
a perturbation, εi
U i = U i + εi
We substitute this into the finite difference equations and follow the growth or decay of ε.
This approach leads to strong physical insight into how the numerical model mimics the
underlying physics of the governing differential equation.
ε
υΔt n
U in +1 = U in +
ΔX 2
[U i+1 − 2 U in + U in−1 ] ; U i = U i + ε i
υ Δt
⇒ U in +1 = ε + [0 − 2ε + 0]
ΔX 2
⎛ 2υΔt ⎞
∴ U in +1 ε = ⎜1 − 2 ⎟
⎝ Δ X ⎠
10
For stability, u in +1 ε ≤ 1
2νΔt ν Δt
Thus : − 1 ≤ 1 − ≤ +1 i.e. ≤1
ΔX 2 ΔX 2
νΔt 1
≤
ΔX 2 2
11
This is for one time-step; what about the continued time-marching?
n=1
INITIAL POINT ε
n=2
. diffusion
n
.
. +ε1
X
-ε1
ν Δt
U in +1 − (− ε ) = (ε − 2(− ε ) + ε )
ΔX 2
= (1 − 4νΔt / ΔX 2 )
n +1
i.e. U i
ε
U in +1
for stability, ≤1
ε
∴ −1 ≤ 1 − 4νΔt / ΔX 2 ≤ +1
νΔt 1
Hence : ≤
ΔX 2 2
This shows that for a given ν and ΔX, the stable choice of Δt is restricted; Fig.l
shows solution attempts either side of the stability boundary.
This stability bound is very restrictive since if we half the mesh spacing (to check
accuracy for example) then Δt is reduced by a factor of four and so we must perform
four times as many time marching steps, each costing twice as much, to get to the
same physical time – an increase in cost of factor 8!
13
VON NEUMANN STABILITY ANALYSIS
In this common analysis we represent the variation of the computed variable by a Fourier
Series:
Un is the Fourier coeff. @ time n
U in = ∑ U n e ĵkX
k
ĵ = √-1
k = wave number = 2π/wavelength
X = iλX with I the space increment
U in
ΔX
14
This allows us to investigate stability (and other properties like convergence rate) of the
difference scheme over a range of harmonics but has the drawback of assuming an infinite
(periodic) space. This is in contrast to the “discrete perturbation method” which does allows
investigation of instabilities associated with boundaries.
(Note: strictly, we are representing the error by the series, not the solution itself.)
∂u ∂2u
We continue to consider the heat conduction equation =ν 2
∂t ∂X
νΔt
modelled by uin+1 = uin + (u + − 2u + u − )n
ΔX2
i 1 i i 1
15
The stability analysis is linear so we consider one harmonic
u in = U n e jkX = U n e ĵθi
ˆ
with θ = kΔX, the “phase angle” and substitute into the difference equation:
U n +1e ĵθi = U n e ĵθi +
νΔt n ĵθ (i+1)
ΔX 2
U e ( − 2e ĵθi + e ĵθ (i−1) )
∴ U
n +1
U n = λ =1+
νΔt ĵθ
ΔX 2
(
e + e − ĵθ − 2 )
AMPLIFICATION FACTOR
2νΔt
∴ λ = 1+ (cos θ − 1)
ΔX 2
If we are only interested in steady solutions and we regard time marching as simply an
iterative strategy we might reasonably ask what is the best value of Δt to choose. It is not
always the case that the bigger Δt the faster the “convergence rate” (i.e. the fewer the steps
needed to attain a steady solution). We assess the convergence rate by examining the
magnitude of the von Neumann λ which, if less than unity, gives the rate at which errors
associated with a given harmonic are damped.
λ
1.
2νΔt
From above we have λ = 1+ (cos θ − 1)
ΔX 2
0.
0 π θ
• SHORTEST WAVELENGTH ERRORS
2π 4νΔt
θ = KΔx = ⋅ ΔX = ∴ λ π = 1 −
2Δx ΔX 2
νΔt 1
-thus for a typical choice of = λπ =0 This means that “wiggles” are
ΔX 2 4 vigorously damped!
17
• LONGEST WAVELENGTH ERRORS
The longest
wavelength which
the mesh can
support is λ = L.
Hence the smallest
L 2π
LENGTH OF θ= ⋅ ΔX ≠0
L
DOMAIN
2ν Δt ⎛ ⎛ 2 π ⎞ ⎞
At this frequency, λ o = 1+ ⎜ cos⎜ Δ X ⎟ − 1⎟
ΔX 2 ⎝ ⎝ L ⎠ ⎠
2νΔt ⎛⎜ ⎛ 2π ⎞
2
⎞
~ 1+ 2 ⎜
1 − ⎜ ΔX ⎟ ... − 1⎟⎟
ΔX ⎝ ⎝ L ⎠ ⎠
i.e. convergence rate is slowest for the
⎛ 2νΔt ⎞⎛ 4π ⎞ 2
2
~ 1− ⎜ ⎜ 2 ⎟⎟ΔX
2 ⎟⎜
longest wave components of the solution.
⎝ ΔX ⎠⎝ L ⎠ Furthermore, the rate deteriorates
dramatically as the mesh is refined (i.e. ΔX
2νΔt
~ 0(1) ∴ λ o = 1 − 0(ΔX 2 )
reduced).
Now
ΔX 2
18
2D EXAMPLE ij+1
n+1
Consider the 2D heat conduction equation Δt
i-1j ij
∂u ⎛∂ u ∂ u⎞
2 2 n i+1j
= ν⎜⎜ 2 + ⎟
2 ⎟
∂t ⎝ ∂X ∂Y ⎠ ΔY ΔX
t
Y
A numerical representation is ij-1
X
n
u ijn +1 − u ijn ⎧ u − 2u ij + u i−1 j u ij+1 − 2u ij + u ij−1 ⎫
= ν ⎨ i+1 j + ⎬
Δt ⎩ Δ X 2
Δ Y 2
⎭
19
Substituting this trial function:
U e(
n +1 ĵ iξ + jη ) − U n e ĵ... = νΔtU n e ĵ... ⎧⎪⎨ e ĵξ + e − ĵξ − 2 + e ĵη + e − ĵη − 2 ⎫⎪⎬
⎪⎩ ΔX 2 ΔY 2 ⎪⎭
νΔt ⎧⎪ ⎫⎪
2
n +1 ⎛ ΔX ⎞
∴U = λ = 1+ 2 ⋅ ⎨(cos ξ − 1) + ⎜ ⎟ (cos η − 1)⎬
Un ΔX 2 ⎪⎩ ⎝ ΔY ⎠ ⎪⎭
This can be analysed for stability etc… In particular, if ΔX= ΔY, ⏐λ⏐≤1 for
νΔt 1
≤ which is twice as restrictive as in 1D!
ΔX 2 4
IMPLICIT TIME-MARCHING
The restrictive stability bounds of “explicit” time-marching can, under some circumstances,
be relieved by “implicit” techniques, i.e. by updating the variables simultaneously:
∂u ν∂ 2 u
= i-1 i i+1
∂t ∂X 2 t
n+1
νΔt Δt ΔX
⇒ u in +1 = u in + (u i +1 − 2u i + u i−1 ) n +1 n
ΔX 2
X
20
⎛ 2 ν Δt ⎞ n +1
u in = U n e ĵθi ⇒ ⎜1 − (cos θ − 1) ⎟ U = U n
⎝ ΔX 2 ⎠
If we analyse this for stability: 1
∴λ =
2νΔt
1+ (1 − cos θ)
ΔX 2
0≤θ≤π ⎞
⎟ Thus, ⏐λ⏐≤1 for all θ for all Δt!
− 1 ≤ cos θ ≤ +1 ⎟
0 ≤ 1 − cos θ ≤ 2 ⎟⎠
Thus, the implicit method is unconditionally stable, and note that as Δt→∞, ⏐λ⏐→0 so
the convergence rate (rate of damping of errors) becomes very favourable!
21
The solution of the set of simultaneous equations is by matrix methods. If we re-order
the expression:
ν Δt n +1 ⎛ 2νΔt ⎞ n +1 νΔt n +1
− u i +1 + ⎜ 1 + ⎟ u i − u i −1 = u n
i
ΔX 2 ⎝ ΔX 2 ⎠ ΔX 2
and assemble: n +1
0 ⎡ ⎤
⎢: ⎥ n
⎢ ⎥ ⎡ ⎤
⎢: ⎥ ⎢: ⎥
⎢ ⎥ ⎢ ⎥
νΔt 2νΔt νΔt ⎢ u i −1 ⎥ ⎢: ⎥
− 1+ − ⎢u i ⎥ ⎢ ⎥
ΔX 2 ΔX 2 ΔX 2 = ⎢u i ⎥
⎢ ⎥
⎢ i+1 ⎥
u ⎢: ⎥
⎢: ⎥ ⎢ ⎥
⎢ ⎥ ⎢: ⎥
⎢: ⎥ ⎢⎣ ⎥⎦
0 ⎢ ⎥
⎣ ⎦
22
We can then readily solve for the vector of unknowns subject to given boundary conditions.
It is often convenient to solve for changes in variable Δui=uin+1- uin to control machine
round-off error and we can obviously re-write the implicit scheme as:
νΔt νΔt
Δu i − (Δu i+1 − 2Δu i + Δu i −1 ) = (u i +1 − 2 u i + u i −1 )n
ΔX 2
ΔX 2
2 2 φi +1 − 2φi + φi −1
Here, δ ⋅ is the centred finite difference operator, δ XX φ =
XX ΔX 2
This compact form has many advantages from the point of view of manipulation.
23
2D IMPLICIT METHOD
1
1 i IM
The LHS matrix has the form:
JM
IMxJM
ij+1
ij-1 ij i+1j
i-1j
24
This is expensive to invert, the cost is proportional to (band width)2 x (order)
i.e. (IM x JM2). In practice, the matrix is “factored” into two matrixes, one for each co-
ordinate direction. This is the so called Alternating Direction Implicit method – ADI.
In operator notation:
[I − νΔt∂ ⋅ ][I − νΔt∂ ⋅ ]Δu = νΔt(∂
2
XX
2
YY
2
XX
u + ∂
2
YY u )
0
0
Δ u = RHS
0 0
The cost of inverting a tridiagonal matrix is proportional to (order), i.e. total cost is
~(IMxJM) – much cheaper than the full implicit method.
This factoring introduces an error as
FACTORISATION ERROR
The error is formally small, 0(Δt2), whereas other terms are 0(Δt). Nevertheless, the whole
point is to have Δt large; then the factorisation error can dominate. 25
THE CONVECTION EQUATION;
FALSE DIFFUSION AND FALSE CONVECTION
Most aerodynamic flows are high Reynolds number and hence convection dominated.
We therefore study the numerical simulation of the model 1D convection equation.
du ∂u
+A =0
∂t ∂X
⎛ dX ⎞
f(X-At) ⎜ ⎟ =A
⎝ dt ⎠λ
X
26
¾ Centred Space Differences
The most obvious finite difference attempt at time marching is “forward in time” and “centred in
space” with explicit updating:
Δt n+1
u in +1 − u in A ΔX
+ (u i +1 − u i −1 )n = 0 n
Δt 2ΔX
i-1 i i+1
AΔt
The amplification factor is λ = 1 − ˆjsin θ
ΔX
Evidently, ⏐λ⏐≥1 for all Δt and all θ! Thus the simple-minded approach is
unconditionally unstable.
27
i-1 i i+1
n+1
An implicit formulation is stable
Δt ΔX
AΔt
u in +1 = u in − (u i +1 − u i −1 )n +1
2ΔX n
1
sin ce λ= and λ ≤ 1 for all Δt.
AΔt
1 + ĵ sin θ
ΔX
However, we prefer not to use implicit method because with coupled sets of equations the
application of boundary conditions and the matrix inversion becomes expensive in
computer time.
28
t ⎛ dX ⎞
¾ Upwind Space Differences ⎜ ⎟ =A
⎝ dt ⎠ λ
We recognise the physics revealed by the presence of
a characteristic curve and mimic this numerically
X
with an upwind difference. Thus the difference
equation is t
u in +1 − u in A Δt
+ (u i − u i −1 )n = 0
Δt ΔX ΔX X
i-1 i
The von-Neumann amplification factor is UNIT CIRCLE
↑
λ = 1−
AΔt AΔt
+
ΔX ΔX
(
cos θ − ĵsin θ )
1
λ
⎛ AΔt ⎞
λ ≤ 1 for ⎜ ⎟ < 1 conditional stability.
⎝ ΔX ⎠
29
⎛ AΔt ⎞ is very important and is called the Courant number (c) or the
The grouping ⎜ ⎟
⎝ ΔX ⎠
Courant-Friedrichs-Lewy number (CFL). The stability condition, CFL<1 has a sound basis
in the physics of the initial value problem:
Chic
t
⎛ dX ⎞ t Chic
⎜ ⎟ =A
⎝ dt ⎠ Chic
Δt
Δt
ΔX ΔX
STABLE UNSTABLE
within domain of outside domain of
dependence dependence
To test the difference scheme we attempt to convect a ramp profile forward, as shown in
Fig. 3. For comparison, Fig 2 shows the Exact Solution, f(X-At).
The results show that although the initial profile is indeed convected physically, the slope
of the ramp reduces monotonically; this implies the presence of diffusion – FALSE
DIFFUSION.
30
∂u A∂u
+ =0
∂t ∂X
30
20
10
MOVIE
TIME =0
u
X
Fig. 2
EXACT
SOLUTION
31
∂u A∂u
+ =0
∂t ∂X
AΔt
A =1 ΔX = 0.1 C= = 0.5
ΔX
40
30
20 MOVIE
TIME
STEP =0 10
u
Fig. 3
32
The evident diffusion is FALSE because it must arise from the difference equation itself (it
is not present in the original differential equation).
We analyse the difference equation to find the “equivalent partial differential equation” using
Taylor expansions: n +1 ∂u Δt 2 ∂ 2 u
u i = u i + Δt +
n
+ ... etc
∂t 2 ∂t 2
AΔt
Substitute into u in +1 = u in − (u i − u i −1 )n
Δx
Shows:
∂u A∂u AΔX ∂ 2 u Δt ∂ 2 u
+ = − + ......
∂t ∂X 2 ∂X 2
14442444 2 ∂t
3
2
TRUNCATION ERROR
∂ 2u
We replace the from the original equation
∂t 2
∂u A∂u ∂ 2u A∂ ⎛ ∂u ⎞ A∂ ⎛ ∂u ⎞ A∂ ⎛ A∂u ⎞
+ = 0∴ 2 = − ⎜ ⎟=− ⎜ ⎟=− ⎜− ⎟
∂t ∂X ∂t ∂t ⎝ ∂X ⎠ ∂X ∂
⎝ ⎠t ∂X ⎝ ∂X ⎠
This can be very restrictive; for example if we have an aerofoil with ΔX=chord/25.
C
ΔX=
25 AC 4AC
then Re eff = = = 100!
ν eff AΔX
34
¾ Lax Wendroff differencing
L-W differencing is a classic attempt to produce a stable solution procedure free from false
diffusion. The basic idea is to expand the time difference to second order:
n
⎛ ∂u ⎞
n
⎛ ∂2u ⎞ Δt 2
uin+1 = uin + ⎜ ⎟ Δt + ⎜⎜ 2 ⎟⎟
⎝ ∂t ⎠ ⎝ ∂t ⎠ 2
A2∂2u
− : L − W " trick"
∂X2
replace the
time terms { −
A∂u
∂X
Replacing the differentials by centred, second order accurate finite differences gives the L-W
scheme itself:
AΔt
u in +1 = u in − (u i+1 − u i−1 )n Δt
n+1
2Δx
2 ΔX
1 ⎛ AΔt ⎞ n
+ ⎜ ⎟ (u i+1 − 2u i + u i−1 )
n
i-1 i i+1
2 ⎝ Δx ⎠
35
∂u A∂u
+ = 0 : L − W SCHEME
∂t ∂X
AΔt
A =1 ΔX = 0.1 C= = 0.5
ΔX
A von-N stability
analysis confirms
that stability
requires CFL = AΔt ΔX ≤ 1 40
i.e. the numerical 30
domain of
TIME 20
dependence must
be contained within STEP 10
the physical one. u
0
t
Fig. 4
MOVIE 36
Applying the L-W scheme to our model problem (Fig. 4) shows results in complete contrast
to those obtained using the upwind scheme. The ramp profile convects with little change in
slope (suggesting there is little false diffusion) but the profile becomes very “wiggly” and
perturbations propagate upstream in clear contravention of the physics! The wiggles and
“false convection” characteristic are common to all centred schemes.
Analysing the difference equation using Taylor expansions we find the “equivalent partial
differential equation” to be
∂u A∂u AΔX ∂ 3u
+ =− ⋅ + ...
∂t ∂X 6 ∂X 3
Even-order trunction error (like in the upwind scheme) is associated with false diffusion.
What about odd-order error?
u = Ue ĵkX ⎫⎪ ∂u ∂ 3u 2 ∂u
let : ⎬ = ĵkUe ;
ĵkX
= − ĵ k 3
Ue ĵkX
= − k
k = 2π wavelength⎪⎭ ∂X ∂X 3 ∂X
LONG WAVELENGTHS
2π
k= → 0 ∴ {A(1 − ...)} → A
λ
Gradient at central
node!
39
CONVECTION-DIFFUSION EQUATION;
CELL REYNOLDS NUMBERS, MORE WIGGLES
The interplay of convection and diffusion is the central theme in fluid mechanics. We
study how this is manifested in numerical solution procedures with the simple 1D
convection-diffusion model equation:
∂u A∂u ν∂ 2 u
+ =
∂t ∂X ∂X 2
A simple explicit finite difference scheme, forward in time and centred in space is:
u in +1 = u in −
AΔt
(u i +1 − u i −1 )n + νΔt2 (u i +1 − 2u i + u i −1 )n
2ΔX ΔX
n+1
Δt
n
ΔX
i-1 i i+1
40
RΔ > 2
RΔ = 2
1
A von-Neumann stability analysis
shows the scheme to be stable for
RΔ < 2
AΔt
ΔX νΔt 1 ⎫
and < ⎪⎪
STABLE REGION ΔX 2 2
2 ⎬
⎛ AΔt ⎞ ⎛ νΔt ⎞⎪
⎜ ⎟ ≤ 2⎜ ⎟
0
1 ⎝ ΔX ⎠ ⎝ ΔX 2 ⎠⎪⎭
0 ν Δt
2
ΔX 2
41
To measure the relative weight of convection and diffusion we define the
AΔX
CELL REYNOLDS NUMBER RΔ =
ν
We study the abilities of the difference scheme with the following steady 1D model
problem:
A∂u ν∂ 2 u
STEADY FLOW: = for 0 ≤ X ≤ 1
∂X ∂X 2
with boundary conditions
u=0@X=0
u=1@X=1
Substitution of the trial function u=eAx into the differential equation (and application
of the b/c’s) shows the CONTINUUM SOLUTION to be:
[ ][
u (X ) = e AX ν − 1 e A ν − 1]
42
1
u INCREASING A/ν
A=0
0
0 X 1
The main feature of the solution is a “boundary layer” of thickness 0(ν/A) at large
Reynolds numbers.
We compare this with numerical solutions obtained by time marching our scheme
forward from initial guess until
u in +1 − u in ~ zero
43
1
EXACT CONTINUUM SOLUTION
AΔX
NUMERICAL SOLUTION, RΔ = =1
ν
u
MOVIE
Δ X = 0 . 1⎫
⎬
I = 11 ⎭
i=1 2 3 i=I
0
0 X 1
1
i=1 2 3 i=I
0
0 X 1
44
• For the first case, RΔ= 1, the numerical
solution produces a very good
representation of the physical coninuum
solution.
Trial function ui =qi
• For the second case, RΔ= 5, the numerical
solution is awful! It must be stressed that
∴
A
2ΔX
( )
q i +1 − q i −1 =
ν
ΔX 2
q (
i +1
− 2 q i
+ q i −1
)
the numerical solution is completely
stable; the wiggles are not instability but,
rather, are the true exact solution of the ( ) (
∴ R Δ q − q −1 = q − 2 + q −1 )
difference equation! We confirm this by
solving the steady flow difference (
∴ q = 1 or 2 + R Δ
)
equations: (2 − R Δ )
u in +1 − u in
=0=−
A
(u i +1 − u i −1 ) + ν 2 (u i +1 − 2u i + u i −1 )
Δt 2ΔX ΔX ( + )
∴ u i = C1 + C 2 ⎡ 2 R Δ ⎤
i
⎢⎣ (2 − R Δ )⎥⎦
⎡ ⎛ 2 + R ⎞i −1 ⎤
u = 0 @ i = 1⎫ ⎢1 − ⎜⎜ Δ⎟ ⎥
⎟
B/C’s u = 1 @ i =
⎬
I ⎭ ⎢⎣ ⎝ 2 − R Δ ⎠ ⎥⎦
ui =
⎡ ⎛ 2 + R ⎞ I −1 ⎤
⎢1 − ⎜⎜ Δ⎟ ⎥
⎟
⎢⎣ ⎝ 2 − R Δ ⎠ ⎥⎦
45
This has a similar form to the continuum solution, and, indeed, if we take the limit ΔX → 0
with i = X/ ΔX then we can recover the continuum solution. It is clear from the discrete
solution that if RΔ > 2 then the factor i −1
⎡(2 + R Δ ) ⎤
⎢⎣ (2 − R Δ )⎥⎦
will alternate in sign depending on whether the space index, i, is odd or even; this
produces the NON-PHYSICAL WIGGLES we found in our numerical solution.
We conclude that although the difference scheme is stable and accurate (in the formal
sense), it will produce completely non-physical results if used with too high a cell
Reynolds number! This is the third BEHAVOURAL PROBLEM we have studied, the
other two being false diffusion and false convection. Physically, the cell Reynolds
number problem arises because higher Reynolds numbers, A/ν, imply steeper gradients
and thus require more mesh nodes to resolve them. Gradients, and flow features in
general can only be resolved by finite difference methods if the mesh spacing is
comparable with the length scales of the feature! High Reynolds number simulations
inevitably imply dense meshes.
Not all difference schemes have the same RΔ limitations. Some, like the upwind scheme,
have so much false diffusion that RΔ always remains ≤ 2! Nevertheless, the basic issue,
that of the scale of the mesh, is a central theme in numerical fluid mechanics.
46