Finite Volume Method
Finite Volume Method
Finite Volume Method
Praveen. C
Computational and Theoretical Fluid Dynamics Division
National Aerospace Laboratories
Bangalore 560 017
email: praveen@cfdlab.net
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Topics to be covered
1. Conservation Laws
2. Finite volume method
3. Types of finite volumes
4. Flux functions
5. Spatial discretization schemes
6. Higher order schemes
7. Boundary conditions
8. Accuracy and stability
9. Computational issues
10. References
Hyperbolic equations, Compressible flow, unstructured grid schemes
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Conservation Laws and FVM
n
UR
Shock
UL
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Entropy condition - second law of thermodynamics
• Entropy satisfying weak solution - unique (Kruzkov)
• Conservative scheme (FVM) - correct shock location (Warnecke)
• Useful for solving equations with discontinuous coefficients
• FVM can be applied on arbitrary grids - structured and unstructured
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Entropy condition - second law of thermodynamics
• Entropy satisfying weak solution - unique (Kruzkov)
• Conservative scheme (FVM) - correct shock location (Warnecke)
• Useful for solving equations with discontinuous coefficients
• FVM can be applied on arbitrary grids - structured and unstructured
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
FVM in 1-D
C
i
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Conservation law for cell Ci
dUi
hi + f (xi+1/2, t) − f (xi−1/2, t) = 0
dt
U i+1
Ui
i+1/2
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Method of lines approach
– Discretize in space
– Integrate the ODE system in time
• Explicit Euler scheme [ Uin ≈ U (xi, tn) ]
Ui(tn+1) − Ui(tn) 1
= − [Fi+1/2(tn) − Fi−1/2(tn)]
∆t hi
⇓
∆t n
Uin+1 = Uin − [Fi+1/2 n
− Fi−1/2 ]
hi
• Conservation: Telescopic collapse of fluxes
X dUi X
hi = − [Fi+1/2(t) − Fi−1/2(t)]
i
dt i
= −[f (b, t) − f (a, t)]
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Numerical Flux Function
• Simple averaging
Fi+1/2 = f ((Ui + Ui+1)/2) or Fi+1/2 = (fi + fi+1)/2
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Significance of conservative scheme
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Higher order scheme in 1-D
• Constant-in-cell representation
C i+1
Ci
C i−1
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Higher order scheme in 1-D
Ci
C i−1 Right
state
• Linear reconstruction
Ũ (x) = Ui + si(x − xi), x ∈ [xi−1/2, xi+1/2]
• Biased interpolant
L R
Ui+1/2 = Ui + si(xi+1/2 − xi), Ui+1/2 = Ui+1 + si+1(xi+1/2 − xi+1),
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Flux for higher order scheme
Fi+1/2 = F (Ui, Ui+1)
• Reconstruction variables
1. Conserved variables - conservative
2. Characteristic variables - better upwinding but costly
3. Primitive variables (ρ, u, p) - computationally cheap
• Unsteady flows - reconstruction must preserve conservation
Z
1
Ũ (x)dx = Ui
hi Ci
• Gradients for reconstruction: backward, forward, central difference
Ui − Ui−1 Ui+1 − Ui Ui+1 − Ui−1
si,b = , si,f = , si,c =
xi − xi−1 xi+1 − xi xi+1 − xi−1
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Flux for higher order scheme
L R
Fi+1/2 = F (Ui+1/2 , Ui+1/2 )
• Reconstruction variables
1. Conserved variables - conservative
2. Characteristic variables - better upwinding but costly
3. Primitive variables (ρ, u, p) - computationally cheap
• Unsteady flows - reconstruction must preserve conservation
Z
1
Ũ (x)dx = Ui
hi Ci
• Gradients for reconstruction: backward, forward, central difference
Ui − Ui−1 Ui+1 − Ui Ui+1 − Ui−1
si,b = , si,f = , si,c =
xi − xi−1 xi+1 − xi xi+1 − xi−1
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Solution with discontinuity
1/2
i−1 i i+1
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Central-difference: Non-monotone reconstruction
1/2
i−1 i i+1
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
FVM in 2-D
Ci
Ci
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
I X Z
(f nx + gny )dS = (f nx + gny )dS
∂Ci j∈N (i) Ci ∩Cj
Cj
nij
Ci
Z
(f nx + gny )dS ≈ Fij ∆Sij
Ci ∩Cj
• Semi-discrete update equation
dUi X
|Ci| =− Fij ∆Sij
dt
j∈N (i)
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Numerical flux function
Fij = F (Ui, Uj , n̂ij )
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Grids and Finite Volumes
• Elements in 2-D
• Elements in 3-D
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Boundary layers - prism and hexahedra
• Cell-centered and vertex-centered scheme [5, 18, 21]
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Voronoi cell
– join circum-center to mid-point of sides
– smooth area variation
– not defined for obtuse triangles
• Containment circle tessalation
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Median and containment-circle tessalation
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Stretched triangles - median dual and containment-circle
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Turbulent flow over RAE2822 airfoil: vertex-centered scheme
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Higher order scheme in 2-D
R
U Cj
L
U
Ci
• Face value
1
Uface = (UL + UR )
2
• Non-uniform cells
Uface = αUL + (1 − α)UR , α ∈ (0, 1)
• Accuracy can degrade for non-uniform grids [4, 6, 8, 14]
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Least-squares reconstruction [3, 5]
3
0 1
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Limited reconstruction
– Cell-centered: Min-max [3, 5], Venkatakrishnan [5], ENO-type [1, 14]
– Vertex-centered: edge-based limiter [17]
• Min-max limiter
Umin ≤ Uo + ao(xj − xo) + bo(yj − yo) ≤ Umax, j = 1, 2, 3, 4
(ao, bo) ←− (φao, φbo), φ ∈ [0, 1]
– Very dissipative - smeared shocks
– Performance degrades on coarse grids
– Stalled convergence - limit cycle
– Useful for flows with large discontinuities
• Venkatakrishnan limiter
– Smooth modification of min-max limiter
– Better control - depends on cell size
– Better convergence properties
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Vertex-centered cell: Edge-based limiter
L R i+2
i+1
i−1 i
1 |P P
i i+1 |
U L = Ui + Limiter (Ui+1 − Ui), (Ui − Ui−1)
2 |PiPi−1|
• Using vertex-gradients
1 h i
U = Ui + Limiter (Ui+1 − Ui), (P~i+1 − P~i) · ∇Ui
L
2
• Van-albada limiter
(a2 + )b + (b2 + )a
Limiter(a, b) = , 1
a2 + b2 + 2
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Higher order flux quadrature
R
U1
L
U1
R
U2
L
Ci U2
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Discretization of viscous flux
• Viscous terms
∇ · µ∇u
• Finite volume discretization
Z I
(∇ · µ∇u)dV = (µ∇u · n̂)dS
Ci ∂Ci
• Simple averaging
1
∇uij = (∇ui + ∇uj )
2
– Odd-even decoupling on quadrilateral/hexahedral cells
– Large stencil size
• 1-D case: ut = uxx
∆t n
un+1
i = uni + (ui−2 − 2uni + uni+2)
2h
• Correction for decoupling problem [5]
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Green-Gauss theorem for auxiliary volume
Face−centered volume
j
i
• Least-squares gradients
– Quadratic reconstruction: gradients and hessian [3]
– Face-centered least-squares
• Vertex-centered scheme
– Galerkin approximation on triangles/tetrahedra
– Nearest neighbour stencil
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Turbulence models
(·) ± |(·)| 1
, (·)± = uij = (ui + uj )
2 2
• Coupled or de-coupled approach
• Stiffness problem - positivity preserving implicit methods
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Boundary conditions
• Cell-centered approach
1. Ghost cell
2. Flux boundary condition
Boundary
w
Ghost cell g
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Boundary flux depends on pressure only
F (Uw , Ug , n̂) = function of p only
• Flux boundary condition
(F~ · n̂)wall = p[0, nx, ny , 0]>
1. Extrapolate pressure from interior cells
2. Solve normal momentum equation [2]
• Vertex-centered approach - flux boundary condition
• Boundary cell in vertex-centered scheme
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Accuracy and Stability
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• If Ui is a local maximum =⇒ Uj − Ui ≤ 0
dUi X
= aij (Uj − Ui) ≤ 0 =⇒ Ui does not increase
dt
j∈N (i)
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
Data structures and Programming
------------------------------------------------------
for cell = 1 to Ncell
FluxDiv = 0
for face = 1 to Nface(cell)
cellNeighbour = CellNeighbour(cell, face)
flux = NumFlux(cell, cellNeighbour)
FluxDiv += flux
end
Unew(cell) = Uold(cell) - dt*FluxDiv
end
------------------------------------------------------
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
• Face-based updating
------------------------------------------------------
FluxDiv(:) = 0
for face = 1 to Nface
LeftCell = FaceCell(face,1)
RightCell = FaceCell(face,2)
flux = NumFlux(LeftCell, RightCell)
FluxDiv(LeftCell) += flux
FluxDiv(RightCell) -= flux
end
Unew(:) = Uold(:) - dt*FluxDiv(:)
------------------------------------------------------
• Flux computations reduced by half - speed-up of two
• Other geometric quantities - cell centroids, face areas, face normals, face
centroids
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
References
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
[6] Delanaye M., Geuzaine Ph. and Essers J. A., “Development and application
of quadratic reconstruction schemes for compressible flows on unstructured
adaptive grids”, AIAA-97-2120, 1997.
[7] Feistauer M., Felcman J. and Straskraba I., Mathematical and Computa-
tional Methods for Compressible Flow, Clarendon Press, Oxford, 2003.
[8] Frink N. T., “Upwind scheme for solving the Euler equations on unstructured
tetrahedral meshes”, AIAA J. 30(1), 70, 1992.
[9] Godlewski E. and Raviart P.-A., Hyperbolic Systems of Conservation Laws,
Paris, Ellipses, 1991.
[10] Godlewski E. and Raviart P.-A., Numerical Approximation of Hyperbolic
Systems of Conservation Laws, Springer, 1996.
[11] Carl Ollivier-Gooch and Michael Van Altena, “A high-order-accurate unstruc-
tured mesh finite-volume scheme for the advection-diffusion equation”, JCP,
181, 729-752, 2002.
[12] Hirsch Ch., Numerical Computation of Internal and External Flows, Vol. 1,
Wiley, 1988.
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
[13] Hirsch Ch., Numerical Computation of Internal and External Flows, Vol. 2,
Wiley, 1989.
[14] Jawahar and Kamath H., “A High-Resolution Procedure for Euler and Navier-
Stokes Computations on Unstructured Grids“, Journal of Computational
Physics, Vol. 164, No. 1, pp. 165-203, 2000
[15] Kallinderis Y. and Ahn H. T., “Incompressible Navier-Stokes method with
general hybrid meshes”, J. Comp. Phy., Vol. 210, pp. 75-108, 2005.
[16] LeVeque R. J., Finite Volume Methods for Hyperbolic Equations, Cambridge
University Press, 2002.
[17] Lohner R., Applied CFD Techniques: An Introduction based on FEM, Wiley.
[18] Mavriplis D. J., “Unstructured grid techniques”, Ann. Rev. Fluid Mech.,
29:473-514, 1997.
[19] Sonar Th., “Finite volume approximations on unstructured grids”, VKI Lec-
ture Notes.
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit
[20] Toro E., Riemann Solvers and Numerical Methods for Fluid Dynamics,
Springer.
[21] Venkatakrishnan V, “Perspective on unstructured grid flow solvers”, AIAA
Journal, vol. 34, no. 3, 1996.
[22] Wesseling P., Principles of Computational Fluid Dynamics, Springer, 2001.
Thank You
These slides can be downloaded from
http://pc.freeshell.org/pub/annamalai.pdf
Praveen. C, CTFD Division, NAL, Bangalore First Prev Next Last Go Back Full Screen Close Quit