You are on page 1of 40

Chapter 5

The Finite Volume Method for


Convection-Diffusion Problems

Prepared by: Prof. Dr. I. Sezai


Eastern Mediterranean University
Mechanical Engineering Department

Introduction
The steady convection-diffusion equation is

div( u ) = div(grad ) + S

Integration over the control volume gives :

n ( u)dA = n (grad )dA + S dV


A

CV

This equation represents the flux balance in a control volume.


The main problem in the discretisation of the convective terms is the
calculation of at CV faces and its convective flux across these
boundaries.
Diffusion process affects the distribution of in all directions.
Convection spreads influence only in the flow direction. This sets a
limit on the grid size for stable convection-diffusion calculations with
central difference method.
ME555 : Computational Fluid Dynamics

I. Sezai - Eastern Mediterranean University

Steady one-dimensional convection and diffusion


In the absence of sources, the steady convection and diffusion of a
property in a given one-dimensional flow field u is governed by
d
d
d
( u ) = ( )
dx
dx dx

(5.3)

The flow must also satisfy continuity, so


d
( u) = 0
dx

Integrating Eqn. (5.3) over the CV



( uA )e ( uA ) w = A A
x

x w

(5.5)

Integrating continuity Eqn.


( uA)e ( uA) w = 0
ME555 : Computational Fluid Dynamics

(5.6)
3

I. Sezai - Eastern Mediterranean University

Let F = uA convective mass flux


at cell faces
D = A/x diffusion conductance
At cell faces:
Fw = ( uA) w
Fe = ( uA)e
Dw =

w Aw
xWP

De =

e Ae
xPE

Using central difference approach for the diffusion terms, Eqn (5.5)
becomes
Fee Fww = De (E P ) Dw (P W )

(5.9)

C i i equation
Continuity
i becomes
b
Fe Fw = 0

We assume that velocity field is known Fe, Fw known.


We need to calculate at faces e and w.
ME555 : Computational Fluid Dynamics

(5.10)

I. Sezai - Eastern Mediterranean University

The Central Differencing Scheme


Works well for diffusion terms.
Let us use this method to compute the convective terms by
linear interpolation.
For a uniform grid, cell face values are:

e = (P + E ) / 2
w = (W + P ) / 2
Substituting into eqn (5.9)
Fe
F
(P + E ) w (W + P ) = De (E P ) Dw (P W )
2
2
ME555 : Computational Fluid Dynamics

I. Sezai - Eastern Mediterranean University

Rearranging,

Fw
Fe
Fw
Fe

Dw 2 + De + 2 P = Dw + 2 W + De 2 E

Fw
Fe
Fw
Fe

Dw + 2 + De 2 + ( Fe Fw ) P = Dw + 2 W + De 2 E

which is of the form


aPP = aW W + aEE

(5.14)

where
aW
Dw +

aE
Fw
2

De

aP
Fe
2

aW + aE + ( Fe Fw )

This equation has the same general form as the diffusion eqn. (4.11).
ME555 : Computational Fluid Dynamics

I. Sezai - Eastern Mediterranean University

Example 5.1
A property is transported by convection and diffusion through the
one dimensional domain shown below. Using central difference
scheme, find the distribution of for (L =1,
1, = 1, = 0.1)
(i) Case 1: u = 0.1 m/s (use 5 CVs)
(ii) Case 2: u = 2.5 m/s (use 5 CVs)
Compare the results with the analytical solution.

o exp( ux / ) 1
=
L o exp( uL / ) 1

(iii) Case 3: u = 2.5 m/s (20 CVs)

ME555 : Computational Fluid Dynamics

The governing equation is:


A
1

=1

I. Sezai - Eastern Mediterranean University

d
d d
( u ) =

dx
dx dx
4
w
e
5

x/2

B
7
=0

xWP= x xPE=x

x/2

aPP = aW W + aEE + Su
where

aP = aW + aE + ( Fe Fw ) S P
Fw = ( uA) w
Dw =

w Aw
xWP

Fe = ( uA)e
De =

For interior nodes: xWP = xPE = x


For node 2: xWP = x / 2
For node 6: xPE = x / 2

e Ae

xPE

Node
aW
aE
SP
Su
2
0
De Fe / 2 ( Dw + Fw / 2) ( Dw + Fw / 2) A
3, 4,5 Dw + Fw / 2 De Fe / 2
0
0
6
0
( De Fe / 2) ( De Fe / 2)B
Dw + Fw / 2
ME555 : Computational Fluid Dynamics

I. Sezai - Eastern Mediterranean University

The resulting system of equations are


aP2

aW3

aE 2
a p3

aE 3

aW4

a p4

aE 4
aWi

a pi

aE i
aWn2

a pn 2
aWn1


Su2
2

3
Su3

4 Su4

Su

i
i

Su

aE n 2 n 2
n2

a pn1 n 1 Sun 1

Solve the system of equations using Tri-diagonal matrix algorithm


(TDMA) for 2, 3, 4, n-1 , where (n = 7)
ME555 : Computational Fluid Dynamics

I. Sezai - Eastern Mediterranean University

The solution for case 1 is:


1 1
0.9421
2

3 0.8006

