Anda di halaman 1dari 127

COMPUTATIONAL

FLUID DYNAMICS
A.E.P. Veldman
Lecture Notes in Applied Mathematics
JMBC PhD Course January 2012
COMPUTATIONAL
FLUID DYNAMICS
A.E.P. Veldman
Institute for Mathematics and Computer Science
University of Groningen
P.O. Box 407
9700 AK Groningen
The Netherlands
Cover picture:
Snapshot of a direct numerical simulation of turbulent ow past a square cylinder at a
Reynolds number of 22000 (color indicates pressure). The computation was performed by
R.W.C.P. Verstappen and A.E.P. Veldman (RuG); the visualisation was carried out in coop-
eration with W.C. de Leeuw (CWI).
iii
Preface
There is uid ow everywhere around us: air is owing past airplanes, cars and buildings;
water is owing past ships, through rivers and harbours; oil is owing through pipelines and
in underground reservoirs; blood is owing through our arteries. And the most important
ow around us has not even been mentioned: the air ow in the atmosphere that determines
our weather.
It will be clear that for weather prediction and for the design of airplanes, cars, ships, etc.
knowledge of ow phenomena is essential. Such knowledge can be obtained along three ways:
experiment, theory and computer simulation.
Experiment: The oldest way of acquiring ow knowledge is by experiment. The Wright broth-
ers already had built a small windtunnel to design their rst airplane. Currently windtunnels
are usually impressive buildings; the experiment time required for a new design is typically
10,000 to 20,000 hours. Even with two shifts a day (i.e. 16 working hours per day) such an
experiment program takes three to ve years. And the time for making the scale model, and
for analysing the measurement data has not even been accounted for. Today, such a long
time for development is not acceptable anymore, and a faster way has to be found.
Theory: Flow research can also be carried out along a theoretical way. More than one and a
half century ago already (Navier 1823, Stokes 1845) the equations describing the ow of air
and water were derived: the NavierStokes equations. With pencil and paper these equations
cannot be solved. Only if the equations are simplied strongly, this theoretical approach can
produce adequate information.
Computer simulation: In the modern computer era, another approach has become feasible:
computer simulation. Here, the NavierStokes equations are solved with methods developed
in the realm of numerical mathematics. There is still a role for experiments, but dierent
from before: experiments will mainly serve as validation of the computational results.
Groningen, November 2011.
iv
Contents
1 The convection-diusion equation 1
1.1 Analytical formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Central versus upwind discretization . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Analytical problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2 Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.3 Solution with central discretization . . . . . . . . . . . . . . . . . . . . 4
1.2.4 Solution with upwind discretization . . . . . . . . . . . . . . . . . . . 6
1.3 Articial diusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3.1 Second-order diusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3.2 Higher-order additives . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4 Preliminary trade-o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Non-uniform grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.1 Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.2 Numerical benchmark . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5.3 Discussion: steady . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5.4 Discussion: unsteady . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.6 Finite-volume discretization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.6.1 One space dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.6.2 More space dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.7 Higher-order space discretization . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.8 Time integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.8.1 Stability analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.8.2 Practical example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.9 Burgers equation discontinuous solutions . . . . . . . . . . . . . . . . . . . 29
1.10 Convective conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.11 Appendix: DirichletNeumann stability analysis . . . . . . . . . . . . . . . . 33
1.12 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2 Incompressible NavierStokes equations 37
2.1 The equations for uid ow . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.2 Choice of the computational grid . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.3 Discretization - explicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.4 The Poisson equation for the pressure . . . . . . . . . . . . . . . . . . . . . . 45
2.4.1 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.4.2 Treatment of div u
(n)
. . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.4.3 Pressure iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
v
vi CONTENTS
2.5 The steady NavierStokes equations . . . . . . . . . . . . . . . . . . . . . . . 50
2.5.1 Discrete formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.5.2 Articial compressibility . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.5.3 SIMPLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.6 Discretization - implicit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.6.1 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.6.2 Pressure correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.7 In- and outow conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3 Direct numerical simulation of turbulence 59
3.1 Computational eort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
3.2 NavierStokes: higher-order space discretization . . . . . . . . . . . . . . . . . 61
3.2.1 2nd- vs. 4th-order discretization . . . . . . . . . . . . . . . . . . . . . 63
3.3 Time integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3.1 Stability limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.3.2 An improvement of the AdamsBashforth scheme . . . . . . . . . . . . 65
3.4 Examples of turbulent-ow simulation . . . . . . . . . . . . . . . . . . . . . . 66
3.4.1 Flow in a 3D driven cavity at Re = 10,000 . . . . . . . . . . . . . . . 67
3.4.2 Flow past a square cylinder at Re = 22,000 . . . . . . . . . . . . . . . 68
3.4.3 Surface mounted cubes . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.4.4 Channel ow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
A Discretization, integration and iteration 79
A.1 Discretization in space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
A.1.1 Finite-dierence methods . . . . . . . . . . . . . . . . . . . . . . . . . 80
A.1.2 Finite-volume methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
A.1.3 Properties of dierence operators . . . . . . . . . . . . . . . . . . . . . 81
A.1.4 Discretization error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
A.2 Iterative solution methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
A.2.1 Jacobi and JOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
A.2.2 Gauss-Seidel and SOR . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
A.3 Some denitions and theorems on eigenvalues . . . . . . . . . . . . . . . . . . 88
A.4 Integration in time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
A.4.1 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
A.4.2 Matrix analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
A.4.3 Positive time-integration schemes . . . . . . . . . . . . . . . . . . . . . 93
A.4.4 Fourier analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
A.4.5 The modied equation . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
A.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
B Computer exercises 101
B.1 Exercise 1 Articial diusion . . . . . . . . . . . . . . . . . . . . . . . . . . 101
B.2 Exercise 2 Various discretization methods . . . . . . . . . . . . . . . . . . . 102
B.3 Exercise 3 The JOR and SOR method . . . . . . . . . . . . . . . . . . . . . 104
B.4 Exercise 4 Time integration . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
CONTENTS vii
B.5 Exercise 5 Navier-Stokes solver . . . . . . . . . . . . . . . . . . . . . . . . . 109
viii CONTENTS
Chapter 1
The convection-diusion equation
1.1 Analytical formulation
The discussion of numerical solution methods for the equations of uid ow starts with a
simple situation: the transport of a solute in a owing medium. Two transport mechanisms
can be distinguished: convection and diusion.
convection = transport due to the motion of the medium;
diusion = transport due to dierences in concentration.
The concentration of solute is denoted by (x, t), where x represents space and t time. The
owing medium is assumed to be incompressible, with a velocity u(x, t).
The equation describing the concentration as a function of space and time can be derived
from a conservation law. Hereto, consider an arbitrary volume with boundary and
outward pointing normal n. A decrease of the amount of solute inside the volume is due
to outward transport of solute through the boundary . The convective transport per unit
of time is given by
_

u nd;
the diusive transport by
_

k grad nd,
where the diusion has been taken proportional to the gradient of the concentration (diusion
coecient k 0).
Conservation of mass in yields
_

t
d =
_

(u k grad ) nd = (Gauss)
=
_

div (u k grad ) d.
As this holds for any arbitrary volume , it follows that

t
+ div (u k grad ) = 0. (1.1)
1
2 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
This is called the divergence form of the equation. When div u = 0 (incompressibility condi-
tion) the convection-diusion equation can be rewritten in its more common form

t
+u grad = div (k grad ).
Remark 1 Equation (1.1) also describes heat transport in a owing medium with the
temperature. The diusion corresponds with heat conduction.
Remark 2 The above mass balance can also be considered in discrete form; the nite-volume
method results. More on this method in Section 1.6.
1.2 Central versus upwind discretization
1.2.1 Analytical problem
We start with the steady convection-diusion equation in one space dimension, with a velocity
eld u and a diusion coecient k that are taken constant
L u
d
dx
k
d
2

dx
2
= 0 (0 < x < L) (0) = T
0
, (L) = T
L
. (1.2)
The solution to this equation is given by
(x) = T
0
+ (T
L
T
0
)
1 e
ux/k)
1 e
uL/k
T
0
+ (T
L
T
0
)
1 e
Pe(x/L)
1 e
Pe
, (1.3)
in which
Pe
uL
k
is the Peclet number.
For moderate values of Pe the solution (x) varies smoothly over the whole domain. When
Pe is large, the solution possesses a boundary-layer character in which (x) T
0
, except in
a thin layer of thickness k/u(= L/Pe) near the outow boundary x = L where the solution
adapts itself to the outow condition (L) = T
L
.
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 1
Pe = 10
Pe = 50
Exact solution of convection-
diusion equation for various
values of the Peclet number
Pe.
1.2. CENTRAL VERSUS UPWIND DISCRETIZATION 3
Remark The fastest way to prove that the boundary layer thickness is proportional to
k/u uses dimensional analysis. First recognize that u has dimension m/sec, whereas k has
dimension m
2
/sec. Then conclude that k/u is the only combination that can be made with
the physical parameters that has a dimension of length.
1.2.2 Discretization
The convection-diusion equation (1.2) will be discretized on a grid with grid points x
i
=
ih, h = L/I, i = 0, , I. Various ways exist of discretizing partial dierential equations;
in these lecture notes we will follow either a nite-dierence or a nite-volume approach
(see Appendix A.1). Let us start simple with a nite-dierence approximation of the partial
derivatives occurring in (1.2).
With second-order central discretization we have
d
dx
=

i+1

i1
2h
+ O(h
2
);
d
2

dx
2
=

i+1
2
i
+
i1
h
2
+ O(h
2
). (1.4)
For the discretized operator L
c
h
this means
(L
c
h

h
)
i

_
u
2h

k
h
2
_

i+1
+
2k
h
2

i
+
_

u
2h

k
h
2
_

