You are on page 1of 15

1

Queensland University of Technology


CRICOS No. 00213J
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
MODULE 3 - FVM for
Advection-Diffusion Equations
The treatment of advection and the inclusion of these
schemes within the framework of the FVM
Monotonicity arguments, TVD schemes, upstream
averaging, other averaging methods
A brief discussion of flux limiting
Invited Lecture Series presented at the APAC / ICE-EM / AMSI Summer School held at the
Australian National University, Canberra, January 2004. Copyright 2004 by Ian Turner
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Overview of Module
The Generalised Transport Equation
One-Dimensional FVM
Flux Limiting
Summary of FVEs
Monotonicity Constraints
Case Studies
2
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Recall the one-dimensional constant parameter case of the
generalised transport equation, stated as follows:
( )
( )
( )
( )



| |
|
|
\ .

| |
|

|
\ .

+

= >

= >

=
= < < >
=
=
< <

0
, 0 (2 )
, 0 (2 )
:
,0 ,
, 0 , 0 (1)
:
0
0 (2 )
x xx u
x xx
x xx
V D
t x x
V D k t a
x
V D k t b
x
and initially
x x
S x L t
Subject to
at x
at x L
x L c
J
and assumed constant
x xx
V D
3.1 Generalised Transport Equation
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Following Module 2, recall the following diagram:
where the point of interest P is surrounded by its neighbours W(est)
and E(ast). The dashed lines, denoted by w and e represent control
volume (CV) faces.
P
x
p

E W
x
e
x
w

Control Volume
w e
3.2 One-dimensional FVM
3
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
As discussed in Module 2, the Finite Volume discretisation process
proceeds by integrating equation (1) across the CV:
The focus of this lecture is the treatment of the advection term at the
CV face.
( )



+ =


+ =


= =

1 1
1
0 (3)
Define cell averages
and
then (3) becomes
(4)
where and represent the transportfluxes
evaluated at the east and west faces respectivel
x
e
u
x
w
x x
e e
u
x x p p
w w
e w
p
e w
x x
d
J J
dt x
J
S dx
t x
dx S S dx
S
J J
CV y
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
It should be noted that this term is a flow term and it must be
treated differently from the diffusion term discussed in Module 2.
The physics is entirely different in that the quantity is advected
according to a fluid/phase velocity.
In what follows we assume that so that the flow is
moving from left to right and we focus on the east CV face.
Clearly the same ideas can be used for the west CV face.
1. Approximation of Advection term

x
e

x
e

+
x
e

x
e
x
V
> 0
x
V
The first thought is to take an average of the values of at P and E.
East Face

(i) Averaging Technique

x
V
4
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
To see this we use Taylor Series expansions as follows:
( )
( )
( )





+
+ + +
+
+ + +


| | | |
| |
+ = + + + +
| | |
\ .
\ . \ .
| |
+ < <
|
\ .
| | | |
| |
= + +
| | |
\ .
\ . \ .
2 3
2 3
2 3
4 5
4 5
4 5
2 3
2 3
2 3
1 1
2 6
1 1
, (5 )
24 120
1 1
2 6
e e e e e e E
e
e e
e e e e e E
e
e e e e e e P
e
e e
d d d
x x x x x
dx dx dx
d d
x x x x a
dx dx
d d d
x x x x x
dx dx dx
( )


| |
< <
|
\ .
4 5
4 5
4 5
1 1
, (5 )
24 120
e e p e e e
e
d d
x x x x b
dx dx
x
e

x
e

+
x
e

x
e
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Recall the Taylor series expansions about the east CV face
location and use to obtain:
( )
+ 1 (5 ) (5 )
e e
a b
( )
( )
+ = +
2
1 (6 )
e e e e P E
O x a
( )
( )
+ = +
2 1
(6 )
2
e e P E
O x b
Cell Centred
Vertex Centred
Although second order accurate this averaging scheme can not
guarantee oscillation free, physically meaningful solutions. One way
to understand why is to argue that if the flow is moving very fast from
left to right then how is it possible for the value at the downstream
point to have any influence on the CV face value ? We will
analyse this approximation with more rigour later in this module.

E