4 = 0.6276
5 0.4163

6 0.1573
0

Exact solution is:

( x) =

2.7183 exp( x)
1.7183

ME555 : Computational Fluid Dynamics

Comparison of the numerical result with the


analytical solution.
10

I. Sezai - Eastern Mediterranean University

The solution for case 2: (u = 2.5 m/s, 5 CVs)

Comparison of the numerical result with the analytical solution.

The solution appears to oscillate about the exact solution.


ME555 : Computational Fluid Dynamics

11

I. Sezai - Eastern Mediterranean University

The solution for case 3: (u = 2.5 m/s, 20 CVs)

Comparison of the numerical result with the analytical solution.

Grid refinement has reduced the F/D ratio from 5 to 1.25.


Central difference scheme yields accurate results when F/D ratio is low.
ME555 : Computational Fluid Dynamics

12

I. Sezai - Eastern Mediterranean University

Properties of Discretisation Schemes


The numerical results will only be physically
realistic when the discretisation scheme has certain
fundamental properties. The most important ones
are:
Conservativeness
Boundednes
Transportiveness

ME555 : Computational Fluid Dynamics

13

I. Sezai - Eastern Mediterranean University

1. Conservativeness
To ensure conservation of for the whole solution
domain the flux of leaving a CV across a certain
face must be equal to the flux of entering the
face
adjacent CV through the same face.
To achieve this the flux through a common face
must be represented in a consistent manner (by one
and the same expression) in adjacent CVs.

ME555 : Computational Fluid Dynamics

14

I. Sezai - Eastern Mediterranean University

Example of consistent specification of diffusive fluxes

w 2 (2 1 )
x

Flux entering CV 2

e 2 (3 2 )
x

Flux leaving CV 2

An overall flux balance may be obtained by summing the net flux through each CV
(3 2 )
(2 1 )
(2 1 )

e1 x q A + e 2 x w 2 x

(4 3 )
(3 2 )
(4 3 )

+ e3
w3
+ q w4
= q q
x
x B
x B A

e1 = w2, e2 = w3 and e3 = w4 Fluxes across CV faces are


expressed in consistent manner,
fluxes cancel out in pairs when summed over the entire domain.
ME555 : Computational Fluid Dynamics

15

I. Sezai - Eastern Mediterranean University

Flux Consistency ensures conservation of over the entire domain


for the central difference formulation of the diffusive flux.
Inconsistent flux interpolation formulae give rise to unsuitable
schemes that do not satisfy overall conservation.

For nodes 1, 2 and 3 quadratic function 1 is used.


For nodes 2, 3 and 4 quadratic function 2 is used.
If gradient of 1 gradient of 2 at cell face flux leaving CV 2 will
not be equal to flux entering CV 3
overall conservation is not satisfied.
ME555 : Computational Fluid Dynamics

16

I. Sezai - Eastern Mediterranean University

2) Boundedness
The sufficient condition for a convergent iterative method is

nb

aP

1 at all nodes

< 1 at one node at least

aP = aP S p

(5.22)

If eqn. (5.22) is satisfied, resulting matrix coefficients are diagonally


dominant.
For diagonal dominance, (aP Sp) should be large and Sp < 0.
Diagonal dominance is a desirable feature for satisfying the boundedness
criterion.
This states that in the absence of sources the internal nodal values of
should be bounded by its boundary values.
In a steady conduction problem without sources for which the boundary
temperatures are 200 and 500 oC, all interior values of T should be between
these temperatures.
ME555 : Computational Fluid Dynamics

17

I. Sezai - Eastern Mediterranean University

Another essential requirement for boundedness is that all coefficients


of the discretised equations should have the same sign.
If the discretisation scheme does not satisfy the boundedness criteria
the solution may not converge at all.
all Or if it converges it will contain
wiggles. (See case 2 of Example 5.1). In case 2 most of the aE values
were negative (Table 5.3).
Table 5.3
Node
2
3
4
5
6

aE = De

Fe e Ae ue Ae
=

2 xPE
2

ME555 : Computational Fluid Dynamics

18

I. Sezai - Eastern Mediterranean University

3) Transportiveness
The transportiveness property of a fluid flow can be illustrated by
considering a constant source of at a point P
u
F
cell Peclet number
Pe = =
D / x

Distribution of in the vicinity


of a source at different Peclet
numbers.

Lines represent contours of constant .


For no convection and pure diffusion Pe = 0
For no diffusion and pure convection Pe , E = P E is
influenced only by P.
ME555 : Computational Fluid Dynamics

19

I. Sezai - Eastern Mediterranean University

Assesment of the Central Differencing Scheme for Convection


Diffusion Problems

Conservativeness
The central differencing scheme uses
consistent expressions to evaluate convective
and diffusive fluxes at the CV faces.
The scheme is conservative.

ME555 : Computational Fluid Dynamics

20

I. Sezai - Eastern Mediterranean University

10

Boundedness
(i) The internal coefficients of discretised scalar transport equation
(5.14) are
aW
Dw +

aE
Fw
2

De

aP
Fe
2

aW + aE + ( Fe Fw )

(Fe Fw) = 0 from continuity aP = aW + aE


