Finite Volume Discretization
MMVN05ROBERT SZASZ
Goal & Outline
⢠1D Cartesian
â Diffusion
â Source
â Convection
â Time dependent
⢠2D Cartesian
⢠2D Unstructured
Partial Differential
Equation(s)
Set of Algebraic
Equations
The Finite Volume Method
⢠Generic transport equation
⢠Integrate over a control volume
ððð
ðð¡+ ððð£ ðð¢ ð = ððð£ Îðððð ð + ð
Time
evolutionConvection Diffusion Source
term
ð
ððð
ðð¡ðð +
ð
ððð£ ðð¢ ð ðð = ð
ððð£ Îðððð ð ðð + ð
ð ðð
Discretization in 1D
Control volume boundaries
Control volume
P EWew
Dx
dxPe
dxPEdxWP
Diffusion problems in 1D
ððð£ Îðððð ð + ð = 0
ð
ððð£ Îðððð ð ðð + ð
ð ðð = 0
P EWew
DxdxPe
dxPEdxWP
ðŽ
ð. Îðððð ð ððŽ + ð
ð ðð = 0
ÎðŽðð
ðð¥ð
â ÎðŽðð
ðð¥ð€
+ ðð = 0
ÎððŽððð
ðð¥ð
â Îð€ðŽð€ðð
ðð¥ð€
+ Su + SpðP = 0
Linear approximation
Diffusion problems in 1D
P EWew
DxdxPe
dxPEdxWP
ÎððŽððð
ðð¥ð
â Îð€ðŽð€ðð
ðð¥ð€
+ Su + SpðP = 0
ððÎððŽðð¿ð¥ððž
+Îð€ðŽð€ð¿ð¥ðð
â ðð = ððÎð€ðŽð€ð¿ð¥ðð
+ ððžÎððŽðð¿ð¥ððž
+ ðð¢
Îð =Îð+Îð
2, Îð€ =
Îðž+Îð
2, ðð
ðð¥ ð=ððžâðð
ð¿ð¥ððž, ðð
ðð¥ ð€=ððâðð
ð¿ð¥ðð
These are usually stored
ðððð = ðððð + ððžððž + ðð¢
Boundaries
P Eew
DxdxPe
dxPE
Case 1: is knownðð€ = ð¹ð€
ÎððŽððð
ðð¥ð
â Îð€ðŽð€ðð
ðð¥ð€
+ Su + SpðP = 0
ðð
ðð¥ð€
=ðð â ð¹ð€ð¿ð¥ð€ð
Case 2: is known
Eastern boundary similarly
ðð
ðð¥ð€
= ðºð€
ðððð = ððžððž + ðð¢
Building the system of equations
1 2 N
ðððð = ðððð + ððžððž + ðð¢
ð1ð1,1 = ð2ð2,1 + ð1
3
Building the system of equations
1 2 N
ðððð = ðððð + ððžððž + ðð¢
ð1ð1,1 = ð2ð2,1 + ð1
ð2ð2,2 = ð1ð1,2 + ð3ð3,2 + ð2
3
Building the system of equations
1 2 N
ðððð = ðððð + ððžððž + ðð¢
ð1ð1,1 = ð2ð2,1 + ð1
ð2ð2,2 = ð1ð1,2 + ð3ð3,2 + ð2
3
ð3ð3,3 = ð2ð2,3 + ð4ð4,3 + ð3
Building the system of equations
1 2 N
ðððð = ðððð + ððžððž + ðð¢
ð1ð1,1 = ð2ð2,1 + ð1
ð2ð2,2 = ð1ð1,2 + ð3ð3,2 + ð2
3
ð3ð3,3 = ð2ð2,3 + ð4ð4,3 + ð3
ðððð,ð = ððâ1ððâ1,ð + ðð
Convection-Diffusion problems in 1D
ððð£ ðð¢ ð = ððð£ Îðððð ð
ð
ððð£ ðð¢ ð ðð = ð
ððð£ Îðððð ð ðð
ðŽ
ð. ððð¢ ððŽ = ðŽ
ð. Îðððð ð ððŽ
P EWew
DxdxPe
dxPEdxWP
ð¢ðð¢ð€
(source terms not considered for simplicity)
ðð¢ðŽð ð â ðð¢ðŽð ð€ = ÎðŽðð
ðð¥ð
â ÎðŽðð
ðð¥ð€
Assume Ae=Aw=A and denote fluxes as:
ð¹ð€ = ðð¢ ð€ ð¹ð = ðð¢ ð ð·ð€ =Îð€ð¿ð¥ðð
ð·ð=Îðð¿ð¥ððž
ð¹ððð â ð¹ð€ðð€ = ð·ð ððž â ðð â ð·ð€(ðð â ðð)
Convection-Diffusion problems in 1D
ð(ðð¢)
ðð¥= 0
The continuity equation must be also fullfilled:
P EWew
DxdxPe
dxPEdxWP
ð¢ðð¢ð€
ðð¢ðŽ ð â ðð¢ðŽ ð€ = 0
ð¹ð â ð¹ð€ = 0
Convection-Diffusion problems in 1D
P EWew
DxdxPe
dxPEdxWP
ð¢ðð¢ð€
ð¹ððð â ð¹ð€ðð€= ð·ð ððž â ðð â ð·ð€(ðð â ðð)
How to estimate fe, fw?
Central difference scheme:ðð =
ðð + ððž2
ðð€ =ðð + ðð
2
ð·ð€ +ð¹ð€2+ ð·ð â
ð¹ð2ðð = ð·ð€ +
ð¹ð€2ðð + ð·ð â
ð¹ð2ððž
ðððð = ðððð + ððžððž
Fig. 5.4. N=5, u=0.1 m/s, F=0.1, D=0.5 Fig.5.5. N=5, u=2.5 m/s, F=2.5, D=0.5
Fig.5.6. N=20, u=2.5 m/s, F=2.5, D=2.0
WHY?
Properties of discretization schemes
⢠Conservativeness
â Estimate the fluxes in a consistent manner!
Fig.5.7
Fig.5.8
Properties of discretization schemes
⢠Boundedness
â In the absence of sources, the value of a property
should be bounded by its boundary values
â Requirements:
» All coefficients the same sign
»â ððð
ððâ²â€ 1 ðð¡ ððð ððððð , < 1 ðð¡ ððð ðððð ðð¡ ðððð ð¡
Properties of discretization schemes
⢠Transportiveness
â Where is the information transported?
Fig.5.9
Assessment of the central differencing
scheme
⢠Conservativeness: OK
⢠Boundedness:
ae<0 for Pee=Fe/De>2 !!!
⢠Transportiveness: Not OK!
⢠Accuracy: 2nd order
ð·ð€ +ð¹ð€2+ ð·ð â
ð¹ð2ðð = ð·ð€ +
ð¹ð€2ðð + ð·ð â
ð¹ð2ððž
Upwind differencing scheme
⢠Compute the convective term depending on the flow
direction:
P EWew
DxdxPe
dxPEdxWP
ð¢ðð¢ð€
ðð = ðð ðð€= ðð
P EWew
DxdxPe
dxPEdxWP
ð¢ðð¢ð€
ðð = ððž ðð€= ðð
Upwind differencing scheme
⢠Assessment:
â Conservativeness: OK
â Boundedness: OK
â Transportiveness: OK
â Accuracy: 1st order
Fig.5.15
Hybrid differencing scheme
⢠Combine schemes:
â Central for Pe=F/D < 2
â Upwind for Pe > 2
⢠Assessment:
â Conservativeness: OK
â Boundedness: OK
â Transportiveness: OK
â Accuracy: 1st order
Power-law scheme
⢠More accurate than hybrid
⢠Diffusion set to 0 for Pe>10
⢠For Pe < 10 polynomial expression is used to evaluate
the fluxes
The QUICK scheme
⢠Quadratic Upstream Interpolation for Convective Kinetics
⢠Higher order & Upwind
⢠Face values of f obtained from quadratic functions
⢠Diffusion terms can be evaluated from the gradient
of the parabola
⢠For uw>0
⢠For ue>0
ðð€ =6
8ðð +
3
8ðð â
1
8ððð
ðð =6
8ðð +
3
8ððž â
1
8ðð
Fig.5.17
The QUICK scheme
⢠Generic form:
⢠Issues at boundaries: no second neighbours
â Create virtual âmirror nodesâ by linear extrapolation
ðððð = ðððð + ððžððž + ðððððð + ððžðžððžðž
Fig.5.18
The QUICK scheme
⢠Assessment
â Conservativeness: OK
â Boundedness:
» Only conditionnaly stable!
â Reformulated versions
to improve stability
â Transportiveness: OK
â Accuracy: better formal
accuracy than upwind
â Possible over/undershoots
Fig.5.20
General upwind-biased schemes
⢠âPureâ upwind:
⢠Linear upwind differencing:
⢠QUICK:
⢠Central differencing:
⢠General:
ðð = ðð
ðð = ðð +1
2(ðð â ðð)
ðð = ðð +1
8(3ððž â 2ðð â ðð)
ðð = ðð +1
2(ððž â ðð)
ðð = ðð +1
2ð(ððž â ðð)
General upwind-biased schemes
⢠UD
⢠CD
⢠LUD
⢠QUICKðð = ðð +
1
2ð(ððž â ðð)
ð = ð(ð)
ð =ðð â ððððž â ðð
ð ð = 0
ð ð = 1
ð ð = ð
ð ð = (3 + ð)/4
Fig.5.21
TVD schemes
⢠Total Variation Diminishing
⢠Criteria:
â Upper limit for TVD:
f1
f2
f3
f4
f5
ðð ð= ð2 â ð1 + ð3 â ð2+ ð4 â ð3 + |ð5 â ð4|
Fig.5.23
ð ð †2ð ð †1
ð ð †2 ð > 1
TVD
⢠For second order:
â Must go through (1,1)
â Limited by CD and LUD
⢠To treat forward and
backward differencing
consistently: symmetry
property:
⢠Flux limiters
ð ð
r= ð(1/ð)
Fig.5.24
Fig.5.25
Unsteady flows
ððð
ðð¡+ ððð£ ðð¢ ð = ððð£ Îðððð ð + ð
ð
ððð
ðð¡ðð +
ð
ððð£ ðð¢ ð ðð = ð
ððð£ Îðððð ð ðð + ð
ð ðð
ð¡
ð¡+Îð¡
ð
ððð
ðð¡ðððð¡ +
ð¡
ð¡+Îð¡
ð
ððð£ ðð¢ ð ðð ðð¡
= ð¡
ð¡+Îð¡
ð
ððð£ Îðððð ð ðð ðð¡ + ð¡
ð¡+Îð¡
ð
ð ðððð¡
Unsteady 1D heat conduction
⢠c â specific heat [J/(kg K)]
ðððð
ðð¡=ð
ðð¥ððð
ðð¥+ ð
P EWew
DxdxPe
dxPEdxWP
ð¡
ð¡+Îð¡
ð
ðððð
ðð¡ðððð¡ =
ð¡
ð¡+Îð¡
ð
ð
ðð¥ððð
ðð¥ðððð¡ +
ð¡
ð¡+Îð¡
ð
ððððð¡
ð
ð¡
ð¡+Îð¡
ðððð
ðð¡ðð¡ðð =
ð¡
ð¡+Îð¡
ððŽðð
ðð¥ð
â ððŽðð
ðð¥ð€
ðð¡ + ð¡
ð¡+Îð¡
ðÎððð¡
Unsteady 1D heat conduction
ð
ð¡
ð¡+Îð¡
ðððð
ðð¡ðð¡ðð =
ð¡
ð¡+Îð¡
ððŽðð
ðð¥ð
â ððŽðð
ðð¥ð€
ðð¡ + ð¡
ð¡+Îð¡
ðÎððð¡
ðð ðð â ðð0 ÎV =
ð¡
ð¡+Îð¡
ððŽððž â ððð¿ð¥ððž
â ððŽðð â ððð¿ð¥ðð
ðð¡ + ð¡
ð¡+Îð¡
ðÎððð¡
Assume uniform T
In control volume
and use backward
differencing
Use central
differencing
How do TE,TW and TP vary in time? Assume
a linear function:@ t+Dt @ t
ðŒð = ð¡
ð¡+Îð¡
ððð¡ = ðð + 1 â ð ð0 Îð¡
Unsteady 1D heat conduction
ðð ðð â ðð0 ÎV =
ð¡
ð¡+Îð¡
ððŽððž â ððð¿ð¥ððž
â ððŽðð â ððð¿ð¥ðð
ðð¡ + ð¡
ð¡+Îð¡
ðÎððð¡
Divide by A and Dt:
ðð ðð â ðð0Îð¥
Îð¡
= ð ðððž â ððð¿ð¥ððž
â ððð â ððð¿ð¥ðð
+ (1 â ð) ðððž0 â ðð
0
ð¿ð¥ððžâ ð
ðð0 â ðð
0
ð¿ð¥ðð+ ðÎð¥
ðððð= ðð ððð + 1 â ð ðð
0 + ððž ðððž + 1 â ð ððž0
+ ðð0 â 1 â ð ðð â 1 â ð ððž ðð
0 + ð
Explicit scheme
ð = 0
ðððð = ðððð0 + ððžððž
0 + ðð0 â ðð â ððž + ðð ðð
0 + ðð¢
TP can be directly computed
First order
Can be negative! To assure stability:
Îð¡ < ððÎð¥ 2
2ð
Very small timesteps when the grid is refined!
Implicit scheme
ð = 1
ðððð = ðððð + ððžððž + ðð0ðð0 + ðð¢
Several unknowns -> System of equations
Unconditionally stable
First order
Crank-Nicolson scheme
ð =1
2
ðððð = ðððð + ðð
0
2+ ððž
ððž + ððž0
2+ ðð
0 âðð2âððž2+ðð2ðð0 + ðð¢
System of equations
To assure stability:
Îð¡ < ððÎð¥ 2
ð
Very small timesteps when the grid is refined!
Second order
Unsteady 1D convection-diffusion
⢠Similarly to unsteady diffusion
⢠Additional stability limits due to convection
ððð
ðð¡+ððð¢ð
ðð¥=ð
ðð¥Îðð
ðð¥+ ð
Finite volume method for 2D Cartesian
grids
⢠E.g. diffusion problem:
Fig.4.12
ð
ðð¥Îðð
ðð¥+ð
ððŠÎðð
ððŠ+ ð = 0
Îð
ð
ðð¥Îðð
ðð¥ðð +
Îð
ð
ððŠÎðð
ððŠðð
+ Îð
ððð = 0
ÎððŽðððž â ððð¿ð¥ððž
â Îð€ðŽð€ðð â ððð¿ð¥ðð
+ ÎððŽððð â ððð¿ðŠðð
â Îð ðŽð ðð â ððð¿ðŠðð
+ ðÎð = 0
ðððð = ðððð + ððžððž + ðððð + ðððð + ðð¢ = 0
Finite Volume Method on unstructured
grids
P
ni
DA
ð
ððð
ðð¡ðð +
ð
ððð£ ðð¢ ð ðð
= ð
ððð£ Îðððð ð ðð + ð
ð ðð
ð
ðð¡
ð
ðð ðð + ðŽ
ð. ðð¢ ð ððŽ = ðŽ
ð. Îðððð ð ððŽ + ð
ð ðð
ð
ðð¡
ð
ðððð + â ÎðŽð
ðð . ðð¢ ð ððŽ = â ÎðŽð
ðð . Îðððð ð ððŽ + ð
ð ðð
⢠ni can be computed based on grid topology
Diffusion term
⢠Central differencing
⢠Only true if the grid is
orthogonal
ÎðŽð
ðð . Îðððð ð ððŽ â
ðð . Îðððð ð ÎðŽð â
ÎððŽ â ððÎð
ÎðŽð
Fig.11.15
Non-orthogonal grids
⢠Can be computed as:
n. gradðÎðŽð
=ð. ðÎðŽðð. ðð
ððŽ â ððÎð
âðð . ðð ÎðŽð
ð. ðð
ðð â ððÎð
Fig.11.17
Non-orthogonal grids
⢠Compare to:
n. gradð ÎðŽð =ð. ðÎðŽðð. ðð
ððŽ â ððÎð
âðð . ðð ÎðŽð
ð. ðð
ðð â ððÎð
Direct gradient Cross-diffusion
Known Interpolated
Can be (pre)computed (and stored) based on grid topology.
n. gradð ÎðŽð =ððŽ â ððÎð
ÎðŽð
Convective term
⢠Approximate as:
ÎðŽð
ðð . ððð¢ ððŽ â
ðð ÎðŽð
ðð . ðð¢ ððŽ â ððð¹ð
Fi = Convective flux
normal to the surface
element.
Usually stored.Fig.11.15
fi
⢠Upwind differencing
â Fi>0 fi=fP
â Fi<0 fi=fA
⢠Linear upwind differencing
⢠QUICK
⢠TVD
⢠âŠ
ðð = ðð + ð»ðð . Îð
Needs to be computed!