e
5
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
c
e
n
tr
a
tio
n
Front location is
however reasonably
accurate
Oscillations in solution - non-
physical behaviour
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
c
e
n
tr
a
tio
n
Must use a very fine mesh
to produce an oscillation
free solution - unpractical
Averaging Technique
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
(ii) Upstream/Upwind Technique

=
=
>0
x e
P
e
E
if V then
else
This scheme does make sense physically given our previous argument. It also
guarantees physically meaningful, oscillation free solutions, however its
accuracy generally smears any steep fronts occurring in the solution substantially.
Note however that the fronts always appear in the correct locations.
( )
O x
e
One way to overcome the problems associated with the averaging
technique is to supplement the true diffusion with numerical
diffusion (CFD - Roache, 1972) which leads to the concept of
upstream weighting
Artificial diffusion is introduced through the truncation error of the
one-sided differences (see Roache, 1972) - it is first order
accurate for uniform grids.
6
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
c
e
n
tr
a
tio
n
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
c
e
n
tr
a
tio
n
Upstream/Upwind
Technique
Even the use of a very fine
mesh cannot eliminate the
smearing entirely
Oscillation free solution,
however, excessive smearing of
the front is evident - i.e., profile is
too diffuse!
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
(iii) Hybrid Technique
Both of the techniques (i) and (ii) can be accommodated into the
following formulae:
( )
( )
( )

0 1
(7 )
2 1 2
up
up e dwn up
e
dwn
dwn e up dwn
if
a
if
( )

= +
2
0 2 (7 )
e up up
dwn
b
Cell Centred
Vertex Centred




= =
= =
> ,
,
0
x up
P dwn E
up
E dwn P
if V then
else
and in both cases the upstream and downstream points are
chosen according to the following test:
= = = 0 ; 1 ; 2 upstream averaging downstream
7
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
2. Treatment of Boundary Conditions
x
e

x
e
Consider the following Figure which shows a typical boundary
control volume BCV
Boundary face at x = 0
Boundary Control Volume
As in Module 2 we must account for three types of boundary conditions:
1. Dirichlet ( )
2. No flux (symmetry planes/adiabatic surfaces)
3. Flux specified (exchange surface of material)

p
specified
b
x
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
( )
( )

+ =

=

+ =


1
and this expression is substituted
directly into the above equation to
0
so that
where represents the transport flux evaluated at the boundary.
In our case (see 2a)
x
e
u
x
b
e b
b
b
b b
d
J J
dt x
k
J
S dx
t x
S
J
J
( )
( )

+ =

give:
1
( ) 8
e b
b
d
J k
dt x
S
We proceed as in Module 2 for an internal CV and integrate
from to
e
b
x x
The three types of boundary conditions are treated via the parameter k as follows:
1. Dirichlet - can set k very large in (8)
2. No flux - set k = 0
3. Flux specified - k given as required
8
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Flux limiting is a technique that is used for the treatment of the
advective term in order to produce oscillation free solutions without
the excessive diffusion offered by first order upstream weighting.
In this module we keep the discussion simple and concentrate more on
the implementation of flux limiting into our finite volume scheme. I refer
the interested student to the following references (and the plethora of
reference therein) for detailed discussions and analysis on stability and
convergence issues associated with the technique:
Blunt, M. and Rubin, B. (1992), Implicit flux limiting schemes for petroleum reservoir
simulation, Journal of computational physics, 102:194-210
LeVeque, R. (1990) Numerical methods for conservation laws. Birkhauser Verlag, Basel.
Sweby, P. (1984). High resolution schemes using flux limiters for hyperbolic conservation
laws. SIAM Journal of Numerical Analysis, 21(5):995-1011.
3.3 Flux Limiting
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Recall the hybrid technique (iii) discussed previously (equations 7),
where we paved the way for the introduction of a parameter into the
spatial weighting method. There we discussed the possibility of using
the parameter to utilise either upstream weighting or averaging in our
approximation.
Flux limiting simply allows (r) to vary according to an appropriately
defined sensor r. Here we take the sensor r as the ratio of the gradients
of at the so called second upstream face to the upstream face:

| |
|
\ .
| |
|
\ .
=
2up
up
d
dx
d
dx
r
9
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
For simplicity we will use the vertex centred finite volume
method to illustrate the underlying ideas of flux limiting and we
again assume that the flow is from left to right, with V
x
>0
East Face
p

x
V
W

WW

Upstream
point (Up)
Downstream
point (Dwn)
Second
Upstream
point (2up)
( )
( )
( )


=
= +
+
=
+
( ) ( ) ( ) ( )
( . . , !)
1
2
and we use the van Leer Limiter
n n n n
P W E P th
e
w e
e
e
P E P
i e defined at n time level otherwise nonlinear
x x
r
r r
r
r
r
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
West Face
( )
( )



=
= +
( ) ( ) ( ) ( )
( . . )
2
n n n n
W WW P W th
w
ww w
w
w
W P W
i e defined at n time level
x x
r
r
Conceptually, the spatial weighting schemes presented above
introduce numerical diffusion at points where the gradient is steep -
it is second order accurate away from such regions
Furthermore, the scheme has the property that it is total variation
diminishing (TVD), implying that the solution cannot contain
oscillations.
10
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
In order for a scheme to be TVD the following inequality must be
satisfied:
( ) ( )
( )


+
+ + +
+

1
1 1 1
1
where
n n
n n n
i i
i
TV TV
TV
It has been shown by Sweby (1984) that for a scheme to be TVD
the flux limiter function must lie in the shaded region below (for
uniform grid spacing) :
r
TVD Region for
uniform grid
spacing
( ) r
( ) 2 r r =
( ) r r =
( ) 1 r =
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
( ) r
( ) 2 r r =
( ) r r =
( ) 1 r =
For the scheme to be second order accurate spatially, the flux limiter
function must be made a weighted convex average of a centrally
weighted scheme and a two-point upstream weighted scheme
(Sweby, 1984)
The van Leer limiter fits perfectly into the shaded region above.
r
11
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
c
e
n
t
r
a
t
i
o
n
The van Leer flux limiter on a
coarse mesh produces an
oscillation free solution without
the excessive smearing of
first-order upstream weighting
Flux Limiting Technique
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
Summary of the One-Dimensional Finite
Volume Equations (FVEs)
Substitution of all approximations into (4), assuming
and using the vertex centred scheme, yields the following finite volume
equation for an interior CV:
( )
( )( ) ( )
( )
( )
( )
( )