Thus, convergence criteria (5.22) is satisfied by the central difference
scheme
scheme.
In the example of section 5.3:
For case 2: Pe = 5 oscillatory
For case 1 and 3: Pe < 2
ME555 : Computational Fluid Dynamics

21

I. Sezai - Eastern Mediterranean University

(ii) aE = De Fe/2

For aE > 0
or

Fe
< De
2

Fe
= Pee < 2
De

to have positive aE .

If Pe > 2 CD scheme violates boundedness


gives physically unrealistic solutions.

ME555 : Computational Fluid Dynamics

22

I. Sezai - Eastern Mediterranean University

11

Transportiveness
The CD scheme does not recognise the direction of the
flow or the strength of convection relative to diffusion.
Thus it does not posses the transportiveness property at
Thus,
high Pe.
Accuracy
The CD scheme is stable and accurate only if Pe = F/D <
2.
The CD scheme satisfies this criteria for low Re numbers
or for small grid spacings.
Thus, CD scheme is not a suitable discretisation practice
for general purpose flow calculations.
ME555 : Computational Fluid Dynamics

23

I. Sezai - Eastern Mediterranean University

5.6 The upwind differencing scheme


The scheme takes into account the flow direction, at cell face = at upstream
node formulation is used

When the flow is in the positive direction, uw>0, ue>0 (Fw>0, Fe>0), the
upwind scheme sets w = W and e = P
(5.25)
ME555 : Computational Fluid Dynamics

24

I. Sezai - Eastern Mediterranean University

12

The discretised equation (5.9) becomes


FeP Fww = De (E P ) Dw (P W )

(5.26)

Which can be rearranged as


( Dw + De + Fe ) P = ( Dw + Fw ) W + DeE
to give
( Dw + Fw ) + De + ( Fe Fw ) P = ( Dw + Fw ) W + DeE
(5.27)
When the flow is in the negative direction, uw<0, ue<0 (Fw<0, Fe<0), the
scheme takes
w = P and e = E
(5.28)
Now the discretised euqation is
(5.29)
FeE FwP = De (E P ) Dw (P W )
or

Dw + ( De Fe ) + ( Fe Fw ) P = DwW + ( De Fe )E
ME555 : Computational Fluid Dynamics

25

(5.30)

I. Sezai - Eastern Mediterranean University

the equations (5.27) and (5.30) can be written in the usual general
form

aPP = aW W + aEE

(5.31)

with central coefficient

aP = aW + aE + ( Fe Fw )
and neighbour coeffcients
aw

ae

Fw>0, Fe>0
Dw + Fw
De
Fw<0,
Dw
De - Fe
<0 Fe<0
A form of notation for neighbour coefficients of the upwind
differencing method that covers both flow directions is:

ae

aw
Dw + max(Fw,0)
ME555 : Computational Fluid Dynamics

26

De + max(0, Fe)
I. Sezai - Eastern Mediterranean University

13

Example 5.2 Solve the problem considered in example 5.1 using the
upwind differencing scheme for
(i) u = 0.1 m/s,
((ii)) u = 2.5 m/s
with the coarse five-point grid.

ME555 : Computational Fluid Dynamics

=1

Dw =

w Aw
xWP

=0

x/2

Fe = ( uA)e
De =

B
7

xWP= x xPE=x

aP = aW + aE + ( Fe Fw ) S P
Fw = ( uA) w

e
P

aPP = aW W + aEE + Su
where

x/2

I. Sezai - Eastern Mediterranean University

d
d d
( u ) =

dx
dx dx

The governing equation is:


A
1

27

For interior nodes: xWP = xPE = x


For node 2: xWP = x / 2
For node 6: xPE = x / 2

e Ae

xPE

Node
aW
aE
SP
Su
2
0
De + max(0, Fe ) ( Dw + max( Fw , 0)) ( Dw + max( Fw , 0)) A
3, 4,5 Dw + max( Fw , 0) De + max(0, Fe )
0
0
6
0
( De + max(0, Fe )) ( De + max(0, Fe ))B
Dw + max( Fw , 0)
ME555 : Computational Fluid Dynamics

28

I. Sezai - Eastern Mediterranean University

14

u = 0.l m/s:

ME555 : Computational Fluid Dynamics

29

I. Sezai - Eastern Mediterranean University

u = 2.5 m/s

Upwind scheme produced a much more realistic solution compared with


central difference scheme.
However, the solution is not very close to the exact value.
ME555 : Computational Fluid Dynamics

30

I. Sezai - Eastern Mediterranean University

15

5.6.1 Assessment of the upwind differencing scheme

Conservativeness
the upwind differencing scheme utilises consistent
expressions to calculate fluxes through cell faces: therefore
it can be easily shown that the formulation is conservative
Boundedness
the coefficients of the discretised equation are always
positive and satisfy the requirements for boundedness
Fe Fw = 0 aP = aW + aE

Stable iterative solution

All coefficients are positive


Coefficient matrix is diagonally dominant
Transportiveness

No wiggles in
solution

The scheme accounts for the direction of the flow so


transportiveness is build into the formulation.
ME555 : Computational Fluid Dynamics

31

I. Sezai - Eastern Mediterranean University

