Professional Documents
Culture Documents
2
The finite-volume method
• The principle of the finite-volume method is local conservation
• the entire computational domain is divided into ‘small’ sub-
volumes, so-called cells.
• A typical 3-d control volume is shown right. Relative to the cell
centre (point P) the coordinate directions are commonly
denoted west, east, south, north, bottom, top with:
lower case w, e, s, n, b, t used for cell faces;
upper case W, E, S, N, B, T for adjacent nodes.
• For a Cartesian mesh these would usually correspond to ± x,
± y, ± z directions respectively.
• Cell-face areas will be denoted Aw, Ae, As, An, Ab, At. Cell
volumes will be denoted V.
3
4
In Two dimension
5
The Steady-State 1-D Advection-Diffusion
Equation
6
Conservation for one control volume gives
(Flux)e – (Flux)w = Source
7
• The one dimensional advection-diffusion equation for
steady state
u
S
x x x
8
Discretising Diffusion
P e
w
W E
(Δx)w (Δx)e
where
Similarly
9
Discretising Advection u
w P e
W E
(Δx)w (Δx)e
Purely diffusive problems (u = 0) are of passing interest only.
In typical engineering flow problems, advection fluxes far
exceed diffusive fluxes because the Reynolds number
(Re = ρUL/ μ= ratio of inertial forces [mass × acceleration] to
viscous forces) is very large.
The 1-d steady-state advection-diffusion equation is:
10
or
The problem is …
How to approximate these face values in terms of the
values at adjacent nodes?
A method of specifying these face values in order to
calculate advective fluxes is called an advection scheme
or advection-differencing scheme.
11
Central Differencing
In central differencing the cell-face value is approximated by
Substituting we get:
or
12
i.e. 𝑎𝑃 ∅𝑃 − 𝑎𝑛𝑏 ∅𝑛𝑏 = 𝑏𝑃
𝑛𝑏
where
𝑎𝑃 = 𝑎𝑤 + 𝑎𝑒 − 𝑠𝑃 + 𝐹𝑒 − 𝐹𝑤
Let Dw = De=1 and Fe = Fw = 4
Then aw = 3, ae = -1 , aP = 2
Now if
E =200 and W =100 P =50 (unrealistic ! )
13
• When 𝐹 > 2D, depending on whether F is positive or
negative, there is a possibility of aE or aW becoming
negative.
• Violates one of the basic rules.
• Negative coefficient also imply that 𝑎𝑃 ≤ σ 𝑎𝑛𝑏
• Fails to satisfy the Scarborough Criteria.
Scarborough Criterion :
14
Example: one-dimensional steady
states convection and diffusion
A property φ is transported by means of convection and
diffusion through the one-dimensional domain. The equation
governing is:
d d d
u
dx dx dx
Boundary conditions are:
0 1 x 0 and L 0 x L
15
Using 5 equally spaced cells and the central differencing
scheme for convection and diffusion, calculate the
distribution of φ as a function of x for,
• Case 1: u = 0.1 m/s
• Case 2: u = 2.5 m/s
Take L = 1.0 m, ρ = 1.0 kg/m3, Γ = 0.1 x 10-3 kg/m/s.
∆x
A B
1 2 3 4 5
Φ= 1 Φ= 0
W w P e E
∆x ∆x
16
For nodes 2, 3, and 4
Compared with the general form:
aPP aw W aeE
where
F F
aw Dw w ae De e
2 2
aP aw ae Fe Fw
Fe
P E Fw W P De E P Dw P W
2 2
17
Where:-
Fe
P E FAA De E P DA P A
2
aP P aw W ae E bP
with aP aw ae Fe Fw SP
19
We have
Node aw ae SP bP
1 0 D-F/2 -(2D+F) (2D+F)φA
2,3,4 D+F/2 D-F/2 0 0
5 D+F/2 0 -(2D+F) (2D-F)φB
20
What is the Remeady?
Peclet number Pe is defined by
21
Upwind Differencing:
• One major inadequacy of the central differencing scheme is
its inability to identify flow direction. In a strong convective
flow from west to east, the above treatment is unsuitable
because the west cell face should receive much stronger
influencing from node W than from node P.
• The upwind differencing or "donor cell" differencing scheme
takes into account the flow direction when determining the
value at a cell face: the convected value of φ is taken to be
equal to the value at the upstream node.
22
In upwind differencing Φface is taken
as the value at whichever is the
upwind node; i.e. in one dimension.
23
When the flow is in the positive direction:
uw > 0 and ue > 0 (Fw > 0 and Fe > 0), the upwind scheme sets:
w W and e P
re-arranging
Dw De Fe P Dw Fw W DeE
or
Dw Fw De Fe Fw P Dw Fw W DeE
24
When the flow is in the negative direction:
uw < 0 and ue < 0 (Fw < 0 and Fe < 0), the upwind scheme sets:
w P and e E
re-arranging
Dw De Fe Fe Fw P DwW De Fe E
25
With this scheme, the algebraic equation for each control
volume takes the form
𝑎𝑃 ∅𝑃 − 𝑎𝑛𝑏 ∅𝑛𝑏 = 𝑏𝑃
𝑛𝑏
where
aP aw ae Fe Fw SP
Discussion:-
• No negative coefficients
• Solution will be always physically realistic
• Scarborough Criteria will be satisfied.
26
Example: the same example as the previous one.
δx
A B
1 2 3 4 5
Φ= 1 Φ= 0
W w P e E
δx δx
27
Boundary nodes 1 and 5
At the boundary node 1, the upwind scheme gives:
Fe P FA A De E P DA P A
At the boundary node 5, the upwind scheme gives:
FB P Fw W DB B P Dw P W
Since at the boundary nodes: FA = FB = F = ρu and DA = DB
= 2Γ/δx = 2D,
We have:
Node aW aE SP bP
1 0 D -(2D+F) (2D+F)φA
2,3,4 D+F D 0 0
5 D+F 0 -2D 2DφB
28
Exact Solution
If Γ is constant, the equation can be solved
exactly. Let 0 ≤ x ≤ L
B.C. x=0 Φ = Φ0
x=L Φ = ΦL
The solution is
𝑃𝑥
∅ − ∅0 𝑒𝑥𝑝 −1
= 𝐿
∅𝐿 − ∅0 𝑒𝑥𝑝 𝑃 − 1
Where P = Peclet Number = Ratio of strengths of
convection and diffusion.
= F/D
29
P = 0 is pure diffusion.
30
Exponential Scheme
d∅
Let total flux J = ρu∅ − Γ
dx
dJ
Hence =0 or Je = Jw
dx
∅P − ∅E
Putting exact solution, we get Je = Fe ∅P +
exp Pe − 1
ρu e ∆x e 𝐹𝑒
where Pe = =
Γe 𝐷𝑒
∅P −∅E ∅W −∅P
Hence Fe ∅P + - Fw ∅W + =0
exp Pe −1 exp P𝑤 −1
31
Exponential Scheme
𝑎𝑃 ∅𝑃 = 𝑎𝑤 ∅𝑊 + 𝑎𝑒 ∅𝐸 + 𝑏𝑃
where
𝐹𝑒
𝑎𝑒 =
exp 𝑃𝑒 − 1
𝐹𝑤 exp 𝑃𝑤
𝑎𝑤 =
exp 𝑃𝑤 − 1
32
Assessment of Upwind Differencing Scheme
(UDS)
• Conservativeness:
UDS utilises consistent expressions to calculate fluxes
through cell faces. Therefore it is conservative.
• Boundedness:
Coefficients of discretised equations are always positive and
satisfies the requirement of boundedness.
𝑎𝑃 = 𝑎𝑤 + 𝑎𝑒 + 𝐹𝑒 − 𝐹𝑤
When flow satisfies continuity, 𝐹𝑒 − 𝐹𝑤 = 0
Hence, 𝑎𝑃 = 𝑎𝑤 + 𝑎𝑒 , which is desirable for stable
iterative solutions.
All coefficients are positive and coefficient matrix is diagonally
dominant.
33
Assessment of Upwind Differencing Scheme
(UDS)
• Transportiveness:
The scheme accounts for the direction of flow, so
transportiveness is built into the formulation.
• Accuracy:
The scheme is first order accurate.
34
The hybrid differencing scheme
• The hybrid differencing scheme of Spalding (1972) is
based on a combination of central and upwind
differencing schemes.
The central differencing scheme, which is accurate to
second-order, is employed for small Peclet numbers
(Pe < 2).
The upwind scheme, which is accurate to first order
but accounts for transportiveness, is employed for
large Peclet number (Pe>2).
• The hybrid differencing scheme uses piecewise
formulae based on the local Peclet number to
evaluate the net flux through each control volume
face:
35
1 2 1 2
qw Fw 1 W 1 P for -2 < Pew < 2
2 Pew 2 Pew
qw Fw AwW for Pew / 2
with aP aw ae Fe Fw SP
aw ae
Fw Fe
max Fw , Dw ,0 max Fe , De ,0
2 2
36
Assessment of the hybrid differencing scheme
37
Quadratic Upstream Interpolation for
Convective Kinetics (QUICK) scheme
• Proposed by Leonard.
38
QUICK Scheme
ΦP ΦE
ΦW Φw Φe
ΦWW
WW W w P e E EE
Fw > 0 Fe > 0
39
QUICK Scheme
6 3 1
• When Fw > 0 ∅𝑤 = ∅𝑊 + ∅𝑃 − ∅𝑊𝑊
8 8 8
6 3 1
• When Fe > 0 ∅𝑒 = ∅𝑃 + ∅𝐸 − ∅𝑊
8 8 8
40
or
3 6
𝐷𝑤 − 𝐹𝑤 + 𝐷𝑒 + 𝐹𝑒 ∅𝑃
8 8
6 1 3 1
= 𝐷𝑤 + 𝐹𝑤 + 𝐹𝑒 ∅𝑊 + 𝐷𝑒 − 𝐹𝑒 ∅𝐸 − 𝐹𝑤 ∅𝑊𝑊
8 8 8 8
or 𝑎𝑃 ∅𝑃 = 𝑎𝑤 ∅𝑤 + 𝑎𝑒 ∅𝐸 + 𝑎𝑤𝑤 ∅𝑊𝑊
6 1
where 𝑎𝑤 = 𝐷𝑤 + 𝐹𝑤 + 𝐹𝑒
8 8
3 1
𝑎𝑒 = 𝐷𝑒 − 𝐹𝑒 𝑎𝑤𝑤 = − 𝐹𝑤
8 8
𝑎𝑃 = 𝑎𝑤 + 𝑎𝑒 + 𝑎𝑤𝑤 + 𝐹𝑒 − 𝐹𝑤
41
6 3 1
• When Fw < 0 ∅𝑤 = ∅𝑃 + ∅𝑊 − ∅𝐸
8 8 8
6 3 1
• When Fe < 0 ∅𝑒 = ∅𝐸 + ∅𝑃 − ∅𝐸𝐸
8 8 8
Hence, for Fw < 0 and Fe < 0
6 3 1 6 3 1
𝐹𝑒 ∅𝐸 + ∅𝑃 − ∅𝐸𝐸 − 𝐹𝑤 ∅𝑃 + ∅𝑊 − ∅𝐸
8 8 8 8 8 8
= 𝐷𝑒 ∅𝐸 − ∅𝑃 − 𝐷𝑤 ∅𝑃 − ∅𝑊
For which we get
𝑎𝑃 ∅𝑃 = 𝑎𝑤 ∅𝑊 + 𝑎𝑒 ∅𝐸 + 𝑎𝑒𝑒 ∅𝐸𝐸
42
3
where 𝑎𝑤 = 𝐷𝑤 + 𝐹𝑤
8
6 1 1
𝑎𝑒 = 𝐷𝑒 − 𝐹𝑒 − 𝐹𝑤 𝑎𝑒𝑒 = 𝐹𝑒
8 8 8
𝑎𝑃 = 𝑎𝑤 + 𝑎𝑒 + 𝑎𝑤𝑤 + 𝐹𝑒 − 𝐹𝑤
Combining we get
6 3 1
𝐹𝑒 ∅𝑒 = ∅𝑃 + ∅𝐸 − ∅𝑊 𝑚𝑎𝑥 𝐹𝑒 , 0 +
8 8 8
6 3 1
∅𝐸 + ∅𝑃 − ∅𝐸𝐸 𝑚𝑎𝑥 −𝐹𝑒 , 0
8 8 8
6 3 1
𝐹𝑤 ∅𝑤 = ∅𝑊 + ∅𝑃 − ∅𝑊𝑊 𝑚𝑎𝑥 𝐹𝑤 , 0 +
8 8 8
6 3 1
∅𝑃 + ∅𝑊 − ∅𝐸 𝑚𝑎𝑥 −𝐹𝑤 , 0
8 8 8
43
𝑎𝑃 ∅𝑃 = 𝑎𝑤 ∅𝑊 + 𝑎𝑒 ∅𝐸 + 𝑎𝑤𝑤 ∅𝑊𝑊 + 𝑎𝑒𝑒 ∅𝐸𝐸 + 𝑏𝑃
6 3 1
𝑎𝑤 = 𝐷𝑤 + 𝑚𝑎𝑥 𝐹𝑤 , 0 + 𝑚𝑎𝑥 −𝐹𝑤 , 0 + 𝑚𝑎𝑥 𝐹𝑒 , 0
8 8 8
3 6 1
𝑎𝑒 = 𝐷𝑒 − 𝑚𝑎𝑥 𝐹𝑒 , 0 − 𝑚𝑎𝑥 −𝐹𝑒 , 0 − 𝑚𝑎𝑥 −𝐹𝑤 , 0
8 8 8
1 1
𝑎𝑤𝑤 = − 𝑚𝑎𝑥 𝐹𝑤 , 0 𝑎𝑒𝑒 = 𝑚𝑎𝑥 −𝐹𝑒 , 0
8 8
44
Example: using the QUICK scheme solve the problem for
u = 0.2 m/s on a 5-point grid.
1 1
𝑎𝑤𝑤 = − 𝑚𝑎𝑥 𝐹𝑤 , 0 𝑎𝑒𝑒 = 𝑚𝑎𝑥 −𝐹𝑒 , 0
8 8
45
Nodes 1, 2 and 5 are all affected by the domain boundaries.
Leonard (1979) suggests a linear extrapolation to create a
"mirror" node at a distance δx/2 to the west of the physical
boundary.
ΦP
ΦA
ΦO
O δx/2 A δx/2 P
46
At node 1
φe at the east face of control volume 1:
6 3 1 6 3 1
e P E 0 P E 2A P
8 8 8 8 8 8
7 3 2
P E A
8 8 8
The diffusive flux through the west boundary is:
DA
A 9P 8A E
x 3
The discretised equation at node 1 is:
7 3 2 D
Fe P E A FAA De E P A 9P 8A E
8 8 8 3
47
At node 5
48
Node aww aw ae SP bP
1 0 0 1 3 8 2 8 2
De
3
DA F
8 3
e DA
8
Fe FA 3 DA
8
Fe FA A
2 0 7 1 3 1
1
Fw A
D F Fe D Fe Fw
8 8
w w e
8 4 4
5 1
Fw 1 6 0
8 8
D D Fw
8 w
3
B
8 DB FB D
3 B FB B
3
49
Assessment of QUICK Scheme
• Uses consistent quadratic profiles for the cell face values
of fluxes and hence conservative.
• Its accuracy in terms of the Taylor series truncation error is
third order on a uniform mesh.
• The transportiveness property is built into the scheme
using two upstream and one downstream nodal values.
• Boundedness:
• For modest Peclet number (Pe < 8/3), if the flow field
satisfies continuity, the coefficient aP equals the sum of all
neighbour coefficient which is desirable for boundedness.
50
Assessment of QUICK Scheme
• For Peclet number (Pe) > 8/3, the main coefficients (E and
W) are not guaranteed to be positive and the coefficients
aWW and aEE are negative.
• This give rise to stability problems and unbounded
solutions under certain flow conditions.
• Since the discretised equations involve not only immediate-
neighbouring nodes but also nodes further away, Tri-
diagonal matrix solution (TDMA) methods are not directly
applicable.
51
Remeady
52
• The Hayase et al. (1990) QUICK scheme:
1
w W 3P 2W WW for Fw > 0
8
1
w P 3W 2P E for Fw < 0
8
1
e P 3E 2P W for Fe > 0
8
1
e E 3P 2E EE for Fe < 0
8
The discritised equation:
aPP aw W aeE bP
53
with central coefficient
𝑎𝑃 = 𝑎𝑤 + 𝑎𝑒 + 𝐹𝑒 − 𝐹𝑤 − 𝑏ത𝑃
1
bno 3P 2W WW max Fw ,0 1 W 2P 3E max Fe ,0
8 8
1 1
3W 2P E max Fw ,0 2E EE 3P max Fe ,0
8 8
54
Extension to 2 and 3 Dimensions
• For a multi-dimensional flow the net flux out of a cell can
be obtained by summing the outward fluxes through all
faces.
• For quadrilateral elements (in 2d) or hexahedral elements
(in 3d) then the net flux out of a cell is simply the sum of
the net fluxes through opposing sides and the general
conservation equation for 3 d may be written:
(fluxe – fluxw) + (fluxn – fluxs) + (fluxt – fluxb) = source
i.e.
𝑎𝑃 ∅𝑃 − 𝑎𝑛𝑏 ∅𝑛𝑏 = 𝑏𝑃
𝑛𝑏
55
Summary
• The generic scalar-transport equation for a particular
control volume has the form
rate of change + net outward flux = source
• “flux” rate of transport through a surface and consists of:
advection – transport with the flow (other authors prefer
convection);
diffusion – net transport by random molecular or turbulent
fluctuations.
• Discretisation of the (steady) scalar-transport equation
yields an equation of form
𝑎𝑃 ∅𝑃 − 𝑎𝑛𝑏 ∅𝑛𝑏 = 𝑏𝑃
𝑛𝑏
56
• Source terms are linearised as:
57
• Upwind, hybrid and power-law differencing scheme
possess conservativeness, boundedness and
transportiveness and are hightly stable, but suffer from
false diffusion in multi-dimensional flows if the velocity
vectors is not parallel to one of the co-ordinate
directions.
• Higher order schemes, such as QUICK, can minimise
false diffusion errors but are less computationally stable.
This causes small over- and undershoots in the solutions
of some problems including those with large gradients of
φ.
• Diffusive fluxes are usually discretised by central
differencing.
58
Lecture notes on CFD by
C. R. Prajapati
Apollo Institute of Engineering & Technology 59