+ +
+ +
(
(

(
+ + +

| |
| |
= +
|
|
\ .
\ .
| |
| |
= +
|
|
\ .
\ .
+
1 1
1 1
1 1
2
2
0 (9 )
where
n n n n
n n n n
p p p e w e w P
p
e E P
e x xx P E P
e
w P W
w x xx W P W
w
t
J J J J t
x
r
V D
x
r
V D
x
a
J
J
> = 0 ,
x u
V S
Interior FVE
12
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
( )
( )( ) ( )
( )
( )
( )



+ +
+ +
(
(

(
+ + +

| |
| |
= +
|
|
\ .
\ .
=

+
1 1
1 1
1 1
2
0 (9 )
where
n n n n
n n n n
p p p e w e w P
p
e E P
e x xx P E P
e
wb w w P
t
J J J J t
x
r
V D
x
k
b
J
J
West boundary FVE
( )
( )( ) ( )
( )
( )
( )


+ +
+ +
(
(

(
+ + +

=
| |
| |
= +
|
|
\ .
\ .
+
1 1
1 1
1 1
2
0 (9 )
where
n n n n
n n n n
p p p e w e w P
p
e e P eb
w P W
w x xx W P W
w
t
J J J J t
x
k
r
V D
x
c
J
J
East boundary FVE
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
( ) ( )
( )







| |
| +
|
\ .
( | | (
( | +

|
(
\ .

= = = =

= =
+
| |
= + + + +
|
\ .
= +
1 2 3 4
3 1 1
3
3 1
4 2 2
4 1
1 1
, , ,
1 ,
2 2
1 1
1 1
2
1
2 2
xx x xx x
p p p p
w e
i i
w e
w e
i
w e
n w e
i i
w e
tD tV tD tV
Define c c c c
x x x x
then
c c c
l c u
x x
d t c c
x x
and
c c c
b c
x x
( )
( )




(
+
(
+
( | | +
+
( |
\ . (

1
4 2
1 1
1 1 1
2
n
i
w e n
i
w e
t c c
x x
Coefficients for Interior nodes - Vertex Centred Case
(11)
13
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
1. Fully Implicit = 1 and Upstream Weighting = 0
Equation (11) shows that there are no monotonicity constraints
because all criteria are satisfied.
2. Crank Nicolson = and Upstream Weighting = 0
1
2


| |
> + + +
|

\ .
1 1 2
x xx
w e p p
V D
x x t x x
In this case equation (11) shows that it possible for the term
involving in to be negative. Consequently, there is a
monotonicity constraint for this combination of spatial and
temporal weighting that must be satisfied to ensure that the
solution is free of unwanted spurious oscillations:

n
i
i
b
Monotonicity Constraints
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
In this case equation (11) shows that it possible that the terms
involving in and can be negative. Consequently,
there are two monotonicity constraint for this combination of spatial
and temporal weighting that must be satisfied to ensure that the
solution in free of unwanted spurious oscillations:
3. Crank Nicolson = and Averaging = 1
1
2


| |
> + + <
|

\ .
1 1 2
and 2
xx x e
w e p xx
D V x
x x t x D

+1
and
n n
i i i
b
i
u
Some analysis from equation (11) shows that there are three
monotonicity constraints for this combination of spatial and
temporal weighting:
4. Crank Nicolson = and Flux Limiting
1
2
( )



+
| |
> + + + <
|

\ .
+
1 1 2
1 , 2 and 2
2
w e x xx x e e
w e
w e p p xx
V D V x
x x t x x D
14
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
t
a
m
in
a
n
t
C
o
n
c
e
n
tr
a
t
i
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
ta
m
i
n
a
n
t
C
o
n
c
e
n
t
r
a
ti
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
t
a
m
i
n
a
n
t
C
o
n
c
e
n
tr
a
t
i
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
ta
m
i
n
a
n
t

C
o
n
c
e
n
t
r
a
t
i
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
30 CVs dt = 0.05 sec t
final
= 2 sec
FI-UP
CN-UP
CN-AV CN-FL
Problem 3
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
ta
m
i
n
a
n
t
C
o
n
c
e
n
t
r
a
ti
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
40 CVs t = 0.05 sec t
final
= 2 sec
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
t
a
m
i
n
a
n
t
C
o
n
c
e
n
t
r
a
t
i
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
t
a
m
i
n
a
n
t
C
o
n
c
e
n
t
r
a
t
i
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
0.2
0.4
0.6
0.8
1
distance (m)
C
o
n
t
a
m
i
n
a
n
t
C
o
n
c
e
n
t
r
a
t
i
o
n
Bechmark Problem - 1-D Advection-Dispersion-Decay
t
1
t
2
t
3
t
4
t
5
t
6
t
7
FI-UP
CN-UP
CN-AV CN-FL
Problem 3
15
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

t
1
t
2
t
3
t
4
t
5
t
6
t
7
25 CVs t = 0.05 sec t
final
= 1.2 sec
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

Bechmark Problem 4 - Diffusion/Advecti on


t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

Bechmark Problem 4 - Diffusion/Advection


t
1
t
2
t
3
t
4
t
5
t
6
t
7
FI-UP CN-UP
CN-AV CN-FL
Problem 4
CRICOS No. 00213J
a university for the
world real
R
APAC / ICE-EM / AMSI SUMMER SCHOOL 2005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9

t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

t
1
t
2
t
3
t
4
t
5
t
6
t
7
30 CVs t = 0.05 sec t
final
= 1.2 sec
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

Bechmark Problem 4 - Diffusion/Advecti on


t
1
t
2
t
3
t
4
t
5
t
6
t
7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
distance (m)

Bechmark Problem 4 - Diffusi on/Advection


t
1
t
2
t
3
t
4
t
5
t
6
t
7
FI-UP CN-UP
CN-AV CN-FL
Problem 4

You might also like