Accuracy
the scheme is based on the backward differencing formula so the accuracy is only
first order on the basis of the Taylor series truncation error (see Appendix A):
A major drawback of the scheme:
it p
produces erronous results when the flow is not aligned
with the ggrid lines.
g
is smeared error has a diffusion-like appearance false diffusion

ME555 : Computational Fluid Dynamics

32

I. Sezai - Eastern Mediterranean University

16

Consider pure convection without diffusion and no source term.


the true solution is:
all nodes above diagonal should be 100
all nodes below diagonal should be 0

Upwind method is not suitable for accurate flow calcualtions


ME555 : Computational Fluid Dynamics

33

I. Sezai - Eastern Mediterranean University

5.7 The hybrid differencing scheme


Central differencing scheme: accurate to second order Not transportive
Upwind differencing scheme: accurate to first order is transportive
Hybrid difference scheme uses:
central difference scheme for Pe < 2
upwind difference scheme in which diffusion has been set to zero for Pe 2
For a west face

Pew =

( u )w
Fw
=
Dw w / xWP

(5.35)

The hybrid differencing formula for the net flux through the west face is as
follows:

1
2
1
2
qw = Fw 1 +
W + 1
P
2 Pew
2 Pew
qw = FwW
qw = FwP
ME555 : Computational Fluid Dynamics

34

for

2 < Pew < 2

for

Pew 2

for

Pew 2

(5.36)

I. Sezai - Eastern Mediterranean University

17

The general form of the discretised equation is


aPP = aW W + aEE

(5.37)

The central coefficient is given by

aP = aW + aE + ( Fe Fw )
After some re-arrangement it is easy to establish that the neighbour
coefficients for the hybrid differencing scheme for steady one dimensional convection diffusion can be written as follows:

aW

aE

F
F

max Fw , Dw + w , 0 max Fe , De e
2
2

ME555 : Computational Fluid Dynamics

35


, 0

I. Sezai - Eastern Mediterranean University

Example 5.2 Solve the problem considered in case 2 of


example 5.1 using the hybrid scheme for u=2.5 m/s.
Compare a 5 node solution with a 25 node solution

ME555 : Computational Fluid Dynamics

36

I. Sezai - Eastern Mediterranean University

18

Comparison with the analytical solution


The numerical results are compared with the analytical solution in table 5.9

ME555 : Computational Fluid Dynamics

37

I. Sezai - Eastern Mediterranean University

5.7.1 Assessment of the hybrid differencing scheme

Is fully conservative
Is unconditionally bounded (since the coefficients
are always positive)
Satisfies the transportiveness property
Produces physical realistic solutions
Highly stable compared with higher order scheme
Is only first order accurate

ME555 : Computational Fluid Dynamics

38

I. Sezai - Eastern Mediterranean University

19

Hybrid differencing scheme for multi-dimensional


convection-diffusion
The discretised equation that covers all cases is given by
aPP = aW W + aEE + aSS + aN N + aBB + aT T

with central coefficient


aP = aW + aE + aS + aN + aB + aT + F

ME555 : Computational Fluid Dynamics

39

I. Sezai - Eastern Mediterranean University

The coefficient of this equation for the hybrid differencing scheme


are as follows:
One-dimensional flow

two-dimensional flow

three-dimensional flow

aW

max[Fw,(D
(Dw+Fw/2),0]
/2) 0] max[Fw,(D
(Dw+Fw/2),0]
/2) 0] max[Fw,(D
(Dw+Fw/2),0]
/2) 0]

aE

max[-Fe,(De-Fe/2),0]

max[-Fe,(De-Fe/2),0]

max[-Fe,(De-Fe/2),0]

aS

max[Fs,(Ds+Fs/2),0]

max[Fs,(Ds+Fs/2),0]

aN

max[-Fn,(Dn-Fn/2),0]

max[-Fn,(Dn-Fn/2),0]

aB

max[Fb,(Db+Fb/2),0]

aT

max[-Ft,(Dt-Ft/2),0]

Fe-Fw

Fe-Fw+Fn-Fs

Fe-Fw+Fn-Fs+Ft-Fb

ME555 : Computational Fluid Dynamics

40

I. Sezai - Eastern Mediterranean University

20

In the above expressions the value of F and D are calculated


with the following formulae
Face
F

(u)wAw

(u)eAe

(u)sAs

(u)nAn

(u)bAb

(u)tAt

wAw/xWP

eAe/xPE

sAs/ySP

nAn/yPN

bAb/zPN

tAt/zPT

ME555 : Computational Fluid Dynamics

41

I. Sezai - Eastern Mediterranean University

The Power Law Scheme


Is a more accurate approximation to the 1-D exact
solution
Produces better results than the hybrid
scheme
y
for Pe > 10 diffusion is set to zero
for 0 < Pe < 10 the flux is evaluated by a
polynomial expression

ME555 : Computational Fluid Dynamics

42

I. Sezai - Eastern Mediterranean University

21

For example, the net flux per unit area at the west control volume
face is evaluated using
qw = Fw W w (P W ) for
5
where w = (1 0.1
0 1Pew ) Pew
and

qw = FwW

for

