FMIA F Moukalled L Mangani M Darwish 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 Moukalled Mangani Darwish Fluid Mechanics and Its Applications 113 Series Editor: A Thess The Finite Volume Method in Computational Fluid Dynamics 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 Fluid Mechanics and Its Applications F Moukalled L Mangani M Darwish The Finite Volume Method in Computational Fluid Dynamics The Finite Volume Method in Computational Fluid Dynamics An Advanced Introduction with OpenFOAM and Matlab Engineering ISBN 78-3-31-16873- 78331 16873 The Finite Volume Mesh Chapter 06
The Process Physical Domain Physical Phenomena Domain Modeling Physical Modeling Set of Governing Equations Defined on a Computational Domain Domain Discretization Equation Discretization Structured Grids Cartesian, Non-Orthogonal) Block Structured grids Unstructured Grids Chimera Grids System of Algebraic Equations Finite Difference Finite Volume Finite Element Boundary Element Solution Method Numerical Solutions Combinations of Multigrid Methods Iterative Solvers Coupled-Uncoupled 2
heat sink microprocessor heat spreader base Domain Modeling Physical Modeling heat sink heat spreader base T sink insulated ( k T )!q microprocessor T microprocessor Domain Discretization Equations Discretization Patch#2 Patch#1 ( ρφ) + ( ρvφ) t ( Γ φ ) + Q transient term convection term a C φ C + diffusion term F NB C source term a F φ F b C ( ) Patch#3 Solution Method 3
Domain Modeling Physical Modeling heat sink heat spreader base Tsink Insulated Q simk Qsource ( k T ) Q microprocessor Tmicroprocessor Domain Discretization Patch#2 Patch#1 Equations Discretization Patch#3 ( ) ρφ + ( ρvφ) t ( Γ φ ) + Q transient term convection term a C φ C + diffusion term NB( C) source term a NB φ NB b P Solution Method 4
Domain Discretization T sink Insulated node element node element T microprocessor face face (a) (b) (c) Figure 61 (a) Domain of interest, (b) domain discretized using a uniform grid system, and (c) domain discretized using an unstructured grid system with triangular elements 5
Gradient Computation Given a field defined over a mesh, we want to compute the field gradient given φ C compute φ C φ C V C V C φ dv f S f1 φ C V C! V C φ ds φ C V C V C φ ds φ C 1 V C ( ) f nb C φ f S f 6
Gradient Computation F 1 S f F 5 S f1 F 2 C f F 3 F 4 φ i, j 1 V i, j ( ) f nb i, j φ f S f φ f f ( φ C,φ ) F φ f g F φ F + g C φ C 7
Structured Grid Nj j +1 j j 1 1 1 i 1 i i +1 Ni Figure 63 local indices and topology 8
Indices a C( 1)!!! a C( 2)!!! a C( 3)!!!!!!!!!!!! a C( n 1)! Nj j +1 j j 1 global index local indices ( ) Ni n i + j 1 a F( n Ni) a F( n 1) a C( n) a F( n+1) a F( n+ni)!! a C( n+1)!!!!!!!!!!!!!!!!!!!!! a C( 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) 1 1 i 1 i i +1 Ni Figure 64 Local versus global indices
Structured Mesh S i 1/2, j S1( i, j) Element( i, j) φ i 1, j+1 φ i 1, j φ i, j+1 φ ij φ i+1, j+1 φ i+1, j (a) local indexing S2( i, j) φ i 1, j 1 φ i, j 1 φ i+1, j 1 S i, j 1/2 φ n-1+ni φ n+ni φ n+1+ni φ n φ n-1 φ n+1 b) global indexing Figure 65 Geometric Information φ n-1-ni φ n-ni φ n+1-ni φ NW φ N φ NE Figure 66 Local versus discretization versus global indices φ W φ SW φ C φ S φ E φ SE (c) discretization indexing 10
Unstructured Mesh indexing 28 21 20 1 26 27 22 18 17 7 25 6 24 8 11 23 10 15 14 12 16 13 5 1 2 3 4 F 4 11 F 6 S f6 F 5 S f5 C S f4 S f3 F 3 Element Connectivity Neighbours Faces 1 2 3 5 6 [10 11 8 6 1 2] 1 2 3 4 5 6 [16 22 23 15 11 10] local index global index local index global index 6 8 15 23 22 16 10 F 1 S f1 S f2 F 2 Nodes 1 2 3 4 5 6 local index [21 22 21 14 13 12] global index 1 11 10 2 (a) Figure 68 Element connectivity and face orientation using (a) local indices and (b) global indices (b) 11
Owners and Neighbours owner owner face S f neighbour face neighbour S f (a) (b) Fig 6 Owners, neighbors, and faces for (a) 2D and (b) 3D elements 12
Connectivities 8 23 22 11 Face Connectivity 1 2 local index Elements [8 ] global index 11 Face Connectivity 1 2 local index Elements [ 11] global index 15 8 23 22 16 Face Connectivity 1 2 local index Elements [6 ] global index 6 6 15 1 11 10 2 16 10 10 Face Connectivity 1 2 local index Elements [ 10] global index Face Connectivity 1 2 local index Elements [1 ] global index 11 1 2 10 Face Connectivity 1 2 local index Elements [2 ] global index Figure 610 An example of face, element, and node connectivities for unstructured grids 13
Unstructured Mesh 28 21 20 1 26 27 22 18 17 7 25 6 24 8 11 23 10 15 14 12 16 13 5 1 2 3 4 Figure 611 An unstructured mesh system 14
Non-Orthogonality N θ S f1f C Figure 612 Angle between surface vector and vector joining the centroids of the owner and neighbor elements 15
Elements Tetrahedron Hexahedron Prism Polyhedron Figure 613 Three-dimensional element types Quadrilateral Triangle Pentagon Figure 614 Three-dimensional face types or two-dimensional element types 16
Element INformation sub-triangle centroid polygon center centroid Figure 615 The geometric centre and centroid of a polygon S f x G 1 k ( x CE ) f k i1 x i S t t~sub triangles( C) ( x CE ) t *S t t~sub triangles( C) S f S 1 ( 2 r r 2 1) ( r 3 r 1 ) 1 2 i j k x 2 x 1 y 2 y 1 z 2 z 1 x 3 x 1 y 3 y 1 z 3 z 1 S x i + S y j + S z k 17
G x G 1 k k i1 x i G d Gf ( x CE ) pyramid 075( x CE ) f + 025( x G ) pyramid d Cf f S S f f Figure 617 A sub-element pyramid V pyramid d S Gf f 3 V C V pyramid ~Sub pyramids(c ) ( x CE ) pyramid V pyramid ~Sub pyramids( C) V C ( x CE ) C x C 18
Face Weights φ F φ f φ f g f φ F + ( f 1 g f )φ C g f d Cf d Cf + d ff φ C C F Figure 618 One dimensional mesh system g f V C V C + V F C f F Figure 61 Axisymmetric grid system g f d Cf e f d Cf e f + d ff e f e f S f S f C f f F C d Cf f f f d ff e f S f F 1 Figure 620 Two dimensional control volume