i1
= 0. (1.5)
Let us rst demonstrate the centrally
discretized solution for a situation where
Pe = 500. The grid in this example consists
of 10 grid points. One observes that the
discrete solution shows enthousiastic wiggles.
To understand this we need the notion
of a monotone operator, as discussed in
Appendix A.1.
If the requirements for being a monotone
operator are compared with the properties of
the discrete scheme given by (1.5), the fol-
lowing can be concluded:
-2
-1
0
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 500
Theorem 1.2.1 The operator L
c
h
is positive if and only if the mesh-Peclet number P satises
P
[u[h
k
2. (1.6)
It is monotone, i.e. a maximum principle holds, if P < 2.
Proof For a denition of a positive operator we rst refer to Appendix A.1. Further it is
assumed that u > 0. In that case the coecient of
i1
, given in (1.5), clearly is always
negative, and only the coecient of
i+1
might give troubles. The latter coecient is given
by u/2h k/h
2
, which is non-positive precisely under the condition (1.6). For a maximum
principle to hold, the coecients have to be strictly negative (Th. A.1.2). 2
4 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
The above condition stresses that when using central discretization the mesh width h has
to be suciently small in order to obtain a positive operator. In the latter case the solution
will be wiggle-free. A physicists reaction would be: If you want to compute the boundary
layer, then the least thing to do is to t your grid size to the boundary-layer thickness, i.e.
choose h = k/u. This insight is helpful, as for this choice of the grid size the mesh Peclet
number becomes equal to 1 (which is smaller than 2!).
A small grid size leads to a large number of grid points and hence an expensive calcu-
lation. And maybe you are not really interested in the details within the boundary layer,
i.e. convection is considered to be much more important than diusion. In that case our
physicist friend has an advice concerning the discretization of the convective term: If the
wind is blowing from a particular direction, then you only have to look in that direction to
see what is coming towards you. With this physical insight, in fact he suggests to consider
an alternative, one-sided discretization of the rst order derivative
d
dx
=
_
_
_

i1
h
+ O(h) (u 0),

i+1

i
h
+ O(h) (u < 0).
(1.7)
(1.7) is called an upwind discretization, be-
cause it is taken against the direction of the
ow velocity u. This discretization is rst-
order accurate in contrast with the second-
order accuracy of (1.4) but it always leads
to a (monotone) positive operator irrespec-
tive of the mesh width h, as can be easily
deduced (see Exercise 1.2.1). The discrete
results in the same case as above indeed do
not possess wiggles! But are they accurate?
We will come back to this question later.
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 500
upwind
Exercise 1.2.1 Prove that, for k > 0, upwind discretization always leads to a positive and monotone
operator.
1.2.3 Solution with central discretization
The central discretization (1.5) can be rewritten as
P
2
(
i+1

i1
) (
i+1
2
i
+
i1
) = 0 (i = 1, . . . , I 1), (1.8)
in which the mesh-Peclet number P = uh/k dominantly features. In fact, when P becomes
large and remains bounded, this equation simplies to

i+1

i1
0. (1.9)
In other words, grid points two meshes apart are closely connected to each other, but they
are independent of their direct neighbours. This phenomenon is called odd-even decoupling.
1.2. CENTRAL VERSUS UPWIND DISCRETIZATION 5
The dierence equation (1.8) can be solved analytically by means of the next lemma.
Lemma 1.2.2 When a ,= b, the solution of the dierence equation a
i+1
(a+b)
i
+b
i1
=
0 (i = 1, . . . , I 1), with boundary conditions
0
= T
0
en
I
= T
L
, is given by

i
= T
0
+ (T
L
T
0
)
1 r
i
1 r
I
where r =
b
a
. (1.10)
Note that the solution will oscillate when z < 0, i.e. when a and b have a dierent sign.
Compare this with the wiggles that can appear for non-positive operators (see Appendix A.1).
Proof Find fundamental solutions of the form r
i
. These satisfy the characteristic equation ar
2
(a+
b)r +b = 0, which leads to r
1
= 1 and r
2
= b/a. Now, the general solution is given by
i
= c
1
r
i
1
+c
2
r
i
2
.
The boundary conditions at i = 0 and i = I x the coecients c
1
and c
2
, after which (1.10) follows.
2
Application of the above lemma gives the exact solution of (1.8)

i
= T
0
+ (T
L
T
0
)
1
_
1+P/2
1P/2
_
i
1
_
1+P/2
1P/2
_
I
, (i = 0, . . . , I).
We will consider this solution for large values of P. Introduce 2/P 1 and apply series
expansion in

i
= T
0
+ (T
L
T
0
)
1 (1)
i
(1 + 2i)
1 (1)
I
(1 + 2I)
+ O(
2
). (1.11)
Distinguish the cases I is even/odd and i is even/odd.
I odd:
When I is odd (1.11) becomes

i
T
0
+ (T
L
T
0
)
1 (1)
i
2(1)
i
i
2(1 + I)
,
hence
i even:
i
T
0
(T
L
T
0
) i; i odd:
i
T
L
(T
L
T
0
)(I i).
The solution in even grid points ts to the left-hand-side boundary condition, whereas
the odd points t to the right-hand-side condition. This is a concrete example of the
odd/even decoupling announced above.
I even:
When I is even we have

i
T
0
+ (T
L
T
0
)
1 (1)
i
(1 + 2i)
2I
,
hence
i even:
i
T
0
+ (T
L
T
0
)
i
I
; i odd:
i
T
0
+ (T
L
T
0
)
_
1
I

i
I
_
.
The solution in the even grid points ts to both boundary conditions. Odd grid points
look awful: the solution there approaches innity when 0. [Note that
i
is no longer
bounded, hence (1.9) does not describe the behaviour.]
6 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
-2
-1
0
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 500
-2
-1
0
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 500
Central discretization for Pe = 500: I odd (left) and I even (right).
1.2.4 Solution with upwind discretization
When an upwind discretization (1.7) is applied, the discrete equation becomes (assuming
u > 0)
P(
i

i1
) (
i+1
2
i
+
i1
) = 0,
0
= T
0
,
I
= T
L
.
The solution again follows from (1.10)

i
= T
0
+ (T
L
T
0
)
1 (1 + P)
i
1 (1 + P)
I
.
For P large we have

i
T
0
+ (T
L
T
0
)P
iI
,
which for i < I is approximately equal to T
0
, whereas
I
= T
L
. The solution does not possess
wiggles and looks more friendly than the central solution. But the boundary layer is too
thick! The two gures below show the upwind solution and the exact solution for a situation
with I = 10, k = 0.002, T
0
= 0 and T
L
= 1.
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 500
upwind
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

Pe = 500 exact
Upwind discretization Exact solution
1.3. ARTIFICIAL DIFFUSION 7
1.3 Articial diusion
1.3.1 Second-order diusion
If we compare the (second-order) central discretization with the (rst-order) upwind dis-
cretization through
u

i

i1
h
u

i+1

i1
2h

uh
2

i+1
2
i
+
i1
h
2
,
it is observed that upwind discretization of (1.2) yields the same discrete equation as central
discretization of
u
d
dx

_
k +
uh
2
_
d
2

dx
2
= 0. (1.12)
When comparing the centrally discretized solution of (1.2) with the upwind discretized solu-
tion of (1.2), the formulation (1.12) can be used as an intermediate step.
upwind
discretization
of (1.2)

central
discretization
of (1.12)

central
discretization
of (1.2)
It is observed that (1.12) in comparison with (1.2) contains an additional term in which
the diusion coecient is increased with k
a
= uh/2. This increase is called articial diusion.
When the articial diusion dominates the real diusion, and when one is interested in the
eects of diusion, then the usefullness of the upwind discretized solution decreases. But
be aware! We have silently assumed that the other discretization errors are small and that
they do not play a role in the above. If this is not the case then the judgement on upwind
discretization can be more positive. Also when diusion is not relevant for the physics there
is little harm in increasing the diusion, making upwind discretization an acceptable choice.
The advantage of upwind discretization is that a (monotone) positive operator is created,
which is easily treated iteratively (see Appendix A.2). Also other choices for the articial
viscosity k
a
lead to a positive operator. To investigate this, let us discretize the equation
u
d
dx
(k + k
a
)
d
2

dx
2
= 0 (1.13)
for arbitrary k
a
using central discretization. We obtain
(L
a
h

h
)
i

uh
2
(
i+1

i1
) (k + k
a
) (
i+1
2
i
+
i1
) = 0.
With reference to Theorem 1.2.1, the operator L
a
h
is a positive operator if and only if
k + k
a

[u[h
2
k
a

[u[h
2
k.
The upwind discretization with k
a
= [u[h/2 satises this criterion. In the literature also other
choices can be found. The gure below shows the quantity k
a
/k, for a number of methods,
as a function of P = [u[h/k.
8 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION

k
a
/k
P
UD
AS
Sp
UD = upwind discretization
Sp = Spalding (1972):
k
a
= max (0,
|u|h
2
k)
AS = Allen & Southwell (1955)
0 2 4 6
0
1
2
3
A special choice for k
a
has been described for the rst time by Allen & Southwell (1955),
and reinvented many times. Gresho & Lee (1981) call it the smart upwind method. Other
names are the locally exact method, and the exponential scheme. This special choice of k
a
can be found by comparing (1.3) and (1.10). One notes that for r = e
Pe/I
= e
P
the discrete
solution (1.10) and the analytic solution (1.3) in the grid points are equal. This situation
arises when (1.13) is centrally discretized with an articial diusion coecient (assume u > 0)
k
a
=
uh
2
coth
P
2
k = k
_
P
2
coth
P
2
1
_
. (1.14)
Proof After central discretization of (1.13), an equation as in Lemma 1.2.2 is obtained with
a
u
2h

k + k
a
h
2
and b
u
2h

k + k
a
h
2
.
Requiring that z b/a = e
P
, we can work backward to reconstruct k
a
:

u
2h

k + k
a
h
2
= e
P
_
u
2h

k + k
a
h
2
_
k+k
a
=
uh
2
_
e
P
+ 1
e
P
1
_
=
uh
2
_
e
P/2
+ e
P/2
e
P/2
e
P/2
_
. 2
For small P the expression between parentheses in (1.14) approaches zero, hence in this
case no articial diusion is added. The discrete solution will now approach the solution of the
centrally discretized problem. For large P, k
a
behaves like k
a

1
2
uh k. The solution then
resembles the upwind discretized solution. Yet, for the above one-dimensional convection-
diusion equation with constant coecients the exact solution is obtained. In more than one
dimension, nothing similar has been found yet.
Articial diusion is often applied in situations with P > 2, i.e.
1
2
h > k/u = the boundary-
layer thickness, to obtain a system of discrete equations which is easier tractable numerically.
When the solution is smooth - the amount of diusion is not important then - this does not
matter very much. However, when the solution should possess a boundary-layer character
the mesh width simply is too large to resolve details in the boundary layer. No choice of k
a
can repair this situation, not even (1.14) which gives the exact solution! A smooth solution is
created, however its boundary layer is too thick
1
. This can be seen only by comparing with
the exact solution. The left-hand-side gure on page 6 looks nice, but comparison with the
exact solution shows that the boundary layer is not computed correctly. In such a situation
the centrally discretized solution gives a warning by showing violent wiggles (see the gures
1
With upwind diusion k
a
uh/2, the thickness of the (articial) boundary layer becomes k
a
/u = h/2,
i.e. it can be resolved by the grid.
1.3. ARTIFICIAL DIFFUSION 9
on page 6). When the details in the boundary layer are relevant the only remedy is to rene
the mesh width, such that at least a few grid points are located inside the boundary layer.
Then automatically P 2 inside the boundary layer (check this!). Outside the boundary
layer P > 2, but that need not be critical (see Section 1.5).
1.3.2 Higher-order additives
The wiggle-dependence of central discretization of a rst-order derivative also can be dimin-
ished by adding a term of the form h
2
d
3
/dx
3
(for u > 0)
2
d
dx
=

i+1

i1
2h


i+1
3
i
+ 3
i1

i2
h
+
h
, (1.15)
with

h
= h
2
_

1
6
_

xxx
+ O(h
3
).
Here we have a family of upwind-biased -schemes
3
, which all are second-order accurate; for
= 1/6 we even have a third-order discretization. Special cases are further = 0 (central
discretization), = 1/2 (second-order upwind: the B3-scheme in which
i+1
drops out) and
= 1/8 (the QUICK method).
Why = 1/8 is a special value, can be seen as follows. Consider in the gure below the
points R and L which lie halfway [i, i + 1], and [i 1, i], respectively. We approximate the
derivative in i in a nite-volume fashion through
i 2 i 1 i i + 1
L R

x
=

R

L
h
.
The values
R
and
L
are determined via quadratic
interpolation on the intervals [i 1, i +1], and [i 2, i]
respectively (assuming u > 0). In this way

R
=

i+1
+
i
2


i+1
2
i
+
i1
8
,
with a similar formula for
L
. QUICK stands for Quadratic Upstream Interpolation for Con-
vective Kinematics (Leonard 1979).
After having added a second-order derivative and a third-order derivative to smooth
central discretization, it sounds logical that a fourth-order derivative (multiplied by h
3
) also
might be useful. Indeed this is the case. Jameson et al. (1981) have introduced this approach
for solving the inviscid Euler equations, but we will not go into further detail here. Another
2
An upwind-biased second-order discretization of a third-order derivative is given by
d
3

dx
3
=

i+1
3
i
+ 3
i1

i2
h
3
.
3
Above upwind-biased schemes are also used, in disguised form, in compressible ow, where they are called
-schemes; see e.g. Hirsch (1990) or Wesseling (2001). They are equivalent when = 1 4.
10 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
way of getting rid of the wiggles is to apply monotone discretization methods, where keywords
like limiters and TVD (total variation diminishing) are issues; see e.g. Chapters 20 and 21
of Hirsch (1990) or Chapter 9 of Wesseling (2001).
Exercise 1.3.1 Prove that max(
1
2

k
|u|h
, 0) is a sucient condition for the upwind-biased methods
from (1.15) to be wiggle-free. Show that the QUICK method is wiggle-free for P 8/3. Hint: Try
fundamental solutions of the form r
i
, and monitor the sign of r.
1.4 Preliminary trade-o
The trade-o between the methods presented above (and the methods still to be presented)
is a delicate matter. An important role is played by the ratio between the mesh size and the
length scales of the solution.
To give a rst impression we have compared a number of methods:
i) the rst-order upwind method (1.7);
ii) the second-order upwind method (1.15) with = 1/2;
iii) the QUICK method (1.15) with = 1/8;
iv) the second-order central method (1.4);
v) the fourth-order central method (see Section 1.7).
s
s
s
s
s c
c c
c c
c c c
c c c c
The dierence stencils of methods ii), iii) and v) are too large near the boundaries. Therefore,
where necessary in the rst and last grid points a central discretization has been applied. The
grid has been chosen uniform in all cases.
The convection-diusion equation (2.3) has been solved with k = 10
3
. Its boundary
layer has thickness
995
(dened as the location where the solution reaches 99.5% of the outer
solution) of about 0.0053. The computation has been performed for a large range of mesh
sizes, varying from h = 10
1
(with which the boundary layer cannot be resolved at all) to
h = 10
5
(with over 500 points inside the boundary layer). In the gure the dierence (as a
discrete L
2
-norm) between the analytic solution and the discrete solution
|y
exact
y
h
|
h
=
_
1
N
N

i=0
(y
exact
(x
i
) y
h
(x
i
))
2
_
1/2
has been plotted. This quantity is a measure for the error of the discrete solution in the grid
points. Where the grid is too coarse to resolve the analytic solution, this quantity gives a
attered image: what happens (or should happen) between the grid points remains invisible.
Accuracy for given grid size We start with some conclusions concerning the discretiza-
tion error of the methods investigated.
There is no method that performs well for all mesh sizes.
For coarse grids, only the rst- and second-order upwind methods are usefull. The error
of the rst-order upwind method is a bit attered because outside the boundary layer
the solution is constant. In a less trivial situation it performs worse.
1.4. PRELIMINARY TRADE-OFF 11
1e-10
1e-08
1e-06
0.0001
0.01
1
1e-05 0.0001 0.001 0.01 0.1
mesh width

boundary-layer thickness
1st upwind
2nd upwind (B3)
QUICK
2nd central
4th central
When the grid is rened until the boundary layer can be resolved, the other three meth-
ods become more attractive. Both central methods behave very regular. The QUICK
method is irregular, with a favorable discretization error just in the accuracy range
around 10
3
which is relevant for practical calculations. Whether this is a structural
property of QUICK is unknown.
For very ne grids the fourth-order method is the most accurate.
Computational eort Next, the eort to solve the discrete system of equations should be
considered. It will be clear that a larger dierence stencil will lead to a less sparse matrix,
making direct solution much more expensive. When the system is solved iteratively, the up-
wind method is very easy to handle. The other methods require a more sophisticated iterative
treatment, which usually will be more expensive. However, when this iteration process can be
combined with other iterative processes, e.g. treating non-linearity, the computational pain
will be relieved.
Maintainability A nal aspect to be taken into account is the simplicity of the method and
herewith the simplicity of the computer code. Methods with a larger stencil require special
measures near the boundaries, introducing many exceptional cases, and increasing the chance
for errors: the code becomes less readible and less maintainable.
Trade-o
For engineering accuracy (say 10
3
) I would prefer a second-order central discretization:
a small stencil, and easy to implement. Of course, the grid size has to be adapted to the
behaviour of the solution: too coarse meshes can lead to large oscillations. The QUICK
method, with its larger stencil, is still a mystery to me.
For coarse-grid calculations only the upwind methods qualify. First-order upwind is
easily handled, but its results are accordingly. Second-order upwind is remarkably
12 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
better, but it has the disadvantage of a larger stencil. It is the only method with
reasonable performance for a large range of mesh sizes.
Only when one is interested in four or more gures accuracy the fourth-order methods
are of interest. One should take into account that the equations to be solved often
will be an approximation of reality containing modelling errors. There is no sense in
reducing the discretization error too far below this modelling error.
In the next sections we will discuss more advanced discretization methods with which their
price/performance ratio can be improved.
1.5 Non-uniform grids
Thus far grids have been used in which, per coordinate direction, the mesh size is constant. In
practice often grids with varying mesh size are used. Their purpose is to describe the solution,
at prescribed accucary, with as little grid points as possible. In this way the discrete systems
to be solved become smaller, and in general - but not always! - can be solved cheaper.
1.5.1 Discretization
We start with a study of the local discretization error on a non-equidistant grid. Hereto we use
a one-dimensional example in which a rst-order and a second-order derivative are discretized.
Consider the following triple of grid points, with function values

,
0
and
+
, and at
mutual distances h

and h
+
x

x
0
x
+
h

h
+


0

+
u u u
In the middle grid point the derivatives
x
and
xx
are approximated with nite-dierence
formulas in which only

,
0
and
+
appear. We start with the Taylor series for
+
and

+
=
0
+ h
+

x
+
1
2
h
2
+

xx
+
1
6
h
3
+

xxx
+ , (1.16)

=
0
h

x
+
1
2
h
2

xx

1
6
h
3

xxx
+ . (1.17)
When we subtract (1.16) and (1.17) we obtain (Method A)

x
=

+

h
+
+ h

1
2
(h
+
h

)
xx

1
6
h
3
+
+ h
3

h
+
+ h

xxx
+
=
h
+
h
+
+ h

0
h
+
+
h

h
+
+ h

+ .
(1.18)
On uniform grids the term (h
+
h

)
xx
vanishes; this term is related to the stretching of
the grid (see below). Geometrically this estimate for the derivative in the i-th grid point
is generated by means of a linear interpolation of between the adjacent grid points (for a
nite-volume interpretation see Section 1.6).
1.5. NON-UNIFORM GRIDS 13
t
t
t
Method A
Method B
x
i1
x
i
x
i+1

h

h
+

+
(
(
(
(
(
(
(
(
(
(
(
(
(
(
h
h
h
h
h
h
h
h
h
h
h
h
h
h
By combining (1.16) and (1.17) in a dierent way, the term with
xx
can be eliminated
beforehand. Take h
2

(1.16) h
2
+
(1.17), then one obtains (Method B)

x
=
h
2

+
+
_
h
2
+
h
2

0
h
2
+

h
+
h

(h
+
+ h

)

1
6
h
+
h

xxx
+
=
h

h
+
+ h

0
h
+
+
h
+
h
+
+ h

+ .
(1.19)
We rst observe that the weights of the forward and backward derivatives have been inter-
changed in comparison with (1.18) Further, the local discretization error in (1.19) looks better
than the one in (1.18). Not only a term with
xx
is missing, but also the coecient of
xxx
is
less or equal the corresponding coecient in (1.18). Again a geometric interpretation can be
given. Draw a parabola through the three points

,
0
and
+
(Lagrange interpolation),
then the tangent to this parabola in
0
gives the estimate (1.19) for the derivative. In the
next section we will see that (1.19) does possess drawbacks.
For the approximation of
xx
, only one feasible option is available: combine h

(1.16) +
h
+
(1.17)

xx
=
h

+
(h
+
+ h

)
0
+ h
+

1
2
h
+
h

(h
+
+ h

1
3
(h
+
h

)
xxx
+ . (1.20)
Again the dierence h
+
h

appears. In the literature it is often called a rst-order term,


but it can equally well be called a second-order term: this depends on the way in which the
mesh width approaches zero. When h
+
and h

approach zero with h


+
/h

= constant ,= 1,
it is a rst-order term. It is a second-order term when the grid is obtained through a trans-
formation, x = f(), in which the -interval is divided uniform with mesh width . From a
Taylor series around
0
(corresponding with the central point) we have
h
+
= x
+
x
0
= f

(
0
) +
1
2

2
f

(
0
) + ,
h

= x
0
x

= f

(
0
)
1
2

2
f

(
0
) + .
hence
h
+
h

=
2
f

(
0
) + and
h
+
h

= 1 +
f

(
0
) + .
It will be clear that f

() controls the amount of stretching of the grid.


14 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

Method B
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

Method A
Discretization according to Method B
(1.19) yields the above result.
Discretization by Method A (1.18), which
looks less promising then (1.19) when
measuring the local truncation error, pro-
duces much better results.
For comparison we show the discrete
solution from upwind discretization.
0
0.5
1
0 0.2 0.4 0.6 0.8 1
x

upwind
1.5.2 Numerical benchmark
The dierence between both discretization methods A and B will be demonstrated with a
few examples. Consider the model problem (1.2) on the interval 0 x 1, with u = 1 and
k = 0.002 and boundary conditions (0) = 0 and (1) = 1. The exact solution is shown on
page 6. In the examples we use a grid given by
x
i
= 0, 0.2 k, 0.4 2k, 0.6 3k, 0.8 4k, 1 5k, 1 4k, 1 3k, 1 2k, 1 k, 1, (1.21)
hence for k = 0.002 we have ve grid cells of size about 0.2 and ve grid cells of size 0.002.
1.5.3 Discussion: steady
The above example gives an impression of the systematic behaviour of both methods; more
examples can be found in Veldman et al. (1991, 1993) and Verstappen and Veldman (1997,
1998, 2003). We will now give a fundamental explanation of the observed behaviour.
To get a feeling of the relation between the local discretization error (as in (1.18) and
(1.19)) and the global discretization error we have to consider (see Appendix A.1)

exact

h
= L
1
h

h
.
1.5. NON-UNIFORM GRIDS 15
This relation shows that the global error is determined by multiplying the local error with
the inverse of the coecient matrix. When the diagonal of L
h
is weakened, roughly spoken,
some eigenvalues may move towards zero herewith increasing L
1
h
. In the examples shown,
for Method B this increase of L
1
h
apparently overrules the decrease of
h
. Let us analyse
this in more detail.
Consider rst the coecient matrix L
A
of Method A, dened from (1.18) and (1.20),
which will be scaled by a diagonal matrix H incorporating the local grid size
M
A
= HL
A
where H = diag
_
h

+ h
+
2
_
. (1.22)
A simple calculation reveals that
2M
A
=
_
_
_
_
_
_
_
_
_
_
_
_
_
_
.
.
.
.
.
.
.
.
.
u
2k
h

2k(h

+h

)
h

u
2k
h

u
2k
h

2k(h

+h
+
)
h

h
+
u
2k
h
+
u
2k
h
+
2k(h
+
+h
++
)
h
+
h
++
u
2k
h
++
.
.
.
.
.
.
.
.
.
_
_
_
_
_
_
_
_
_
_
_
_
_
_
, (1.23)
where h

, h

, h
+
and h
++
are adjacent mesh sizes.
In the matrix M
A
the diusive term gives a purely symmetric contribution and the con-
vective term gives a purely skew-symmetric contribution, in line with the analytical property
of diusion and convection
4
, respectively. Therefore a method with such a property is called
symmetry preserving. This property allows to prove that the coecient matrix M
A
can never
become singular, no matter how the grid is chosen. We formulate this in the next theorem.
Theorem 1.5.1 For Method A, the eigenvalues of the scaled coecient matrix M
A
lie in
the right half plane (i.e. the matrix is positive-stable); hence this matrix is nonsingular.
Proof Bendixsons theorem A.3.1 states that all eigenvalues of a matrix lie in the rectangle
formed by the eigenvalues of the symmetric part and the eigenvalues of the skew-symmetric
part. As just remarked, the symmetric part of M
A
is generated by the diusive term. This
part is weakly diagonally dominant, and hence positive denite. Thus the rectangle just men-
tioned lies fully in the right half plane, and all eigenvalues of M
A
have a positive real part.
In particular M
A
is nonsingular. 2
Also several related matrices are nonsingular, as formulated in the following theorem:
Theorem 1.5.2 For Method A, also the eigenvalues of the non-scaled coecient matrix L
A
and of the shifted Jacobi matrix (diag L
A
)
1
L
A
= (diag M
A
)
1
M
A
are lying in the positive
half plane. Thus these matrices are positive-stable and hence nonsingular.
4
In one dimension, the skew-symmetry of convection basically follows from the integration-by-parts formula:

v dx =

uv

dx, whereas the symmetry of diusion follows from

v dx =

dx =

uv

dx.
16 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
Proof First observe that, trivially, the diagonal matrix H is positive denite. Further, the
symmetric part of M
A
is positive denite. Then Lemma A.3.4 makes the non-scaled coe-
cient matrix L
A
= H
1
M
A
positive-stable. Also, D
A
diag M
A
is positive denite. This,
similarly, makes D
1
A
M
A
positive-stable. 2
The just proven property of the shifted Jacobi matrix implies that many iterative methods
can be used to solve the discrete system, for example SOR (see Appendix A.2).
Method B does not possess such pleasant properties. On the contrary! The diagonal
entries of this method (before scaling) are given by
u(h
+
h

) + 2k
h

h
+
, (1.24)
from which we see that the convective term contributes to the diagonal. The diagonal can
easily become negative; note that in our example h
+
< h

, which is a natural situation for


u > 0 in view of the outow boundary layer that may appear. Hereafter D
1
B
M
B
is found to
be no longer positive-stable (see gure), and we can no longer use SOR and similar iterative
solution methods. When the lowering of the diagonal is stronger, some eigenvalues move to
the left half plane and the coecient matrix M
B
can even become singular!
To illustrate this we show one of the eigenvalues of M
B
and of D
1
B
M
B
as a function
of k, using the grid (1.21). Already for k = 1/20, where the stretching in the irregular grid
point equals 1/3, the shifted Jacobi matrix is singular (a diagonal element becomes zero).
For k = k
M
0.0084, where the stretching is approximately 0.04, the coecient matrix itself
becomes singular.
-8
0
8
0 0.02 0.04 0.06
k

M
B
D
1
B
M
B
Re
Im
k
M
Remark Manteuel and White (1986) have proven theoretically that on grids where the
ratio between the smallest and the largest mesh size is bounded during grid renement, both
Method A and Method B are second-order accurate. In view of the above observations, this
again is an acknowledgement of the power of Method A, where the local discretization error
at rst sight would suggest only rst-order accuracy.
1.6. FINITE-VOLUME DISCRETIZATION 17
1.5.4 Discussion: unsteady
In an unsteady setting
d
h
dt
+L
h

h
= 0 (1.25)
it is possible to talk about conservation of certain solution properties with time. Let us dene
the energy [[
h
[[
2
h
of the solution in such a way that it incorporates the local grid size: in
matrix-vector notation
[[
h
[[
2
h

h
H
h
. (1.26)
When H is positive denite, this is a genuine vector norm.
Theorem 1.5.3 The solution of (1.25) conserves energy (1.26) if and only if the scaled co-
ecient matrix HL
h
is skew-symmetric. Furthermore the energy is decreasing if and only if
HL
h
is positive real.
Proof The evolution of the energy (1.26) in time reads (note that H is symmetric)
d
dt
[[
h
[[
2
h
=
d

h
dt
H
h
+

h
H
d
h
dt
= (L
h

h
)

H
h

h
HL
h

h
=

h
(HL
h
+(HL
h
)

)
h
.
The right-hand side vanishes if and only if HL
h
is skew-symmetric. It is negative for all
,= 0 if and only if the symmetric part of HL
h
is positive denite, i.e. HL
h
is positive real.
2
The scaled coecient matrix M
A
(= HL
A
) of Method A satises the latter condition in
the theorem, once again explaining the favorable properties of this discretization method. On
the other hand, the scaled coecient matrix of Method B does not satisfy the conditions in
the theorem. A fortiori, as soon as one of the eigenvalues of the coecient matrix becomes
negative (or has negative real part), the time-dependent formulation (1.25) is unstable.
Remark In the above approach, the analytic skew-symmetry of the convective operator has
been preserved in its discrete counterpart. This is an example of a general strategy to preserve
(i.e. to mimic) properties of the analytic equations. In the literature, this general approach
is known as mimetic or compatible discretization.
Exercise 1.5.1 Write down the discretization of the unsteady convection-diusion equation using
forward-Euler in time and Method B in space. Use a grid with only one interior grid point. Show that
the time integration is unstable when 2k < u(h

h
+
). Note that here we have an example where
reduction of the number of grid points in(!)creases the computational eort. Next apply Method A
and choose the single interior grid point as 1 2k. What do you think of the discrete steady solution
in this case?
1.6 Finite-volume discretization
In a nite-volume discretization each grid point is surrounded by a cell, or control volume, in
which the weak form of the conservation law is applied. When applied to a control volume

h
with boundary
h
a general conservation law can be written as
_

t
d
h
+
_

h
F() nd
h
= 0, (1.27)
18 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
which forms the basis for the nite-volume method. As an immediate consequence we have
conservation of momentum
_

d as soon as along the outer boundary of the domain the


ux function F vanishes, since all contributions of the uxes along the interior cell faces cancel.
To investigate conservation of energy it is convenient rst to discretize (1.27) further as
H
d
h
dt
+M
F

h
= 0, (1.28)
where H again is a diagonal matrix, now representing the size of the individual control
volumes. The evolution of energy, dened by (1.26), then obeys
d
dt
[[
h
[[
2
h
=
d
dt
(

h
H
h
) =

h
(M
F
+M

F
)
h
.
Again it is observed that a positive real matrix M
F
implies a decrease of energy (Theo-
rem 1.5.3).
1.6.1 One space dimension
The convection-diusion equation in one dimension ts in the general framework (1.27) with
a ux function given by
F() = u k
x
,
where for the moment u and k will be kept constant.
The choice of the control volumes is not straightforward. On uniform grids the control
faces usually lie halfway the grid points, whereas at the same time the grid points lie in the
centre of the control volumes. On non-uniform grids only one of these properties can hold.
Below both variants will be treated, to show that their behaviour is completely dierent.
Faces halfway between grid points
We will start with a situation where the control faces lie halfway between the grid points; it
is sometimes called a vertex-centered method (because in a rectangular setting the vertices
of the control volumes lie central between the grid points).
u u u
i 1 i i + 1

.
F()[
i+1/2
1
2
(h

+ h
+
)
h
+
h



In this situation the convective and diusive uxes are found immediately with second-
order accuracy as (see notation in above gure)
F()[
i+1/2
= u

i+1
+
i
2
k

i+1

i
h
+
.
The discrete convection diusion equation then becomes
1
2
(h

+ h
+
)
d
i
dt
+
1
2
u(
i+1

i1
) k
_

i+1

i
h
+


i1

i
h

_
= 0.
1.6. FINITE-VOLUME DISCRETIZATION 19
It is observed that this method equals Method A, and it might give the impression as if the
nite-volume approach automatically results in a good discretization method. But this is not
true in general, as we will see in the next variant.
Grid points halfway between faces
Next the cell-centered method in which the grid points lie halfway between the cell faces
will be discussed. In this case the faces are not halfway the grid points, and a second-order
approximation of the convective ux at a cell face becomes more complicated than in the
previous approach.
u u u
i 1 i i + 1

.
F()[
i+1/2
H
0
h
+
h



Referring to the notation in the gure above, a linear interpolation results in a convective
ux
F[
i+1/2
=
H
0
2h
+

i+1
+ (1
H
0
2h
+
)
i
.
For the diusive ux one can do no better than in the previous approach, after which one
ends up with
H
0
d
i
dt
+ u
_
H
0
2h
+

i+1
+
_
H
0
2h

H
0
2h
+
_

H
0
2h

i1
_
+ diusive terms = 0.
We observe that the convective term contributes to the diagonal. Rewriting the terms between
braces as an approximation for the derivative gives

x

1
2

i+1

i
h
+
+
1
2

i1
h

.
By comparison with the bottom lines in (1.18) and (1.19) if follows that, with respect to
the convective term, this method is the average of Methods A and B discussed earlier. On
non-uniform grids it behaves just as bad as Method B, although for this averaged method
again Manteuel and White (1986) have proven second-order convergence.
Because of this behaviour, Jameson et al. (1981) in their version of the cell-centered
method have changed the computation of the convective ux into
F[
i+1/2
=
1
2
(
i+1
+
i
).
This is a formula we have seen earlier, but as the cell faces are not halfway the grid points,
its local truncation error is not second-order accurate. The resulting discretization of the
convective derivative reads

x
=

i+1

i1
2H
0
+
h
,
20 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
where
h
is the discretization error given by

h
= (
h
+
+ h

2H
0
1)
x
+
h
2
+
h
2

2H
0

xx
+ .
Note that 2H
0
is not the distance between the neighbouring grid points, therefore this method
is not even consistent on arbitrary grids! In fact, also the discretization of the second-order
derivative is inconsistent. On exponential grids with severe stretching this behaviour will
show up (Veldman and Botta 1993). Then, why is Jamesons cell-centered method so pop-
ular? Its because its coecient matrix can never become singular, just like that of Method
A. Once more the favorable properties of the coecient matrix make up for the unfavorable
local truncation error.
Another message to be learned from this section is that, although nite-volume discretiza-
tion ensures conservation of a linear quantity like momentum, conservation of a quadratic
quantity like energy is not automatic. In the previous section we have seen that the latter is
a very crucial property.
1.6.2 More space dimensions
Next the vertex-centered method will be demonstrated in two dimensions. The steady
convection-diusion equation in conservation form reads
_

(u k grad ) n d = 0, (1.29)
in which u and k are allowed to vary over the domain of interest. It is assumed however that
the velocity eld u = (u, v) is divergence free, i.e. div u = 0.
N
n
W
w
S
s
E
e

x
w
x
e

`
y
n
y
s
C

`

y
e
= y
w
x
n
= x
s
In order not to complicate the presentation, we will restrict ourselves to a rectangular grid,
but it is allowed to be non-uniform (for notation see the accompanying gure). Discretization
1.7. HIGHER-ORDER SPACE DISCRETIZATION 21
of (1.29) yields in rst instance
y
e
_
u
e

e
k
e

e
_
+ x
n
_
v
n

n
k
n

n
_
+
y
w
_
u
w

w
+ k
w

w
_
+ x
s
_
v
s

s
+ k
s

s
_
= 0.
As the points o, n, w and z lie halfway the grid points the uxes are found with second-order
accuracy leading to
y
e
_
u
e

E
+
C
2
k
e

C
x
e
_
+ x
n
_
v
n

N
+
C
2
k
n

N

C
y
n
_
+
y
w
_
u
w

W
+
C
2
k
w

W

C
x
w
_
+ x
s
_
v
s

S
+
C
2
k
s

C
y
s
_
= 0.(1.30)
If we assume that the continuity equation div u = 0 has been discretized with the same control
volume, then
y
e
u
e
+ x
n
v
n
y
w
u
w
x
s
v
s
= 0. (1.31)
Combining this with (1.30) it is observed that the contribution of
C
from the convective term
vanishes. We know already that this a favorable property. The following discrete equation
results
y
e
_
u
e
2

k
e
x
e
_

E
+ x
n
_
v
n
2

k
n
y
n
_

N
+
y
w
_

u
w
2

k
w
x
w
_

W
+ x
s
_

v
s
2

k
s
y
s
_

S
+
_
y
e
x
e
k
e
+
x
n
y
n
k
n
+
y
w
x
w
k
w
+
x
s
y
s
k
s
_

C
= 0.
We note that the coecient of
E
depends only on quantities dened in e. When the
equation in the neighbouring control volume is constructed,
C
in the neighbouring equa-
tion obtains the same coecient, apart from a minus sign in the convective contribution.
This makes the contribution of the convective terms skew symmetric, whereas the diusive
contribution is symmetric. And this is just what one wants!
Remark Generalization of the vertex-centered concept to general grids suggests choosing the
control volumes according to a Voronoi tesselation.
1.7 Higher-order space discretization
Inspired by the success of the above second-order symmetry-preserving discretization, in
Groningen we have concentrated on their extension to higher-order accuracy. As before, our
choice of the discretization on non-uniform grids will be explained by studying the convection-
diusion equation. It will be discretized in a nite-volume fashion, as discussed already in
Section 1.6, where the control faces are chosen halfway between the grid points (for notation
see Figure 1.1).
22 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
i+1 i+2 i
h
i1 i2
h
c
f
Figure 1.1: Fine (h
f
) and coarse (h
c
) control volumes. The volume faces are located halfway
the grid points (i, i 1) and (i, i 2), respectively.
As in Section 1.6, with a second-order ux in x
i+1/2
given by
u

i+1
+
i
2
k

i+1

i
x
i+1
x
i
,
the semi-discrete convection-diusion equation becomes
h
f
d
i
dt
+
1
2
u(
i+1

i1
) k
_

i+1

i
x
i+1
x
i


i1

i
x
i1
x
i
_
= 0. (1.32)
To turn this method into a fourth-order method, a similar equation on a two-times-larger
control volume (see Figure 1.1) is written down
h
c
d
i
dt
+
1
2
u(
i+2

i2
) diusive terms = 0. (1.33)
The leading term in the discretization error can be removed through a Richardson extrapo-
lation from (1.32) and (1.33). Since the errors in (1.32) and (1.33) are of third order (note
that these discrete equations are multiplied by h as compared to their usual formulation),
on a uniform grid this would mean to make a combination 8*Eq. (1.32) - Eq. (1.33). On a
non-uniform grid one would be tempted to tune the weights to the actual mesh sizes, but
we think it important that the skew symmetry of the convective contribution is maintained.
This can only be achieved when the weights are taken independent of the grid location, and
hence equal to the uniform weights. In this way the discretization of the convective derivative
becomes
H
i

x

1
2
(
i+2
+ 8
i+1
8
i1
+
i2
), (1.34)
where
H
i
= 8h
f
h
c
=
1
2
(x
i+2
+ 8x
i+1
8x
i1
+ x
i2
).
On a uniform grid, of course, the usual fourth-order method is obtained, but on non-uniform
grids the method diers considerably! In particular, the local truncation error given implicitly
by
2H
i

x
=
i+2
+ 8
i+1
8
i1
+
i2
+ (h
2
++
8h
2
+
+ 8h
2

h
2

)
xx
+
(where h
++
= x
i+2
x
i
, h
+
= x
i+1
x
i
, etc.) does not look very promising at rst sight. On
irregular grids it might even behave rst-order!
The diusive term undergoes a similar treatment leading to
H
i

x
2
8
_

i+1

i
x
i+1
x
i


i1

i
x
i1
x
i
_

i+2

i
x
i+2
x
i


i2

i
x
i2
x
i
_
. (1.35)
1.7. HIGHER-ORDER SPACE DISCRETIZATION 23
Remark The expressions (1.34) and (1.35) can also be derived through a coordinate trans-
formation x = x() by writing
d
dx
=
d
d
/
dx
d
and
d
2

dx
2
=
d
d
_
d
d
/
dx
d
_
/
dx
d
.
Choose a uniform grid in with mesh size , then
d
d
=

i+2
+ 8
i+1
8
i1
+
i2
12
+ O(
4
),
dx
d
=
x
i+2
+ 8x
i+1
8x
i1
+ x
i2
12
+ O(
4
)

d
dx
=

i+2
+ 8
i+1
8
i1
+
i2
x
i+2
+ 8x
i+1
8x
i1
+ x
i2
+ O(
4
).
Now, fourth-order behaviour looks obvious...
Testcase convection-diusion
The performance of the above 2nd- and 4th-order methods will be demonstrated by comparing
them with the traditional discretization methods based on Lagrange interpolation (minimizing
local truncation error). Since on uniform grids the methods are equal, an example with
a boundary-layer character is chosen, requiring grid renement near the outow boundary
x = 1. Thus, the steady convection-diusion equation
d
dx
k
d
2

dx
2
= 0 (0 < x < 1) (0) = 0, (1) = 1 (1.36)
is solved, with a diusion coecient equal to k = 0.001.
Two types of grid have been examined. Firstly, we will present results for piecewise-
uniform grids where the interval [0, 1] is split into two parts, in each of which the grid is taken
uniform. The interface point, denoted by 1 d, is chosen near the edge of the boundary layer
which has thickness d = O(k). In both parts half of the grid points are positioned. Note
that near the interface point the grid size abruptly changes, and only here the discretization
diers from the Lagrangian one. Secondly, we have investigated more smoothly stretched
grids. Results will be presented for a grid with a constant stretching (obtained through an
exponential transformation function), again chosen such that half of the grid points lie in the
boundary layer. Four discretization methods have been investigated:
2L: The traditional Lagrangian second-order method.
2S: The second-order symmetry-preserving method dened by (1.32).
4L: The traditional fourth-order Lagrangian method where we have implemented exact
boundary conditions to circumvent the problem of a dierence molecule that is too
large near the boundary. In this way the boundary treatment does not interfere with
the internal discretization.
24 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
4S: In the method dened by (1.34) and (1.35), the problems due to the missing
boundary conditions have been solved by using the second-order discretization (1.32)
in the end points.
As the analytical solution to (1.36) is known, we can monitor the global discretization error
dened by [[
h

exact
[[
h
, where the norm is the kinetic energy norm dened in (1.26).
Figure 1.2: The global error as a function of the mean mesh size. Half of the grid points
is located in the boundary layer of thickness d. Four methods are shown: 2L (second-order
Lagrangian), 2S (second-order symmetry-preserving), 4L (fourth-order Lagrangian with exact
boundary conditions) and 4S (fourth-order symmetry-preserving with second-order boundary
treatment).
In Fig. 1.2 the global error is presented as a function of the mean mesh size (= 1/N, where
N is the number of grid points). Two abrupt grids have been chosen, one in which d = 5k,
which is too narrow to catch the boundary layer accurately, and one with d = 15k. Further,
one exponential grid is shown with d = 10k (on a smoothly stretched grid the location of the
interface point is less critical).
A number of observations can be made. Firstly, often the fourth-order Lagrangian method
is not more accurate than its second-order counterpart, especially when the number of grid
points is not abundant. This explains why thus far fourth-order discretization has not been
very popular.
Secondly, when the number of grid points is low, Lagrangian discretization is much less ac-
curate than symmetry-preserving discretization. Also, on the narrow abrupt grid Lagrangian
discretization suers most. In contrast, the symmetry-preserving discretization method be-
haves smoothly on all grids; even on the coarsest grids the error does not exceed 10
2
.
Turbulent-ow simulations will always create the situation where one has to cope with limi-
tations on the aordable number of grid points; hence methods that are less sensitive in this
respect are preferable.
1.8. TIME INTEGRATION 25
Figure 1.3: The number of eigenvalues located in the (unstable) left halfplane for the La-
grangian methods as a function of mean mesh size (2L second-order; 4L fourth-order with
exact boundary conditions).
Thirdly, on the exponential grid the fourth-order Lagrangian method nearly breaks down
for N = 28 where the stretching factor is 1.4 (which is large but not extreme). For this class
of methods some eigenvalues of the coecient matrix may be located in the left halfplane.
Upon renement these eigenvalues will cross the imaginary axis, and, for this particular value
of N, one of these eigenvalues almost vanishes, making the system almost singular. Note that
the symmetry-preserving fourth-order method for this value of N is already very accurate,
with an error around 10
5
.
When one or more eigenvalues of the coecient matrix are located in the left halfplane,
the semi-discrete system (1.25) is unstable, and cannot be integrated in the time domain;
in the above examples the discrete solution has been obtained by a direct matrix solver. To
illustrate how serious this problem is, in Fig. 1.3 the number of eigenvalues that are located in
the unstable left halfplane are presented. Only the Lagrangian methods are shown, since the
symmetry-preserving discretization always keeps the eigenvalues in the stable right halfplane.
Note that upon grid renement also all Lagrangian eigenvalues will end up in the right
halfplane, since eventually the mesh Peclet numbers will become smaller than 2.
1.8 Time integration
1.8.1 Stability analysis
Before proceeding towards more advanced space discretization methods for the convection-
diusion equation its time integration will be discussed, i.e. we start with the unsteady equa-
tion

t
+ u

x
k

2

x
2
= 0, 0 < x < 1. (1.37)
This equation will be discretized explicitly in time and central in space, to obtain

(n+1)
j

(n)
j
t
+ u

(n)
j+1

(n)
j1
2h
k

(n)
j+1
2
(n)
j
+
(n)
j1
h
2
= 0.
After introduction of the following abbreviations

ut
h
(CFL-number) and d
2k t
h
2
(1.38)
26 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
the discrete equation can be rewritten as

(n+1)
j

(n)
j
+

2
_

(n)
j+1

(n)
j1
_

d
2
_

(n)
j+1
2
(n)
j
+
(n)
j1
_
= 0. (1.39)
In case of periodic boundary conditions
(0, t) = (1, t),
Fourier analysis yields the correct amplication behaviour of the time-integration method (see
Appendix A.4). Thereto
(n)
j
= c
(n)

e
ij
is substituted, to nd (after division by e
ij
)
c
(n+1)

= c
(n)

_
1 +
d
2
_
e
i
2 + e
i
_


2
_
e
i
e
i
_
_
= c
(n)

[1 + d (cos 1) i sin ] .
The expression between the brackets is the Fourier
amplication factor
g() = 1 d (1 cos ) i sin . (1.40)
In the complex plane it represents an ellipse with
center (1 d, 0) and half main axes equal to d and
, respectively.

d
1
1

locus of the
amplication factor g()
The requirement [g()[ 1 leads to
[1 + d (cos 1)]
2
+
2
sin
2
1
d
2
(cos 1)
2
+ 2d (cos 1) +
2
(1 cos
2
) 0
d
2
(1 cos ) 2d +
2
(1 + cos ) 0
d
2
+
2
2d + (
2
d
2
) cos 0. (1.41)
This has to hold for all . A simple observation shows that the left-hand side in (1.41) attains
its maximum in either = 0 or = . These two values lead to the necessary and sucient
conditions for Fourier stability

2
d and 0 d 1. (1.42)
The rst condition in (1.42) can be rewritten as

2
d u
2
t 2k P
2
d

2

d
.
We investigate zero-stability (see Appendix A.4) for t 0 and h 0 with d constant.
Taking the modulus of (1.40) yields
[g[
2
= 1 d (1 cos )
2
+
2
sin
2
= 1 d (1 cos )
2
+
u
2
t
2
h
2
sin
2
. (1.43)
1.8. TIME INTEGRATION 27
The rst term (between braces) in the right-hand side is less or equal unity as soon as
0 d 1. The second term looks small enough anyway, it is even O(t
2
), but the factor 1/h
2
is misleading. It can become arbitrary large when h 0. Therefore it has to be tamed by
one of the factors t; i.e. t/h
2
should remain bounded. The latter is obviously satised when
d is bounded, and the desired O(t) is achieved. Thus, ultimately we nd that the scheme is
zero-stable when
0 d 1, (1.44)
which is a weaker requirement than that for Fourier stability in (1.42). However, the coef-
cient of the t-term in (1.43) can be large, and herewith [g[. This is a situation which is
not acceptable in practice (as is shown below), and where one uses preferably the stronger
concept of practical Fourier stability (see Appendix A.4).
A nal aspect to investigate is the positivity of the discrete operator. Hereto the coef-
cients of all neighbouring points (in space as well as in time) have to be considered. It
easily follows that the discrete operator in our problem is a positive operator if and only if
d 1 P 2: a requirement which is stronger than (1.42).
1.8.2 Practical example
When mixed Dirichlet/Neumann boundary conditions
(0, t) = given;

x
(1, t) = given, (1.45)
are applied, in Section 1.11 the matrix method predicts absolute stability under the conditions
[
2
d
2
d +
_
d
2

2
2] [d
2

2
2d]. (1.46)
In the adjacent gure the various stability regions
have been indicated. In the white area in the
bottom-left corner the operator is positive; the dis-
crete solution does not show any wiggles. The re-
quirement of absolute stability for periodic bound-
ary conditions allows the doubly shaded area top
left. Here the time-integration method is practical
(Fourier) stable. Zero-stability increases the allow-
able region to the strip d 1. Also the Dirichlet
Neumann conditions increase the region of absolute
stability; this time with the singly-shaded region
given by (1.46).
s s s
s s
s s s
4
2
0
0 1 2
d t
P h
D E F
A B C
G H

................................
...................................

Next we will show what the discrete solution looks like for various choices of t and h.
The equation (1.37) is solved for u = 2 and k = 0.05, with homogeneous DirichletNeumann
boundary conditions (1.45). As initial condition (x, 0) = x is chosen. Three choices for the
grid size have been made: h = 1/10, 1/20 and 1/40. At each of these grid sizes the discrete
solution has been determined for a number of choices for the time step t. The various cases
have been indicated in the gure with the letters A through H.
The behaviour of the discrete solution as a function of time is shown by plotting (1, t),
i.e. the value at the Neumann boundary, for 0 t 4.
28 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
0
0.5
1
0 1 2 3 4
t

A
A : h = 1/10; t = 0.02
(A + N + P+)
0
0.5
1
0 1 2 3 4
t

B
B : h = 1/10; t = 0.04
(A + N + P)
0
0.5
1
0 1 2 3 4
t

C
C : h = 1/10; t = 0.055
(A N + P)
0
0.5
1
0 1 2 3 4
t

D
D : h = 1/20; t = 0.02
(A + N + P+)
-10
0
10
0 1 2 3 4
t
E
E : h = 1/20; t = 0.03
(A + N P)
-1e+09
0
1e+09
0 1 2 3 4
t
F
F : h = 1/20; t = 0.04
(A + N P)
0
0.5
1
0 1 2 3 4
t

G
G : h = 1/40; t = 0.005
(A + N + P+)
-0.5
0
0.5
1
0 1 2 3 4
t

H
H : h = 1/40; t = 0.00655
(A + N P)
Between parentheses + and indicate whether for this choice of t and h the time-integration
method possesses absolute stability (A), zero-stability (N) and/or practical stabililty (P).
Cases A, B and C possess a grid size h = 1/10. For A the time step has been selected
such that the scheme is absolutely and practically stable for periodic boundary condi-
tions. In B there is only absolute stability with DN conditions, and in C there is no
absolute stability. For each of these cases the scheme is zero-stable. All three solutions
show oscillations (we are outside the area where the solution should be wiggle-free).
Case A with t = 0.02 looks quite nice, case C is unacceptable.
In the cases D, E and F the grid size equals h = 1/20. In D a positive operator is
created, which is absolutely, practically and zero-stable; the solution is monotone. E
and F are only absolutely stable with DN conditions. An instability developes, which
after some time (when the Dirichlet condition becomes manifest) is being damped. But
in the mean time the solution has been growing quite a bit (in F : 10
9
).
In G and H the grid size equals h = 1/40. Case G satises all stability conditions
and produces a nice solution. Case H is just outside the region of absolute stability
for periodic boundary conditions; the stability boundary is at t = 0.00625. Just as in
cases E and F an instability developes which eventually gets damped.
1.9. BURGERS EQUATION DISCONTINUOUS SOLUTIONS 29
The time step in case H is t = 0.00655; this is a factor of three smaller than in cases A
and D. With respect to accuracy the latter cases are quite good and the larger time step
apparently is small enough. The fact that in cases H and G a much smaller time step has to
be chosen is dictated by the stability of the method, rather than by its accuracy.
In conclusion it is remarked that the three best-looking solutions A, D and G precisely
correspond with the cases where the time-integration method satises the criteria for practical
stability, herewith illustrating the usefullness of this notion.
1.9 Burgers equation discontinuous solutions
In this section a rst step is made towards solving the compressible NavierStokes equations.
The main dierence between the compressible and the incompressible equations is the possi-
bility for discontinuities shock waves to develop in the solution. Using the one-dimensional
equation of Burgers as a model, either in non-conservation form
u
t
+ u
u
x
= 0, (1.47)
or in conservation form
u
t
+

x
(
1
2
u
2
) = 0, (1.48)
the performance of the thus far treated discrete approximation methods on non-smooth so-
lutions will be demonstrated.
Finite-volume discretization
In Section 1.6 we have already encountered the nite-volume method (FVM) for the dis-
cretization of a conservation law like
__

u
t
d +
_

F(u) n d = 0. (1.49)
Consider this approach in a one-dimensional situation on a uniform grid as shown here:
u p
p
u u
i 1 i i + 1

.
F(u)[
i+1/2
h

The ux through the right-hand face of the control volume around the point i is computed
as
F(u)[
i+1/2
:= F(u
i+1/2
) = F(
1
2
(u
i
+ u
i+1
)), (1.50)
in which the value of u on this face is found through averaging the neighbouring cell values
of u. For the discretization of the term F/x in the dierential equation corresponding to
(1.49)
u
t
+ div F(u) = 0, (1.51)
this implies
F
x

F(u
i+1/2
) F(u
i1/2
)
h
. (1.52)
30 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
As an alternative to (1.50), we could have averaged F(u)[
i+1/2
from neighbouring values
of F(u):
F(u)[
i+1/2
:=
1
2
F(u
i
) + F(u
i+1
). (1.53)
This results in the discretization
F
x

F(u
i+1
) F(u
i1
)
2h
, (1.54)
where a central nite-dierence (FDM) discretization is recognized. In Section 2.3 it is demon-
strated that the choice (1.50) is to be preferred, as in the NavierStokes equations it corre-
sponds with (2.18

) which leads to a skew-symmetric discretization of convection.


An upwind-biased choice of the ux is given by F(u)[
i+1/2
:= F(u
i
) (for u > 0), leading
to the upwind discretization
F
x

F(u
i
) F(u
i1
)
h
. (1.55)
Burgers equation
We will study Burgers equation (named after Johannes Marinus Burgers, a Delft professor
of uid dynamics) in a situation with shock waves. In order to obtain the correct analytical
shock solution it is necessary to employ the conservation form (1.48). It is known that the
propagation speed S of a discontinuity in its solution is given by
S[u] + [
1
2
u
2
] = 0, (1.56)
where [] is the jump of the argument across the discontinuity. For Burgers equation this
results in
S =
1
2
(u
Left
+ u
Right
). (1.57)
As initial condition we choose
x 0 : u = 1; 0 x 1 : u = 1 x; 1 x : u = 0.
The characteristics of Burgers equation, along which u = Constant, have a slope dx/dt = u.
As u
Left
> u
Right
the waves from the left overtake the other ones and a shock wave is created,
with a shock speed S =
1
2
as follows from (1.57). The analytic solution is shown below.
`u

x
t

.
.
.
.
.
.
.
.
.

(
(
(
(
(
(
(
(
(
(
(
(

P
P
P
P
P
P
P
P
P
P
H
H
H
H
H
H
H
Z
Z
Z
Z
Z
S
S
S
S
1.9. BURGERS EQUATION DISCONTINUOUS SOLUTIONS 31
Discretization
We will now solve Burgers equation by several discretization methods, globally distinguished
as i) upwind or ii) central (with or without explicitly added diusion). Moreover, both the
conservative form (1.48) and the non-conservative form (1.47) will be considered. Forward
Euler is used as time integrator. For all computations the mesh size in x-direction has been
chosen as h = 1/10 with a time step t = 1/40; the CFL-number becomes u t/h 1/4.
Since there is no diusion, the mesh-Peclet number P uh/k is innite.
In the table below the various discretizations for the convective terms are summarized
non-conservation form conservation form
upwind FDM/FVM u
i
u
i
u
i1
h
1
2
u
2
i

1
2
u
2
i1
h
central FDM u
i
u
i+1
u
i1
2h
1
2
u
2
i+1

1
2
u
2
i1
2h
central FVM not applicable
1
2
u
2
i+1/2

1
2
u
2
i1/2
h
Below it will be shown that the dierence between both columns is essential. The dierence
between both central methods in the right-hand column is less important; both are a discrete
conservation law, only the ux computation is slightly dierent compare (1.50) with (1.53).
In Section 1.8 the stability of centrally-discretized convection-diusion equations has been
studied. Next to the CFL-number , the quantity d 2k t/h
2
has been introduced. It was
demonstrated that forward Euler is zero-stable if and only if d 1. Practical stability is
achieved for (see (1.42))
2
d 1, whereas for Dirichlet/Neumann conditions the region
with absolute stability is larger than that of practical stability. Without diusion d = 0,
hence central discretization is always zero-stable. At the same time, for no choice of t > 0
the criterion
2
d can be satised (unless u = 0), hence there is no practical stability.
Discrete solution
Let us rst observe the dierence between upwind discretization and central discretization.
The upwind solution is smooth, as was to be expected from the theory of positive operators.
The practical stability limit is CFL = 1 which is clearly satised.
Remark As u is not constant we cannot perform the accuracy trick for upwind CFL 1
(see the example in Section A.4.4).
Clearly visible in the central solution are the strongly growing oscillations induced by the
steep gradient. If we want to suppres these, numerical diusion has to be added explicitly.
Its inuence is investigated with k
a
= 1/20, chosen such that for u 1 the mesh-Peclet
number satises P 2. Further it follows that d = 1/4, hence the time integration is stable
under all denitions (we are in the blank bottom-left area in the gure on page 27). As ex-
pected theoretically, all oscillations have disappeared, but the discontinuity has been smeared
out excessively. Note that in regions with low values of u, this amount of viscosity is much
larger than the upwind viscosity (which scales with u). In this respect, upwind isnt that bad...
32 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
Next, observe the propagation speed of the shock. In both solutions of the non-conservation
form (1.47) the shock does not move; the solutions of the conservation form do have a proper
shock speed. This holds for both upwind and central solutions. It is concluded that analytic
jump conditions, like (1.56), only correctly carry over to the discrete form if we start from the
conservation form of the equations; in fact we should start from the conservation law (1.49).
Since in the nite-volume discretization one is obliged to start from the conservation
law, the propagation of discontinuities automatically proceeds in the correct way. With a
nite-dierence or nite-element discretization you have to remind yourself to start with the
1.10. CONVECTIVE CONCLUSIONS 33
conservative form, and than it still can go wrong. As an example, the convection-diusion
equation earlier in this chapter is formulated in conservation form (simply because it is linear
with constant coecients). However, its non-uniform discretization (1.19) is not a discrete
conservation law, whereas the variant (1.18) is! Hence, with regard to discontinuous solutions,
the nite-volume discretization is essentially dierent from the other discretization methods.
The above gures clearly show the inuence of using the conservation form or not (left:
no, right: yes). The gure below shows the central FVM (by denition in conservation form)
with and without adding numerical diusion. It will be clear that the discrete solutions
for discontinuous solutions are not yet really convincing. Therefore special methods have
been developed, e.g. based on the concept of (nonlinear) limiters, to reduce the amount of
oscillations in the solution. The monograph by Hirsch (1990) gives a nice introduction into
this subject.
1.10 Convective conclusions
It has been demonstrated that the discretization of convection, just a simple rst-order
derivative, is very subtle. The major problem with the discretization is that, through its
discretization error, it interferes with diusion: sometimes this poses no serious harm, but
sometimes it can also be devastating to the quality of the numerical solution. It is impossible
to give general guidelines, yet I would like to do so.
The question to ask is:
Is diusion critical to the ow problem?
Depending upon the answer, two situations arise:
Yes, diusion is critical In this case it is necessary to resolve all boundary layers through
grid renement. Further, convection is preferably discretized with skew-symmetric
methods.
No, diusion is not critical In this case diusion could be neglected (to obtain the Euler
equations), but also there is no problem with (limited) increasing diusion. Boundary
layers do not have to be resolved, and upwind-biased discretization of convection (im-
plicitly adding numerical diusion) is applicable; explicit addition of diusion is suitable
as well. If necessary, to retain sharp discontinuities or to further suppress oscillations,
limiters may be applied.
1.11 Appendix: DirichletNeumann stability analysis
We will here
5
give the details of the stability analysis of (1.39) under mixed DirichletNeumann conditions
(0, t) = given and

x
(1, t) = given.
(1.39) combined with these boundary conditions can be written in following matrix notation
2I
(n+1)
= (2I A)
(n)
(1.58)
5
This section is taken from P. Wesseling and P. Wilders (1984) Numerieke Stromingsleer A, Lecture Notes
a110A (in Dutch), TU Delft.
34 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
with
A =

2d d
d 2d d
.
.
.
d 2d d
2d 2d

here the Dirichlet condition


has been substituted
the Neumann condition
(1.59)
We need two lemmas. The rst lemma introduces a similarity transformation with which A can be trans-
formed into either a symmetric matrix or the sum of a constant diagonal matrix and a skew-symmetric matrix.
The second lemma gives an estimate for the eigenvalues of this type of matrices. We remark that Lemma 1
implies that A is non-defect.
Lemma 1 Let A be a tridiagonal matrix with
a
ii
=
i
(i = 1, . . . , k);
a
i+1,i
=
i+1
, a
i,i+1
=
i+1
,
i
,= 0,
i
,= 0 (i = 1, . . . , k 1).
Let D be a diagonal matrix with
d
11
= 1, d
ii
= d
i1,i1

(i = 2, . . . , k).
Let B = D
1
AD. Then B is tridiagonal with
b
ii
=
i
(i = 1, . . . , k);
b
i+1,i
= sgn (
i+1
)

[
i+1

i+1
[
b
i,i+1
= sgn (
i+1
)

[
i+1

i+1
[

(i = 1, . . . , k 1).
Proof Is left to the reader. 2
Lemma 2 Let B be a tridiagonal k k matrix with
b
ii
= d (i = 1, . . . , k);
[b
i+1,i
[ = [b
i,i+1
[ = b (i = 1, . . . , k 2);
[b
k,k1
[ = [b
k1,k
[ = where b

2.
Then each eigenvalue of B satises [ d[ 2b.
Proof Let D be a diagonal matrix with d
ii
= 1 (i = 1, . . . , k 1), and d
kk
= b/. Let C = D
1
BD.
We have c
ij
= b
ij
, (i, j) ,= (k, k 1), (k 1, k) and c
k,k1
=

b
b
k,k1
en c
k1,k
=
b

b
k1,k
. On C Gerschgorins
theorem can be applied from which the lemma follows immediately. 2
We can now proceed to estimating the eigenvalues of the matrix A from (1.59). When
2
,= d
2
the
transformation from Lemma 1 is applicable. The resulting matrix B becomes
b
ii
= 2d (i = 1, . . . , k);
b
i,i+1
= sgn ( d)

[d
2

2
[ , (i = 1, . . . , k 2);
b
i+1,i
= sgn ( d)

[d
2

2
[ , (i = 1, . . . , k 2);
b
k1,k
= sgn ( d)

2d [d [ ;
b
k,k1
= sgn (2d)

2d [d [.
Since 0 we have

2d [d [

2(d + ) [d [ =

[d
2

2
[,
with which the matrix B satises the conditions from Lemma 2. We remark that the matrices A and B from
Lemma 1 possess the same eigenvalues
=
R
+ i
I
.
1.12. REFERENCES 35
For d
2
>
2
the matrix B is symmetrical. The eigenvalues of B (and of A) are real and, according to
Lemma 2, satisfy
2d 2

d
2

2

R
2d + 2

d
2

2
,
I
= 0.
For d
2
<
2
we have B = 2dI +

B, where

B is skew symmetric. The eigenvalues of

B are purely imaginary.
Lemma 2 is applicable to

B, which yields

R
= 2d, 0
I
2

2
d
2
. (1.60)
Absolute stability requires all eigenvalues of the iteration matrix (I
1
2
A) from (1.58) to satisfy [[ 1.
I.e. the eigenvalues of A (and B) have to satisfy
[1
1
2
[ 1
2
R
+
2
I
4
R
0. (1.61)
For d
2
>
2
we have
I
= 0, after which we only have to show that 0
R
4. From (1.60) it follows
simply that
d +

d
2

2
2
is a sucient condition to satisfy (1.61).
For d
2
<
2
we have
R
= 2d. The estimate (1.60) now yields that

2
2d
is a sucient condition for (1.61) to hold.
Herewith the statement in (1.46) has been proven. Moreover it is clear, from a comparison with (1.42), that
the Dirichlet-Neumann conditions yield additional stability in comparison with periodic boundary conditions.
1.12 References
D.N. de G. Allen and R.V. Southwell (1955) Relaxation methods applied to determine the motion in
two dimensions of a viscous uid past a xed cylinder. Quart. J. Mech. Appl. Math. 8, 129
P.M. Gresho and R.L. Lee (1981) Dont suppress the wiggles - they are telling you something. Comput.
Fluids 9, 223253.
A.C. Hindmarsch, P.M. Gresho and D.F. Griths (1984) The stability of explicit Euler time-integration
for certain nite dierence approximations of the multi-dimensional advection-diusion equa-
tion. Int. J. Num. Meth. Fluids 4, 853897.
C. Hirsch (1990) Numerical Computation of Internal and External Flows, Volume 2. John Wiley.
A. Jameson, W. Schmidt and E. Turkel (1981) Numerical solutions of the Euler equations by nite-
volume methods using RungeKutta time-stepping schemes. AIAA paper 81-1259.
B.P. Leonard (1979) A stable and accurate convective modelling procedure based on quadratic
upstream interpolation. Comput. Meth. Appl. Mech. Eng. 19, 5998.
B.P. Leonard and J.E. Drummond (1995) Why you should not use hybrid, power-law or related
exponential schemes for convective modelling - there are much better alternatives. Int. J. Num.
Meth. Fluids 20, 421442.
T.A. Manteuel and A.B. White Jr. (1986) The numerical solution of second-order boundary value
problems on nonuniform meshes. Math. Comput. 47, 511535.
R.D. Richtmyer and K.W. Morton (1967) Dierence Methods for Initial Value Problems. John Wiley.
D. Spalding (1972) A novel nite-dierence formulation for dierential expressions involving both
rst and second derivatives. Int. J. Num. Meth. Eng. 4, 551559.
A.E.P. Veldman and E.F.F. Botta (1993) Grid quality - an interplay of grid and solver. In: M.J.
Baines and K.W Morton (eds.) Numerical Methods for Fluid Dynamics 4. Oxford University
Press, 329335.
36 CHAPTER 1. THE CONVECTION-DIFFUSION EQUATION
A.E.P. Veldman and K. Rinzema (1991) Playing with nonuniform grids, J. Eng. Math. 26, 119130.
R.W.C.P. Verstappen and A.E.P. Veldman (1997) Direct numerical simulation of turbulence at lower
costs. J. Eng. Math. 32, 143159.
R.W.C.P. Verstappen and A.E.P. Veldman (1998) Spectro-consistent discretization: a challenge to
RANS and LES. J. Eng. Math. 34, 163179.
R.W.C.P. Verstappen and A.E.P. Veldman (2003) Symmetry-preserving discretization for turbulent
ow. J. Comput. Phys. 187, 343368.
P. Wesseling (2001) Principles of Computational Fluid Dynamics. Springer Verlag.
Chapter 2
Incompressible NavierStokes
equations
2.1 The equations for uid ow
The equations of uid ow are governed by conservation laws for mass, momentum and
energy, completed by a number of thermodynamic relations. The conservation law of mass in
a volume reads
_

t
d +
_

u nd = 0, (2.1)
where denotes the density of the uid. Conservation of momentum can be written as
_

u
t
d +
_

uu nd =
_

nd, (2.2)
where = pI + is the internal stress tensor, with p the pressure. The viscous stress tensor
is dened through
= [u + (u)

2
3
( u) I],
with the dynamic viscosity of the uid. The conservation law of energy E = e +
1
2
u u
reads
_

E
t
d +
_

E u nd =
_

( u) nd +
_

k
T
n
d,
where heat transport due to temperature (T) dierences has been modelled by Fouriers law,
with k being the thermal conductivity coecient. Finally, two thermodynamic relations are
applicable
p = RT and e = c
v
T,
where R = c
p
c
v
is the universal gas constant, and c
p
and c
v
are the specic heat coecients.
Several dimensionless parameters are associated with uid ow. For viscous ow the most
important one is the Reynolds number, named after Osborne Reynolds (1842-1912). It is
dened by Re = UL/, where U is a characteristic velocity of the ow and L a characteristic
length scale. Roughly, this number indicates the relevance of viscous eects in the ow: the
larger Re, the less inuence viscosity has on the ow. In this vain, the Reynolds number
forms a useful indicator for the onset of turbulence (see Chapter 3).
37
38 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
Dierential form By applying Gauss theorem, the above conservation laws can be trans-
formed into dierential equations. In particular, conservation of mass (2.1) and momentum
(2.2) can be reformulated as

t
+ (u) = 0 (2.3)
and
u
t
+ (uu) = p + . (2.4)
By combining both equations, conservation of momentum can also be written in the non-
conservative form

u
t
+ u u = p + . (2.4

)
Incompressible ow
In these lecture notes we will focus on incompressible ow. In this case, eectively the energy
equation is replaced by the condition of incompressibility
D
Dt


t
+u = 0,
i.e. the density of a given particle remains constant during its motion (note that in principle
the density does not have to be the same everywhere in the ow). This condition can be
combined with the conservation of mass in dierential form (2.3) to conclude that the velocity
eld is divergence free
1
div u = 0. (2.5)
The stress tensor now can be simplied, and when moreover and are assumed constant,
the momentum equation (2.4

) becomes
u
t
+ (u grad) u =
1

grad p + div grad u, (2.6)


where = / is the kinematic viscosity. It is remarked that under the incompressibility
constraint (2.5), the convective term can be written as (u grad) u = div(uu). Now the
momentum equation can again be denoted in conservation form
u
t
+ div(uu) =
1

grad p + div grad u. (2.6

)
When an internal ow is simulated in a domain with a solid boundary only a boundary
condition for the velocity u can be formulated. Usually this will be
u = 0 on . (2.7)
This boundary condition describes two physical eects. Firstly, the impenetrability of the
wall requires the normal velocity to vanish. Secondly, the (viscous) shear stress requires the
tangential velocity component to vanish (no-slip condition).
1
From now on we will use the notation div and grad instead of the -notation.
2.2. CHOICE OF THE COMPUTATIONAL GRID 39
Acoustical degeneration
Heuristically there does not seem to be an equation for the pressure, unlike in the compress-
ible case. It is natural to consider the momentum equation as an equation for the velocity.
In the compressible case the continuity equation is an equation for the density, whereas the
pressure then follows through an equation of state. In the incompressible case the density
does not appear in the continuity equation (2.5), and neither does the pressure. But of course
(2.5)+(2.6) together determine velocity and pressure.
To get a feeling for what is going on, we will rst consider the one-dimensional isentropic
Euler equations
_

t
+

x
(u) = 0,
u
t
+ u
u
x
+
1

p
x
= 0,
(2.8)
where pressure and density are related through
p = p() with
dp
d
= c
2
> 0, (2.9)
in which c is the velocity of sound. Substitution of the p- relation (2.9) in (2.8) yields
_

t
+
u
x
+ u

x
= 0,
u
t
+ u
u
x
+
c
2

x
= 0.
(2.10)
This system of equations possesses the characteristic directions
dx
dt
= u + c and u c.
Both directions are real, hence the system is hyperbolic. In the incompressible limit we have
c , therefore the two characteristic directions dx/dt approach , and hence coincide
in the limit.
The theory on partial dierential equations now tells us that the system is degenerating.
The acoustical part of the equations, the combination of div u and grad p, is responsible for
this behaviour. Disturbances in the pressure are instantaneously noted everywhere in the
domain. This innite propagation speed will force us to treat the acoustical part of the
NavierStokes equations in an implicit manner, as we will see in the sequel.
2.2 Choice of the computational grid
We will start the numerical treatment with a discussion of the spatial discretization. For
convenience only rectangular domains will be considered, covered by a uniform grid .
The grid cells are positioned such that the cell faces coincide with the boundary of . It
seems obvious to dene the unknown variables u = (u, v) and p in the corners of the grid cells.
However, there are some snakes in the grass. This is not only the case in nite-dierence or
nite-volume discretizations, but also in a nite-element approach.
40 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
A: u, v and p in corner points
When u, v and p are dened in the corner points of the grid cells, it is obvious to apply
the momentum equations in these corner points too. For second-order accuracy, the discrete
version of grad p, which we shall denote by Gp, should be computed with central dierences.
For the grid point indicated with 2 this implies that values of p are used from grid points
indicated by (for p/x) and (for p/y). In this discretization it is possible to con-
struct a p ,= Constant for which G p = 0. To each solution p this p can be added without
any consequences for the equations of motion. Moreover there is the danger that during the
computations one encounters (4-fold) singular matrices, which reect this non-uniqueness of
the solution.
x
x
2
d d

d
d
d
d
d
d
2
2
2
2
2
2
2
2
2
x x x
x x x
.
.
.
.
The grid points have been divided into 4 groups: 2, , and .. Choose p such that in
each of the groups p is constant, but the 4 constants are allowed to be arbitrary. Then in a
discrete sense G p = 0, while p shows oscillating behaviour. Again we encounter an example of
odd/even decoupling, caused by discretizing a rst-order derivative over two grid cells. When
p itself, and not just its gradient, is relevant to the problem (e.g. one would like to know
forces excerted on the solid walls), then some kind of averaging has to be applied to remove
the non-physical oscillations. This is not very elegant.
In spite of the above drawback, this spatial positioning is often used, especially for com-
pressible ow. Its advantage is that all ow variables (velocity components, pressure, density,
temperature, etc.) are dened at the same location. Thus relations between these variables,
for instance the thermodynamic relations, are easily implemented without complicated aver-
aging procedures. However, to overcome the above decoupling of the pressure a price has to
be paid, for instance some form of articial pressure diusion (e.g. Rhie and Chow 1983).
B: u and v in corner points, p in cell centres
An alternative is to dene p in the centres of the grid cells. In the momentum equation
applied in the point , second-order discretization of grad p leads to
p
x

1
2
_
p
NE
p
NW
h
x
+
p
SE
p
SW
h
x
_
=
1
2h
x
p
NE
p
SW
+ p
SE
p
NW
,
p
y

1
2
_
p
NE
p
SE
h
y
+
p
NW
p
SW
h
y
_
=
1
2h
y
p
NE
p
SW
p
SE
+ p
NW
. (2.11)
2.2. CHOICE OF THE COMPUTATIONAL GRID 41
(2.11) implies that a discrete pressure p, of which the values in the points indicated with
are equal and likewise in the points indicated with , will lead to G p = 0. The same prob-
lems as described above are present, this time with a decoupling according to a checkerboard
mode (red-black decoupling).
`


h
y
h
x
x
x

p
p
p
p
NW
SE
NE
SW
x x
x

`
`
E
S
C
p
u
v
u
v
Alternative positionings B (left) and C (right) for the unknowns of NavierStokes.
C: u and v in middle of cell faces, p in cell centres
Yet another alternative is to dene the pressure in the centre of a cell, u in the middle of the
vertical cell faces, and v in the middle of the horizontal faces. This arrangement of velocities
and pressure is called a staggered grid. The x-momentum equation is applied in the point
where u is dened; similar for the y-momentum equation. For alternatives A and B a p ,=
Constant can be found for which Gp = 0. Here this is no longer possible, since p/x = 0
applied in the middle of the right-hand cell face (where the x-momentum equation is applied)
yields p
E
= p
C
, whereas p/y = 0 in the middle of the lower cell face yields p
S
= p
C
. In
this way all pressure points are coupled to each other, and the only mode in the kernel of the
discrete gradient is the constant function. Note that the continuous gradient operator has
the same kernel (for incompressible ow the pressure is determined upto a constant), hence
we cannot improve the situation further.
A minor disadvantage of alternative C is that boundary conditions for the velocity do not
directly correspond with the velocities in their grid points. On a vertical wall, for example,
the point where the horizontal velocity is dened is on the boundary (hence no problem here),
but the point where the vertical velocity is dened is half a mesh size away from the boundary.

-
6 6
v v
u
j
i i + 1
A second-order discretization of the boundary condi-
tion for the vertical velocity requires the use of a mir-
ror point. The discrete boundary condition (u, v) =
(0, 0) in the indicated situation becomes
(u)
i+
1
2
,j
= 0,
(v)
i,j+
1
2
= (v)
i+1,j+
1
2
.
Alternative C is used very often, for example in the methods derived from the Marker-And-
Cell (MAC) method developed in the mid-sixties (Harlow and Welsh 1965). This method was
developed to describe free-surface ow. It contained two new ideas: one is the staggering of
42 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
the discrete locations as just described, the other is the way in which markers are used to
keep track of the liquid. The latter idea gave the method its name.
2.3 Discretization - explicit
In the sequel the computational grid from the MAC method (alternative C) will be used.
However, this does not imply that both other alternatives do not have reason for existence
(for example on non-orthogonal grids). The grids remain uniform for ease of presentation.
First the equations of motion (2.5)+(2.6) will be written in a more schematic form
div u = 0,
u
t
+ grad p = R,
_
_
_
(2.12)
where p/ is replaced by p (i.e. is normalized at 1). Further
R = (u grad) u + div grad u (2.13)
contains all convective, diusive forces; if desired, also a body force can be included.
In this section, again for simplicity, an explicit time-integration method with two time
levels is applied:
div u
(n+1)
= 0, (2.14a)
u
(n+1)
u
(n)
t
+ grad p
(n+1)
= R
(n)
. (2.14b)
Equation (2.14a) and grad p in (2.14b) have
received an index n + 1 to indicate that the
u
(n+1)
that follows from (2.14b) is divergence
free. In fact, this constraint determines the
pressure p
(n+1)
: p is the Lagrange multiplier
corresponding with this constraint.
For the discretization in space the following
schemes are applied (for notation see accompa-
nying gure):
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6
6
6
6
- - -
-
-

S
SW
s
SE
W
w
C
e
E
NW n NE
N
Continuity equation
The continuity equation (2.14a) is applied in cell centres. In a natural way it can be discretized
centrally. The eastern cell with centre e gives a discrete nite-volume conservation law
u
(n+1)
E
h
y
+ v
(n+1)
NE
h
x
u
(n+1)
C
h
y
v
(n+1)
SE
h
x
= 0. (2.15)
2.3. DISCRETIZATION - EXPLICIT 43
In nite-dierence notation it reads
u
(n+1)
E
u
(n+1)
C
h
x
+
v
(n+1)
NE
v
(n+1)
SE
h
y
= 0. (2.16)
Note that the number of continuity equations equals the number of grid cells. Also the
number of pressure unknowns equals the number of cells. Hence there are as many continuity
equations as unknown pressure values! This equality does not hold for positioning methods
A and B.
Momentum equation: convection
The x-momentum equation is applied in the midpoints of the vertical cell faces. In the point
C we obtain (in nite-dierence notation)
u
(n+1)
C
u
(n)
C
t
+
p
(n+1)
e
p
(n+1)
w
h
x
= R
(n)
C
, (2.17)
where the pressure gradient has been discretized centrally. The term R
C
contains derivatives
for the convective and diusive terms; the latter are also discretized centrally. For the dis-
cretization of the convective terms several options exist which will be shortly discussed next.
Written out, the convective term in the x-momentum equation (2.6) reads
u
u
x
+ v
u
y
, (2.18)
which, since the velocity is divergence free, is identical to the conservation form

x
(u
2
) +

y
(uv); (2.18

)
compare (2.6

). Both upwind and central discretization can be used. Their pros and cons
have been treated in Section 1.4.
In the discretization of (2.18) and (2.18

) some averages have to be computed, since u and


v are not dened in the same point. For example the v appearing in v u/x in (2.18) is
computed as
v
C
=
1
4
(v
NE
+ v
NW
+ v
SW
+ v
SE
).
Some more remarks on the discretization in conservation form (2.18

) are in order. The control


volume is chosen as indicated in the gure above. The total convective ux through the faces
is given by
u
e
u
e
h
y
+ v
n
u
n
h
x
u
w
u
w
h
y
v
s
u
s
h
x
. (2.19)
Note that we have written u
e
u
e
instead of u
2
e
, since one of the factors is regarded as the
transport velocity, while the other is the convected quantity, i.e. x-momentum. For the latter
we choose
u
e
=
1
2
(u
E
+ u
C
), u
n
=
1
2
(u
N
+ u
C
), etc. (2.20)
Substitution in (2.19) yields a convective ux
1
2
[u
e
(u
E
+ u
C
) u
w
(u
W
+ u
C
)]h
y
+
1
2
[v
n
(u
N
+ u
C
) v
s
(u
S
+ u
C
)]h
x
. (2.21)
44 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
The coecient of u
C
is given by
1
2
[(u
e
u
w
)h
y
+ (v
n
v
s
)h
x
]. By once more substituting
(2.20), and using the discrete continuity equations (2.15) in the eastern and western cells, this
coecient is found to vanish. Herewith the discrete version of the convective terms becomes
1
2
h
y
(u
e
u
E
u
w
u
W
) +
1
2
h
x
(v
n
u
N
v
s
u
S
). (2.22)
Pressure gradient
Analytically, there exists a relation between the gradient operator and the divergence oper-
ator. Hereto, consider one-times dierentiable functions dened on a domain , for which
at the boundary of the domain the values of function and derivative vanish (in abstract
mathematical terms, consider the function space H
1
0
() of functions with compact support).
Then Gauss theorem gives
0 =
_

u nd =
_

div (u) d =
_

( div u + grad u) d.
It follows that for functions which vanish near the boundary
_

grad ud =
_

div ud. (2.23)


Recognizing that the integrals represent inner products, this relation can also be denoted as
grad

= div. In words, relation (2.23) implies that, apart from a minus sign, the gradient
operator and the divergence operator are each others adjoint
2
. With the current choice of
discretization, this analytical relation also holds in the discrete approximation, as shown next.
We will see below that this has favourable consequences.
In the discrete version, the inner-product integrals in (2.23) have to be considered in
a discrete sense. Hence, rstly the products of the functions appearing in the respective
integrands should make sense
3
. And, indeed with = p, the discrete gradient Gp and the
discrete velocity vector u are dened at the same locations in the grid (cell edges). For p and
the discrete divergence Du the same applies (cell centers), hence their respective products
are formed in a natural way. Further, it is not dicult to verify that the discrete matrices G
and D, where apart from mesh size scaling each row consists of a 1 and a -1, are each
others transpose, i.e. G

= D.
Symmetry-preserving discretization
When the variables with lower case subscripts in (2.22) are considered to be part of the coef-
cient matrix, whereas the upper case subscripts belong to the unknowns, a skew-symmetric
2
Let 1 and V be two function spaces and let the operator / : 1 V. Then the adjoint operator
/

: V 1 is dened by (/v, w)
W
= (v, /

w)
V
for all v 1 and w V, where , ) denotes the inner
product in the respective function spaces.
3
In a more mathematical notation, dene two discrete function spaces:
i) 1
div
: the set of scalar-valued functions dened in cell centers;
ii) 1
grad
: the set of vector-valued functions dened at cell faces.
As an example, we have p 1
div
and u 1
grad
. Next note that G : 1
div
1
grad
, hence Gp 1
grad
; similarly
D : 1
grad
1
div
. With p, the discrete version of (2.23) can be written as Gp, u)
V
grad
= p, Du)
V
div
.
In vector-inner product terminology, the notation of this relation can be further simplied to (Gp)

u = p

Du.
2.4. THE POISSON EQUATION FOR THE PRESSURE 45
contribution to the coecients is recognized. With this denition, the discrete NavierStokes
equation can be written as

du
dt
+C(u) u +V u +Gp = 0, Du = 0, (2.24)
where is a diagonal matrix representing the sizes of the control volumes, C(u) is built
from the convective ux contributions, and V contains the viscous, diusive uxes.
Similar to the discussion in Section 1.5, the evolution of the discrete energy u

u is
governed by
d
dt
(u

u) = (Cu +V u +Gp)

u u

(Cu +V u +Gp)
= u

(C +C

) u p

u (G

u)

p u

(V +V

) u
= p

Du + (Du)

p u

(V +V

) u
= u

(V +V

) u 0. (2.25)
In the derivation we have used that the convective part of the coecient matrix is skew sym-
metric, and equally important that the discrete gradient is the adjoint of the discrete
divergence (apart from a minus sign), i.e. G

= D, combined with Du = 0. It follows


that, for non-zero u, the right-hand side of (2.25) is zero if and only if V +V

= 0, i.e. the
(discrete) energy is conserved if and only if the diusion is turned o. With diusion (i.e.
for V +V

,= 0) the right-hand side is negative for all u ,= 0. As a consequence, the energy


of the discrete system (2.24) decreases in time when the symmetry-preserving discretization
(2.22) is used: the semi-discrete system is stable, and a solution of (2.24) can be obtained on
any grid (see e.g. Verstappen and Veldman 2003). Hence, there is no need to add articial
damping in order to stabilize the spatial discretization.
Apart from the above discrete energy-conserving property, the dierences between the
discretizations of (2.18) and (2.18

) are small, but in certain conditions they can have con-


sequences. In particular this holds when the solution possesses large gradients; use the con-
servation form (2.18

) in those cases, and always discretize in a symmetry-preserving way! A


further theoretical fundament of the dierences is hardly possible because of the non-linearity.
In their book, Richtmyer and Morton (1967) pay relatively much attention to the complica-
tions that can arise from non-linearity.
2.4 The Poisson equation for the pressure
2.4.1 Boundary conditions
As already remarked, the pressure in (2.14b) has to be determined such that (2.14a) is satis-
ed. This can be realized by combining these two equations. We can write (2.14b) as
u
(n+1)
= u
(n)
+ t R
(n)
t grad p
(n+1)
, (2.26)
and substitute this in (2.14a), after which we obtain
div grad p
(n+1)
= div (
u
(n)
t
+R
(n)
). (2.27)
46 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
This is the Poisson equation for the pressure. There are no boundary conditions directly
available, since these only contain the velocity u. This is no problem, however. We can
rst discretize (2.14a) before we substitute the discrete version of (2.26)
4
. Note that after
discretization of (2.14a) the number of velocity unknowns equals the number of discrete mo-
mentum equations; and also the number of pressure unknowns is equal to the number of
discrete continuity equations, since both are equal to the number of grid cells. Hence su-
cient equations for all of the unknowns are available!
Thus the apparent lack of a boundary condition for the pressure is an artefact of the ap-
proach, which can easily be prevented. For a cell adjacent to a boundary of the computational
domain this proceeds as follows.
`
`

v
S
u
W
v
N
u
E

(i, j)

Discrete conservation of mass (2.16) gives


u
(n+1)
E
u
(n+1)
W
h
x
+
v
(n+1)
N
v
(n+1)
S
h
y
= 0,
in which u
(n+1)
E
= 0 according to the boundary condition (2.7).
This is substituted rst. Thereafter the other three velocities
are transformed with the discretized (2.26).
In this way a discretization of (2.27) is created in which p
(n+1)
i,j
, p
(n+1)
i,j+1
, p
(n+1)
i,j1
and p
(n+1)
i1,j
appear, but not p
(n+1)
i+1,j
corresponding with a cell centre outside the computational domain.
The result is a discretization of (2.27) in which no (visible) boundary conditions are required
anymore. In fact they have been used the moment when u
E
= 0 was substituted.
Let us introduce some notation to describe the above formally. In the discrete grid two
parts are distinguished: the grid points in the interior
0
and those on the boundary

.
The grid function for the velocity u is split similarly: u
0
is dened in the grid points in
0
,
while u

is dened on the boundary

.
The discrete divergence operator as dened in (2.16) is denoted by D; the discrete gradient
operator by G. D acts on velocity components dened in grid points from
0

, i.e. on
u
0
and u

(since div u = 0 is only discretized in interior points). We split the divergence


operator in two parts
D = D
0
+D

, (2.28)
where D
0
acts on values of u in the interior of (i.e. on u
0
), and D

corresponds with u

.
The above method can now be written as follows.
First write the discretized version of (2.14a) as
D
0
u
(n+1)
= D

u
(n+1)
, (2.29)
in which the right-hand side can be determined from the boundary condition for u. Discretize
4
This is a general strategy: discretize rst, substitute the boundary conditions next, and only afterwards
perform other operations on the equations (Veldman 1990). As soon as the discrete system of equations is
OK, nothing dangerous can happen anymore.
2.4. THE POISSON EQUATION FOR THE PRESSURE 47
(2.26) in the interior points from
0
u
(n+1)
= u
(n)
+ t R
(n)
t Gp
(n+1)
, (2.30)
where R
(n)
is the discrete version of R
(n)
. Now substitute (2.30) in the left-hand side of
(2.29) and note that only interior points occur for u. The result can be written as
D
0
Gp
(n+1)
= D
0
(
u
(n)
t
+R
(n)
) +D

u
(n+1)
t
. (2.31)
In the left-hand side we have one equation for each cell, corresponding with one unknown p
per cell. There are no values of p belonging to cell centres outside .
The operator in the left-hand side of (2.31) is singular, as a pressure p that is constant
satises G p = 0, with which also D
0
G p = 0. In turn p = Constant is the only solution of
D
0
Gp = 0. This is a consequence of the choice of the computational grid; in Section 2.2 we
have discussed this extensively. The fact that the operator in the left-hand side of (2.31) is
singular, does imply that there need not be a solution for each right-hand side. The latter
has to satisfy a compatibility relation: it has to be perpendicular to the kernel of (D
0
G)

.
This leads to a condition for the boundary condition of u on : the discrete nett massow
through the boundary has to be zero (i.e. we must have discrete conservation of mass over
the whole domain ). This restriction can usually be satised in a discrete sense, since it is
satised in the continuous case. This compatibility relation corresponds with the relation that
has to be satised by the boundary condition in a Neumann problem for the Poisson equation.
Remark In the literature, the combination u
(n)
+t R
(n)
in (2.26) is often referred to as an
auxiliary velocity. Some people even try to derive boundary conditions for it, as these seem to
be necessary in the right-hand side of (2.27). The correction with t grad p
(n+1)
is called the
projection onto the space of divergence-free functions, whence the approach is often called a
projection method. This is a nice geometric interpretation, but there is no necessity to use
such fancy words. It is just a straightforward combination of the original discrete equations
(2.14a) and (2.14b).
Equivalent alternative
In the literature the problem of the missing boundary condition for p is often solved in a
dierent way: sometimes this is equivalent to the above approach, sometimes it is not. An
equivalent way is to consider the x-component of (2.14b) on the right-hand boundary. After
substitution of the boundary condition for u we have

n
p
(n+1)
= n [R
(n)

u
(n+1)
u
(n)
t
], (2.32)
in which the normal on the wall is indicated with n. This equation can be discretized as in
(2.30)
n Gp
(n+1)
= n [R
(n)

u
(n+1)
u
(n)
t
]. (2.32

)
The discretization of R
(n)
poses problems, because more information from outside the com-
putational domain is required (the normal-velocity one mesh outside the wall). The Poisson
48 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
equation that is solved is
DGp
(n+1)
= D(
u
(n)
t
+R
(n)
). (2.33)
Here R
(n)
features as well. We will show that when the R
(n)
in (2.32

) and (2.33) are treated


in the same way, this does not have consequences for the solution of p
(n+1)
in the interior of
. It does for values of p
(n+1)
outside , therefore one has to be careful when the pressure p
on the boundary of is obtained through interpolation. Consider both sides of (2.33)
DGp
(n+1)
= D
0
Gp
(n+1)
+D

Gp
(n+1)
= D
0
Gp
(n+1)
+D

[R
(n)

u
(n+1)
u
(n)
t
],
and
D(
u
(n)
t
+R
(n)
) = D
0
(
u
(n)
t
+R
(n)
) +D

u
(n)
t
+D

R
(n)
,
respectively. Finally, observe that substitution of these relations in (2.33) leads to (2.31).
Despite the correct approach has been known for more than forty years, there still exists
unclarity in the literature; see e.g. Roache (1988). For a comprehensive discussion of this
subject we refer to Gresho and Sani (1987).
2.4.2 Treatment of div u
(n)
When the Poisson equation (2.27) is solved exactly then div u
(n+1)
= 0. We could substitute
this in the right-hand side of (2.27) on the next time level (i.e. set div u
(n)
= 0). However,
in reality (2.27) is not solved exactly (at most machine accuracy can be reached; we would
prefer to stop an iterative method earlier), hence an error is made. When div u
(n)
= 0 is sub-
stituted the danger exists that these errors accumulate. Error accumulation can be prevented
by leaving the term div u
(n)
in the equation. The functioning of this correcting term can be
seen as follows (Hirt and Harlow 1967):
Start taking the divergence of (2.14b)
1
t
(div u
(n+1)
div u
(n)
) + div grad p
(n+1)
= div R
(n)
. (2.34)
If we were to solve (2.27) with div u
(n)
= 0 substituted, i.e.
div grad p
(n+1)
= div R
(n)
, (2.35)
then after substitution in (2.34) this leads to
1
t
(div u
(n+1)
div u
(n)
) = 0. (2.36)
This is a discrete version of

t
div u = 0, which analytically is equivalent is with div u = 0 (at
t = 0 we start with div u = 0). However, numerical error accumulation is possible, because
an error made in computing div u
(n)
is fully visible in div u
(n+1)
, through (2.36). Such errors
are made when (2.35) is not solved exactly, but with an error
(n+1)
:
div grad p
(n+1)
= div R
(n)
+
(n+1)
. (2.37)
2.4. THE POISSON EQUATION FOR THE PRESSURE 49
Substitution in (2.34) yields
div u
(n+1)
= div u
(n)
t
(n+1)
.
When, for example, systematically the same error is made in solving (2.35), then at a xed
moment in time t = nt we have
div u
(n)
= div u
(0)
nt = div u
(0)
t .
Letting t 0 gives no improvement. A fortiori, when we let t , e.g. when we are
interested in the steady limit, then even div u
(n)
. Moreover, when the inital velocity
eld is not divergence free, this is not corrected!
If, on the other hand, (2.27) is solved instead of (2.35), then from (2.34) it follows that
div u
(n+1)
= 0 (the discrete version of div u = 0). A numerical error like in (2.37) now leads
to
div u
(n+1)
= t
(n+1)
,
such that no accumulating eect of these errors is present. Moreover, t 0 leads to
div u
(n)
0.
The above reasoning is also valid for the spatially discretized version (2.29)-(2.31). When
the approach without error accumulation is used, less stringent requirements have to be
imposed on solving the Poisson equation. Its solution process thus becomes cheaper.
2.4.3 Pressure iteration
Above we have seen how we can solve the problem of the missing boundary condition for p
in a safe manner. The formulas become somewhat more complicated in their presentation,
which will be neutralized from now on by restricting ourselves to the homogeneous condition
u = 0 on . The equations to be solved become in this case
D
0
u
(n+1)
= 0, (2.38)
u
(n+1)
+ t Gp
(n+1)
= u
(n)
+ t R
(n)
. (2.39)
Instead of this system we can also solve (2.39) combined with the Poisson equation
D
0
Gp
(n+1)
= D
0
(
u
(n)
t
+R
(n)
). (2.40)
The Poisson equation can be solved in many ways, for example with a direct method. In
recent years many Fast Poisson Solvers have been developed. One has to be aware that the
equation is singular - the pressure level is not xed. Also, often iterative techniques are being
used. Because we will encounter these again, in disguise, in the next sections, we will spend
some attention to them here.
We start with the Jacobi method with relaxation (JOR; see Appendix A.2.1) for solving
(2.40). The operator symbols are to be interpreted as matrices now; let be the diagonal of
D
0
G. Following (A.18c), the JOR method for solving (2.40) becomes
(p
(n+1)
)
(k+1)
= (p
(n+1)
)
(k)

1
_
D
0
G(p
(n+1)
)
(k)
D
0
(
u
(n)
t
+R
(n)
)
_
, (2.41)
50 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
where is the relaxation factor and k the iteration index.
An at rst sight dierent technique results when (2.38) and (2.39) are being used. Suppose
an estimate (p
(n+1)
)
(k)
for the pressure is available, then (2.39) yields an estimate for the
velocity
(u
(n+1)
)
(k+1)
= (u
(n)
+ t R
(n)
) t G(p
(n+1)
)
(k)
. (2.42)
In general this will not satisfy (2.38) and therefore a new pressure estimate is determined
through
(p
(n+1)
)
(k+1)
= (p
(n+1)
)
(k)
+ D
0
(u
(n+1)
)
(k+1)
, (2.43)
where is a relaxation parameter. This iteration process does not contain a Poisson equation,
but . . . combine (2.42) with (2.43). Then we have
(p
(n+1)
)
(k+1)
= (p
(n+1)
)
(k)
t D
0
G(p
(n+1)
)
(k)
+ D
0
(u
(n)
+ t R
(n)
). (2.44)
And this is the same as (2.41), when the relaxation parameters and are being chosen such
that
=
i
t,
where
i
is the diagonal element of the Poisson matrix in the i
th
grid point. Therefore both
methods discussed are in fact identical when grid-point dependent values for and are
allowed. This is a non-traditional idea, but nevertheless can work extremely well (Botta and
Veldman 1982).
2.5 The steady NavierStokes equations
2.5.1 Discrete formulation
In the preceding pages an explicit method has been presented to solve the unsteady Navier
Stokes equations (2.12). This method can also be used to determine the steady solution. But,
of course, there are other options. In this section we will discuss two methods to solve
div u = 0, (2.45)
grad p = R(u), (2.46)
where R(u) is an abbreviation, given in (2.13), for the convective and diusive terms.
After discretization and linearization of (2.45)+(2.46) a system of equations is created
with the following matrix-vector structure
_
M G
D
0
0
__
u
p
_
=
_
(RM)(u)
0
_
,
where M is a linearized version of R. The matrix in the left-hand side is singular (because
the pressure is determined upto a constant). More problematic is the zero submatrix in the
right-bottom corner which is present because the pressure does not appear in the continuity
equation. Such a matrix is called a saddle-point matrix.
Direct inversion of the left-hand-side matrix is not done often, as the system is very large
and singular. Further, standard iterative techniques are not applicable because of the zero
submatrix. Currently, at RuG research is going on to solve the full system with preconditioned
conjugate gradient methods (Botta and Wubs 1999; ).
2.5. THE STEADY NAVIERSTOKES EQUATIONS 51
2.5.2 Articial compressibility
Because solving the compressible equations does have its advantages, it may make sense to
approximate the incompressible equations with the compressible ones. Inspired by (2.9),
Chorin (1967) introduced an articial gas model p = c
2
, and substituted it in the continuity
equation (after normalizing at 1). In this way one obtains
p
t
+ c
2
div u = 0. (2.47)
This equation does not have a physical meaning as far as it concerns the time-dependent
behaviour. But when a limit-solution exists for t , then p/t = 0 after which (2.47)
implies (2.45). To (2.46) we add the normal time-derivative (other choices are possible).
After discretization in space and time (explicit) the following algorithm is obtained
p
(k+1)
= p
(k)
c
2
t D
0
u
(k)
,
u
(k+1)
= u
(k)
+ t R
(k)
t Gp
(k)
.
_
(2.48)
By comparing with (2.42)+(2.43), it is observed that (2.48) is just an unsteady version hereof,
in which = c
2
t.
2.5.3 SIMPLE
Spalding & Patankar (see e.g. Patankar 1980) have developed software packages for ow sim-
ulation (TEACH, CHAMPION, PHOENICS) in which use is made of the SIMPLE algorithm
(or variants hereof) to solve the incompressible equations of motion. SIMPLE stands for
Semi-Implicit Method for Pressure Linked Equations. This algorithm works as follows.
Start with the discrete version of (2.45) and (2.46) and assume that an estimate for the
pressure p
(k)
is available. Then solve
R(u
(k)
) = Gp
(k)
. (2.49)
In general u
(k)
will not be divergence free. Therefore introduce a pressure correction p, with
a corresponding velocity correction u, in other words
R(u
(k)
+ u) = G(p
(k)
+ p).
From this relation u is solved approximately: u = Gp, and require next that D
0
(u
(k)
+
u) = 0, hence
D
0
Gp = D
0
u
(k)
. (2.50)
Solving this equation provides a new estimate for the pressure
p
(k+1)
= p
(k)
+ p; (2.51)
often here relaxation is applied. Finally we can return to (2.49).
In (2.49) as well as (2.50) a system of equations has to be solved. This can be done with
a direct method, but also iteratively. This iteration process can then be combined with the
52 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
iteration process in (2.49)(2.51). As an example (2.49) and (2.50) are solved with JOR, and
apply one JOR iteration per k-iteration. Instead of (2.49) we obtain
u
(k+1)
= u
(k)
+
u
R(u
(k)
) Gp
(k)
. (2.52a)
Next, (2.50) is solved approximately with one JOR iteration, while the initial guess p = 0 is
chosen
p =
p
D
0
u
(k)
. (2.52b)
The iterative process (2.52a)+(2.52b) is related to (2.48). The choice
u
= t and
p
= c
2
t
makes both processes identical. From the optimal t following from a stability study of (2.48)
the optimal choice for both s can be deduced.
Simply spoken one can say that in SIMPLE the time integration of the unsteady approach
(e.g. MAC) and the iterations of the Poisson equation have been merged together. Therefore
it is somewhat peculiar to apply a SIMPLE-like approach per time step in unsteady problems,
as is often done.
In the preceding pages some frequently used iterative methods have been discussed. Closer
inspection has revealed that they are intimately related.
2.6 Discretization - implicit
When fully implicit (backward Euler) discretized in time, the incompressible NavierStokes
equations read
div u
(n+1)
= 0, (2.53)
1
t
(u
(n+1)
u
(n)
) + grad p
(n+1)
R
(n+1)
= 0. (2.54)
Combination of these two equations gives the Poisson equation
div grad p
(n+1)
div R
(n+1)
= div
u
(n)
t
. (2.55)
After discretization in spatial direction, where the boundary condition u = 0 on has already
been substituted as in Section 2.4.1, we obtain
D
0
u
(n+1)
= 0, (2.56)
u
(n+1)
t R(u
(n+1)
) + t Gp
(n+1)
= u
(n)
. (2.57)
The discrete Poisson equation reads
D
0
Gp
(n+1)
D
0
R(u
(n+1)
) = D
0
u
(n)
t
. (2.58)
Remark 1 For the following presentation it is not relevant which time-integration method for
R is applied. Despite the time index has been written as n+1, R
(n+1)
may also contain con-
tributions from earlier time levels, such that e.g. the method of Crank-Nicolson is also covered.
Remark 2 In (2.32) and further an alternative way to treat the boundary condition for the
Poisson equation has been described. For explicit time-integration it could be proved that
this is equivalent; for implicit time-integration this can no longer be proved, as the equations
at the new time level are not solved exactly.
2.6. DISCRETIZATION - IMPLICIT 53
2.6.1 Linearization
The term R
(n+1)
contains the discrete convective and diusive terms; the former are non-
linear. We will next present some methods for treating this non-linearity. As an example we
will treat a generic term u
x
, which we write after discretization as
u
(n+1)

(n+1)
x
. (2.59)
We leave open whether a central or an upwind discretization has been used. This term will
be linearized: either with respect to the old time level n, or with respect to the new level
n + 1.
a) Linearization around the old time level:
(2.59) is approximated by
u
(n)

(n+1)
x
(2.60)
where we make an error O(t). When the remainder of the method possesses a similar
discretization error everything nicely ts together.
b) Newton-linearization around the old time level:
Write
u
(n+1)
= u
(n)
+ u and
(n+1)
x
=
(n)
x
+
x
,
then u and
x
are of the order O(t). Substitution in (2.59) yields
u
(n+1)

(n+1)
x
= u
(n)

(n)
x
+ u
(n)

x
+ u
(n)
x
+ O(t
2
)
= u
(n)

(n+1)
x
+ u
(n+1)

(n)
x
u
(n)

(n)
x
+ O(t
2
).
(2.61)
The expression in the right-hand side of (2.61) is linear in the variables at the new time
level and possesses a discretization error O(t
2
).
c) Linearization around the new time level:
At the cost of introducing an additional iteration process the linearization around the
new time level can be performed. This proceeds similar to a) or b), but now no additional
discretization error is being made. E.g., the version analogous to a) reads
(u
(n+1)
)
(k)
(
(n+1)
x
)
(k+1)
, (2.62)
where k is the counter of the additional iteration process. Often such an additional
process has been introduced already because of other reasons, and the iteration (2.62)
can be included on the y.
2.6.2 Pressure correction
An orderly way to solve the implicit system is the pressure-correction method. A good
explanation of this method, including reections on accuracy and stability, has been given by
Van Kan (1986). In this method rst a predictor velocity eld u

is determined by solving
the following implicit equation
u

u
(n)
t
+ grad p
(n)
R

= 0. (2.63)
54 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
Next the pressure-correction is determined from the Poisson equation
div grad (p
(n+1)
p
(n)
) = div (
u

t
), (2.64)
which is equivalent with (compare (2.27) and (2.55))
div grad p
(n+1)
= div (
u
(n)
t
+R

).
Finally, with this newly calculated pressure eld, the new velocity eld is computed from a
simple substitution
u
(n+1)
= u

t grad (p
(n+1)
p
(n)
), (2.65)
where (2.64) guarantees that u
(n+1)
is divergence-free.
By combining (2.63) with (2.65) it follows that eectively
u
(n+1)
u
(n)
t
+ grad p
(n+1)
= R

(2.66)
has been solved. This is not quite the desired equation (2.54), but the dierence between
R

and R
(n+1)
is small. When e.g. the Crank-Nicolson method is used (instead of backward
Euler), the nal u
(n+1)
is O(t
2
) accurate, as shown by Van Kan (1986).
Alternatives?
But why do it neatly when you can also make a mess of it? The equations (2.56)(2.58)
resemble (2.38)(2.40) where an explicit time integration has been applied. The dierence
lies in the treatment of R, which now has to be evaluated at the new time level. This can
be done, for example, by letting R evolve with the k-iteration in the iterative methods from
Section 2.4.3. In the formulas (2.41), (2.42) and (2.44) R
(n)
is replaced by R(u
(n+1)
)
(k)
. As
an example (2.42)+(2.44) becomes
(u
(n+1)
)
(k+1)
= u
(n)
+ t [R(u
(n+1)
)
(k)
G(p
(n+1)
)
(k)
], (2.67)
(p
(n+1)
)
(k+1)
= (p
(n+1)
)
(k)
t D
0
G(p
(n+1)
)
(k)
+ D
0
[u
(n)
+ t R(u
(n+1)
)
(k+1)
]. (2.68)
The treatment in (2.67) is related to the predictor-corrector method. The factor t outside
the square brackets allows that 2 to 3 iterations suce (each iteration a factor O(t) is gained).
When we want to keep the Poisson equation visible, we can e.g. combine (2.67) with
D
0
G(p
(n+1)
)
(k+1)
= D
0
R(u
(n+1)
)
(k+1)
+D
0
u
(n)
t
. (2.68)
It is tempting to solve this equation iteratively. In this way a three-fold nested iterative
process is created. Those who know whether the whole will converge may speak up!
When the R-part in (2.67) is moved to the left-hand side and only treat the G-part in a
predictor-corrector way, then we obtain an unsteady variation of (2.49):
(u
(n+1)
)
(k+1)
t R(u
(n+1)
)
(k+1)
= u
(n)
t G(p
(n+1)
)
(k)
. (2.69)
2.7. IN- AND OUTFLOW CONDITIONS 55
Together with (2.68) this gives the PISO method (Issa, 1986).
It is also possible to place an alternating part of R in the left-hand side, as in the alter-
nating direction implicit (ADI) methods. In short, with some phantasy many methods can
be invented to determine the solution at the new time level. An advice: keep the method
simple and orderly. This also reduces the chance on programming errors, and increases the
readability and maintainability of the programme. Remind that a more complicated method
(and computer code) might solve the system of equations faster, but this activity is only a
limited portion of the complete simulation (including pre- and postprocessing), such that a
gain in CPU time for the solver does not have much impact on the time required for the whole
problem.
2.7 In- and outow conditions
The choice of boundary conditions at in- and outow openings is an art in itself. Recently
two minisymposia have been held that were devoted exclusively to this problem. A report
of the ndings has been given by Sani and Gresho (1994), and is summarized by them as:
. . . perhaps nowhere else do theory and practice seem to clash so much.
The treatment of in- and outow conditions will be illustrated by a two-dimensional
channel ow as shown in the gure.
-
-
-
-
-
-
-
IN
OUT
A
B
C
D

`
x
y

Inow conditions
The inow boundary usually does not lead to too many problems. Often both velocity
components, u and v, are prescribed. Thus, as for a solid wall, no boundary condition for
the pressure is required. It is preferable to let the values of u and v be consistent with the
boundary conditions next to the inlet. E.g. in the shown conguration one has u = v = 0 in
the points A and B. Further, the continuity equation xes v/y because
u
x
+
v
y
= 0. (2.70)
At the wall in the points A and B the no-slip condition u = 0 induces u/x = 0, hence in
these points v/y = 0. When the inow prole is inconsistent, the discrete solution near A
and B becomes irregular (but usually the damage is not that big and only local).
An alternative is to prescribe a pressure dierence across the channel, in combination with
e.g. v = 0 and u/x = 0 at inow and outow (but see the discussion below).
56 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
Outow conditions
The outow boundary is much more problematic. A central role is being played by the normal
stress and the shear stress along the outow boundary. As a reminder (see Section 2.1), for
incompressible ow the normal stress is given by

n
n = p + 2
u
n
n
, (2.71)
and the tangential stress by

t
t = (
u
n
t
+
u
t
n
). (2.72)
Here u
n
= u n is the velocity in the direction of the normal and u
t
= u t the velocity in
tangential direction.
When at an outow boundary the normal velocity u
n
is prescribed then a boundary layer
may be created (or even worse: large wiggles), as we have seen in the discussion of the
convection-diusion equation. It is therefore better to replace this Dirichlet condition by
a homogeneous Neumann condition: u
n
/n = 0. Physically this means that there is no
viscous normal stress contribution. The continuity equation now yields u
t
/t = 0, hence
u
t
= 0, with which two boundary conditions are available. Sani and Gresho (1994) com-
ment this method as: u
n
/n = 0 is illegal (hopelessly ill-posed) because of insucient
information; the system is underdetermined, resulting (in general) in an innite number of
solutions. In addition, in 2D it is overly restrictive on u
t
, causing u
t
= 0 regardless of the
actual boundary condition applied to u
t
. When additionally a condition on the pressure is
prescribed, e.g. p = 0, then this is illegal (ill-posed) because of too much information; the
system is overdetermined and no solution exists in general. However, in practice the latter
choice is not that bad!
Another way is to set
2
u
n
/n
2
= 0 at the outow boundary, and to discretize u
n
/n
in an upwind way (central discretization will yield the same result, though). In this case
no values of u
n
outside the domain are required. A consistent condition for the tangential
velocity is u
t
/n = 0. Again a pressure condition should be added.
A mathematically better way is to prescribe the normal stress
n
= 0. Sani and Gresho
write: [This condition] is well-posed but may not always be useful. This boundary con-
dition is a natural condition and is often being used in nite-element formulations. In the
nite-element world it is logical to prescribe additionaly the tangential stress
t
= 0.
Sani and Gresho (1994) have studied much more candidate outow conditions. There is
no clear winner. A safe strategy is to set the outow position as downstream as possible:
Nothing interesting should be happening at such a boundary; otherwise the boundary is in
the wrong place.
2.8 References
E.F.F. Botta and A.E.P. Veldman (1982) On local relaxation methods and their application to
convection-diusion equations. J. Comput. Phys. 48 (1982) 127149.
2.8. REFERENCES 57
E.F.F. Botta and F.W. Wubs (1999) Matrix Renumbering ILU: an eective algebraic multilevel ILU
preconditioner for sparse matrices. SIAM J. Matrix Anal. Appl. 20, 10071026.
A.J. Chorin (1967) A numerical method for solving incompressible viscous ow problems. J. Comput.
Phys. 2, 1226.
P.M. Gresho and R.L. Sani (1987) On pressure boundary conditions for the incompressible Navier
Stokes equations. Int. J. Num. Meth. Fluids 7, 11111145.
F.H. Harlow and J.E. Welsh (1965) Numerical calculation of time-dependent viscous incompresible
ow of uid with free surface. Phys. Fluids 8, 21822189.
C.W. Hirt and F.H. Harlow (1967) A general corrective procedure for the numerical solution of
initial-value problems. J. Comput. Phys. 2, 114119.
R.I. Issa, A.D. Gosman and A.P. Watkins (1986) The computation of compressible and incompressible
recirculating ows by a non-iterative implicit scheme. J. Comput. Phys. 62, 6682.
J. van Kan (1986) A second-order accurate pressure-correction scheme for viscous incompressible
ow. SIAM J. Sci. Stat. Comput. 7, 870891.
S.V. Patankar (1980) Numerical Heat Transfer and Fluid Flow. Hemisphere-McGraw Hill.
C.M. Rhie and W.L. Chow (1983) Numerical study of the turbulent ow past an airfoil with trailing
edge separation. AIAA J. 21, 15251532.
R.D. Richtmyer and K.W. Morton (1967) Dierence Methods for Initial Value Problems. John Wiley.
P. Roache (1988) A comment on the paper Finite dierence methods for the Stokes and Navier
Stokes equations by J.C. Strikwerda. Int. J. Num. Meth. Fluids 8, 14591463.
R.L. Sani and P.M. Gresho (1994) Resume and remarks on the open boundary condition minisym-
posium. Int. J. Num. Meth. Fluids 18, 9831008.
A.E.P. Veldman (1990) Missing boundary conditions? Discretize rst, substitute next, combine later.
SIAM J. Sci. Stat. Comput. 11, 8291.
R.W.C.P. Verstappen and A.E.P. Veldman (2003) Symmetry-preserving discretization for turbulent
ow. J. Comput. Phys. 187, 343368.
58 CHAPTER 2. INCOMPRESSIBLE NAVIERSTOKES EQUATIONS
Chapter 3
Direct numerical simulation of
turbulence
3.1 Computational eort
Solving the Reynolds-averaged NavierStokes equations (RaNS) is a tremendous task, even
for modern-day computers. A 1987 workshop on simulating viscous transonic ow around
airfoils (2-D) shows that in practice between 10
6
and more than 10
7
oating point operations
per grid point are required to obtain a steady solution (Holst 1987: see accompanying gure).
For 3-D problems 10
7
ops/point are typical. A 3-D grid for an airplane e.g. contains 10
6
10
7
grid points, with which a computation costs around 10
14
oating point operations. It may
be expected that in the future these numbers will decrease because of algorithmic improve-
ments, such as the symmetry-preserving discretisation described in Chapter 1. The gure
10
3
10
4
10
5
10
7
10
8
10
9
10
10
10
11
10
12
grid points
ops
Navier-
Stokes

potential
+ boundary
layer

10
4
10
5
10
6
10
7
(ops/pt)
further shows that simulations based on boundary-layer methods are two orders cheaper than
Reynolds-averaged NavierStokes. At present they do not provide less useful results than the
NavierStokes methods, and therefore they are popular in the industrial design process.
59
60 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
The Reynolds-averaged NavierStokes equations model all turbulent phenomena. For cer-
tain applications this may not be accurate enough. The alternative is to resolve the large-scale
turbulent phenomena with suciently ne meshes and suciently small time steps. This is
called large-eddy simulation (LES); see e.g. Reynolds (1990. Only the smallest structures are
modelled; it is expected that they can be described in a more universal way. The required
mesh widths are typically one order smaller than those for RaNS. Adding a corresponding
smaller time step, a LES computation will be four orders more expensive than a RaNS com-
putation.
Direct numerical simulation (DNS) does not contain any turbulence modelling. It requires
a grid that resolves the smallest ow scales in space and time. The Kolmogorov length
scale for 3D homogeneous isotropic turbulence
1
is proportional to
K
Re
3/4
ed

ed
, with a
corresponding time scale proportional to
K
Re
1/2
ed

ed
/u
ed
, in which
ed
is the size of the
large eddies and u
ed
their velocity. Further, Re
ed
is the Reynolds number based on the large
eddies Re
ed
= u
ed

ed
/. This number is roughly one order smaller than the usual Reynolds
number (based on the global length and time scale), which for aerodynamic applications
lies around 10
7
, and for hydrodynamic applications around 10
9
. For a 3-D calculation the
grid would require O(Re
9/4
ed
) points, with O(Re
1/2
ed
) time steps. Hence, the complexity of a
simulation scales with Re
11/4
ed
! Thus a Reynolds number 10 times larger, requires almost a
factor 1000 more computing eort.
medium speed Reynolds grid performance
points (2 week run)
cyclist (tourist) air 20 km/h 1 10
5
golfball (pro) air 250 km/h 2 10
5
10
9
10
11.5
op/s
speed skater (pro) air 45 km/h 5 10
5
swimmer (pro) water 5 km/h 3 10
6
10
11
10
14
op/s
car air 80 km/h 5 10
6
shark water 20 km/h 2 10
7
10
13
10
16.5
op/s
airplane air 900 km/h 3 10
7
ship water 20 km/h upto 10
9
10
17
10
21
op/s
Table 3.1: Overview of (estimated) required computational resources (CPU performance) for
DNS at Reynolds numbers in the range 10
5
10
9
(2010 algorithms).
The national supercomputer that was installed in 2000 aimed at an eective performance
around 100 Gigaops/s (peak 1 Teraop/s)
2
. Starting from here, about ve orders of mag-
nitude have to be bridged to perform a DNS of a turbulent ow at Re = 10
7
. Assuming that
both computer hardware and computational algorithms will continue to progress at the rate
that they have developed during the past three decades - both have become one and a half
1
In 1941 Kolmogorov suggested that on the smallest ow scales an equilibrium exists between the production
of these small scales and their destruction through viscous dissipation. Relevant quantities are the energy
dissipation dk/dt (m
2
/s
3
), with k the turbulent kinetic energy per unit of mass, and the kinematic
viscosity (m
2
/s). Combining these quantities yields a unique length scale
K
(
3
/)
1/4
and time scale

K
(/)
1/2
.
2
Giga= 10
9
, Tera= 10
12
, Peta= 10
15
, Exa= 10
18
, Zeta= 10
21
.
3.2. NAVIERSTOKES: HIGHER-ORDER SPACE DISCRETIZATION 61
order of magnitude faster per decade - within two decades the lacking ve orders of magnitude
could be bridged. For this estimate to come true, computers need to become about a thousand
times faster and must be supplied with one thousand times as much memory within the next
two decades. Within that span of time the numerical algorithms for DNS need to become
three orders of magnitude faster, need to run eciently at the fastest avaliable machines, and
need to use three orders of magnitude less memory than todays algorithms do require.
In fact, the ASCI project in the USA, initiated in the mid 1990-ies, strived for this type of
performance improvement. In 1999 already three computers existed where the 1 Teraop/s
limit has been achieved. The Supercomputer Top500 of November 1999 was led by the prod-
ucts of the ASCI project: on top of the list Intels ASCI Red with 2.4 Teraop/s, followed
by IBMs Blue Pacic with 2.1 Teraop/s and SGIs Blue Mountain with 1.6 Teraop/s.
However, the type of application for which these processor speeds are achieved, the so-called
Linpack benchmark, is not fully representative for CFD. Linpack is very cache-friendly, i.e.
once data have arrived in cache the algorithm makes frequent of use of them before they are
replaced by fresh data. In CFD algorithms the communication with main memory is much
more frequent, and a factor of three (or more) is easily lost compared to Linpack performance.
Thus, in CFD computers with high access rates of memory (high bandwidth), such as vec-
tor computers (where up 30-50% of peak performance can be achieved in practice), are very
much in favor over commodity processors (such as the Pentium and Itanium family, where
only around 5% of peak performance can be achieved for CFD algorithms).
Since a decade, a battle is going on between (North-American) massively parallel cache-
based (scalar) computers, and (Japanese) computers based on vector architecture. For about
three years, 2002-2004, the fastest computer was the Japanese Earth Simulator (based on vec-
tor processors), where 12 Teraop/s sustained(!) performance could be achieved on codes for
climate modelling (36 Teraop/s on Linpack). This challenged the computer manufacturers
in the USA: currently, as of June 2009, the Top500 is headed by several Intel, IBM and AMD
based clusters, with the two toppositions breaking the Petaop/s (= 1000 Teraop/s) barrier!
Thus, the progress in computer hardware remains impressive. Together with the equally
impressive progress in numerical algorithms, DNS computations at full-scale Reynolds num-
bers glore at the horizon.
3.2 NavierStokes: higher-order space discretization
It will be clear that DNS requires the utmost of computers and algorithms. Therefore much
research is going on in improving the eciency of algorithms. In Groningen we have concen-
trated on higher-order discretization methods along the lines presented in Section 1.5. We
will apply the above ideas now to construct a higher-order discretization of the NavierStokes
equations on the staggered grid as discussed above. In the described second-order method
the x-momentum equation is applied to a control volume as shown in Figure 3.1 (left). We
note that the vertical velocity is dened in the corner points of this volume.
The control volume now is combined with a larger one: for the convection-diusion equa-
tion above we chose a two-times larger volume, but here we will use a three-times larger
62 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.1: The left picture shows a control volume for the conservation of the horizontal
component of the momentum eld (in two spatial dimensions). The right picture shows a
three-times larger control volume that is applied to eliminate the leading term of the truncation
error. The arrows denote the components of the discrete velocity that are used to discretize
the application of the conservation law to the control volume.
volume as indicated in Figure 3.1 (right). The latter choice is the smallest volume for which
the corners coincide with positions of the vertical velocity. The coinciding of corners with ver-
tical velocities implies that one discretization method can be used for the spatial integration of
the momentum equation over both the original control volumes and the larger volumes. Two
times larger control volumes, for instance, have corners that do not coincide with positions
of the vertical velocity, and thus do require additional high-order interpolations (e.g. for the
cross terms in the convective ux). This interpolation unavoidably introduces some diusion
in the discretization, which does interfere with the real diusion as we have experienced in
test calculations. For DNS this is an unacceptable situation.
As in the convection-diusion example above, near the boundaries we simply follow the
second-order approach to avoid problems with control volumes that do not t in the domain.
We update the velocity by integrating the momentum equations over one time step and by
correcting the result by adding the pressure gradient in such a way that the mass is conserved
in control volumes centred on the pressures. Obviously, we can also apply the balance of
mass to three times larger control volumes and use these control volumes to eliminate the
leading term in the truncation error. Thus, a fourth-order-accurate spatial discretization can
be derived for the continuity equation. Since the div and grad operator analytically are
each others transpose (apart from a minus-sign; see Section 2.3), the discretization of the
divergence immediately implies the discretization of the gradient. Subsequently, the discrete
Laplacian (= div grad) appearing in the pressure Poisson equation is implied. More elabo-
rated details can be found in Verstappen and Veldman (2003).
The discrete Poisson equation for the pressure is solved by means of the conjugate gradient
method with modied incomplete Choleski preconditioning according to Gustafson (1978).
The MICCG code is fully vectorized by an explicit reordering of the unknowns along diagonals
of grid planes parallel to the symmetry plane of the cavity. The implementation of the
3.3. TIME INTEGRATION 63
Lower-order and higher-order computation
vs. experiment of turbulent ow in a 3D
driven cavity at Re = 10000. Shown is the
normal velocity along the central axes of
the symmetry plane.
preconditioned iterative method is optimized as proposed by Eisenstat (1981). The initial
guess for the iteration is obtained by extrapolation of the pressure from previous time levels.
3.2.1 2nd- vs. 4th-order discretization
As an example of the progress made, we present a comparison between a second-order ap-
proach and our fourth-order approach for ow in a 3D driven cavity at Re = 10000. Experi-
mental results are available for comparison (Prasad and Kose 1989). We show the vertical
velocity along the central axis of the cavity as obtained from a second-order calculation on a
100 100 100 grid, a fourth-order calculation on a 50 50 50 grid and the experimental
results. The overall error in an instantaneously measured velocity is about 0.6% of the
maximum velocity. The stretching in the latter grid is moderate: the grid spacing is expo-
nentially stretched away from the wall, and the largest mesh width is approximately seven
times wider than the smallest.
In this example the fourth-order results are clearly superior to the second-order results,
whereas the computational eort is about twenty times less. Indeed, the CPU-time per grid
point and time step of both methods is comparable, a 50
3
grid has 8 times less grid points than
a 100
3
grid, it allows for a twice as large a time step (note that the time step is restricted by
the CFL-condition), and the number of iterations needed to solve the pressure correction from
the Poisson equation is somewhat less for a 50
3
grid than for a 100
3
grid: 8 2 1.25 = 20.
Essential to this success is the way in which the discretization of the convective terms copes
with the stretching of the computational grid.
3.3 Time integration
3.3.1 Stability limits
The choice of the time step in time integration requires a balance between stability and accu-
racy. In this section we will give an estimate of the time step required for accuracy, based on
the time scales of the ow, and compare it to the stability limits of explicit time-integration
methods.
64 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
In the literature often implicit methods are being used to treat the diusive terms (see e.g.
the review paper by Kleiser and Zang (1989)). The argument is that the diusive stability
limit
t
(x)
2

1
2
(3.1)
is more restrictive than the convective CFL-limit
ut
x
1, (3.2)
because of the occurrence of (x)
2
in the former. We will show that, unless the grid is chosen
ner than the physical length scales, it is the latter limit (3.2) that is most restrictive.
Laminar For laminar ow the reasoning is as follows. The thickness of a boundary layer
is proportional to
1/2
, and the spatial grid will have meshes of this size. Thus, the diusive
limit (3.1) becomes
t O(1),
while the convective limit (3.2) reads
t O(
1/2
).
For small viscosity the latter clearly is much more stringent.
Turbulent For turbulent we have to proceed in a more complicated way. First an estimate
of the length and time scales is required. We use the Kolmogorov scales
K
en
K
(see above):

K
= Re
3/4
ed

ed
;
K
= Re
1/2
ed

ed
/u
ed
.
Substitution of x =
K
/n
x
(i.e. we choose n
x
grid points per Kolmogorov length scale) in
the diusive stability limit (3.1) yields
t
(x)
2
2
=

2
K
2n
2
x
= Re
3/2
ed

2
ed
2n
2
x
= Re
3/2
ed

ed
u
ed

ed
u
ed

1
2n
2
x
= Re
1/2
ed

ed
2 u
ed
n
2
x
=

K
2 n
2
x
.
We recognize the Kolmogorov time scale, hence this limit is not restrictive. Substitution in
the convective limit (3.2) yields
t
x
u
=

K
un
x
= Re
3/4

ed
un
x
= Re
1/4
Re
1/2

ed
u
ed
u
ed
u
1
n
x
= Re
1/4
ed
u
ed
u

K
n
x
. (3.3)
The propagation velocity of the large eddies is much smaller than the turbulent velocity uc-
tuations: for aerodynamic applications the ratio u
ed
/u is roughly about 0.01. Together with
the factor Re
1/4
ed
it follows that, also in turbulent ow, for large Reynolds numbers the con-
vective limit is the most stringent.
Based on these observations, in my opinion the convective term should be the rst to be
treated implicitly. As it is non-linear this might lead to complications in the coupling between
momentum equation and Poisson equation, but in Section 2.6 we have seen a useful approach
in the form of the pressure-correction method.
3.3. TIME INTEGRATION 65
3.3.2 An improvement of the AdamsBashforth scheme
As long as stability does not require an implicit treatment, we prefer an explicit treatment.
Compared to the traditional methods still some renements can be made. Below we will treat
a simple adaptation of the AdamsBashforth method which enhances its eciency by a factor
of two.
Hereto we consider a family of explicit second-order one-leg methods, which we will discuss
with aid of the test problem u

= f(u). For this problem the one-leg family reads


( +
1
2
)u
(n+1)
2u
(n)
+ (
1
2
)u
(n1)
= tf
_
(1 + )u
(n)
u
(n1)
_
. (3.4)
This discretization is second-order accurate for all ,=
1
3
, and third-order accurate when
=
1
3
. Its error constant is given by C
3
=
1
6
(1 + 3). The one in one-leg refers to the
fact that these methods evaluate the right-hand side f at one point only. For more details on
one-leg methods the reader is referred, for instance, to Hairer (1991).
Taking =
1
2
, a one-leg method is created which is the twin of AdamsBashforth. Accord-
ing to AdamsBashforth we ought to take
3
2
f(u
(n)
)
1
2
f(u
(n1)
) instead of f(
3
2
u
(n)

1
2
u
(n1)
).
One- and two-leg methods are identical when f is linear with time-independent coecients,
and then they have the same region of linear stability. They dier when the right-hand side
f is non-linear or explicitly time-dependent. For instance, in the simple situation where
f(u) = (t) with (t) < 0 (i.e. u does not even enter the right-hand side), the solution u
(n+1)
of (3.4), i.e.
u
(n+1)
= u
(n)
+ t (
3
2
t
n

1
2
t
n1
),
is smaller than u
(n)
(for any time step) as it should be. On the other hand, the solution
obtained with the associated multistep method given by
u
(n+1)
= u
(n)
+ t
3
2
(t
n
)
1
2
(t
n1
)
does not satisfy the inequality u
(n+1)
< u
(n)
unconditionally (it depends on the variation of
with time). In addition, it is emphasized in Nevanlinna (1978) that (some) one-leg methods
are more reliable than their corresponding multistep methods when used with variable time
steps.
For = 0 the leapfrog method is obtained. This method cannot be used to integrate a
diusive ux in time, since it is not stable: the linear stability region of leapfrog consists of
all purely imaginary numbers with modulus smaller than or equal to one.
Our aim is to determine such that the corresponding method allows for the largest
time step, or stated otherwise, possesses the largest region of convective stability. Figure 3.2
(left) shows the stability domain of the one-leg method for = 0.05 and = 0.5 (Adams
Bashforth). The stability domain is pressed against the imaginary axis when goes to zero.
In the limit = 0 the stability domain is equal to the interval [i, i]. Above we concluded
that convective stability puts the most severe restriction on the time step. Thus, we look for
stability domains which include eigenvalues = x +iy, where the real part x is negative and
the absolute value of the imaginary part y is much larger than the absolute value of the real
66 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.2: The left picture shows the stability domain of the one-leg method (3.4) for = 0.05
and = 0.5. The right picture shows a blow up of the stability domains near the positive
imaginary axis.
part. Here, much can range from one to two orders of magnitude. For a DNS of a ow in a
driven cavity at Re = 10
4
with a grid size x = 10
2
, and a maximum velocity U
max
= 1, for
example, [x[ : [y[ is of the order of 1 : 100.
Under these conditions, the one-leg method with = 0.05 outperforms AdamsBashforth.
Figure 3.2 (right) shows a blow up of the stability domains of both methods near the positive
imaginary axis. The points denoted by A and B lie on the line [x[ : [y[ = 1 : 20. The point
A lies close to the boundary of the stability domain for = 0.05; B lies near the boundary
of the stability domain for = 0.5. A lies approximately two times as far from the origin
as B. Thus, the time step of the one-leg method with = 0.05 can be enlarged by a factor
of two compared to AdamsBashforth. For [x[ : [y[ = 1 : 10 this factor is about 1.5; for
[x[ : [y[ = 1 : 100 it is approximately 2.5. We have carried out a number of numerical test
calculations of the (2D) ow in a driven cavity at Re = 10
3
10
5
. The results demonstrate
that the one-leg method with = 0.05 requires indeed about two times less computational
eort than the AdamsBashforth method, whereas the accuracy is just as good.
3.4 Examples of turbulent-ow simulation
Both the algorithmic improvements and the improvements in computer performance have
opened the door to solve the Navier-Stokes equations numerically for Reynolds numbers in
the range 10
4
10
5
without using any turbulence model. Results in this range will rst be
compared to those of LES. Section 3.4.1 deals with the ow in a lid-driven cavity at Re =
10,000; Section 3.4.2 concerns the ow past a long, square cylinder at Re = 22,000. Therafter,
in Section 3.4.3 a comparison is made between DNS and RaNS for a ow past an array of
cubes. Finally (Section 3.4.4), results for a channel ow are presented for which experimental
results and early DNS computations are avialable. For more details see Verstappen and
Veldman (1996, 1997, 1998).
3.4. EXAMPLES OF TURBULENT-FLOW SIMULATION 67
3.4.1 Flow in a 3D driven cavity at Re = 10,000
This section concerns the comparison with LES for a turbulent ow in a three-dimensional
lid-driven cavity (Re = 10,000). Prasad and Kose (1989) have measured ows in cavities
with dierent spanwise aspect ratios at Reynolds numbers (based on the length of the cavity
and the speed at which the lid is driven) between 3,200 and 10,000. The LDA-measurements
were performed along the horizontal and the vertical centre line in the symmetry plane of the
cavity. The overall error in an instantaneous measured velocity is about 06%.
Zang et al. (1993) have performed a number of large-eddy simulations of driven-cavity
ows (with dierent aspect ratios and Reynolds numbers) and have compared their simula-
tion results with the experimental data of Prasad and Kose. The LES of Zang et al. uses
a dynamic mixed subgrid-scale model. The subgrid model is incorporated in a nite-volume
approach. The ltered Navier-Stokes equations are discretized on a non-staggered grid. A
test-scale lter is introduced like in Germano (1991). The test ltering volume is approxi-
mately twice as large as the grid ltering volume (in all spatial directions). The mixed model
of Bardina et al. (1984) forms the base model for the subgrid scales of motion. A fractional
step method is employed for the semi-implicit time-marching procedure; the viscous terms,
the pressure and the incompressibility constraint are treated implicitly. The discretization
method is formally second-order accurate in both space and time.
We have performed a second- and a fourth-order accurate symmetry-preserving simula-
tion of a ow in a lid-driven cavity at Re = 10,000 with a spanwise aspect ratio of one half.
The number of grid points is comparable to that of the LES of Zang et al.: the LES uses
a stretched 64 64 32 grid (131,072 grid points); here a stretched 50
3
grid (125,000 grid
points) is used for both the second- and fourth-order simulation. It may be remarked that the
grid used by the LES is somewhat more stretched. The smallest mesh size of the LES-grid is
5 10
3
; the rst grid point of the 50
3
grid is located 765 10
3
from the wall.
The agreement between the mean velocities of all simulations with the experimental data
is good. The dierence between mean velocities of the fourth-order simulation and the exper-
iment falls within the estimation of error in the LDA-measurements. The agreement between
the root-mean-square velocities is somewhat less. The LES underestimates the maximal val-
ues of the centre line root-mean-squares by up to 20% (see Figure 5 in Zang 1993). The
dierences between the maximal root-mean-square velocities of the second- and fourth-order
simulation and the experiment stay within 15% and 5%, respectively. The largest dierences
between the simulation methods occur in the Reynolds stresses at the centre lines. In Figure
3.3 we demonstrate the challenge of LES by comparing the Reynolds stress of the LES with
that of the second- and fourth-order simulation and the experiment.
Figure 3.3 shows that the dynamic mixed subgrid-scale model used in the LES is still
open for improvement: the Reynolds stress is systematically larger than in the experiment.
It may be noted that the Reynolds stress of the LES is based on the velocities resolved by the
grid, while the Reynolds stress that is computed from the experimental data contains contri-
butions from all scales of motion, i.e. from the large scales as well as the small scales. Zang
et al. (1993) have estimated the contribution of the subgrid model to the Reynolds stress.
They showed that this contribution is about an order of magnitude smaller than the resolved
68 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.3: Comparison of experimental results, large-eddy and (second- and fourth-order)
symmetry-preserving simulation in a 3D driven cavity with aspect ratio 05 at Re = 10,000.
The second-order LES uses approximately the same number of grid points as the second- and
fourth-order simulations. The Reynolds stress u

along the vertical centre line in the central


plane of the cavity (multiplied by 500) is shown. The LES-data is taken from Zang (1993);
the experimental data is taken from Prasad (1989).
Reynolds stress, except in the vicinity of the lid, where it is of equal order. So, except in the
vicinity of the lid, we need not to take the unresolved part of the Reynolds stress of the LES
into account. Near the lid the subgrid contribution to the Reynolds stress has the wrong sign
(see Figure 6 in Zang 1993). Adding it to the resolved part worsens the agreement between
the LES and the experiment.
From Figure 3.3 it is obvious that the second-order LES results do not lie nearer to
the measurements than the second-order symmetry-preserving simulation without model:
the subgrid modeling does not improve the results signicantly. Evidently, the fourth-order
results are better than the second-order ones. The comparison between the LES and the
fourth-order method turns out to favor the latter: the fourth-order method - not requiring
any modeling and hence only containing numerical errors - shows a better performance.
3.4.2 Flow past a square cylinder at Re = 22,000
The second comparison with LES concerns the ow past a long, square cylinder at Re = 22,000
(at zero angle of attack). We assume that the ow is periodical in the spanwise direction. The
spanwise boundaries are taken four diameters apart. We prescribe laminar inow at six and a
half diameters upstream of the cylinder. Experiments by Lyn et al. (1995) indicate a turbu-
lence level (i.e. the ratio between the uctuating and the mean velocity) of about 2% at four
and a half diameters upstream from the cylinder. The lateral boundaries are taken 14 diame-
ters apart. The outow boundary is positioned at 20 diameters past the cylinder. In addition,
in a buer zone (of ve diameters length) the Reynolds number is decreased from 22,000 to
1,000 to suppress (non-physical) waves which are reected by the articial outow boundary.
The (articial) outow conditions read v
nn
= w
nn
= 0 and p
n
= constant, where the con-
stant is determined such that the mass inow equals the mass outow (at each time-step); this
constant is approximately zero. No-slip boundaries are imposed at the surface of the cylinder.
3.4. EXAMPLES OF TURBULENT-FLOW SIMULATION 69
We have used a 28021064 staggered grid to cover the computational domain. The rst
grid point is spaced 0005 from the cylinder surface. The grid is stretched out away from the
cylinder surface by means of a sinh function; the ratio of the largest to smallest grid size in
the streamwise direction is approximately 200. About 5% of the grid points are located in the
buer zone. The discrete Poisson equation for the pressure is solved with a combination of a
Fast Fourier Transform method in the spanwise direction and a modied incomplete Choleski
Conjugate-Gradient method in the resulting spectral space.
The start-up of the ow plus three shedding cycles have been computed on 16 nodes of a
CRAY J932. We compute averages over three shedding cycles by sampling the ow at each
time step. Velocities are also averaged over the top and bottom halves. All quantities are
normalized by the cylinder width and the inow velocity.
Table 3.2: Comparison with experiment: bulk quantities
Simulation Experiments
Lyn et al. (1995) Lee (1975) Vickery (1966)
Mean Strouhal number 0133 0133 0003
Mean drag coecient C
d
209 21 205 205
Mean lift coecient C
l
0005
Rms uctuation of C
d
0178 016 023
Rms uctuation of C
l
145 068 132
Table 3.2 shows the mean Strouhal number, the mean drag coecient C
d
, the mean lift
coecient C
l
and the root-mean-square uctuations of C
d
and C
l
. Here, it may be noted that
the mean lift coecient has not been measured; it should be zero by symmetry. All computed
bulk quantities fall within the range set by the experiments, except for the root-mean-square
of the uctuations of the lift coecient C
l
which is slightly overestimated. Figure 3.4 shows
a comparison of mean streamwise velocities with experimental data at four locations past the
cylinder. The agreement between the experimental data and the numerical data is good.
The ow past a square cylinder at Re = 22,000 (at zero angle of attack) has served as
a test case at two LES workshops. The results submitted to the workshops can be found
in Rodi (1997) and Voke (1997). The results show a great variation in the predictions, and
it was concluded that this ow forms a major challenge to current LES techniques; no one
has found the denite solution, yet. There is no doubt that the denite solution has to be
computed by means of an accurate, cost-eective numerical method. In Figure 3.5, we have
plotted the drag coecients of almost all the submissions versus the numerical method that
has been applied. Here, we have left out a few, namely those that had serious failings (a too
large lift coecient, or a shedding frequency that diered signicantly from the experiments).
There are of course many factors that (can) aect the prediction of the drag coecient:
the subgrid scale model, the value of parameters in the model, the grid resolution, the nu-
merical approach, the treatment of the walls, etc. Unfortunately, these factors varied during
the workshops, and consequently it is dicult to trace the source of the errors in the results
of the simulations.
70 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.4: Flow past a square cylinder at Re=22000: a comparison of mean velocities of
the fourth-order simulation with experimental results. The experimental data is taken from
ERCOFTAC Database Case 43; see also Lyn et al. (1995). What is shown is the mean
streamwise velocity. The continuous lines correspond to the simulation; the experimental data
is depicted by the dots.
As can be seen in Figure 3.5, large-eddy simulations with a QUICK or a third-order up-
wind (U3) discretization predict a drag force which is too large. The U3-approach that comes
closest to the experimental data uses approximately ve times the number of grid points of
each of the other QUICK/U3-methods. Although we cannot draw rm conclusions, for the
reason mentioned above, it is most likely that the articial diusion added by QUICK/U3
contaminates the results.
The performance of subgrid models is dicult to judge since modelling errors and nu-
merical errors interact; see also Vreman et al. (1994). To separate these errors, a number
of subgrid models need to be considered within the same numerical approach. We feel that
symmetry-preserving methods provide a good basis for evaluating turbulence models, since
they are accurate on non-uniform grids and the character of the numerical error is well-dened:
the error in the convective term is convective; the error in the diusive term is diusive.
3.4.3 Surface mounted cubes
Next we show an example of a turbulent ow that has served as a test case for turbulence
modeling at the 6th ERCOFTAC/IAHR/COST Workshop on Rened Flow Modelling which
was held at Delft University of Technology in June 1997 (Hanjalic and Obi 1997). The prob-
lem considered is the fully developed ow in a channel where an array of 25 10 cubes is
placed regularly at the bottom. The Reynolds number based on the height of the channel
and the bulk velocity is 13,000. The channel is 3.4 times wider than a cube. The pitch of the
cubes is four cube lengths in both the streamwise and the spanwise direction.
3.4. EXAMPLES OF TURBULENT-FLOW SIMULATION 71
Figure 3.5: Flow past a square cylinder at Re=22000: the mean drag coecient versus the
discretization of the convective terms of the NavierStokes equations. Here, U stands for
upwind, and C for a central discretization. The number denotes the order of the method: C2,
for example, represents a second-order central discretization. The experimental results of Lyn
et al. (1995), Lee (1975) and Vickery (1966) fall within the shaded area. The results of the
large-eddy simulations are taken from Rodi (1997) and Voke (1997).
Meinders et al. (1998) have measured this complex turbulent ow. Their ow measure-
ments around the 18th row from the inlet showed that the inuence of the in- and outlet
can be neglected there. Hence, the computational domain for a numerical simulation can be
conned to a sub-channel unit of dimension 4h 3.4h 4h (where h denotes the height of a
cube) with periodic boundary conditions in both the streamwise and the spanwise directions.
Figure 3.6 displays the sub-channel unit.
We have applied the fourth-order, symmetry-preserving method that is outlined in Sec-
tion 3.2 to compute mean velocity proles and Reynolds stresses at various locations in the
sub-channel (Verstappen and Van de Velde, 2006). To this end, the sub-channel is covered by
a 100
3
grid. The rst mesh point is spaced 0006 to a wall. A cube is represented by 40 grid
points in each direction. The grid is slightly stretched: the largest grid size is approximately
three times the smallest. No-slip boundaries are imposed at the surfaces of the cubical ob-
stacles and also on the walls of the channel.
The entire computation (including start-up and sampling time) took about 100 hours on
one vector-processor of a CRAY C90. Mean velocity proles as well as Reynolds stresses at
various locations in the channel have been computed. The sampling of data for the computa-
tion of the rst- and second-order statistics of the ow started after a transitional period of
100 (non-dimensional) time units. The time-averages were computed over 200 time units and
over the two symmetrical halves of the sub-channel unit. Samples were taken at each time
step.
Figure 3.7 shows a comparison of the rst- and second-order statistics of the 100
3
simula-
tion with the experimental data of Meinders et al. (1997) in the symmetry plane parallel to
the streamwise direction that bisects a cube. The agreement between the experimental data
and the numerical data is excellent.
72 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.6: Top- and side-view of a sub-channel unit. An instantaneous ow eld at two planes
through the centre of the cubes is shown, as obtained from the 100
3
DNS. In both pictures the
ow is directed from left to right. The visualization has been made by means of the spot noise
technique (De Leeuw 1997). It may be noted that large structures of recirculating ow behind
the obstacles are not present in any of the snapshots of this ow. These regions can only be
observed if the ow is averaged over a long period in time.
In order to challenge RaNS computations, we have also performed a simulation at a 60
3
grid. On this grid, a cube is represented by 30 grid points in each direction. The rst grid
point of the 60
3
grid lies approximately twice as far from the wall than the rst grid point
of the 100
3
grid. The coarse grid simulation takes about one tenth of the CPU-time of the
ne grid simulation, among other things because the time step can be increased by a factor
of about two.
There were four groups who presented results of their RaNS computations of the ow in
the channel with surface-mounted cubes at the workshop (Hanjalic and Obi 1997). Here, we
restrict ourselves to the RaNS computation (of Dr. S. Jansson from the Department of Fluid
Mechanics of Vattenfall Entvecklung AB in Sweden) that agreed the best with the available
experimental data. It may be noted that there were no results of large-eddy simulations
submitted to this workshop, nor have there been any reported elsewhere.
The best RaNS result was based on a second-order, cell-centered, nite-volume method.
The QUICK scheme was used for the velocities and the turbulent quantities were integrated
by means of a second-order accurate scheme with a Van Leer limiter. Periodic boundary
conditions were applied in the streamwise direction; the period was taken equal to four cube
lengths. Symmetry conditions were applied in the spanwise directions. The spanwise bound-
aries were taken two cube lengths apart. Dirichlet conditions were applied at the solid walls,
except for the dissipation rate : the normal derivative of was put to zero at solid walls.
The turbulence model consisted of a two-layer eddy-viscosity combined with a standard k
model. The transport equation for the dissipation rate was not solved in near-wall regions,
but instead it was computed explicitly from a predicted length scale. This RaNS computation
3.4. EXAMPLES OF TURBULENT-FLOW SIMULATION 73
Figure 3.7: Comparison of numerical results (continuous lines) with experiment (dots) for
ow past an array of cubes. The left picture shows the mean streamwise velocity u, whereas
the right picture shows the uctuating streamwise velocity u

.
was performed on a stretched, orthogonal grid of 67 72 57 points in the streamwise, the
normal and the spanwise direction, respectively. Except for the spanwise direction, the grid
spacing of this RaNS computation is slightly ner than that of our 60
3
simulation. In the
spanwise direction, the average resolution of the RANS computation is about two times ner
than the average resolution of the 60
3
grid, due to the fact that the RaNS computation uses
symmetry conditions and therefore can restrict its spanwise computational domain to two
cube lengths, while in our simulation periodic boundary conditions have been applied in the
spanwise direction with a period of four cube lengths.
Mean streamwise velocities are compared in Figure 3.8. On a corresponding grid, the
mean velocities computed from the Reynolds averaged NavierStokes equations agree less
with the experimental data than the results of the symmetry-preserving simulation. The
velocity proles of the RaNS computation are much too smooth. In addition, the maxima
of the velocities are located in the symmetry-plane between two cubes, which is in distinct
disagreement with the experimental data.
Finally, it may be observed that the convergence of the symmetry-preserving simulation
upon grid renement is plain: the results on the 100
3
grid are closer to the measurements
than those of the 60
3
grid.
3.4.4 Channel ow
To further illustrate the accuracy of the symmetry-preserving discretization, consider a tur-
bulent channel ow at a Reynolds number of Re=5,600. A large number of numerical results
as well as experimental data is available for comparison. Figure 3.9 (left) shows a comparison
of the mean velocity prole as obtained from the 4th-order symmetry-preserving simulation
with those of other direct numerical simulations. The grids used by the DNSs that we com-
pare with have typically about 128
3
grid points, that is 16 times more grid points than our
grid has. Nevertheless, the agreement is excellent.
74 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.8: Comparison of the mean streamwise velocity at half cube height. The ow comes
from below; the horizontal corresponds to the spanwise direction. The dashed vertical lines
are lines of symmetry; their distance is two cube lengths. The lowermost proles are located
at 0.3 cube lengths before the front of the cube, the middlemost proles at 0.3 cube lengths
after the front an the uppermost proles at one cube length after the middlemost. The velocity
scale is shown for the uppermost proles only. The experimental data is taken from Meinders
(1997); the RaNS data is taken from Hanjalic and Obi (1997).
The root-mean-square of the uctuating streamwise velocity u
rms
near the wall (0 < y
+
<
40) is presented in Figure 3.9 (right). The results show that the u
rms
predicted by the 4th-
order simulation ts the experiment data of Kreplin and Eckelmann (1979) nicely. This holds
for very coarse grids too, as can be inferred from the results computed with the 4th-order
symmetry-preserving scheme with only 32 grid points in the wall-normal direction. It is in-
teresting to compare the ratio between our 32 or 64 grid points in wall-normal direction and
the 128 grid points used in the reference computations (Kim et al. 1987, Kuroda el al. 1995,
Gilbert and Kleiser 1991). This ratio (a factor two to four) compares quite well with the
predicted possible increase in grid size (a factor of three) as found in the one-dimensional
test case described in Section 1.7.
This ow case has also been used to carry out a grid renement study to show indeed
4th-order convergence behaviour. The skin-friction coecient C
f
has been monitored as ob-
tained from simulations on ve dierent grids, denoted A E. Their spacings dier only in
3.4. EXAMPLES OF TURBULENT-FLOW SIMULATION 75
Figure 3.9: Comparison of the mean streamwise velocity u
+
(left) and its root-mean-square
(right) as function of the wall normal coordinate y
+
.
Figure 3.10: Convergence of the skin-friction coecient upon grid renement, displayed as a
function of the fourth power of the cell size next to the wall.
the direction normal to the wall, with 128 (A), 96 (B), 64 (C), 56 (D) and 48 (E) points,
respectively. The rst (counted from the wall) grid line varies between y
+
1
= 0.72 (grid A) and
y
+
1
= 1.9 (grid E). The renement study, as indicated in Figure 3.10, clearly shows a 4th-order
behaviour on the non-uniform grid. The straight line in Figure 3.10 is approximately given by
C
f
= 0.008364 0.000004(y
+
1
)
4
. The extrapolated value at the crossing with the vertical axis
y
+
1
= 0 lies in between the C
f
= 0.00818 reported by Kim et al. (1987) and Deans correlation
C
f
= 0.073Re
1/4
= 0.00844. Note that the extrapolation eliminates the (leading term of
the) discretization error in the wall-normal direction, but not the other discretization errors
in space and time.
The convergence of the uctuating streamwise velocity near the wall (0 < y
+
< 20) is
presented in Figure 3.11 (left). Here, we have added results obtained on three still coarser
grids (with 32, 24 and 16 points in the wall-normal direction, respectively), since the results on
the grids AE fall almost on top of each other. The coarsest grid, with only 16 points to cover
the channel width is coarser than most of the grids used to perform a large-eddy simulation
76 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Figure 3.11: The root-mean-square velocity uctuations normalized by the wall shear velocity
as a function of the wall coordinate y
+
on various grids for y
+
20 (left) and y
+
200
(right).
(LES) of this turbulent ow. Nevertheless, in the near wall region, the 64 16 32 solution
is not that far o the solution on ner grids. Further away from the wall, the turbulent
uctuations predicted on the coarse grids (32 points or less in vertical direction) become too
high compared to the ne grid solutions, as is shown in Figure 3.11 (right).
3.5 References
J. Bardina, J.F. Ferziger and W.C. Reynolds (1984) Improved turbulence models based on LES
of homogeneous incompressible turbulent ows. Report No. TF-19, Dept. of Mech. Engng.,
Stanford.
S.C. Eisenstat (1981) Ecient implementation of a class of preconditioned Conjugate Gradient meth-
ods, SIAM J. Sci. Stat. Comput. 2, 14.
M. Germano, U. Piomelli, P. Moin and W.H. Cabot (1991) A dynamic subgrid-sacle eddy viscosity
model. Phys. Fluids A 3, 17601765.
N. Gilbert and L. Kleiser (1991) Turbulence model testing with the aid of direct numerical simulation
results. In: Proc. Turb. Shear Flows 8, paper 26-1.
I. Gustafson (1978) A class of rst order factorization methods. BIT 18, 142156.
E. Hairer and G. Wanner (1991) Solving Ordinary Dierential Equations II. Berlin: Springer-Verlag.
K. Hanjalic and S. Obi (eds.) (1997) Proc. 6th ERCOFTAC/IAHR/COST Workshop on Rened
Flow Modeling, Vol. 3, Section Heat Transfer, Delft University of Technology, 38 pp.
T.L. Holst (1987) Viscous transonic airfoil workshop compendium of results. AIAA paper 871460.
J. Kim, P. Moin and R. Moser (1987) Turbulence statistics in fully developed channel ow at low
Reynolds number. J. Fluid Mech. 177, 133166.
L. Kleiser and T.A. Zang (1991) Numerical simulation of transition in wall-bounded shear ows.
Annu. Rev. Fluid Mech. 23, 495537.
H.P. Kreplin and H. Eckelmann (1979) Behavior of the three uctuating velocity components in the
wall region of a turbulent channel ow. Phys. Fluids 22, 12331239.
3.5. REFERENCES 77
A. Kuroda, N. Kasagi and M. Hirata (1995) Direct numerical simulation of turbulent plane Couette-
Poisseuille ows: eect of mean shear rate on the near-wall turbulence structures. In: F. Durst
et al. (eds.) Proc. Turb. Shear Flows 9. Berlin: Springer-Verlag, pp 241257.
B.E. Lee (1975) The eect of turbulence on the surface pressure eld of square prisms. J. Fluid Mech.
69, 263282.
W. de Leeuw (1997) Presentation and Exploration of Flow Data. Ph.D. Thesis, Delft University of
Technology, Delft, 107 pp.
D.A. Lyn, S. Einav, W. Rodi and J.H. Park (1995) A laser-Doppler-velocimetry study of emsemble-
averaged characteristics of the turbulent near wake of a square cylinder. J. Fluid Mech. 304,
285316.
E.R. Meinders, T.H. van der Meer and K. Hanjalic (1998) Local convective heat transfer from an
array of wall-mounted cubes. Int. J. Heat Mass Transfer 41, 335346.
O. Nevanlinna and W. Liniger (1978) Contractive methods for sti dierential equations; Part I. BIT
18, 457474.
A.K. Prasad and J.R. Kose (1989) Reynolds number and end-wall eects on a lid-driven cavity ow.
Phys. Fluids A, 1, 208218.
W.C. Reynolds (1990) The potential and limitations of direct and large eddy simulations. In: J.L.
Lumley (ed.) Whither Turbulence: Turbulence at the Crossroads. Springer Verlag, pp. 313342.
W. Rodi, J.H. Ferziger, M. Breuer and M. Pourquie (1997) Status of Large Eddy Simulation: Results
of a workshop. ASME J. Fluids Eng. 119, 248262.
R.W.C.P. Verstappen and R.M. van de Velde (2006) Symmetry-preserving discretisation of heat
transfer in a complex turbulent ow. J. Eng. Math. 54, 299318.
R.W.C.P. Verstappen and A.E.P. Veldman (1996) A fourth-order nite volume method for direct
numerical simulation of turbulence at higher Reynolds numbers. In: J.-A. Desideri et al. (eds.)
Computational Fluid Dynamics 96. John Wiley, pp. 10731079.
R.W.C.P. Verstappen and A.E.P. Veldman (1997) Direct numerical simulation of turbulence at lower
costs. J. Eng. Math. 32, 143159.
R.W.C.P. Verstappen and A.E.P. Veldman (1998) Spectro-consistent discretization: a challenge to
RANS and LES. J. Eng. Math. 34, 163179.
R.W.C.P. Verstappen and A.E.P. Veldman (2003) Symmetry-preserving discretization for turbulent
ow. J. Comput. Phys. 187, 343368.
B.J. Vickery (1966) Fluctuating lift and drag on a long square cylinder of square cross-section in a
smooth and in a turbulent stream. J. Fluid Mech. 25, 481494.
P.R. Voke (1997) Flow past a square cylinder: test case LES2. In: J.P. Chollet et al. (eds.), Direct
and Large Eddy Simulation II, pp. 355373.
B. Vreman, B. Geurts and H. Kuerten (1994) Discretization error dominance over subgrid-terms
in large eddy simulation of compressible shear layers in 2D. Comm. Num. Meth. Eng. 10,
785790.
Y. Zang, R.L. Street and J.R. Kose (1993) A dynamic mixed subgrid-scale model and its application
to turbulent recirculating ow. Phys. Fluids A 5, 31863196.
78 CHAPTER 3. DIRECT NUMERICAL SIMULATION OF TURBULENCE
Appendix A
Discretization, integration and
iteration
In the appendix we will give a short review of numerical fundamentals concerning space
discretization, time integration and iterative solution of (sparse) systems of equations.
A.1 Discretization in space
Space discretization methods are often divided in four approaches:
nite-dierence methods;
nite-volume methods;
nite-element methods; and
spectral methods.
This subdivision is not strict in the sense that combinations of the above approaches also
appear, such as control-volume nite elements or spectral elements. Also, a number of
discretization formulas can be derived along several of these approaches. Here, we will only
make some remarks on the rst two approaches. They make use of a computational grid,
typically denoted by

h
= (ih
1
, jh
2
)[i = 0, 1, , I; j = 0, 1, , J,
where h
1
and h
2
are the respective mesh widths.
(i, j)

h
h
2
h
1

h
e
e e
e
e e
e e
e e e
e e e
u
u
u u
u u
79
80 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
Some notation: The discrete approximation of an unknown function is denoted by
h
.
The value of the grid function
h
in the grid point (ih
1
, jh
2
) - or short (i, j) - is denoted
by
ij
. The boundary of
h
is denoted by
h
. Internal grid points are collected in
0
h
, the
boundary points with a Dirichlet (or Robin) condition are denoted by
D
h
, and
N
h
is the set
of boundary points with a Neumann condition.
A.1.1 Finite-dierence methods
In a nite-dierence method derivatives are approximated by combining local Taylor series
such that the local truncation error becomes satisfactory in some sense, e.g. minimized
between all other combinations using the same neighbouring grid points. As an example,
consider the i-th grid point with its two nearest neighbours, corresponding to Taylor series
(x
i
+ h) =
i
+ h
d
dx

x
i
+
h
2
2
d
2

dx
2

x
i
+ O(h
3
). (A.1)
and
(x
i
h) =
i
h
d
dx

x
i
+
h
2
2
d
2

dx
2

x
i
O(h
3
). (A.2)
Subtracting (A.1) and (A.2) we obtain an estimate for the rst-order derivative
d
dx

x
i
=

i+1

i1
2h
+ O(h
2
). (A.3)
which possesses a second-order accurate truncation error (cf. the term O(h
2
)). This formula
uses two points positioned symmetrically with respect to the central point. As an alternative
one of these neighbours can be combined with the central point, yielding a formula that is
only rst-order accurate
d
dx

x
i
=

i

i1
h
+ O(h).
As we will demonstrate in Chapter 1, minimization of the local truncation error may
not be the optimum criterion for selecting discretization formulas (see also the discussion in
Section A.1.4).
A.1.2 Finite-volume methods
A nite-volume method starts with a physical conservation law expressing conservation of
some quantity over a domain with boundary

t
_

d =
_

F() nd +
_

f d. (A.4)
The integral over describes the nett outow of the considered quantity (given by the ux-
function F()), whereas f represents a source term. When the ux-function is dierentiable,
Gauss divergence theorem can be applied
_

t
d +
_

div F() d =
_

f d.
A.1. DISCRETIZATION IN SPACE 81
Since this holds for arbitrary small volumes the conservation law can be written as a PDE
in divergence form

t
+ div F() = f. (A.5)
Note that the physical conservation law (A.4) requires less smoothness of the solution; more-
over it induces the correct jump relations.
In the nite-volume method the relation (A.4) is applied to individual control volumes,
surrounding the grid points. We give a typical example of a nite-volume grid in the accom-
panying gure. The control volumes are indicated by dashed lines, which lie halfway between
the grid point P = (x
i
, y
j
) and its neighbours N, E, S and W.
t t t
t
t
E
N
W
S
P
r
r
r
r
e
n
w
s


The integrals appearing in (A.4) can be approximated by e.g. the midpoint rule as
h
1
h
2

P
= h
2
[F
1
()[
e
F
1
()[
w
] h
1
[F
2
()[
n
F
2
()[
s
] + h
1
h
2
f
P
,
in which F
1
and F
2
are the components of the ux-function. After division by h
1
h
2
this
formula can be reshaped as follows
d
dt

h
= L
h

h
+ f, (A.6)
but as we will see in Section 1.5 this scaling is not always desireable. The curly /t
has been replaced by a straight d/dt, since in the right-hand side no spatial derivatives
appear anymore. In time direction no discretization has taken place yet; we call this semi-
discretization.
A.1.3 Properties of dierence operators
Irrespective of the followed discretization approach, ultimately a spatial dierential operator
is approximated by a dierence operator which acts on functions dened on the computational
grid. Such a dierence operator will be of the form
(L
h
)
ij
=

k,l
c
kl
ij

kl
. (A.7)
82 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
Denition A.1.1 The operator L
h
dened in (A.7) is called positive
1
when

k,l
c
kl
ij
= 0, (i, j)
0
h

N
h
; (A.8)
c
kl
ij
0, (i, j)
0
h

N
h
, (k, l) ,= (i, j). (A.9)
The above requirements need only hold in the interior
0
and on Neumann boundaries
N
;
on a Dirichtlet boundary
D
they are not applicable since only a central coecient c
ij
ij
is
present there.
A positive operator satises a maximum principle, which gives smoothness to the solution:
the above denition implies that the solution in a grid point is a convex combination of its
neighbours:

ij
=

(k,l)=(i,j)

c
kl
ij
c
ij
ij

kl
,
with all coecients in the right-hand side non-negative and adding up to 1. A fortiori , when
there is a direct link between adjacent grid points, the solution of L
h

h
= 0 is non-oscillatory
(no wiggles).
Theorem A.1.2 (Maximum principle) Let L
h
, as dened in Def. A.1.1, be a positive oper-
ator and suppose L
h

h
0 in
0
h

N
h
. Suppose also that L
h
satises a direct-neighbour
condition
c
kl
ij
,= 0, (k, l) (i 1, j), (i, k 1), (i, j)
0

N
, (A.10)
then
h
can only take its maxima on
D
h
(unless
h
is constant).
Proof Suppose
h
takes its maximum M in the grid point (i, j)
0
h

N
h
. Suppose L
h
is
given by (A.7). Then from

k,l
c
kl
ij

kl
= (L
h

h
)
ij
0
we have
c
ij
ij

ij

(k,l)=(i,j)
c
kl
ij

kl
.
As the coecients in the right-hand side are all non-positive we obtain
c
ij
ij

ij

(k,l)=(i,j)
c
kl
ij
max
k,l

kl
= c
ij
ij
max
k,l

kl
= c
ij
ij
M.
Because
ij
= M, everywhere the equality sign has to hold, from which we conclude that all
neighbours
kl
for which c
kl
ij
,= 0 have to be equal to M too. Because of the direct-neighbour
condition (A.10), the stencils with centre in
0
h

N
h
share some overlap, with which the
theorem follows. 2
1
Condition (A.8) implies that a positive operator can also be written in the form (L
h
)
ij
=

kl=ij
c
kl
ij
(
kl

ij
), with all relevant c
kl
ij
0 according to (A.9).
A.1. DISCRETIZATION IN SPACE 83
Corollary Let L
h
be a positive operator satisfying the direct-neighbour condition (A.10),
and let L
h

1
= f
1
and L
h

2
= f
2
with f
1
f
2
. Then
1

2
.
Proof Apply Th. A.1.2 to L
h
(
1

2
) = f
1
f
2
. 2
Because of this property, positive operators are also called monotone. There exists a
link with the so-called M-matrices (see Def. A.3.5), which form an important subclass of the
monotone matrices (for which A
1
0).
Theorem A.1.3 When the Dirichlet part of the boundary is non-empty, then a positive
operator gives rise to an M-matrix. When L
h
also satises a direct-neighbour condition
(A.10) then the matrix is irreducible.
Proof The sign requirement for an M-matrix follows immediately from the denion (A.9) of
a positive operator. Further, because of (A.8) the matrix is (weakly) diagonally dominant. In
Dirichlet boundary points the diagonal dominance is strict. Now a Gershgorin-type argument
yields that all eigenvalues lie in the right half plane. 2
Next to their monotonicity property, leading to smooth solutions as discussed above, M-
matrices also possess pleasant iterative properties, e.g. Jacobi and Gauss-Seidel iteration con-
verge (see Section A.2). Unfortunately, one has to pay a price for such favourable properties,
as formulated in the following theorem.
Theorem A.1.4 (Order barrier) Positive (hence monotone) discretizations of a rst-order
derivative can maximally be rst-order accurate.
Proof (For a uniform one-dimensional grid with grid size h.) Suppose in grid point i we
have
d
dx

k
c
k

i+k
.
A Taylor expansion of the occurring -values results in
d
dx

k
c
k
_

i
+ kh
d
dx

i
+
1
2
(kh)
2
d
2

dx
2

i
+ O(h
3
)
_
. (A.11)
As this expression is meant to be a discrete approximation for the rst-order derivative,
consistency requires that the zero-th order term vanishes and that the rst-order term is
equal to d/dx. These conditions can be satised. But, to achieve second-order accuracy,
the second-order term in (A.11) should also vanish (note that c
k
1/h), i.e.

k
1
2
(hk)
2
c
k
= 0.
Alas, this is impossible when all neighbouring coecients c
k
0, as required for a positive
operator. 2
For more information on monotone discretization methods we refer to e.g. Chapter 21 of
Hirsch (1990).
84 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
A.1.4 Discretization error
The above dierential operators are being used for approximating (partial) dierential oper-
ators. Suppose the dierential equation is given by
L = f,
and the dierence approximation by
L
h

h
= f
h
.
In general, the exact solution of the PDE will not satisfy the dierence approximation. The
dierence

h
L
h
f
h
= L
h
(
h
) (A.12)
is called the local truncation error. When h 0 implies that
h
0, then the dierence
approximation is called consistent.
The dierence
h
, between the exact solution and the discrete solution, is called the
global discretization error. Both errors are related by

h
= L
1
h

h
. (A.13)
We have convergence when the global discretization error vanishes upon grid renement (i.e.
when h 0). Note that the right-hand side in (A.13) consists of a product of the inverse
dierence operator and the local truncation error, hence smallness of the latter does not
necessarily lead to an accurate discrete solution (cf. the discussion in Section 1.5).
A.2 Iterative solution methods
After discretization and linearization of a partial dierential equation often a linear system
Ax = b has to be solved. In this section we will summarize a number of iterative stationary
one-step methods. These have the generic form
Qx
(n+1)
= (QA)x
(n)
+ b, n = 0, 1, , (A.14)
where Q is a non-singular matrix. By rewriting (A.14) we obtain
x
(n+1)
= Cx
(n)
+ Q
1
b, n = 0, 1, , where C = (I Q
1
A). (A.15)
The matrix C is called the iteration matrix.
Since the iteration error, i.e. the dierence with the exact solution x, satises
x x
(n+1)
= C(x x
(n)
),
the iteration method (A.15) will converge if and only if C
n
0. The growth of C
n
is given
by
|C
n
| cn
p1
[[
n(p1)
, n , (A.16)
where is the modulus of the largest eigenvalue of C, and p the order of the largest Jordan
block corresponding with eigenvalues of modulus . It easily follows that an iterative method
is convergent if and only if its spectralradius (C) < 1. The behaviour of C
n
can be very
irregular when defect eigenvalues are present.
A.2. ITERATIVE SOLUTION METHODS 85
A.2.1 Jacobi and JOR
Write the matrix A as A = D L U, in which D = diag(A), L a strict lower-triangular
matrix and U a strict upper-triangular matrix. A simple splitting of the matrix is obtained
by only leaving its diagonal in the left-hand side
Dx
(n+1)
= (D A)x
(n)
+ b,
which upon division by D becomes
x
(n+1)
= (I D
1
A)x
(n)
+ D
1
b. (A.17)
The iteration matrix of this process I D
1
A = D
1
(L + U) is called the Jacobi matrix.
When the iteration proces behaves very regularly, it may pay o to extrapolate the step
x
(n+1)
x
(n)
as
x
(n+1)
= x
(n)
+ (x

x
(n)
) = x

+ (1 )x
(n)
,
where x

is the value from (A.17). This idea is called relaxation, and is the relaxation
factor. Adding relaxation to the Jacobi method (A.17) gives
x
(n+1)
= [ (I D
1
A) + (1 )I ] x
(n)
+ D
1
b (A.18a)
= (I D
1
A)x
(n)
+ D
1
b (A.18b)
= x
(n)
D
1
(Ax
(n)
b). (A.18c)
From (A.18b) we conclude
1

Dx
(n+1)
= (
1

D A)x
(n)
+ b,
which shows a splitting where D/ is left on the diagonal in the left-hand side. This method
is called JOR: Jacobi with OverRelaxation (although often < 1, i.e. underrelaxation, gives
better results). The components of x
(n+1)
can be computed independent of each other; the
method is perfectly vectorizable and parallelizable.
In formulation (A.18c) we recognize the residual Ax
(n)
b. This shows that in simple
words the JOR method can be expressed as: the new guess equals the old guess plus a factor
times the residual. We will use this interpretation several times in these lecture notes.
Next let us investigate the convergence behaviour of JOR. We will restrict ourselves rst
to the class of weakly diagonally dominant matrices, which include the M-matrices.
Theorem A.2.1 When the matrix A is irreducible and weakly diagonally dominant, i.e.
[a
ii
[

j=i
[a
ij
[ for all i, with strict inequality for at least one i,
then the Jacobi method converges.
Proof Young (1971), Th. 4-2.1. 2
86 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
Theorem A.2.2 When Jacobi converges, then also JOR with 0 < 1 converges.
Proof From (A.18a), the iteration matrix of JOR is given by (I D
1
A) + (1 )I. Its
eigenvalues
JOR
are related the eigenvalues
J
of the Jacobi matrix by

JOR
=
J
+ 1 = 1 + (
J
1).
Observe that this corresponds with inter(extra)polation between the points 1 and
J
in the
complex plane. The gure reveals that as soon as Jacobi converges, i.e. all Jacobi eigenvalues
lie within the unit circle, all eigenvalues for JOR with 0 < 1 also lie within the unit
circle. This establishes the proof. 2
r
1

r
r

JOR

.
[
J
1[
\
\`
r
r
\
\
\
\
\
\
\
\
\
\ .
.
.
.
r
. .,
1

1+
2
I

I
1
`

opt
The above proof reveals that the eigenvalues of the Jacobi matrix I D
1
A have to lie
on the left side of the line 1e = 1. Thus, for complex eigenvalues we have in general
Theorem A.2.3 The JOR method converges for suciently small (>0) if and only if the
matrix D
1
A is positive-stable (i.e. all eigenvalues of D
1
A are located in the right halfplane).
In many cases the eigenvalues of the Jacobi matrix lie outside the unit circle, hence the
Jacobi method will no longer converge. Often the eigenvalues lie far up on the imaginary
axis. Let the largest eigenvalue be given by
J
= i
I
, with
I
real. In the above gure we
observe that the JOR method converges for 0 < <
JOR,max
where
JOR,max
=
2
1+
2
I
. The
optimum relaxation factor is given by

JOR,opt
=
1
1 +
2
I
, with spectral radius
JOR,opt
=

I
_
1 +
2
I
. (A.19)
Example
Consider a one-dimensional convection-diusion equation discretized with central dierences
(see Section 1.2)
(
P
2
1)
i1
+ 2
i
+ (
P
2
1)
i+1
= 0,
with Dirichlet boundary conditions (P is the mesh-Peclet number). The Jacobi matrix I
D
1
A reads
diag
_
P
4
+
1
2
, 0,
P
4
+
1
2
_
.
A.2. ITERATIVE SOLUTION METHODS 87
The eigenvalues of this Jacobi matrix are given by (see Lemma A.3.6)

J
=
1
2
_
4 P
2
cos(
i
I
); i = 1, 2, . . . , I 1.
These eigenvalues are real if and only if P 2, which corresponds precisely with the wiggle-
limit. For P > 2 they are purely imaginary, with an imaginary part that is proportional
to P. This implies that for JOR the optimum relaxation factor decreases quadratically with
P:
JOR,opt

4
P
2
. The spectral radius is correspondingly close to 1,
JOR,opt
1
2
P
2
, hence
convergence is not really fast.
This example shows that a central discretization of a large convective term causes di-
vergence of Jacobi. Severe underrelaxation is required to obtain convergence; professional
skill is required to determine a suitable relaxation factor. On the other hand, the upwind
method does not pose any iterative problem whatsoever (since the matrix remains diagonally
dominant). For many researchers this iterative convenience is the reason to choose upwind
. . . !
A.2.2 Gauss-Seidel and SOR
In the Gauss-Seidel method also the lower-triangular part of the matrix is kept in the left-hand
side, hence
(D L)x
(n+1)
= Ux
(n)
+ b.
Its relaxation version SOR (Successive OverRelaxation) reads
(
1

D L)x
(n+1)
=
_
(
1

1)D U
_
x
(n)
+ b,
with iteration matrix
C

= (D L)
1
[(1 )D + U]. (A.20)
For consistently ordered matrices (see Young, 1971) a relation exists between the eigen-
values of C

and the eigenvalues


J
of the Jacobi matrix. This relation reads
( + 1)
2
=
2

2
J
.
A special case is = 1, when this relation reduces to =
2
J
. This implies that for consis-
tently ordered matrices Gauss-Seidel converges if and only if Jacobi converges. More precise,
for such matrices Gauss-Seidel converges/diverges twice as fast as Jacobi. As a corollary,
Gauss-Seidel converges for consistently ordered M-matrices.
For a large class of matrices SOR can be made convergent, as shown in the next theorem.
Theorem A.2.4 Let A be a consistently ordered matrix. Then SOR converges for suciently
small (>0) if and only if D
1
A is positive-stable.
Proof Young (1971), Th. 6-4.2. 2
In Figure A.1 we show the spectral radius of the SOR matrix (A.20) for various choices of
the determining Jacobi eigenvalues. We note that for a symmetric matrix A (for which the
88 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
Jacobi spectrum is real), SOR converges if and only if A is positive denite and 0 < < 2.
The optimum relaxation factor is given by (see Young (1971) Th. 4-3.3 and 4-3.6)

SOR,opt
=
2
1 + (1
2
R
)
1/2
, with
SOR,opt
=
SOR,opt
1.
Figure A.1: Relation between spectral radius, relaxation factor and Jacobi eigenvalue =

R
+ i
I
.
When the Jacobi eigenvalues are complex, than the -interval for which convergence occurs
becomes smaller. For purely imaginary Jacobi spectra, with extremal eigenvalues
J
= i
I
,
it can be shown (Botta and Veldman 1982) that SOR converges if and only if
0 < <
SOR,max
with
SOR,max
=
2
1 +
I
.
Hence, when
I
> 1 Gauss-Seidel no longer converges (in fact Jacobi does neither). The
optimum relaxation factor is given by

SOR,opt
=
2
1 + (1 +
2
I
)
1/2
, with
SOR,opt
= 1
SOR,opt
. (A.21)
It follows that
SOR,opt
< 1, i.e. underrelaxation is desired (and for
I
> 1 even necessary).
By comparing (A.19) and (A.21) we see that in the example above SOR converges signif-
icantly faster than JOR. This dierence is much larger than the factor two between Gauss-
Seidel and Jacobi. A little arithmetic yields that for large mesh-Peclet numbers P we have

SOR,opt

4
P
with
SOR,opt
1
4
P
.
A.3 Some denitions and theorems on eigenvalues
In this section we present some denitions and theorems on the location of matrix eigenvalues.
A.3. SOME DEFINITIONS AND THEOREMS ON EIGENVALUES 89
Lemma A.3.1 (Bendixson) Let A = S + i T be a general matrix, where 2S = A + A

is its
symmetric part, and 2iT = AA

its skew-symmetric part. Let


m
and
M
be the smallest
and largest eigenvalues of R, respectively; similarly
m
and
M
w.r.t. T. Then the eigenvalues
of A are located in a rectangle dened by the lower-left and upper-right corners (
m
,
m
) and
(
M
,
M
).
Proof (from Householder 1964) Let x be a normed eigenvector (i.e. x

x = 1) corresponding
to an eigenvalue = a + i b of A. Then
a + i b = = x

x = x

Ax = x

Sx + i x

Tx,
hence a = x

Sx and b = x

Tx. Since both S and T are symmetric matrices their eigenvalues


are real and one has

m
x

Sx
M
for any x,
and a similar relation for T. Now the theorem follows. 2
Denition A.3.2 A matrix A is called positive-stable if all of its eigenvalues are located in
the right halfplane, i.e. 1e (A) > 0.
Denition A.3.3 A matrix A is called positive real if its symmetric part A+A

is positive
denite.
The property positive-stable is somewhat weaker than the property positive real, as
follows from the next lemma.
Lemma A.3.4 Let A be a positive real matrix. Then for each positive denite matrix Q the
product QA is positive-stable; in particular the matrix A itself is positive-stable.
Proof We rst prove that P Q
1/2
AQ
1/2
is positive real. This follows from
((x, (P + P
T
)x)) = ((x, (Q
1/2
AQ
1/2
+ Q
1/2
A
T
Q
1/2
)x))
= ((x, Q
1/2
(A + A
T
)Q
1/2
x)) = ((Q
1/2
x, (A + A
T
)Q
1/2
x)) > 0
for all x ,= 0. Subsequently we prove that P is positive-stable. Hereto let be an eigenvalue
of P with corresponding eigenvector y. Then we have
2 1e |y|
2
= ( + )|y|
2
= ((y, y)) + ((y, y))
= ((Py, y)) + ((y, Py)) = ((y, (P + P
T
)y)) > 0,
from which we conclude 1e > 0. The theorem now follows since QA = Q
1/2
PQ
1/2
pos-
sesses the same eigenvalues as P. 2
Remark That A itself is positive-stable also follows directly from Lemma A.3.1.
An important example of positive-stable matrices is formed by the so-called M-matrices.
Denition A.3.5 A matrix A (a
ij
) is called an M-matrix when
90 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
1. its diagonal elements are positive a
ii
> 0, and its non-diagonal elements are non-positive
a
ij
0, i ,= j;
2. the matrix is positive-stable, i.e. all eigenvalues of A lie in the right halfplane 1e (A) > 0.
Another useful lemma to compute the eigenvalues of a matrix is
Lemma A.3.6 The eigenvalues of a tri-diagonal nn matrix with entries a, b, c are given
by
= b + 2

ac cos
_
i
n + 1
_
, i = 1, , n.
In fact, the above lemma describes one of the rare occasions where eigenvalues can be com-
puted analytically.
A.4 Integration in time
Let us now proceed from (A.6) where the spatial derivatives have been discretized with one
of the methods from the preceding section
d
dt
+ L
h
= 0. (A.22)
To integrate this equation in time, discrete time levels t
n
= nt are introduced. Hereafter
a recipe is used to compute the newest time level. As an example, explicit time integration
(also known as the forward Euler method) is given by

(n+1)

(n)
t
= L
h

(n)
, (A.23)
where the spatial-derivative term L
h
is evaluated at the old time level. In the CrankNicolson
method this term is evenly divided between the old and the new time level

(n+1)

(n)
t
=
1
2
_
L
h

(n+1)
+ L
h

(n)
_
, (A.24)
whereas the backward Euler method evaluates it at the new time level only.
Many more methods are feasible; we refer to textbooks on solving dierential equations
(e.g. Lambert 1973) for an overview of the large amount of time-integration methods that
have been designed. Anyway, a generic time step (using only one previous time level) will
look like

(n+1)
= A(t)
(n)
. (A.25)
Such a time step will have a certain formal asymptotic accuracy, e.g. forward and backward
Euler are rst-order accurate in time, whereas CrankNicolson is second-order accurate.
A.4. INTEGRATION IN TIME 91
A.4.1 Stability
Next to accuracy, the stability of the process (A.25) when n grows is of concern. Stability
may put restrictions on the time step that are more stringent than those put by accuracy
(especially for sti equations there can be a large discrepancy). The notion of stability is
closely related to the well-posedness of the discrete problem, i.e. a solution should depend
continuously on the parameters dening the problem.
As an example, well-posedness with respect to initial con-
ditions requires that two solutions
1
(t) and
2
(t), start-
ing close to each other at t = 0 remain close to each
other: the situation in the adjacent gure is not what one
would like to see. In mathematical terms, for any time
interval 0 t T there should exist a constant K
T
such
that
|
1
(t)
2
(t)| K
T
|
1
(0)
2
(0)| for all t T.
When the underlying equation is linear, the above
relation also holds for the solution itself (not just for the
dierence between two solutions).
Stability is often a confusing notion, therefore we will pay some attention to it here. At
rst we have to further specify the type of process we want to investigate. There are two
ways in which n can grow, corresponding with two types of stability:
absolute stability, also known as stepwise stability,
zero-stability or pointwise stability.
Absolute stability is concerned with keeping the time step t xed while n (i.e.
T = in the above well-posedness denition). This notion of stability is relevant when the
solution of the steady problem in the limit t is pursued. The time-integration method
has become an iteration process for nding the solution of L
h

h
= 0, where the time step
plays a role as relaxation parameter. Absolute stability demands that the subsequent time
levels remain bounded, i.e.
|A
n
(t)| K for all n. (A.26)
For the process to converge when time proceeds a stronger condition has to hold, viz.
|A
n
(t)| 0 for n . We will see later (cf. Section 1.8) that absolute stability can-
not guarantee that during the process (i.e. for nite t) no strange things can happen.
Zero-stability is concerned with nding the solution on a xed and nite time interval
[0, T]. When time step and mesh size approach zero the discrete solution should converge to
the continuous one. The number of time steps grows since the time steps decreases, but the
total number of time steps remains bounded for non-zero time step, namely it is bounded by
T/t. During this limit process the discrete formulation should remain well-posed uniformly
in t (with 0 < t t
max
). I.e. there has to exist a constant K
T
, independent of n, t and
h, such that
|A
n
(t)| K
T
for 0 < n T/t. (A.27)
92 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
The Equivalence Theorem of Lax applies to this situation: for a consistent discretization,
zero-stability is equivalent with convergence. For a proof see Richtmyer and Morton (1967).
Thus zero-stability guarantees that for suciently small t the discrete solution becomes
a good approximation of the continuous solution. However it gives no clue about how small
the time step has to be chosen to attain a certain accuracy. A guide line for selecting an
accurate t can be obtained through the notion of practical stability introduced by Richtmyer
and Morton. This notion is sort of an intermediate between well-posedness and accuracy.
Practical stability demands that the growth of the discrete solution, characterized by
|A(t)|, is similar to the growth of the continuous solution. Since |A(t)| often is dicult
to determine, Richtmyer and Morton (1967) formulate their guide line in terms of Fourier
analysis:
no discrete Fourier component may grow (signicantly) faster than the maximum
growth of the exact solution.
We have to realize that Fourier analysis does not take into account the inuence of boundary
conditions, non-equidistant grids, non-constant coecients and non-linearity of the equations.
Nevertheless, as we will see in Section 1.8, for practical situations a useful guide line is provided
for selecting t and h. For equations of which the solution does not grow, practical stability
leads to the (absolute) requirement [g()[ 1, 0 2, where g() is the amplication
factor of the Fourier component with frequency (see below). Historic remark: Fourier
analysis of dierence equations has been introduced by John von Neumann; especially he
considered the zero-stability-like variant (see page 96).
Remark On the one hand (because of the condition for all n) absolute stability is a stronger
requirement than zero-stability. On the other hand (because K is allowed to depend on h
and t) it is a weaker requirement. We will see in Section 1.8 that neither notion follows from
the other.
A.4.2 Matrix analysis
The requirements put by the various types of stability can be expressed in terms of the
spectrum of the operator A(t) describing the time evolution. In Section A.2 we mention
that
|A
n
| cn
p1
[(A)]
n(p1)
, n , (A.28)
where (A) is the spectral radius, and p the order of the largest Jordan block belonging to
the eigenvalues with [[ = (A). When A is non-defect, i.e. A is diagonalizable, then p = 1.
This induces
Theorem A.4.1 The process (A.25) is absolutely stable if and only if
(A) < 1 [(A) = 1 [[ = 1 non defect ]. (A.29)
When (A) < 1 then |A
n
| 0 for n , but during the transient |A
n
| can become large
(see Section 1.8).
A.4. INTEGRATION IN TIME 93
The investigation of zero-stability is more complicated as the boundedness of |A
n
| does
not have to hold for all n (n always remains nite and the asymptotic behaviour (A.28)
does not contain sucient information). To keep control over the situation we will restrict
ourselves to non-defect matrices.
Theorem A.4.2 When A is non-defect, the following three properties are equivalent:
1. the process (A.25) is zero-stable, i.e. (A.27) holds;
2. the spectral radius of A satises the Von Neumann condition
1 + O(t), (A.30)
where the order constant is independent of t and h;
3. at each time t > 0 we have
|
(n)
| ke
ct
|
(0)
|, (A.31)
where k and c are independent of t and h.
Proof 1 2 : Suppose (A.27) holds. Then
n
(A) = (A
n
) |A
n
| K
T
, 0 < n T/t.
Now we can employ that fact that this only has to hold for a limited number of time steps.
The most challenging situation is for the largest value of n, i.e. n = T/t, leading to the
requirement
T/t
K
T
. This can be rewritten as
K
t/T
T
1 + K
T
t/T = 1 + O(t),
since for 0 x 1 we have K
x
1 + Kx.
2 3 : Next let 1 + ct, and assume c 0. Then from 1 + x e
x
we have for
n = t/t

n
(1 + ct)
n
e
ctn
= e
ct
.
Because of |
(n)
| |A
n
||
(0)
| and the non-defect variant of (A.28) the estimate (A.31)
follows.
3 1 : By choosing K
T
equal to max(1, ke
cT
) we obtain (A.27). 2
Remark The estimate (A.31) shows that zero-stability is the discrete equivalent of the notion
well-posedness for continuous problems (cf. RuG lecture notes Partial Dierential Equations,
or any other mature book on PDE).
A.4.3 Positive time-integration schemes
Similar to the denition of positive (monotone) operators for steady problems (cf. Def. A.1.1),
for unsteady problems the notion of positivity can be introduced. In this case the central
unknown is
(n+1)
i
; its coecient has to be positive, whereas all other coecients should
be non-positive. In a somewhat dierent notation than used in Def. A.1.1, the following
denition emerges for linear time-integration methods.
94 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
Denition A.4.3 Under the consistency condition

k
c
k
i
= 1, the (explicit) time-integration
scheme

(n+1)
i
=

k
c
k
i

(n)
k
A
(n)
is called positive when all coecients c
k
i
0.
Harten, Hyman and Lax (1976) give a generalization of this denition to non-linear schemes.
Further, for implicit schemes the denition is similar.
Because the values at the new time level are a convex combination of those at the old
time level, an immediate consequence of positivity is that global extrema cannot grow
min
k

(n)
k

(n+1)
i
max
k

(n)
k
.
In more abstract terms, this is equivalent to saying that a positive time-integration scheme is
(absolutely and zero-)stable in the maximum norm (|A|

= max
i

k
[c
k
i
[ = 1).
When the steady operator is positive it is not dicult to construct a positive time-
integration scheme.
Theorem A.4.4 When the steady operator L
h
dened in (A.7) is positive, then forward
Euler time integration of (A.22) gives rise to a positive scheme if and only if the time step
satises t 1/c
ij
ij
.
Proof The consistency condition is an immediate consequence of (A.8). Further, by rear-
ranging terms we have

(n+1)
ij
= (1 c
ij
ij
t)
(n)
ij
t

(k,l)=(i,j)
c
kl
ij

(n)
kl
.
Because of (A.9), only the coecient of
(n)
ij
requires some attention, leading to the indicated
requirement on the time step. 2
A.4.4 Fourier analysis
As it is dicult to determine the norm or the eigenvalues of A, a stability analysis is often
carried out in terms of Fourier analysis. Here the solution
h
is decomposed into Fourier
components e
ix
. The interval [0, L] is discretized with mesh width h = L/K and grid
points x
k
= kh = kL/K (k = 0, . . . , K). On this interval, the Fourier components with
= 2/L ( = 0, 1, . . .) are orthogonal. Rewriting the exponent via
x = kh =
2
L
kL
K
=
2
K
k k,
some analysis reveals that on a uniform grid the Fourier modes
e
i

k
with

=
2
K
, = 0, 1, . . . , K 1. (A.32)
A.4. INTEGRATION IN TIME 95
are orthogonal, and sucient in number to describe any periodic grid function dened in the
only K independent discrete points, i.e. they form an orthogonal basis.
The gure below shows the real part of some discrete basis functions, where one has to
recall that information between the grid points is not visible. In this example with K = 8
the function with = 4 (i.e.

= ) corresponds with the highest frequency. Larger values


of appear to possess in the grid points a lower frequency. In particular we have
f
+K
(k) = f

(k).
This phenomenon where on the discrete grid higher frequencies cannot be distinguished form
lower frequencies is known as aliasing. Already in the pioneering lm age this phenomenon
was known: carriage wheels that seem to be standing still or turn backward. The nite num-
ber of frames is responsible for this.
s s s s s s s s s
s
s
s
s s
s
s s
s
s s s s s
s s s s
s
s
s
s
s
s
s
s
s
s s s s s s s s s
= 0;
= 1;
= 4 = K/2,

= : as a grid function
this one has the highest frequency;
= 7 = K 1: the real part equals that
of = 1, the imaginary part is dierent
however;
= 8 = K,

= 2: the same grid


function as the one at = 0, and hence
not to be included as a basis function.
Amplication factor
Substitution of the Fourier decomposition

(n)
h
(x
k
) =
K1

=0
c
(n)

e
ik

,
into the discretized dierential equation will ultimately result in a relation expressing the
amplitude at the new time level c
(n+1)
in terms of the previous amplitude c
(n)
. Their quotient
g(

) c
(n+1)

/c
(n)

(A.33)
96 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
is called the amplication factor.
As before, both step wise (absolute) and point wise (zero) stability variants can be dis-
tinguished. It can be shown that (Fourier) absolute stability corresponds with
max

[g(

)[ 1, (A.34)
whereas the integration method is (Fourier) zero-stable if and only if the Von Neumann
condition
max
[0,2]
[g()[ 1 + O(t) (A.35)
holds, where the order constant should be independent of h.
It is remarked, that the above analysis is exact when four properties are satised: i) the
equation is linear; ii) the equation has constant coecients; iii) the boundary conditions are
periodic; iv) the grid is uniform. In other situations, the analysis is only approximate.
For practical stability a stronger requirement is set for the order constant, namely it should
be related to the analytic growth of the Fourier components in the continuous problem. For
diusive problems, not allowing any growth, this leads to the requirement
max
[0,2]
[g()[ 1. (A.36)
Compared with (A.34) we must stress that we are dealing with a dierent situation: t 0
versus t xed. The optical similarity between (A.34) and (A.36) gives rise to much confusion
about stability in the existing literature.
The Fourier symbol
The amplication factor is built from the amplication of the individual derivatives in the
PDE. For example, a rst-order derivative d/dx discretized as

k+1

k1
2h
when applied to = e
ik
gives a contribution (after division by e
ik
)
e
i
e
i
2h
=
i
h
sin ;
a second-order derivative d
2
/dx
2
discretized centrally gives a contribution
e
i
2 + e
i
h
2
=
2
h
2
(cos 1).
The expressions in the right-hand sides are called the discrete Fourier symbol of the
dierence quotients. They should form approximations of the corresponding Fourier symbols
P(i) of the dierential operators P(/x). These symbols describe the evolution of a discrete
Fourier component e
ik
and a continuous Fourier component e
ix
, respectively
P
h
(/x)e
ik
= P
f
e
ik
versus P(/x)e
ix
= P(i)e
ix
.
A.4. INTEGRATION IN TIME 97
Referring to one of the above examples, the operator /x possesses the Fourier symbool
i. Its centrally discretized counterpart possesses the discrete Fourier symbol
i
h
sin =
i
h
sin h i + O(
3
h
2
).
When h = is small, the discrete Fourier symbol approaches its continuous counterpart.
The same holds for the discrete Fourier symbol of the second-order derivative
2
h
2
(cos 1) =
2
h
2
(cos h 1)
2
+ O(
4
h
2
).
The criterion h is small implies that the mesh width h has to be small with respect
to to the wave length 2/ of the Fourier component. For these relatively long waves the
continuous and discrete evolution are more or less the same. For short waves, with ( ),
the discrete evolution diers considerably from the continuous evolution, thus jeopardizing
accuracy.
Below we will give the relation between Fourier analysis for the continuous problem and
the corresponding (semi-)discrete versions. In all three cases the solution is decomposed in
Fourier components e
ix
and e
ik
, respectively, where h = .
continu
/t = P(/x)
(t) = a(t)e
ix
da/dt = P(i)a
a(t) = a(0)e
P(i)t
a(t + t)/a(t) = e
P(i)t
1 + P(i)t
semi-discrete
d
h
/dt = P
h
(/x)
h

h
(t) = a
h
(t)e
ix
da
h
/dt = P
f
a
a
h
(t) = a
h
(0)e
P
f
t
a(t + t)/a(t) = e
P
f
t
1 + P
f
t
discrete - forward Euler

(n+1)
h

(n)
h
t
= P
h
(/x)
(n)
h

(n)
h
(x
k
) = c
(n)

e
ik
c
(n+1)

c
(n)

t
= c
(n)

P
f
g() c
(n+1)

/c
(n)

= 1 + tP
f
Another time integration method leads to another amplication factor. For example back-
ward Euler leads to g() = (1tP
f
)
1
, whereas for Crank-Nicolson g() = (1+
1
2
tP
f
)/(1
1
2
tP
f
). These expressions are approximately equal for small t, but quite dierent for large t.
For the semi-discrete version to be a good approximation of the continuous problem, the
discrete Fourier symbol P
f
has to be a good approximation of the continuous Fourier symbol
P(i). Subsequently, for the discrete time integration to be a good approximation of the
exact time integration, the amplication factor g() in turn has to be a good approximation
of the analytical growth e
P
f
t
. Combined this leads to a desire to have
g() e
P
f
t
e
P(i) t
. (A.37)
By comparing modulus and argument, respectively, of the left-hand side and right-hand side,
assertions can be made on the diusive and dispersive character of the discrete approximation.
Example
The simple-wave equation

t
+ c
x
= 0 (A.38)
98 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
discretized using forward Euler in time and upwind in space gives

(n+1)
k

(n)
k
t
+ c

(n)
k

(n)
k1
h
= 0. (A.39)
Its discrete Fourier symbol reads c(1 e
i
)/h and the amplication factor becomes
g() = 1
c t
h
(1 e
i
).
The locus of the amplication factor is a circle with centre 1
c t
h
and radius
c t
h
. Hence
(A.39) is Fourier-stable if and only if
CFL
c t
h
1.
The expression in the left-hand side is called the CFL-number, after Courant, Friedrichs and
Lewy, who in 1928 for the rst time brought up the notion of stability. This requirement
means that a numerical method can never be smarter than the physics, in the sense that one
can never take larger time steps than allowed by the region of determinacy.

.
.
.
.
.
`
arg g()

g()
1
1
c t
h

u u
u

i 1 i
n 1
n
t
h
charact.
slope c
H
Hj
This example does not have diusion, hence the analytical Fourier symbol is purely imag-
inary, and the right-hand side of (A.37) has modulus 1. The left-hand side g() possesses a
modulus less or equal to 1 (in the stable range), with a minimum for = , i.e. the discrete
approximation possesses diusion: the shortest wave on the grid is damped most. Only when
CFL = 1 no damping takes place (see gure). We note that for this special value of the
CFL-number the discretized formula (A.39) reduces to

(n+1)
i
=
(n)
i1
.
This is exact since in this case the characteristic passes through both points involved.
A.4.5 The modied equation
Finally we present in this section an alternative way to determine the dissipative and disper-
sive properties of a discrete equation. Hereto we take the reverse way. Starting form a discrete
equation we trace back which dierential equation does correspond; we call this the modied
A.5. REFERENCES 99
equation. This equation can be interpreted through physical insight or analytic-mathematical
techniques.
As an example we again treat the simple-wave equation (A.38), discretized with forward
Euler in time and upwind in space (A.39). We express all appearing grid values through
Taylor series around
(n)
i
, hence

(n+1)
i
=
(n)
i
+ t
t
+
1
2
(t)
2

tt
+ ,

(n)
i1
=
(n)
i
h
x
+
1
2
h
2

xx
+ .
Substitution in (A.39) yields

t
+ c
x
=
1
2
(c h
xx
t
tt
) + . (A.40)
All time derivatives are transformed into spatial derivatives by using the dierential equation
(A.38), such as in

tt
= (
t
)
t
= (c
x
)
t
= c(
t
)
x
= c(c
x
)
x
= c
2

xx
.
Now (A.40) transforms to the modied equation

t
+ c
x
=
1
2
c (1 CFL) h
xx
+ . (A.41)
The right-hand side contains the dierence with the equation that we wanted to solve. We
recognize a diusive term. From PDE theory it is known that this equation is stable/unstable
for positive/negative diusion, which (for c > 0) physically suggests the stability requirement
0 1 CFL. And this is indeed the correct numerical criterion.
A.5 References
E.F.F. Botta and A.E.P. Veldman (1982) On local relaxation methods and their application to
convection-diusion equations. J. Comput. Phys. 48, 127149.
A. Harten, J.M. Hyman and P.D. Lax (1976) On nite dierence approximations and entropy con-
ditions for shocks. Comm. Pure Appl. Math. 29, 297322.
C. Hirsch (1990) Numerical Computation of Internal and External Flows, Volume 2. John Wiley.
A.S. Householder (1964) The Theory of Matrices in Numerical Analysis. Blaisdell Publishing Com-
pany (reprinted in 2006, Dover).
J.D. Lambert (1973) Computational Methods in Ordinary Dierential Equations. John Wiley.
R.D. Richtmyer and K.W. Morton (1967) Dierence Methods for Initial Value Problems. John Wiley.
A.E.P. Veldman (1996) Partiele Dierentiaalvergelijkingen. Lecture notes (in Dutch), University of
Groningen.
D.M. Young (1971) Iterative Solution of Large Linear Systems. Academic Press.
100 APPENDIX A. DISCRETIZATION, INTEGRATION AND ITERATION
Appendix B
Computer exercises
During the course several computer exercises have to be made. These exercises are to be
solved in pairs of one or two students. A (short) written report of the ndings has to be
handed in the following week; discussion of the homework with other pairs of CFD students
is not allowed during that period.
All software required for the exercises is available by downloading the les from the Nestor
pages for this course:
Computational Fluid Dynamics > Course Information
An alternative is to download them through
http://www.math.rug.nl/veldman/Colleges/CFD/CFD-Exercises.html
B.1 Exercise 1 Articial diusion
Files and commands Required les: cfd 1.m, cfd upw.m, ns exact.m
The program is started in Matlab with the command cfd 1.
Description
Consider the inhomogeneous convection-diusion equation
d
dx
k
d
2

dx
2
= S on 0 x 1, with (0) = 0, (1) = 1.
The right-hand side is given by
S(x) =
_
2 5x , 0 x 0.4,
0 , 0.4 < x 1.
In this exercise an upwind discretization of the above equation is applied. The discrete
solution for three values of the diusion coecient k is plotted in one picture. Also the exact
solution for one value of k can be included in this picture.
101
102 APPENDIX B. COMPUTER EXERCISES
Questions
1. Firstly, study the discrete solution for a grid with N = 20 grid points, at the following
values of k: k = 0.1, 0.01 and 0.001. These values correspond with mesh-Peclet numbers
P = 0.5, 5 and 50, respectively. One would expect (or at least hope) that these solutions
tend to the (analytical) solution for k = 0. Hence, compare the discrete solutions to
the exact solution at k = 0 (ignore the Matlab warnings concerning division by zero).
What do you observe; is there any such relation?
2. Next, compare the same three discrete solutions at k = 0.1, 0.01 and 0.001 (again for
N = 20) to the exact solution at k = 0.025. Now, there seems to be some relation
between the upwind limit for k 0 and the exact solution at k = 0.025. Explain this
relation.
3. Finally, study once more the upwind solutions at k = 0.1, 0.01 and 0.001, but now on a
grid with N = 40 grid points. Which exact solution, i.e. at which value of k, corresponds
with the upwind limit for k 0?
B.2 Exercise 2 Various discretization methods
Description
As in Exercise 1, we consider the inhomogeneous convection-diusion equation
d
dx
k
d
2

dx
2
= S on 0 x 1, with (0) = 0, (1) = 1.
The right-hand side is given by
S(x) =
_
2 5x , 0 x 0.4,
0 , 0.4 < x 1.
The Matlab le cfd 2 solves this equation with a number of nite-dierence (-volume)
methods. Several types of discretization are employed; the solutions obtained with these
discretizations are shown in one combination gure the exact solution is also indicated.
Each gure shows eight smaller pictures, arranged as indicated below:
uniform grid upwind smart upwind
lambda schemes B3 ( = 1/2) QUICK ( = 1/8) central ( = 0)
nonuniform grid upwind central A central B
Two types of grid are used: uniform grids and non-uniform (stretched) grids. The
stretched grid possesses N/2 equal grid cells between 0 and 1 5k, and N/2 equal grid
cells between 1 5k and 1.
The Matlab script also gives the eigenvalues of Method B; they are displayed in Matlabs
main window.
B.2. EXERCISE 2 VARIOUS DISCRETIZATION METHODS 103
Required les
This exercise requires the les cfd 2.m, cfd upw.m, cfd lam.m, cfd cen.m, ns exact.m.
Questions to be solved on the computer
Compute the solutions for k = 0.05, k = 0.01 and k = 0.001 (i.e. P = 1, 5 and 50). Use a
grid with N = 20 grid cells
1. Compare the upwind results with those of the smart upwind method for the same values
of k; give a personal opinion of the usefullness of the latter method in comparison with
the standard upwind.
2. Compare the results of the lambda-schemes (cf. Section 1.3.2) with those of the up-
wind method; watch features like wiggle-dependency and articial diusion. Determine
empirically for which value of k the QUICK method starts to wiggle, and explain this
wiggle boundary theoretically (see Question 5 below).
3. Finally, consider the results on the stretched grid. Compare the upwind method and
both generalizations (A and B) of the central method (cf. Section 1.6). Describe the
dierence between the discrete solutions; why has the upwind solution not improved?
4. On the stretched grid, determine empirically the value of k for which one of the eigen-
values of the coecient matrix of Method B crosses the imaginary axis. Furthermore,
try to nd a value of k for which the coecient matrix is approximately singular. Watch
how the solution of Method B behaves at this singularity.
Questions to be solved by pencil-and-paper
5. Prove that max(
1
2

k
uh
, 0) is a sucient condition for the upwind-biased lambda
schemes from Eq. (1.15) on page 12 to be wiggle-free. In particular show that the
QUICK method is wiggle-free for P 8/3. Hint: Try fundamental solutions of the
form r
i
, and monitor the sign of r.
6. Discretize the convection-diusion equation
d
dx
k
d
2

dx
2
= 0 on 0 x 1,
with Dirichlet boundary conditions
(0) = 0, (1) = 1.
Use a nonuniform grid with only one interior grid point at x = 1 2k; k remains an
unspecied variable here. Use the discretization methods A and B. In both cases, A and
B, solve the discrete system (which in fact is only one equation). Sketch both solutions
using linear interpolation between the grid points. Compute the exact solution of the
convection-diusion equation (at x = 12k) as well. Which discrete solution is better?
104 APPENDIX B. COMPUTER EXERCISES
B.3 Exercise 3 The JOR and SOR method
Description
After discretization of a (system of) partial dierential equation(s) one obtains a large system
of algebraic equations, Ax = b. Solving such a large system with a direct method is expensive
with respect to both memory and CPU time. Therefore, such systems are often solved with
an iterative method.
As in Exercise 1 and 2, we consider the inhomogeneous convection-diusion equation
d
dx
k
d
2

dx
2
= S on 0 x 1, with (0) = 0, (1) = 1.
The right-hand side is given by
S(x) =
_
2 5x , 0 x 0.4,
0 , 0.4 < x 1.
The Matlab le cfd 3.m discretizes this equation with a number of nite-dierence (-
volume) methods, and solves the resulting linear systems iteratively.
Two types of grid are used: uniform grids and non-uniform (stretched) grids. The
stretched grid possesses N/2 equal grid cells between 0 and 1 5k, and N/2 equal grid
cells between 1 5k and 1. Several types of discretization are employed; on the uniform grid
both an upwind and a central discretization, and on the stretched grid an upwind, a central
A and a central B discretization are used.
The resulting linear systems are solved iteratively with the JOR and SOR methods. As
stopping criterion in these methods
|
n+1

n
|

10
5
is used, in which n is the counter of the iterative steps; the maximum norm of the dierence
between the solutions of two consecutive iteration steps must be suciently small.
Required les
This exercise requires the les cfd 3.m, plotev.m, plotsol.m, ns iterative.m, ns jor.m,
ns sor.m, ns exact.m.
Typing the command cfd 3 in Matlab starts a menu in which the choice of the grid,
the discretization method, the iterative method and the value of the relaxation factor
can be given. Then, with the menu a program can be started which solves the convection-
diusion equation in the prescribed way. The results produced by the program consist of the
eigenvalues of the Jacobi matrix, a plot of the iteration error (this error is written to the
screen as well), the total number of iterations and a plot showing the continuous solution, the
discrete solution computed with a direct solver and the discrete solution computed with the
iterative method (provided the iterative method did converge).
B.3. EXERCISE 3 THE JOR AND SOR METHOD 105
Questions to be solved on the computer
Compute the solution for k = 0.01. As a default, the program uses N = 10 grid cells.
1. Select the uniform grid; use rst the upwind and then the central method. Determine
numerically whether the Jacobi method (i.e. the JOR method with = 1) converges
or not. Do the same for the Gauss-Seidel method (i.e. the SOR method with = 1).
Put the results in the table below.
uniform Jacobi method Gauss-Seidel method
grid convergent? # iterations convergent? # iterations
upwind
central
Use the eigenvalues of the Jacobi matrix, computed by cfd 3, to explain the results.
When both methods converge, compare the convergence rate of the Jacobi and Gauss-
Seidel method.
2. Select the uniform grid; use rst the upwind and then the central method. Use various
(suitably chosen) values of and determine numerically for each value of the number
of iterations needed by the JOR method. Determine in this way the optimal and max-
imal relaxation factor,
opt
and
max
, for the JOR method. Do the same for the SOR
method. Put the results in the table below.
uniform JOR method SOR method
grid
opt
# it.
max
# it.
opt
# it.
max
# it.
upwind
central
Which systems are solved better by the JOR and SOR method, those resulting from
the upwind discretization or those resulting from the central discretization?
3. Select the stretched grid; use rst the upwind, then the central A and nally the central
B method. Determine numerically whether the Jacobi method ( = 1) converges or
not. Do the same for the Gauss-Seidel method ( = 1). Put the results in the table
below.
stretched Jacobi method Gauss-Seidel method
grid convergent? # iterations convergent? # iterations
upwind
central A
central B
106 APPENDIX B. COMPUTER EXERCISES
Use the eigenvalues of the Jacobi matrix, computed by cfd 3, to explain the results.
When both methods converge, compare the convergence rate of the Jacobi and Gauss-
Seidel method.
4. Select the stretched grid: use rst the upwind, then the central A and nally the central
B method. Use various (suitably chosen) values of and determine numerically for each
value of the number of iterations needed by the JOR method. Determine in this way
the optimal and maximal relaxation factor,
opt
and
max
for the JOR method. Do the
same for the SOR method. Put the results in the table below.
stretched JOR method SOR method
grid
opt
# it.
max
# it.
opt
# it.
max
# it.
upwind
central A
central B
In case of the central B discretization compare the discrete solution obtained with the
JOR or SOR method with the discrete solution obtained with the exact solver. Do
the JOR and SOR method really converge? Use the eigenvalues of the Jacobi matrix,
computed by cfd 3, to explain this result. Which systems are solved better by the JOR
and SOR method, those resulting from the upwind discretization, those resulting from
the central A discretization or those resulting from the central B discretization?
Questions to be solved by pencil-and-paper
5. In Section A.3.1 for a central discretization on the uniform grid the Jacobi matrix and
its eigenvalues are derived. The Jacobi matrix reads
diag[
P
4
+
1
2
, 0,
P
4
+
1
2
],
(P is the mesh-Peclet number) and its eigenvalues
J
are given by

J
=
1
2
_
4 P
2
cos(
i
N
), i = 1, . . . , N 1,
where N is the number of grid cells.
Derive in a similar way for the upwind discretization on the uniform grid the eigenvalues

J
of the Jacobi matrix. Show that these eigenvalues are real and between -1 and 1 for
every value of P.
Hint: the eigenvalues of the tri-diagonal matrix diag(a, 0, c) are given by
= 2

ac cos(i/N), i = 1, . . . , N 1.
6. For a central discretization on the uniform grid the eigenvalues of the Jacobi matrix
are pure imaginary when P > 2. Let the largest pure imaginary eigenvalue be given
by
J
= i
I
, with
I
real. The optimal and maximal relaxation factor for the JOR
method are given by (cf. Section A.3.1)

JOR,opt
=
1
1 +
2
I
,
JOR,max
=
2
1 +
2
I
.
B.4. EXERCISE 4 TIME INTEGRATION 107
For an upwind discretization on the uniform grid the eigenvalues of the Jacobi matrix
are real (see Question 5). Let the largest real eigenvalues be given by
J
=
R
and

J
=
R
, with
R
real. Derive, as a function of
R
, the optimal and maximal
relaxation factor for the JOR method.
Hint: the eigenvalues
JOR
of the iteration matrix of the JOR method are related to
the eigenvalues
J
of the Jacobi matrix by
JOR
= 1 + (
J
1), and the JOR
method converges when the eigenvalues
JOR
lie within the unit circle.
Furthermore, for the SOR method give the optimal and maximal relaxation factor (as a
function of
I
and
R
respectively) when using the central and the upwind discretization.
7. Use Questions 5 and 6 (remember that k = 0.01 and N = 10) to determine for the
JOR method the values of the optimal and maximal relaxation factor when solving
the systems resulting from the discretization on the uniform grid with respectively
the upwind and central method. Do the same for the SOR method. Compare these
theoretical results with the numerical results from Question 2.
8. Consider the upwind discretization on the stretched grid. Use Question 6 (remember
that k = 0.01 and N = 10) and the numerical values of the eigenvalues
J
of the Jacobi
matrix, computed as a byproduct by cfd 3 in Question 4, to determine for the JOR
method the theoretical values of the optimal and maximal relaxation factor. Do the
same for the SOR method. Compare these theoretical results with the numerical results
for the upwind discretization on the stretched grid from Question 4.
Why is it dicult to compute the theoretical optimal and maximal relaxation factor
when solving the systems resulting from a discretization on the stretched grid with a
central A or central B method?
B.4 Exercise 4 Time integration
Description
Consider the heat equation
T
t
=

2
T
x
2
, 0 x 1, 0 t 4,
with boundary conditions
T(0, t) = 0 and
T
x
(1, t) = 0,
and initial condition
T(x, 0) = x.
This equation is solved with a nite-dierence method on a grid with N grid points (N = 10
or 20). The Neumann condition is discretized with a mirror point. The quantity T(1, t) is
monitored. As time-integration method the generalized Crank-Nicolson method is used. The
discretized heat equation reads
T
n+1
j
T
n
j
t
= (1 )
T
n
j+1
2T
n
j
+ T
n
j1
h
2
+
T
n+1
j+1
2T
n+1
j
+ T
n+1
j1
h
2
.
The simulation program is available as Matlab le cfd 4.m.
108 APPENDIX B. COMPUTER EXERCISES
Required les
This exercise requires the le cfd 4.m.
Typing the command cfd 4 in Matlab asks for the input of the required parameters for
this exercise: N, (omega) and t.
Questions to be solved on the computer
1) First consider the fully explicit method ( = 0). Vary the number of grid points as
N = 10 and N = 20. Solve the heat equation for various time steps, as indicated in
the table below. Monitor whether the time integration is stable. In Question 4 you are
asked to explain the stability limit on the time step.
time step 0.001 0.00125 0.00126 0.0025 0.005 0.0051 0.01
stable? stable? stable? stable? stable? stable? stable?
N=10
N=20
2) Next, use the Crank-Nicolson method ( = 0.5) and the generalized Crank-Nicolson
method with = 0.6. Use N = 10. Set the time step t at 0.05 and 0.5; see the table
below. For the larger time step the solution shows clear oscillations. Make a rough
estimate for the damping factor (dened as the quotient of two successive amplitudes)
of the oscillations.
time step t = 0.05 t = 0.5
stable? stable? damping
= 0.5
= 0.6
3) Finally, again for N = 10, investigate the fully implicit method ( = 1). Use the same
time steps as in Question 2. Observe whether or not the solution shows oscillations.
time step t = 0.05 t = 0.5
stable? oscillations? stable? oscillations?
= 1.0
Questions to be solved by pencil-and-paper
4) First consider the fully explicit method ( = 0). Carry out a Fourier analysis of this
method. Determine the maximum allowable time step for N = 10 and N = 20. Compare
these stability limits with the empirical observations in Question 1.
5) Carry out a Fourier stability analysis of the generalized Crank-Nicolson method, and
determine the amplication factor. Show that the generalized Crank-Nicolson method
is unconditionally stable for 0.5. Investigate how the amplication factor behaves
B.5. EXERCISE 5 NAVIER-STOKES SOLVER 109
when t . Now explain the oscillations visible in Question 2. How are these
oscillations inuenced when is increased from 0.5 to 0.6? Give a possible explanation
why the observed amplication factors in Question 2 are somewhat dierent from the
theoretical amplication factors computed in this Question.
6) Derive theoretically for which values of the Crank-Nicolson parameter the solution is
wiggle-free. As a special case, explain why the fully implicit method ( = 1) does not
show oscillations (see Question 3). Hint: Use the concept of a positive operator.
B.5 Exercise 5 Navier-Stokes solver
General description
After semi-discretization with an explicit time-discretization method with two time levels, the
Navier-Stokes equations can be written as
div u
n+1
= 0,
u
n+1
u
n
t
+ grad p
n+1
= R
n
,
in which R = (u.grad)u + div grad u consists of the convection and diusion terms.
Rewriting and combining these two equations gives
div grad p
n+1
= div (
u
n
t
+R
n
), (1a)
u
n+1
= u
n
+ t R
n
t grad p
n+1
. (1b)
The fortran program cfd 5.f solves the Navier-Stokes equations.
Files and commands
This exercise requires the les cfd 5.f, cfd.in, liqdmenu.m, liqdplot.m, liqprint.m,
xplot.m.
The program cfd 5.f has to be compiled with the command gfortran -o cfd 5 -O
cfd 5.f (any other Fortran compiler, e.g. ifort, will also do). Then, the program can be
run with the command ./cfd 5. This program needs the input le cfd.in, this le has to be
adjusted to perform the dierent computations. The input le, with the parameter setting of
Question 0, is included at the end of this exercise. At the end of the input le an explanation
of the dierent parameters is given.
The program writes output both to the screen and to les. The output to the screen rst
gives the values of the parameters describing the problem, and then gives each (user specied)
time interval the time, div u, the number of Poisson iterations and the horizontal velocities
at three positions at the vertical center line of the domain (at the bottom, halfway, and at the
top). Furthermore, output is written to the les uvpf#.dat and config.dat. The output
le config.dat contains a description of the grid. The output le uvpf#.dat contains the
horizontal and vertical velocity and pressure in each grid cell at a certain time. In the input
le the user can specify whether the le uvpf#.dat is made each (user specied) time interval
110 APPENDIX B. COMPUTER EXERCISES
or only at the end of the computation.
The output les uvpf#.dat and config.dat are needed for the post-processing in Matlab.
Typing the command liqdmenu in Matlab starts a menu with which the post-processing can
be controlled. With the upper part of the menu surface or contour plots of the (dierent)
velocities, pressure, vorticity or streamfunction can be made and with the lower part of the
menu a movie of these plots at consecutive time steps can be made. With the middle part of
the menu plots of the (dierent) velocities or the pressure along horizontal or vertical sections
of the domain can be made.
Part I: Treatment of div u
n
Description
The term div u
n
= 0 in the semi-discretized Navier-Stokes equations can be treated in two
ways. The rst way is to maintain this term in the equations. In this case equations (1a) and
(1b) have to be solved. However, when the Poisson equation is solved exactly, div u
n+1
= 0.
Therefore, the second way is to substitute this in the right-hand side of equation (1a) in the
next time step (i.e. substitute div u
n
= 0). In this case the following equations have to be
solved
div grad p
n+1
= div R
n
, (2a)
u
n+1
= u
n
+ t R
n
t grad p
n+1
. (2b)
Consider the lid-driven cavity problem; the ow in a square cavity with constantly moving
lid. This problem is a well known test case for numerical methods for solving the Navier-
Stokes equations. The domain and boundary conditions of this problem are shown in the
gure below. We will solve the lid-driven cavity problem with = 0.01.
u = 1 v = 0
u = v = 0
u = v = 0 u = v = 0
0
1
1
Parameter setting in the input le
Since we solve the lid-driven cavity problem with = 0.01, set Nu=0.01 in the input le. Use
a stretched grid with 16 cells in each direction, i.e. set iMaxUs=jMaxUs=18. Take smaller cells
at the boundaries of the cavity, set xpos=ypos=0.5 and stretching parameters cx=cy=-0.5.
Discretize the convection terms with a central method, i.e. set Alpha=0.0.
Since the velocity at the top is prescribed, set top=8, Uin=1.0 and Vin=0.0 in the in-
put le. Furthermore, since at the other boundaries we have no-slip conditions, set left=2,
B.5. EXERCISE 5 NAVIER-STOKES SOLVER 111
right=2 and bottom=2.
Since the program was originally developed to compute non-stationary ows, it does not
contain a stopping criterion which checks whether a stationary solution is reached or not.
Instead, the program stops when the simulation time is equal to a user prescribed time (TFin),
take TFin=25. Set the time step at DelT=0.025 and the maximal allowed CFL number at
CFLMax=0.5. The program automatically adjusts the time step such that the CFL number is
between 0.4*CFLMax and CFLMax. In each time step the Poisson equation is solved with
MILU. Use in the input le PrtDt=1 and uvp=0, i.e. every second output is written to the
screen and the velocity eld is written to the le uvpf0001.dat at the end of the simulation.
Question 0: exact solution
First the exact solution is computed, i.e. the discrete steady solution on the given grid.
Hereto set in the input le Divuv=1 (i.e. retain the term div u
n
in the Poisson equation),
StrtP=1 (i.e. use the previously found pressure as initial guess for the iterations in the new
time step) and = 10
3
. Note that the solution has converged in time, and write the results
at t = 25 in the table below.
time div u # it. u bottom u mid u top
25
Questions without div u
n
First, substitute div u
n
= 0 in the Poisson equation (i.e. set Divuv=0 in the input le).
Hence, solve the Navier-Stokes equations in the form (2a) and (2b). In each of the following
questions, put the output of the program at t = 20, 21, . . . , 25 in a table of the format given
below.
time div u # it. u bottom u mid u top
20
21
22
23
24
25
1) Use for the Poisson solver an accuracy = 10
1
and use as initial solution for the
Poisson solver p = 0, i.e. start the Poisson solver from scratch.
a) Look what happens with the term div u in time. Furthermore, make a plot of
the solution; e.g. use the post-processing menu in Matlab to view the ow, use the
upper part of the menu to make a surface plot of the streamfunction. Also have
a look at the absolute velocity (crange [0, 0.1]) and the vertical velocity. Repeat
the simulation with TFin=100. Does the velocity eld converge?
112 APPENDIX B. COMPUTER EXERCISES
b) Now we will consider what happens with the divergence when t 0: will this
improve the solution? Set (temporarily) DelT=0.0025 and CFLMax=0.05 in the
input le. Repeat the simulation (with TFin=25). Look what happens with the
term div u in time. Compare this with the behaviour of div u in Question 1a.
Explain the results.
2) Use for the Poisson solver an accuracy = 10
3
, and use as initial solution for the
Poisson solver p = 0, i.e. start the Poisson solver from scratch. Look what happens
with the term div u in time. Furthermore, make various plots of the solution as in the
previous question. The solution has improved, but is it really accurate?
3) Use for the Poisson solver an accuracy = 10
3
, and use as initial solution for the
Poisson solver the solution from the previous time step. Look once more what happens
with the term div u in time. Are you satised now?
4) Use for the Poisson solver an accuracy = 10
1
, and use as initial solution for the
Poisson solver the solution from the previous time step. Once again, describe the
behaviour of div u in time.
Questions with div u
n
Next, retain the term div u
n
in the Poisson equation (i.e. set Divuv=1 in the input le).
Hence, solve the Navier-Stokes equations in the form (1a) and (1b).
5) Use for the Poisson solver an accuracy = 10
1
and use as initial solution for the
Poisson solver p = 0, i.e. start the Poisson solver from scratch.
a) Look what happens with the term div u in time. How do you like the solution?
b) Now we will consider what happens with the divergence when we let t 0.
Set (temporarily) DelT=0.0025 and CFLMax=0.05 in the input le. Repeat the
simulation. Look what happens with the term div u in time. Compare the results
with those from Question 5a, and explain the dierences.
6) Use for the Poisson solver an accuracy = 10
3
, and use as initial solution for the
Poisson solver p = 0, i.e. start the Poisson solver from scratch (set StrtP=0 in the input
le). Look what happens with the term div u in time. Compare the results with those
from Question 5a, and explain the dierences.
7) Use for the Poisson solver an accuracy = 10
3
, and use as initial solution for the
Poisson solver the solution from the previous time step (i.e. set StrtP=1 in the input
le). Monitor div u in time, and make plots of the solution. Explain the results.
8) Use for the Poisson solver an accuracy = 10
1
, and use as initial solution for the
Poisson solver the solution from the previous time step. Monitor div u and plot the
solution. How do you like the results?
Summary We have seen that the various approaches give quite dierent results. In the last
question of this part you will have to decide which approaches give acceptable results.
B.5. EXERCISE 5 NAVIER-STOKES SOLVER 113
9) In practical applications one is often satised when the nal solution has an accuracy
of two digits. Keeping this in mind, compare the results from the Questions 1 to 8 and
give your opinion about which approaches give acceptable results?
Part II: Inuence of boundary conditions
Description
We will now consider the choice of boundary conditions at in- and outow openings. The
inow boundary usually does not lead to too many problems. However, the outow boundary
is much more problematic. When at an outow boundary the normal velocity is prescribed
then a boundary layer may be created.
Consider the ow in a channel of length 10 and height 1. At the left (inow) boundary
the uid ows into the channel with a horizontal velocity u = 1. At the upper and lower
boundary of the channel we impose no-slip conditions. The geometry and (part of) the
boundary conditions are given in the gure below.
u = 1
v = 0
u = v = 0
u = v = 0

We will use two types of boundary conditions at the right (outow) boundary of the
channel. Firstly, we will prescribe a horizontal velocity u = 1 at the right (outow) boundary
of the channel as well. Secondly, we will allow a free outow, obtained by setting the pressure
at 0, at the right (outow) boundary. We will consider the inuence of these boundary
conditions on the solution.
Parameter setting in the input le
Use a grid without stretching with 32 cells in x-direction and 17 cells in y-direction, i.e. use
iMaxUs=34 and jMaxUs=19 and cx=cy=0.0 in the input le. Note that the length of the
channel is 10, i.e. Xmax=10. Discretize the convection terms with a central method, i.e. set
Alpha=0.0.
At the left (inow) boundary the velocity is prescribed, hence set left=8, Uin=1, and
Vin=0. Furthermore, at the upper and lower boundary no-slip conditions are imposed, i.e.
set top=2 and bottom=2.
Maintain the term div u
n
in the Poisson equation (i.e. solve the Navier-Stokes equations
in the form (1a) and (1b), set Divuv=1 in the input le). Solve the Poisson equation with an
accuracy = 10
4
. The Poisson equation is solved with MILU. Use as initial solution for the
Poisson solver the solution from the previous time step (i.e. set StrtP=1).
Simulate the ow in the channel for 15 seconds, that is set TFin=15 in the input le. Set
the time step at DelT=0.025 and the maximal allowed CFL number at CFLMax=0.1. Use in
114 APPENDIX B. COMPUTER EXERCISES
the input le PrtDt=1 and uvp=1, i.e. every second of the simulation output is written to the
screen and every second of the simulation the velocity eld is written to a le uvpf#.dat (be
aware: this takes a lot of memory).
In every question below, plot the ow at the rst ve seconds of the simulation and
at the end of the simulation, i.e. at t = 1, 2, . . . , 5 and t = 15. Use the post-processing
menu in Matlab to plot the ow. Use the upper part of the menu to make a surface plot
of the absolute velocity. Furthermore, use the middle part of the menu to make a plot of
the horizontal velocity along the horizontal center line (i.e. j-plane=10). By using the hold
button in the menu the plots of the horizontal velocity along the horizontal center line at
t = 1, 2, . . . , 5 and t = 15 can be put in one gure. A boundary layer and irregularities of the
ow can easily be seen in the second plot.
Questions with prescribed outow
Firstly, prescribe a horizontal velocity at the right (outow) boundary of the channel as well:
u = 1 and v = 0 (i.e. set right=8 in the input le).
10) Simulate the ow for = 0.01. Make plots of the ow as described above. Describe and
explain the development in time of the horizontal velocity along the horizontal center
line.
11) Simulate the ow for = 0.005. Make plots of the ow as described above. Compare
the ow with the one computed in Question 10, and explain the dierences.
12) Simulate the ow for = 0.001. Make plots of the ow as described above. Com-
pare the ow with those computed in Question 10 and 11, and explain the dierences.
Furthermore, make a surface plot of the absolute velocity in which the vector plot is
included (select in the menu arrows automatic instead of no velocity vectors),
and zoom rst in on the x-interval [0,1] and then on the x-interval [9,10] (i.e. take
manual x-axis instead of automatic zoom and select the interval). Furthermore,
make a plot of the horizontal velocity at the vertical section at the i-plane 32. What
happens with the velocity at the upper and lower boundary?
Questions with free outow
Secondly, allow at the right boundary of the channel a free outow condition (i.e. set right=7
in the input le).
13) Simulate the ow for = 0.01. Make plots of the ow as described above. Compare
the ow with the one computed in Question 10, and explain the dierences. What is
the limit value of the horizontal velocity at the center line y = 0.5.
When the ow is fully developed the (horizontal) velocity prole is a parabola. Compute
this parabola theoretically. What is the theoretical value of the horizontal velocity of the
fully developed ow at the center line y = 0.5. Compare this result with the numerical
value. Also make a cross sectional plot of the horizontal velocity near the end of the
channel to check the parabolic prole.
14) Simulate the ow for = 0.005. Make plots of the ow as described above. Compare
the ow with those computed in Question 11 and 13, and explain the dierences. What
B.5. EXERCISE 5 NAVIER-STOKES SOLVER 115
is the limit value of the horizontal velocity at the center line y = 0.5. Compare this
numerical value with the theoretical value computed in Question 13.
15) Simulate the ow for = 0.001. Make plots of the ow as described above. Compare
the ow with those computed in Question 12, 13 and 14 and explain the dierences.
What is the value of the horizontal velocity at the center line y = 0.5 at the end of the
channel. Explain why this numerical value of the horizontal velocity at the center line
y = 0.5 diers from the theoretical value computed in Question 13. Also make a cross
sectional plot of the horizontal velocity near the end of the channel to see the shape of
the velocity prole: is it a parabola?
Repeat the simulation with a channel of respectively length 20 and length 50 (set rst
Xmax=20 and then Xmax=50), use TFin=50 in order to reach a steady-state solution; also
increase Imax (although it has little inuence). Set uvp=0 in order to save memory. Make
only at the end of the simulation (i.e. at t = 50) a plot of the horizontal velocity along
the horizontal center line (i.e. j-plane=10). What is the limit value of the horizontal
velocity at the center line y = 0.5. Again make a cross sectional plot of the horizontal
velocity near the end of the channel to see the shape of the velocity prole: is it a
parabola now? Find a physical explanation of the results.
Example input le
***** tank geometry *************************************************
Xmin Xmax Ymin Ymax
0.0 1.0 0.0 1.0
***** grid definition ***********************************************
iMaxUs jMaxUs cx cy xpos ypos
18 18 -0.5 -0.5 0.5 0.5
***** liquid properties *********************************************
Nu
0.01
***** boundary conditions and inflow characteristics ****************
left right top bottom UIn VIn
2 2 8 2 1.0 0.0
***** discretization ************************************************
Alpha Divuv
0.0 1
***** poisson iteration parameters **********************************
Epsi ItMax StrtP
1.0e-4 100 1
***** time step ****************************************************
TFin DelT CFLMax
25 0.025 0.5
***** print/plot control ********************************************
116 APPENDIX B. COMPUTER EXERCISES
PrtDt uvp
1.0 0
---------------------------------------------------------------------
***** E X P L A N A T I O N ************* E X P L A N A T I O N *****
---------------------------------------------------------------------
**TANK GEOMETRY**
Xmin, Xmax, Ymin, Ymax : position of boundaries of computational domain
**GRID DEFINITION**
iMaxUs (<=130), jMaxUs (<=130) : number of cells including mirror cells,
the number of real cells is iMaxUs-2, jMaxus-2
cx, cy : stretchparameters - 0=no stretch;
>0=smaller cells near position
indicated by xpos,ypos;
<0=smaller cells away from xpos,ypos
**LIQUID PROPERTIES**
Nu : kinematic viscosity
**BOUNDARY CONDITIONS AND INFLOW CHARACTERISTICS**
left,right,top,bottom : type of boundary condition
1=slip
2=no-slip
7=free outflow : as boundary condition the pressure
is set at 0
8=inflow : the velocities are prescribed
UIn,VIn : in case of inflow conditions, prescribed velocities
the sign of UIn/VIn corresponds to the x/y-direction (hence it
does not necessarily correspond to the inward pointing direction)
**DISCRETIZATION**
Alpha : upwind parameter, discretization of convection term
0 = central
1 = upwind
Divuv : treatment of divergence
0 = substitute div u^n=0 in Poisson equation
1 = maintain div u^n in Poisson equation
**POISSON ITERATION PARAMETERS**
Epsi : convergence criterion of Poisson solver
ItMax : maximal allowed number of iterations of Poisson solver
Strtp : initial field of Poisson solver
0 = zero field p=0
1 = solution from previous time step, p=poud;
**TIME STEP**
TFin : endtime of simulation
DelT : timestep (is adjusted during the simulation in order to
keep the CFL number smaller than CFLMax)
CFLMax : maximum allowed CFL number
B.5. EXERCISE 5 NAVIER-STOKES SOLVER 117
** PRINT/PLOT CONTROL**
PrtDt : time between 2 small printouts (to the screen and a file)
uvp : velocity and pressure in Matlab format
0=only at end of computation (preferable)
1=at every small printout (takes a lot of memory)

Anda mungkin juga menyukai