0 < Pe < 10

(5.44a)

Pew > 10

(5.44b)

The coefficients of the one-dimensional descretised equation


utilising the power-law scheme for steady one-dimensional
convection-diffusion are given by
Central coefficient: aP = aW + aE + ( Fe Fw )
and
aW
Dw max 0, (1 0.1 Pew

aE

) + max [ F , 0]
5

ME555 : Computational Fluid Dynamics

De max 0, (1 0.1 Pee

43

) + max [ F , 0]
5

I. Sezai - Eastern Mediterranean University

5.9 Higher order differencing schemes for convectiondiffusion problems

Hybrid and Upwind schemes are


Stable
Obey the transportiveness requirement
But have first order accuracy
Are prone to numerical diffusion errors

Such errors can be minimized by employing higher order


discretisations.
CentralDifference scheme is second order accurate but is not
stable.
Formulations that do not take into account the flow direction are
unstable
For more accuracy:
use higher order schemes, which preserve upwinding for
stability
ME555 : Computational Fluid Dynamics

44

I. Sezai - Eastern Mediterranean University

22

5.9.1 Quadratic upwind differencing scheme: the QUICK scheme

The quadratic upstream interpolation for convective kinetic (QUICK)


scheme of Leonard(1979) uses a three-point upstream-weighted
upstream quadratic interpolation for cell face values. The face value of
is obtained from a quadratic function through two bracketing nodes
( each
h side
id off the
h face)
f ) andd a node
d on the
h upstream side
id (Fig.
( i 5.17)
1 )
(on

Two upstream nodes and one downstream node is used to calculate the
face value of
ME555 : Computational Fluid Dynamics

45

I. Sezai - Eastern Mediterranean University

It can be shown that for a uniform grid the value of at the cell face
between two bracketing nodes i and i-1, and upstream node i-2 is given by
the following formula:
6
3
1
face = i 1 + i i 2
(5.45)
8
8
8
h uw > 0, the
h bbracketing
k i nodes
d for
f the
h west face
f
d P, the
h
When
w are W and
upstream node is WW (Figure 5.17), and
6
3
1
(5.46)
w = W + P WW
8
8
8
When ue > 0, the bracketing nodes for the east face e are P and E, the
upstream node is W ,so

6
8

3
8

1
8

e = P + E W

(5.47)

The diffusion terms may be evaluated using the gradient of the appropriate
parabola.
It is interesting to note that on a uniform grid this practice gives the same
expressions as central differencing for diffusion.
ME555 : Computational Fluid Dynamics

46

I. Sezai - Eastern Mediterranean University

23

If Fw>0 and Fe>0 and if we use equations (5.46-5.47) for the convective
terms and central differencing for the diffusion terms, the discretised form of
the one-dimensional convection-diffusion transport equation(5.9) may be
written as Fee Fww = De (E P ) Dw (P W )
(5.9)
6
3
1
3
1
6

Fe 8 P + 8 E 8 W Fw 8 W + 8 P 8 WW = De (E P ) Dw (P W )


which can be rearranged to give
3
6
6
1
3
1

Dw 8 Fw + De + 8 Fe P = Dw + 8 Fw + 8 Fe W + De 8 Fe E 8 FwWW

This is now written in the standard form for discretised equations


aPP = aW W + aEE + aWW WW
where

ME555 : Computational Fluid Dynamics

47

(5.48)

(5.49)
(5 49)

I. Sezai - Eastern Mediterranean University

For Fw < 0 and Fe < 0 the flux across the west and east boundaries is given
by the expressions

6
3
1
8
8
8
6
3
1
e = E + P EE
8
8
8

w = P + W E

(5 50)
(5.50)

Substitution of these two formulae for the convective terms in the discretised
convection-diffusion equation (5.9) together with central differencing for the
diffusion terms leads, after re-arrangement as above, to the following
coefficients:

ME555 : Computational Fluid Dynamics

48

I. Sezai - Eastern Mediterranean University

24

General expressions, valid for positive and negative flow directions, can be obtained
by combining the two sets of coefficients above.
The QUICK scheme for one-dimensional convection-diffusion problems can be
summarised as follows:

aPP = aW W + aEE + aWW WW + aEEEE

(5.51)

With central coefficient

aP = aW + aE + aWW + aEE + ( Fe Fw )
And neighbour coefficients

where

w=1 for Fw > 0 and e=1 for Fe > 0


w=0 for Fw < 0 and e=0 for Fe < 0

ME555 : Computational Fluid Dynamics

49

I. Sezai - Eastern Mediterranean University

Example 5.4 Using the QUICK scheme solve the problem considered in
example 5.1 for u=0.2 m/s on a five-point grid. Compare the quick solution
with the exact and central differencing solution.

A
1

=1

w
W

x/2

e
P

xWP= x xPE=x

B
7
=0

x/2

Boundaryy Points :
Consider node 2. w = A

To calculate e : w is needed. But there is no w use linear


interpolation to create a mirror node at x/2 to the west of boundary A.
ME555 : Computational Fluid Dynamics

50

I. Sezai - Eastern Mediterranean University

25

Mirror Node

Domain boundary

Node 2

It can be easily shown that the linearly extrapolated value at the minor
node is given by
(5.52)
0 = 2 A P
The extrapolation to the mirror node has given us the required W node
for the formula (5.47) that calculates e at the east face of control
volume 2:

6
8

3
8

e = P + E

1
7
3
2
( 2 A P ) = P + E A
8
8
8
8

ME555 : Computational Fluid Dynamics

51

(5.53)

I. Sezai - Eastern Mediterranean University

At the boundary nodes the gradients in diffusive flux terms


can be evaluated using central difference scheme similar to
calculation of diffusion terms in interior nodes.

ME555 : Computational Fluid Dynamics

52

I. Sezai - Eastern Mediterranean University

26

The discretised equations for nodes 2, 3 and 6 are now written to fit into the
standard form to give:

aPP = aWW WW + aW W + aEE + Su

with

(5.59)

aP = aW + aE + aWW + aEE + ( Fe Fw ) S P

The solution is
2 0.9648
0.8707
3

4 = 0.7309

5 0.5226
6 0.2123

(5.60)
(5 60)

ME555 : Computational Fluid Dynamics

53

I. Sezai - Eastern Mediterranean University

ME555 : Computational Fluid Dynamics

54

I. Sezai - Eastern Mediterranean University

27

5.9.2 Assessment of the QUICK scheme


The scheme:
Uses consistent quadratic profiles is conservative
Is based on a quadratic function has 3rd order truncation error
Is based on 2 upstream and 1 downstream nodes has
transportiveness
aP = anb if flow field satisfies continuity desirable for
boundedness
aE and aW may not be positive aWW and aEE are negative
If uw > 0 and ue > 0 :
F 8
Then aE = De 3 / 8 Fe becomes negative for Pee = e >
De 3
Gives rise to stability problems and unbounded solutions.
QUICK scheme is conditionally stable
Involves WW and EE which are not immediate-neighbour nodes
ME555 : Computational Fluid Dynamics

55

I. Sezai - Eastern Mediterranean University

5.9.3 Stability problems of the QUICK scheme and remedies


May have negative main coefficients can be unstable
Also other higher order schemes may be oscillatory and unstable
under certain conditions
In this case use:
Method of deferred correction
In this method the cell face value f is formulated as the sum of the
upwind value and other higher order terms which are evaluated at the
previous iteration.
u
o

f = f + f
HO

of = of of

where:
uf = f value to be computed by 1st order upwind method
HO

0f = f value computed by high order scheme from previous old values


u
0f = f value computed by 1st order upwind method from previous old values
ME555 : Computational Fluid Dynamics

56

I. Sezai - Eastern Mediterranean University

28

Let us apply the deferred correction method to QUICK scheme.


For uw > 0 QUICK scheme is
6
3
8
8
This can be written as

1
8

w = W + P WW

w = W +

Similarly:

uf

1
[3P 2W WW ]
8

For Fw > 0

0f is added to source term Su

1
[3E 2P W ]
8
1
w = P + [3W 2P E ]
8
1
e = E + [3P 2E EE ]
8

e = P +

ME555 : Computational Fluid Dynamics

57

F Fe > 0
For
For Fw < 0
For Fe < 0
I. Sezai - Eastern Mediterranean University

The discretisation equation takes the form


aPP = aW W + aEE + Su
The central coefficient is
aP = aW + aE + ( Fe Fw )
where
aw

ae

Dw + max( Fw , 0) De + max(0, Fe )

(5.62)

(5.63)
((5.64))

Su
max[ Fw , 0](w W ) max[ Fw , 0](w P )
+ max[ Fe , 0](e E ) max[ Fe , 0](e P )

((5.65))

Note that aw and ae are the same as that of the upwind method.

The advantage of this approach is that the coefficients are always


positive and now satisfy the requirements for conservativeness,
boundedness and transportiveness
ME555 : Computational Fluid Dynamics

58

I. Sezai - Eastern Mediterranean University

29

5.9.4 general comments on the QUICK differencing scheme

QUICK scheme
Has greater accuracy than central, upwind or power schemes
Retains the upwind weighted characteristics
Resultant false diffusion is small

Can give (minor) undershoots and overshoots (see Fig. 5.20)


ME555 : Computational Fluid Dynamics

59

I. Sezai - Eastern Mediterranean University

To prevent this problem use:


1. Limiters
Limit the scheme to have the face value f to be between
certain values (ULTRA SHARP)

2. Total variation diminishing schemes (TVD)

ME555 : Computational Fluid Dynamics

60

I. Sezai - Eastern Mediterranean University

30

Homework

H
y

Consider a fluid at a uniform temperature Ti entering a channel whose surface is maintained at a


different temperature Ts. A Thermal boundary layer along the tube developes, after which the form of
the temperature profile does not change. Assume that the flow profile is constant in the channel where
the velocities are given by
2
u
2y
= 1
1 and v = 0
umax
H

where umax = 1.5umean. The energy equation is


( uT ) ( vT ) k T k T
+
=
+

x
y
x c p x y c p y

Find the temperature profile in the channel for Re = umeanH/ = 10, Pr = cp/k = 1. Use Lx/H = 5, where
Lx is the length of the solution domain. Use UPWIND method. (Note: k/cp = /Pr for fluids.). Also,
choosing = 1, find from Re relation. Take Tin = 0, Twalls = 100, umean = 1 m/s
ME555 : Computational Fluid Dynamics

61

I. Sezai - Eastern Mediterranean University

Generalisation of Upwind-biased Schemes


For convection terms, an estimate of value at the faces of a CV is
required. Consider east face, assuming ue > 0
1) Standard Upwind Differencing Scheme (UD)
P

