Chapter 06 The Finite Volume Mesh - American University of ...€¦ · This textbook explores both...
Transcript of Chapter 06 The Finite Volume Mesh - American University of ...€¦ · This textbook explores both...
FMIA
ISBN 978-3-319-16873-9
Fluid Mechanics and Its ApplicationsFluid Mechanics and Its ApplicationsSeries Editor: A. Thess
F. MoukalledL. ManganiM. Darwish
The Finite Volume Method in Computational Fluid DynamicsAn Advanced Introduction with OpenFOAM® and Matlab®
The Finite Volume Method in Computational Fluid Dynamics
Moukalled · Mangani · Darwish
113
F. Moukalled · L. Mangani · M. Darwish The Finite Volume Method in Computational Fluid Dynamics An Advanced Introduction with OpenFOAM® and Matlab ®
This textbook explores both the theoretical foundation of the Finite Volume Method (FVM) and its applications in Computational Fluid Dynamics (CFD). Readers will discover a thorough explanation of the FVM numerics and algorithms used in the simulation of incompressible and compressible fluid flows, along with a detailed examination of the components needed for the development of a collocated unstructured pressure-based CFD solver. Two particular CFD codes are explored. The first is uFVM, a three-dimensional unstructured pressure-based finite volume academic CFD code, implemented within Matlab®. The second is OpenFOAM®, an open source framework used in the development of a range of CFD programs for the simulation of industrial scale flow problems.
With over 220 figures, numerous examples and more than one hundred exercises on FVM numerics, programming, and applications, this textbook is suitable for use in an introductory course on the FVM, in an advanced course on CFD algorithms, and as a reference for CFD programmers and researchers.
Engineering
9 783319 168739
The Finite Volume MeshChapter 06
The Process
2
Set of Governing Equations Defined on a Computational
Domain
System of Algebraic Equations
Numerical Solutions
Finite DifferenceFinite VolumeFinite Element
Boundary Element
Combinations ofMultigrid MethodsIterative Solvers
Coupled-Uncoupled
Structured GridsCartesian, Non-Orthogonal)
Block Structured gridsUnstructured Grids
Chimera Grids
Physical Phenomena
Physical Domain
Physical ModelingDomain Modeling
Equation DiscretizationDomain Discretization
Solution Method
3
Patch#3
Patch#2 Patch#1
∂ ρφ( )∂t
transientterm
+∇⋅ ρvφ( )
convectionterm
= ∇⋅ Γ∇φ( )
diffusionterm
+ Qsourceterm
• •
• ...
• •
•
..
• • •
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
•••...•••...•••
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
=
•••...•••...•••
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
Domain Modeling Physical Modeling
Domain Discretization Equations Discretization
Solution Method
aCφC + aFφFF∼NB C( )∑ = bC
Tmicroprocessormicroprocessor
heat spreader baseheat sink Tsink insulated
heat sink
heat spreader base
microprocessor
−∇⋅ k∇T( ) = !q
4
microprocessor
heat sink heat spreader base
Domain Modeling
Patch#3
Patch#2 Patch#1
Domain Discretization
∂ ρφ( )∂t
transientterm
+∇⋅ ρvφ( )
convectionterm
= ∇⋅ Γ∇φ( )
diffusionterm
+ Qsourceterm
aCφC + aNBφNBNB C( )∑ = bP
Equations Discretization
• •
• ...
• •
•
..
• • •
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
•••...•••...•••
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
=
•••...•••...•••
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
Solution Method
−∇⋅ k∇T( ) =Q
Tmicroprocessor
Tsink Insulated
Physical Modeling
Qsimk
Qsource
Domain Discretization
5
Insulated
Tmicroprocessor
Tsink node element
face
node element
face
Figure 6.1 (a) Domain of interest, (b) domain discretized using a uniform grid system, and (c) domain discretized using an unstructured grid system with triangular elements.
(a) (b) (c)
Gradient Computation
6
∇φCVC = ∇φ dVVC∫
∇φCVC = φ dS∂VC!∫
∇φCVC = φ dS∫∂VC∑
∇φC = 1VC
φ f S ff =nb C( )∑
∇φC
Given a field defined over a mesh, we want to compute the field gradient
φCgiven compute
f
Sf1
F1
F2
F3F4
F5
C
Sf
Gradient Computation
7
∇φi, j =1V i, j
φ fS ff =nb i, j( )∑ φ f = f φC ,φF( )
Sf1f
φ f = gFφF + gCφC
Structured Grid
8
1 i −1 i +1i Ni
1
Nj
j −1
j
j +1
Figure 6.3 local indices and topology.
Indices
9
aC 1( ) ! !
! aC 2( ) ! !
! aC 3( ) ! !
! • !! ! • !
! ! • !! ! aC n−1( ) !
aF n−Ni( ) aF n−1( ) aC n( ) aF n+1( ) aF n+Ni( )
! ! aC n+1( ) ! !
! ! • ! !! ! • ! !
! ! • !! ! • !
! ! • !! ! aC NiNj( )
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
φ1φ2
φn−Ni
φn−1φnφn+1
φn+Ni
φNiNj
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
=
b 1( )
b 2( )
b n−Ni( )
b n−1( )
b n( )
b n+1( )
b n+Ni( )
b NiNj( )
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
global index
local indices
1 i −1 i +1i Ni
1
Nj
j −1jj +1
n = i + j −1( )Ni
Figure 6.4 Local versus global indices.
Structured Mesh
10
Si−1/2, j Element i, j( )S1 i, j( )
S2 i, j( )
Si, j−1/2
Figure 6.5 Geometric Information.
φi−1, j φi+1, j
φi, j+1
φi, j−1
φi−1, j+1
φi+1, j−1φi−1, j−1
φi+1, j+1
φij
φn-1-Ni φn-Ni
φn
φn+1-Ni
φn-1+Ni φn+Ni φn+1+Ni
φn-1 φn+1
φSW φS
φC
φSE
φ NW φN φNE
φW φE
(a) local indexing
b) global indexing
(c) discretization indexing Figure 6.6 Local versus discretization versus global
indices.
Unstructured Mesh indexing
11
9
26
21 20 19
2227
23
1817
1511
2425
7
814
10
16
1312
43215
6
28
Sf1Sf2
Sf3
Sf4Sf5
Sf6
F4
F5
F3
F2F1
F6C
11
8
10
21
6 916
2223
15
1110
ElementConnectivity
Neighbours
Faces
Nodes
[10 11 8 6 1 2]1 2 3 5 6
[16 22 23 15 11 10]1 2 3 4 5 6
local indexglobal index
local indexglobal index
[21 22 21 14 13 12]1 2 3 4 5 6 local index
global index
Figure 6.8 Element connectivity and face orientation using (a) local indices and (b) global indices.
(a) (b)
Owners and Neighbours
12
owner
neighbour
face
S f
owner
neighbour
face
S f
(a) (b)
Fig. 6.9 Owners, neighbors, and faces for (a) 2D and (b) 3D elements.
Connectivities
13
96
FaceConnectivity
Elements [9 11]1 2 local index
global index
9
8
9
11
9 10
9
2
9
1
FaceConnectivity
Elements [8 9]1 2 local index
global index
FaceConnectivity
Elements [1 9]1 2 local index
global index
FaceConnectivity
Elements [9 10]1 2 local index
global index
FaceConnectivity
Elements [2 9]1 2 local index
global index
FaceConnectivity
Elements [6 9]1 2 local index
global index
118
10
21
6 916
2223
15
1110
22
15
23
11
16
10
Figure 6.10 An example of face, element, and node connectivities for unstructured grids.
Unstructured Mesh
14
9
26
21 20 19
2227
23
1817
1511
2425
7
814
10
16
1312
43215
6
28
Figure 6.11 An unstructured mesh system.
Non-Orthogonality
15
Sf1f
C
Nθ
Figure 6.12 Angle between surface vector and vector joining the centroids of the owner and neighbor elements.
Elements
16
Hexahedron PrismTetrahedron Polyhedron
Figure 6.13 Three-dimensional element types.
TriangleQuadrilateral Pentagon
Figure 6.14 Three-dimensional face types or two-dimensional element types.
Element INformation
17
centroid
sub-triangle centroid
polygon center
Figure 6.15 The geometric centre and centroid of a polygon.
xG = 1k
xii=1
k
∑
Sf = Stt~Sub−triangles C( )
∑
xCE( ) f =xCE( )t *St
t~Sub−triangles C( )∑
Sf
S = 12r2 − r1( )× r3 − r1( ) = 1
2
i j kx2 − x1 y2 − y1 z2 − z1x3 − x1 y3 − y1 z3 − z1
= Sxi + Sy j+ Szk
18
f
G
dGf
S f
d Cf
G
S f
Figure 6.17 A sub-element pyramid.
xG = 1k
xii=1
k
∑xCE( )pyramid = 0.75 xCE( ) f + 0.25 xG( )pyramidVpyramid =
dGf ⋅S f
3VC = Vpyramid
~Sub−pyramids(C )∑
xCE( )C = xC =xCE( )pyramid Vpyramid
~Sub−pyramids C( )∑
VC
Face Weights
19
φ f = gfφF + 1− gf( )φC f
φC
φFφ f
C F
Figure 6.18 One dimensional mesh system.
gf =dCf
dCf + d fF
f
C
Fgf =VC
VC +VF
Figure 6.19 Axisymmetric grid system.
f
′f
C
Ff
′f
′′f
S fe fdCf
d fF
C
F
Figure 6.20 Two dimensional control volume
gf =dCf ⋅e f
dCf ⋅e f + d fF ⋅e f e f =S f
S f