Professional Documents
Culture Documents
The Finite Volume Method For Convection-Diffusion Problems: Div U Div Grad S
The Finite Volume Method For Convection-Diffusion Problems: Div U Div Grad S
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 A CV
1
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φ ) = (Γ ) (5.3)
dx dx dx
The flow must also satisfy continuity, so
d
( ρu) = 0
dx
Integrating Eqn. (5.3) over the CV
⎛ ∂φ ⎞ ⎛ ∂φ ⎞
( ρ uAφ )e − ( ρ uAφ ) w = ⎜ ΓA ⎟ − ⎜ ΓA ⎟ (5.5)
⎝ ∂x ⎠e ⎝ ∂x ⎠ w
Integrating continuity Eqn.
2
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 5 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
aPφP = aW φW + aEφE (5.14)
where
aW aE aP
Fw Fe
Dw + De − aW + aE + ( Fe − Fw )
2 2
This equation has the same general form as the diffusion eqn. (4.11).
ME555 : Computational Fluid Dynamics 6 I. Sezai - Eastern Mediterranean University
3
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 CV’s)
(ii) Case 2: u = 2.5 m/s (use 5 CV’s)
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 CV’s)
4
The resulting system of equations are
⎡ − aP2 aE 2 ⎤ φ − Su2 ⎤
⎢ ⎥⎡ 2 ⎤ ⎡
⎢ aW3 − a p3 aE 3 ⎥ φ3⎢ ⎥ ⎢ ⎥
⎢ ⎥⎢ ⎥ ⎢ − Su3 ⎥
−a p4
⎥ ⎢ φ4 ⎥ ⎢ − Su4 ⎥
aW4 aE 4
⎢
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ = ⎢ ⎥
⎢ aWi −a pi aE i ⎥ i⎢ φ ⎥ ⎢ − Su i
⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ aWn−2 − a pn − 2 ⎥ ⎢φ
aE n −2 ⎢ n − 2 ⎥ ⎢ ⎥ ⎢ − Su ⎥
⎢ ⎥
n−2
⎥
⎣⎢ aWn−1 −a pn−1 ⎦⎥ ⎢⎣φn −1 ⎥⎦ ⎢⎣ − Sun −1 ⎥⎦
⎡φ1 ⎤ ⎡ 1 ⎤
⎢φ ⎥ ⎢ 0.9421⎥
⎢ 2⎥ ⎢ ⎥
⎢φ3 ⎥ ⎢0.8006 ⎥
⎢ ⎥ ⎢ ⎥
⎢φ4 ⎥ = ⎢0.6276 ⎥
⎢φ5 ⎥ ⎢ 0.4163⎥
⎢ ⎥ ⎢ ⎥
⎢φ6 ⎥ ⎢ 0.1573⎥
⎢φ ⎥ ⎢ 0 ⎥
⎣ 7⎦ ⎣ ⎦
5
The solution for case 2: (u = 2.5 m/s, 5 CV’s)
6
Properties of Discretisation Schemes
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 CV’s.
7
Example of consistent specification of diffusive fluxes
Γ w 2 (φ2 − φ1 ) Γ e 2 (φ3 − φ2 )
δx δx
Flux entering CV 2 Flux leaving CV 2
An overall flux balance may be obtained by summing the net flux through each CV
⎡ (φ2 − φ1 ) ⎤ ⎡ (φ3 − φ2 ) (φ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
8
2) Boundedness
Table 5.3
Node
2
3
4
5
6
Fe Γ e Ae ρ ue Ae
aE = De − = −
2 δ xPE 2
ME555 : Computational Fluid Dynamics 18 I. Sezai - Eastern Mediterranean University
9
3) Transportiveness
The transportiveness property of a fluid flow can be illustrated by
considering a constant source of φ at a point P
F ρu
Pe = = cell Peclet number
D Γ /δ x
Conservativeness
The central differencing scheme uses
consistent expressions to evaluate convective
and diffusive fluxes at the CV faces.
The scheme is conservative.
10
Boundedness
(i) The internal coefficients of discretised scalar transport equation
(5.14) are
aW aE aP
Fw Fe
Dw + De − aW + aE + ( Fe − Fw )
2 2
(ii) aE = De – Fe/2
Fe
For aE > 0 → < De
2
Fe
or = Pee < 2 to have positive aE .
De
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
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
FeφP − Fwφw = De (φE − φP ) − Dw (φP − φW ) (5.26)
Which can be rearranged as
( Dw + De + Fe ) φP = ( Dw + Fw ) φW + DeφE
to give
⎡⎣( Dw + Fw ) + De + ( Fe − Fw ) ⎤⎦ φP = ( Dw + Fw ) φW + DeφE
(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)
FeφE − FwφP = De (φE − φP ) − Dw (φP − φW )
the equations (5.27) and (5.30) can be written in the usual general
form
aPφP = aW φW + aEφE (5.31)
with central coefficient
aP = aW + aE + ( Fe − Fw )
and neighbour coeffcients
aw ae
Fw>0, Fe>0 Dw + Fw De
Fw<0,
<0 Fe<0 Dw De - Fe
A form of notation for neighbour coefficients of the upwind
differencing method that covers both flow directions is:
aw ae
Dw + max(Fw,0) De + max(0, – Fe)
ME555 : Computational Fluid Dynamics 26 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.
14
u = 0.l m/s:
u = 2.5 m/s
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 No wiggles in
Coefficient matrix is diagonally dominant solution
Transportiveness
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
g with the ggrid lines.
φ is smeared Æ error has a diffusion-like appearanceÆ false diffusion
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
17
The general form of the discretised equation is
aPφP = aW φW + aEφE (5.37)
The central coefficient is given by
aP = aW + aE + ( Fe − Fw )
aW aE
⎡ ⎛ F ⎞ ⎤ ⎡ ⎛ F ⎞ ⎤
max ⎢ Fw , ⎜ Dw + w ⎟ , 0 ⎥ max ⎢ − Fe , ⎜ De − e ⎟ , 0⎥
⎣ ⎝ 2 ⎠ ⎦ ⎣ ⎝ 2 ⎠ ⎦
18
Comparison with the analytical solution
The numerical results are compared with the analytical solution in table 5.9
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
19
Hybrid differencing scheme for multi-dimensional
convection-diffusion
The discretised equation that covers all cases is given by
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]
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]
20
In the above expressions the value of F and D are calculated
with the following formulae
Face
F w e s n b t
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 0 < Pe < 10 (5.44a)
where β w = (1 − 0.1
0 1Pew ) Pew
5
⎣ w
⎣ e
22
5.9.1 Quadratic upwind differencing scheme: the QUICK scheme
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
8 8 8 (5.45)
h uw > 0, the
When h bbracketing
k i nodesd for
f the
h west face
f ’w’ are W andd P, the
h
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 3 1
φe = φP + φE − φW (5.47)
8 8 8
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 Feφe − Fwφw = De (φE − φP ) − Dw (φP − φW ) (5.9)
⎡ ⎛6 3 1 ⎞ ⎛6 3 1 ⎞⎤
⎢ 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 FwφWW
(5.48)
This is now written in the standard form for discretised equations
aPφP = aW φW + aEφE + aWW φWW (5.49)
(5 49)
where
For Fw < 0 and Fe < 0 the flux across the west and east boundaries is given
by the expressions
6 3 1
φw = φP + φW − φE
8 8 8
(5 50)
(5.50)
6 3 1
φe = φE + φP − φEE
8 8 8
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:
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:
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 B
1 2 3 w 4 e 5 6 7
φ=1 W P E φ=0
25
Mirror Node Domain boundary Node 2
It can be easily shown that the linearly extrapolated value at the minor
node is given by
φ0 = 2φ A − φP (5.52)
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 3 1 7 3 2
φe = φP + φE − ( 2φ A − φP ) = φP + φE − φA (5.53)
8 8 8 8 8 8
ME555 : Computational Fluid Dynamics 51 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:
aPφP = aWW φWW + aW φW + aEφE + Su (5.59)
with
aP = aW + aE + aWW + aEE + ( Fe − Fw ) − S P
The solution is
⎡φ2 ⎤ ⎡ 0.9648 ⎤
⎢φ ⎥ ⎢0.8707 ⎥
⎢ 3⎥ ⎢ ⎥
⎢φ4 ⎥ = ⎢ 0.7309 ⎥ (5.60)
(5 60)
⎢ ⎥ ⎢ ⎥
⎢φ5 ⎥ ⎢ 0.5226 ⎥
⎢⎣φ6 ⎥⎦ ⎢⎣ 0.2123 ⎥⎦
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
HO u
Δφ 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
28
Let us apply the deferred correction method to QUICK scheme.
For uw > 0 QUICK scheme is
6 3 1
φw = φW + φP − φWW
8 8 8
This can be written as
1
φw = φW + [3φP − 2φW − φWW ] For Fw > 0
8
φ uf Δφ 0f is added to source term Su
Similarly: 1
φe = φP + [3φE − 2φP − φW ] F Fe > 0
For
8
1 (5.62)
φw = φP + [3φW − 2φP − φE ] For Fw < 0
8
1
φe = φE + [3φP − 2φE − φEE ] For Fe < 0
8
ME555 : Computational Fluid Dynamics 57 I. Sezai - Eastern Mediterranean University
aw ae Su
max[ Fw , 0](φw − φW ) − max[ − Fw , 0](φw − φP )
Dw + max( Fw , 0) De + max(0, − Fe )
+ 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.
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
30
Homework
H
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
w e
WW W P E EE
ve
UPWIND
φe = φP (5.66)
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 φe
φW
w e
WW W P E EE
SOU (LUD) ve
w e
WW W P E EE
CENTRAL ue
32
Generalisation of Upwind-biased Schemes
4) QUICK Scheme
φe = 6/8φP + 3/8φE – 1/8φW)
φP φ e
φE
φW
w e
WW W P E EE
QUICK ue
33
Generalisation of Upwind-biased Schemes
ψ = 0 for UD scheme
ψ = 1 for CD scheme
34
All of the above expressions assume that the flow
direction is positive (from west to east).
Similar expressions
p exist for negative
g flow direction.
In that case, r is still the ratio of upwind-side
gradient to downwind-side gradient.
35
Total Variation and TVD Schemes
Consider the discrete data set shown in the figure.
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
37
Symmetry Property for Limiter Functions
Symmetry Property for limiter functions:
ψ (r )
= ψ (1/ r ) (5.80)
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.
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
MIN‐MOD
MIN‐MOD
1 ⎛ φ −φ ⎞
For u < 0 φe = φE + ψ ( re− )(φP − φE ) re− = ⎜ EE E ⎟
2 ⎝ φE − φP ⎠
(5.83)
1 ⎛ φ −φ ⎞
φw = φP + ψ (rw− )(φW − φP ) rw− = ⎜ E P ⎟
2 ⎝ φP − φW ⎠
ME555 : Computational Fluid Dynamics 78 I. Sezai - Eastern Mediterranean University
39
Implementation of TVD Schemes
The discretisation equation takes the form
aPφP = aW φW + aEφE + S dc (5.84)
The central coefficient is
aP = aW + aE + ( Fe − Fw ) (5 85)
(5.85)
where
aw ae S dc
max[ Fw , 0](φw − φW ) − max[ − Fw , 0](φw − φP )
Dw + max( Fw , 0) De + max(0, − Fe )
+ max[− Fe , 0](φe − φE ) − max[ Fe , 0](φe − φP )
((5.86))
φe and φw are as defined in Eqs. (5.82) and (5.83)
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
Comparison of TVD schemes for pure convection flowing 45o to the grid direction.
40