w
WW

e = P
e

EE

ve

UPWIND

The face value of is taken to be equal to the value of the upstream


node;

e = P
ME555 : Computational Fluid Dynamics

(5.66)
62

I. Sezai - Eastern Mediterranean University

31

Generalisation of Upwind-biased Schemes


2) Linear Upwind Differencing Scheme (LUD) also called the second
order upwind differencing scheme (SOU)
e = P +(P W) / 2
P

w
WW

SOU (LUD)

EE

ve

is assumed to vary linearly between W and e. Then e is found by


extrapolating the two upstream node values W and P to face e.
(P W ) x
x
2
1
= P + (P W )
2

e = P +

(5.67)

The term (P W) can be thought as a second order correction to


the standard upwind scheme.
ME555 : Computational Fluid Dynamics

63

I. Sezai - Eastern Mediterranean University

Generalisation of Upwind-biased Schemes


3) Central Differencing Scheme (CD)
e = (P + W) / 2
e

w
WW

CENTRAL

EE

ue

The value of is assumed to vary linearly between the two nodes


straddling the face, that is;
( + )
(5 68)
(5.68)
e = P E
2
or

1
2

(5.69)

64

I. Sezai - Eastern Mediterranean University

e = P + (E P )
ME555 : Computational Fluid Dynamics

