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 978-3-319-16873-9 9 783319 168739 Mathematical Review Chapter 02
Vector Operations z v = ui + vj+ wk v = u v w v T = u v w v = u 1 w 1 = v 2 2 2 = u + v + w + = u 1 + + w 1 + x u v w y sv = s( ui + vj+ wk) = sui + svj+ swk = su sv sw 2
Dot Product = cos(, ) i i = j j = k k = 1 i j = i k = j i = j k = k i = k j = 0 α = cos( α) = ( u 1 i + j+ w 1 k) ( i + j+ k) = u 1 + + w 1 = cos α ( ) vector magnitude unit vector α v = v v e v = v v 3
Cross Product v 3 = = sin(, ) = ( u 1 i + j+ w 1 k ) ( i + j+ k ) = u 1 i i + u 1 i j+ u 1 i k + j i + j j+ j k +w 1 k i + w 1 k j+ w 1 k k ( ) ( ) + 0 + i ( ) + w 1 0 = u 1 0 + u 1 k + u 1 j + k +w 1 j+ w 1 i determinant notation = v 3 = α i j k u 1 w 1 = area v 3 = sin α i i = j j = k k = 0 i j = k = j i j k = i = k j k i = j = i k w 1 w 1 u 1 u 1 ( ) 4
Scalar Triple Product volume ( ) v 3 u 1 w 1 ( ) = v 3 u 3 v 3 w 3 β v 3 α The scalar triple product represent the volume defined by the paralleled formed by the base vector 5
Gradients Nabla operator Gradient = i x + j y + k z s C e l l directional derivative s = s( x, y,z) = ds dl = s e l φ = i φ x + j φ y + k φ i k j x y Directional Derivative ds dl = s e = s cos s,e l ( l ) 6
Divergence divergence v = x x + y y + z divergence of the gradient of a scalar is the Laplacian of the scalar curl = 0 curl ( s) = 2 s = 2 s x + 2 s 2 y + 2 s 2 2 φ = ( φ) = 2 φ == 2 v x x 2 + 2 v y y 2 + 2 v z 2 v = x i + y j+ k = i j k x y u v w ( ui + vj+ wk) = y i + u x j+ x u y k divergence = 0 7
Tensors τ yy τ yx τ = τ xx τ xy τ xz τ yx τ yy τ yz τ zx τ zy τ zz τ xx τ xy τ xz τ yz τ zy τ zx τ zz τ = iiτ xx + ijτ xy + ikτ xz + jiτ yx + jjτ yy + jkτ yz + kiτ zx + kjτ zy + kkτ zz 8
Other Tensors { vv} = ( ui + vj+ wk) ( ui + vj+ wk) = iiuu + ijuv + ikuw + jivu + jjvv + jkvw + kiwu + kjwv + kkww { vv} = uu uv uw vu vv vw wu wv ww Velocity gradient { v} = x i + y j+ k = ii u + ij + ik x x x + ji u + jj + jk y y y + ki u + kj + kk ( ui + vj+ wk) 9 { v} = u x u y u x y x y
Tensor Operations Σ = σ + τ = σ xx + τ xx σ xy + τ xy σ xz + τ xz σ yx + τ yx σ yy + τ yy σ yz + τ yz σ zx + τ zx σ zy + τ zy σ zz + τ zz { sτ } = sτ xx sτ xy sτ xz sτ yx sτ yy sτ yz sτ zx sτ zy sτ zz τ v = iiτ + ijτ + ikτ + jiτ + xx xy xz yx ui + vj+ wk jjτ yy + jkτ yz + kiτ zx + kjτ zy + kkτ zz ( ) τ v = τ xx τ xy τ xz τ yx τ yy τ yz τ zx τ zy τ zz u v w 10 = τ xx u + τ xy v + τ xz w τ yx u + τ yy v + τ yz w τ zx u + τ zy v + τ zz w
Tensor Operations divergence of a tensor τ = τ xx x + τ yx y + τ zx i + τ xy x + τ yy y + τ zy j+ τ xz x + τ yz y + τ zz k double dot product of two tensors ( τ : v) = ii u iiτ xx + ijτ xy + ikτ xz + x jiτ yx + jjτ yy + jkτ yz + : ji u kiτ zx + kjτ zy + kkτ y zz ki u u ( τ : v) = τ xx x + τ xy τ yy y + τ yz u y + τ xz + τ zx u + τ yx 11 x + x + τ zy + ij x + jj y + kj y + τ zz + jk y + + kk + ik x +
Tensor Operations Deformation tensor D( v) = 1 2 Spin tensor ( v + vt ) = ) + + + + + + + + * + 1 # 2 $ % 1 2 # $ % x x x y + y x x + z x & ' ( & ' ( 1 # 2 $ % 1 # 2 $ % y x + x y y y y + z y & ' ( 1 2 # $ % 1 # 2 $ % z x + x z y + y & z ' ( symmetric part of &, ' (... &. ' (.... -. v S ( v) = v D( v) = 1 2 ( v vt ) Skew-symmetric part of v trace( v) = v 12
Gradients Theorem for Line Integrals C z r(t) C s dr ( ) s( r( a) ) = s r( b) r(a) r(b) y x The gradient theorem for line integrals relates a line integral to the values of a function at its endpoints 13
Green s Theorem Convert a volume integral to a surface integral and reduce the order of equations by one ( udx + vdy) = x u! C R y dxdy C dr = dxi + dyj v = ui + vj ds = dxdyk! v dr = v ds C R R dr ds 14
Stoke s Theorem v ds =! v dr S C z S ds v y x C 15
Divergence Theorem ( v)dv =! v nds V S z ds S ds = nds y x v V 16
Leibniz Integral Rule d dt b( t) φ( x,t)dx = a( t) b( t) φ t dx a( t)!" # $# Term I ( ) b + φ b( t),t!#"# $ t Term II ( ) a φ a( t),t! #" ## $ t Term III φ φ( x,t + Δt) Term I φ( x,t) Term III Term II a( t) a( t + Δt) b( t) b( t + Δt) t 17