32

Generalisation of Upwind-biased Schemes


4) QUICK Scheme
e = 6/8P + 3/8E 1/8W)
P

W
w
WW

e
P

QUICK

EE

ue

The scheme is based on the assumption that varies in terms of a


second degree polynomial between two upstream (W and P) and the
downstream node E.
E
6
3
1
(5.70)
e = P + E W
8
8
8
1
(5.71)
e = P + (3E 2P W )
or
8
ME555 : Computational Fluid Dynamics

65

I. Sezai - Eastern Mediterranean University

Generalisation of Upwind-biased Schemes


All higher order schemes can be expressed in the form:
1
e = P + (E P )
2
= an appropriate
pp p
function

(5.72)

Convective flux at face e is Fee


For a higher order scheme convective flux consist of two parts:
1) Upwind flux, FeP
2) Additional flux, Fe(E P)/2
Additional flux is connected to the gradient of at face e, as
indicated by (E P)

ME555 : Computational Fluid Dynamics

66

I. Sezai - Eastern Mediterranean University

33

Generalisation of Upwind-biased Schemes


= 0 for UD scheme
= 1 for CD scheme
LUD scheme may be written as
1
e = P + P W (E P )
2 E P

(5.73)


= P W for LUD scheme
E P

(5.74)

QUICK scheme may


Q
y be written as
1
2

P W
E P

e = P + 3 +


=3+ P W
E P

ME555 : Computational Fluid Dynamics

1
(E P )
4

(5.75)

1
for QUICK scheme
4
67

(5.76)

I. Sezai - Eastern Mediterranean University

Generalisation of Upwind-biased Schemes


let

r=

P W
E P

(5.77)

r = ratio of upwind-side gradient to downwind-side gradient


is a function of r:
= (
(r))
A higher order convection scheme can be written as
1
e = P + (r )(E P )
2
= 0 for UD scheme

(5.78)

= 1 for CD scheme
P W
for LUD scheme
E P
1
= 3 + P W for QUICK scheme
E P 4

ME555 : Computational Fluid Dynamics

68

I. Sezai - Eastern Mediterranean University

34

All of the above expressions assume that the flow


direction is positive (from west to east).
Similar expressions
exist for negative
flow direction.
p
g
In that case, r is still the ratio of upwind-side
gradient to downwind-side gradient.

ME555 : Computational Fluid Dynamics

69

I. Sezai - Eastern Mediterranean University

Total Variation and TVD Schemes


UD scheme is the most stable scheme (no wiggles)
CD and QUICK have higher order accuracy but give rise
to wiggles under certain conditions.
Our aim is to find a convection scheme with a higherorder accuracy but without wiggles.
The desirable property for a stable, non-oscillatory, higher
order scheme is monotonicity preserving.
For a scheme to preserve to preserve monotonicity:
1. It must not create local extrema
2. The value of an existing local minimum must be non-decreasing
and that of a local maximum must be non-increasing.

Monotonicity preserving schemes do not create


new undershoots and overshoots.
ME555 : Computational Fluid Dynamics

70

I. Sezai - Eastern Mediterranean University

35

Total Variation and TVD Schemes


Consider the discrete data set shown in the figure.

The total variation of this data set is


TV ( ) = 2 1 + 3 2 + 4 3 + 5 4

(5.79)

= 3 1 + 5 3

For monotonicity, this TV must not increase with


time.
ME555 : Computational Fluid Dynamics

71

I. Sezai - Eastern Mediterranean University

Total Variation and TVD Schemes


In other words TV must diminish with time.
Hence, the term total variation diminishing or
TVD.
Originally TVD was developed for time-dependent
flows.
For TVD: TV(n+1) TV(n) where n refer to time
step.
In the next section we show how TVD is also linked
to desirable behaviour of discretisation schemes for
steady convection-diffusion problems.
ME555 : Computational Fluid Dynamics

72

I. Sezai - Eastern Mediterranean University

36

Criteria for TVD Schemes


Necessary and sufficient conditions for a scheme to be TVD
1) For 0 < r < 1 (r) 2r
2) For r 1 (r) 2

UD scheme is TVD
LUD scheme is not TVD for r > 2
CD scheme is not TVD for r < 0.5
QUICK scheme is not TVD for r < 3/7 and r > 5
ME555 : Computational Fluid Dynamics

73

I. Sezai - Eastern Mediterranean University

Requirement for Second Order Accuracy


For second order accuracy, the flux limiter function should pass
through the point (1, 1) in the r diagram.
Range of possible second-order schemes is bounded by the CD and
LUD schemes:
For 0 < r < 1 for TVD to be second order r (r) 1
For r 1 for TVD to be second order 1 (r) r

Region for a second-order TVD scheme


ME555 : Computational Fluid Dynamics

74

I. Sezai - Eastern Mediterranean University

37

Symmetry Property for Limiter Functions


Symmetry Property for limiter functions:
(r )
(5.80)
= (1/ r )
r
A limiter function that satisfies the symmetry
property ensures that backward and forward-facing
gradients are treated in the same fashion without the
need for special coding.

ME555 : Computational Fluid Dynamics

75

I. Sezai - Eastern Mediterranean University

Flux Limiter Functions


Name
Van Leer
V Alb
Van
Albada
d
Min-Mod

Limiter function

Source

r+ r

Van Leer (1974)

1+ r
r + r2
1+ r2

V
Van Alb
Albada
d et all. (1982)
min(r ,1) if r > 0
if r 0
0

(r ) =

Roe (1985)

SUPERBEE

max[0, min(2r ,1), min( r , 2)]

Roe (1985)

Sweby

max[0, min( r ,1), min(r , )]

Sweby (1984)

QUICK
UMIST
S

max[0, min(2r , (3 + r ) / 4, 2)]


max[0,
[0 min(2
i (2r , (1 + 3r ) / 4,
4 (3 + r ) / 4,
4 2)]

Leonard (1988)
Lien
i andd Leschziner
h i
(1993)

0 2
= 1 Min-Mod Limiter
= 2 SUPERBEE Limiter of Roe
ME555 : Computational Fluid Dynamics

76

I. Sezai - Eastern Mediterranean University

38

Flux Limiter Functions

MINMOD
MINMOD

All Limiter functions in a r diagram


All limiter functions are symmetric except QUICK limiter.
UMIST limiter function is a symmetric version of the QUICK limiter.
ME555 : Computational Fluid Dynamics

77

I. Sezai - Eastern Mediterranean University

Implementation of TVD Schemes


For the one dimensional convection diffusion equation

d
d d
( u ) =

(5.81)
dx
dx dx
The coefficients of the discretized equation are written in the deferred correction
approach.
h IIn thi
this approach,
h the
th aE, aW, aP coefficients
ffi i t are the
th same as off UD scheme.
h
The extra terms resulting from the application of a limiter function is added to the
source term Sdc.
The face values are:
For u > 0

For u < 0

1
2
1
w = W + (rw+ )(P W )
2

e = P + (re+ )(E P )

1
2
1
w = P + (rw )(W P )
2

e = E + ( re )(P E )

ME555 : Computational Fluid Dynamics

78


re+ = P W
E P

rw+ = W WW
P W

re = EE E
E P

rw = E P
P W

(5.82)

(5.83)

I. Sezai - Eastern Mediterranean University

39

Implementation of TVD Schemes


The discretisation equation takes the form

aPP = aW W + aEE + S dc

(5.84)

The central coefficient is


(5 85)
(5.85)

aP = aW + aE + ( Fe Fw )
where
aw

ae

Dw + max( Fw , 0) De + max(0, Fe )

S dc
max[ Fw , 0](w W ) max[ Fw , 0](w P )
+ max[ Fe , 0](e E ) max[ Fe , 0](e P )

e and w are as defined in Eqs. (5.82) and (5.83)

((5.86))

Note that Sdc is the same as defined in Eq. (5.65).


Note also that aw and ae are the same as that of the upwind method.
The advantage of this approach is that the coefficients are always positive
and now satisfy the requirements for conservativeness, boundedness and
transportiveness
ME555 : Computational Fluid Dynamics

79

I. Sezai - Eastern Mediterranean University

Evaluation of TVD Schemes

Comparison of TVD schemes for pure convection flowing 45o to the grid direction.

TVD schemes does not give unphysical overshoots or undershoots.


However, TVD schemes require about 15% more CPU time.
ME555 : Computational Fluid Dynamics

80

I. Sezai - Eastern Mediterranean University

40

You might also like