Block (2D Space-Time Compressible NS) Derivation: I. Coefficient Matrices M. Behr http://www.cats.rwth-aachen.de/library/research/technotes Abstract This note describes the derivation of the generalized advective-diffusive equation system from the 2D space-time compressible Navier-Stokes governing equations, in conservation form. 1. Introduction Starting with the governing equations, we derive the coefficient matrices used to express these equations as a generalized advective-diffusion system. Large portion of the material follows Aliabadi [1] and Mittal and Tezduyar [2]. See also a separate technical note: http://www.cats.rwth-aachen.de:8080/pdf/tn-blkcns3dst-derivation.pdf which describes the derivation of the generalized advective-diffusive equation system from the 3D space-time compressible Navier-Stokes equations. 2. Governing Equations Let Ωt ⊂ R2 and (0, T ) be the spatial and temporal domains respectively, and let Γt denote the boundary of Ωt . The spatial and temporal coordinates are denoted by x and t. The Navier-Stokes equations of compressible flows in conservation form are: ∂ρ + ∇ · (ρu) = 0 ∂t ∂ (ρu) + ∇ · (ρuu) + ∇p − ∇ · T = 0 ∂t ∂ (ρe) + ∇ · (ρeu) + ∇ · (pu) − ∇ · (Tu) + ∇ · q = 0 ∂t on Ωt ∀t ∈ (0, T ), (1) on Ωt ∀t ∈ (0, T ), (2) on Ωt ∀t ∈ (0, T ). (3) Here ρ(x, t), u(x, t), p(x, t), T(x, t), e(x, t), and q(x, t) are the density, velocity, pressure, viscous stress tensor, total energy per unit mass, and the heat flux vector, respectively. The viscous stress tensor is defined as: T = µ ∇u + (∇u)T + λ (∇·u) I, (4) where µ and λ are the viscosity coefficients, assumed to be related by: 2 λ = − µ. 3 (5) Block (2D Space-Time Compressible NS) Derivation I M. Behr Pressure is related to the other variables via the equation of state. For ideal gases, the equation of state assumes the special form: p = (γ − 1)ρi, (6) where γ is the ratio of specific heats and i is the internal energy per unit mass. The internal energy is related to the total energy and kinetic energy as: 1 i = e − u2 . 2 (7) q = −κ∇θ, (8) The heat flux vector is defined as where κ is the heat conductivity and θ is the temperature. The temperature is related to the internal energy with the following expression: θ= i , Cv (9) where Cv is the specific heat of the fluid at constant volume. For an ideal gas Cv = R , γ−1 (10) where R is the ideal gas constant. Prandtl number (Pr), assumed to be specified, relates the heat conductivity of the fluid to its viscosity according to: κ= µCp , Pr (11) where Cp is the specific heat of the fluid at constant pressure. For an ideal gas Cp = γR . γ−1 (12) Equations (1), (2), and (3) may be written in conservation variables as: ∂U ∂Fi ∂Ei + − =0 ∂t ∂xi ∂xi on Ωt ∀t ∈ (0, T ), (13) where U = (ρ, ρu1 , ρu2 , ρe) is the vector of conservation variables, and Fi and Ei are, respectively, the Euler and viscous flux vectors defined as: ui ρ uiρu1 + δi1 p (14) Fi = uiρu2 + δi2 p , ui (ρe + p) 2 Block (2D Space-Time Compressible NS) Derivation I 0 τi1 . Ei = τi2 −qi + τik uk M. Behr (15) Here ui, qi , and τik are the components of the velocity, heat flux, and viscous stress tensor, respectively. Equation (13) can be re-written as ∂U ∂U ∂U ∂ + Ai − (16) Kij =0 on Ωt ∀t ∈ (0, T ), ∂t ∂xi ∂xi ∂xj where ∂Fi ∂U is the Euler Jacobian matrix, and Kij is the diffusivity matrix satisfying: Ai = Kij ∂U = Ei . ∂xj (17) (18) Corresponding to Equation (16), the boundary and initial conditions are represented as: U = g on Γg ∀t ∈ (0, T ), n · E = h on Γh ∀t ∈ (0, T ), U(x, 0) = U0 on Ω0 . (19) (20) (21) 3. Coefficient Matrices The coefficient matrices of the generalized advective-diffusive system (16) use the following additional parameters for simplicity: γ̄ = γ − 1, κ , µ̄ = µ − Cv c1 = γ̄u2 − γe, γ̄ c2 = γe − u2 , 2 κ 1 2 u − i − µu2 c3 = Cv 2 κ u2 − e − µu2 . = Cv 3 (22) (23) (24) (25) (26) (27) Block (2D Space-Time Compressible NS) Derivation I M. Behr In order to derive the matrices A1 and A2 one has to express the fluxes F1 and F2 solely in terms of the independent variables U: u1 ρ u ρu + p 1 1 F1 = (28) u1 ρu2 = = u1 (ρe + p) u1 ρ u1 ρu1 + γ̄ρ e − 12 u2 u ρu 1 12 u1 ρ γe − 2 γ̄u2 (ρu1 ) 2 (ρu1 ) /(ρ) + γ̄(ρe) − γ̄2 (ρu1 )2 /(ρ) − γ̄2 (ρu2 )2 /(ρ) (ρu1 )(ρu2 )/(ρ) γ̄ γ(ρu1 )(ρe)/(ρ) − 2 (ρu1 )3 /(ρ)2 − γ̄2 (ρu1 )(ρu2 )2 /(ρ)2 (29) . (30) Similarly, F2 = = u2 ρ u2 ρu1 u2 ρu2 + p u2 (ρe + p) (31) (ρu2 ) (ρu2 )(ρu1 )/(ρ) (ρu2 )2 /(ρ) + γ̄(ρe) − γ̄2 (ρu1 )2 /(ρ) − γ̄2 (ρu2 )2 /(ρ) γ(ρu2 )(ρe)/(ρ) − γ̄2 (ρu2 )(ρu1 )2 /(ρ)2 − γ̄2 (ρu2 )3 /(ρ)2 The advective coefficient matrices can now be clearly derived as: 0 1 0 0 γ̄ ||u||2 − u u (3 − γ)u1 −γ̄u2 γ̄ 1 1 A1 = 2 −u1 u2 u2 u1 0 c2 − γ̄u1 u1 −γ̄u1 u2 γu1 c1 u 1 0 0 1 0 −u2 u1 u2 u1 0 A2 = γ̄ 2 2 ||u|| − u2 u2 −γ̄u1 (3 − γ)u2 γ̄ −γ̄u2 u1 c2 − γ̄u2 u2 γu2 c1 u 2 4 . (32) , (33) . (34) Block (2D Space-Time Compressible NS) Derivation I M. Behr The diffusive coefficient matrices are obtained by expanding the diffusive flux terms in terms of derivatives of the variables U: 0 τ11 E1 = τ12 −q1 + τ11 u1 + τ12 u2 0 1 1 2 + λ ∂u + ∂u 2µ ∂u ∂x ∂x ∂x 1 1 2 = ∂u2 1 + µ ∂u ∂x ∂x 2 1 ∂u1 ∂u1 ∂u2 ∂u1 ∂u2 ∂θ κ ∂x1 + 2µ ∂x1 u1 + λ ∂x1 + ∂x2 u1 + µ ∂x2 + ∂x1 u2 0 4µ ∂u1 ∂u2 − 2µ 3 ∂x1 3 ∂x2 = ∂u1 ∂u2 µ + µ ∂x2 ∂x1 4µ 2µ ∂u1 ∂u2 ∂u1 ∂u2 κ ∂e κ ∂u2 − 2Cv ∂x1 + 3 u1 ∂x1 − 3 u1 ∂x2 + µu2 ∂x2 + µu2 ∂x1 Cv ∂x1 0 ∂((ρu2 )/(ρ)) 4µ ∂((ρu1 )/(ρ)) − 2µ 3 ∂x1 3 ∂x2 ∂((ρu2 )/(ρ)) µ ∂((ρu∂x1 )/(ρ)) + µ ∂x 2 1 2 /(ρ)2 2 /(ρ)2 = ∂ (ρu ) ∂ (ρu ) ( 1 ) ( 2 ) κ ∂((ρe)/(ρ)) κ κ − − Cv ∂x1 2Cv ∂x1 2Cv ∂x1 ∂((ρu1 )/(ρ)) ∂((ρu2 )/(ρ)) 2µ . . . + 4µ u − u 3 1 ∂x1 3 1 ∂x2 ∂((ρu1 )/(ρ)) ∂((ρu2 )/(ρ)) . . . + µu2 + µu2 ∂x2 ∂x1 0 ∂(ρu2 ) 4µ ∂(ρu1 ) − 4µ u ∂(ρ) − 2µ + 2µ u ∂(ρ) 3 ∂x1 3 1 ∂x1 3 ∂x2 3 2 ∂x2 ∂(ρu1 ) ∂(ρu2 ) ∂(ρ) ∂(ρ) µ − µu + µ − µu 1 1 2 ∂x ∂x ∂x ∂x 2 2 1 1 = ∂(ρu1 ) ∂(ρu2 ) κ ∂(ρe) κ ∂(ρ) κ κ κ 2 ∂(ρ) ρ Cv ∂x1 − Cv e ∂x1 − Cv u1 ∂x1 − Cv u2 ∂x1 + Cv u ∂x1 . . . + 4µ u ∂(ρu1 ) − 4µ u2 ∂(ρ) − 2µ u ∂(ρu2 ) + 2µ u u ∂(ρ) 3 1 ∂x1 3 1 ∂x1 3 1 ∂x2 3 1 2 ∂x2 1) 2) . . . + µu2 ∂(ρu − µu1u2 ∂(ρ) + µu2 ∂(ρu − µu22 ∂(ρ) ∂x2 ∂x2 ∂x1 ∂x1 0 ∂(ρu2 ) 4µ ∂(ρu1 ) − 4µ u ∂(ρ) − 2µ + 2µ u ∂(ρ) 3 ∂x1 3 1 ∂x1 3 ∂x2 3 2 ∂x2 ∂(ρ) ∂(ρ) ∂(ρu1 ) ∂(ρu2 ) µ ∂x2 − µu1 ∂x2 + µ ∂x1 − µu2 ∂x1 1 ∂(ρe) ∂(ρ) µ = (35) κ κ , 2 2 + (u − e) − µu − u u 1 1 ρ Cv ∂x1 Cv 3 ∂x1 ∂(ρu1 ) ∂(ρu2 ) 4µ κ κ . . . + − + µ − u u 1 ∂x1 2 ∂x1 3 Cv Cv ∂(ρu2 ) ∂(ρ) ∂(ρu1 ) 2µ µ . . . − 3 u1 ∂x2 − 3 u1 u2 ∂x2 + µu2 ∂x2 with terms coded blue-green contributing to the K11 coefficient matrix, and terms coded purple contributing to the K12 matrix. 5 Block (2D Space-Time Compressible NS) Derivation I Similarly, second diffusive flux can be expanded as: 0 τ21 E2 = τ22 −q2 + τ21 u1 + τ22 u2 0 2 1 + ∂u µ ∂u ∂x1 ∂x2 = ∂u2 ∂u1 ∂u2 2µ ∂x2 + λ ∂x1 + ∂x2 ∂u2 ∂u1 ∂u2 ∂u1 ∂u2 ∂θ + µ + + 2µ u + λ + κ ∂x u u 1 2 ∂x1 ∂x2 ∂x2 2 ∂x1 ∂x2 2 0 2 1 + µ ∂u µ ∂u ∂x1 ∂x2 = 4µ ∂u2 2µ ∂u1 − 3 ∂x2 3 ∂x1 2 4µ 2µ ∂u2 ∂u1 ∂u2 ∂u1 κ ∂e κ ∂u − 2Cv ∂x2 + µu1 ∂x1 + µu1 ∂x2 + 3 u2 ∂x2 − 3 u2 ∂x1 Cv ∂x2 0 µ ∂((ρu∂x2 )/(ρ)) + µ ∂((ρu∂x1 )/(ρ)) 1 2 )/(ρ)) )/(ρ)) ∂((ρu ∂((ρu 4µ 2µ 2 1 − 3 3 ∂x ∂x 2 1 2 /(ρ)2 2 /(ρ)2 = ∂ (ρu ) ∂ (ρu ) ( ) ( ) 1 2 κ ∂((ρe)/(ρ)) κ κ − − Cv ∂x2 2Cv ∂x2 2Cv ∂x2 ∂((ρu2 )/(ρ)) ∂((ρu1 )/(ρ)) . . . + µu1 + µu1 ∂x1 ∂x2 ∂((ρu2 )/(ρ)) ∂((ρu1 )/(ρ)) 4µ 2µ . . . + 3 u2 − 3 u2 ∂x2 ∂x1 0 2) 1) − µu2 ∂(ρ) + µ ∂(ρu − µu1 ∂(ρ) µ ∂(ρu ∂x1 ∂x1 ∂x2 ∂x2 ∂(ρu2 ) ∂(ρu1 ) ∂(ρ) ∂(ρ) 4µ 4µ 2µ 2µ − 3 u2 ∂x2 − 3 ∂x1 + 3 u1 ∂x1 1 3 ∂x2 = ∂(ρu1 ) ∂(ρu2 ) κ ∂(ρe) κ ∂(ρ) κ κ κ 2 ∂(ρ) ρ Cv ∂x2 − Cv e ∂x2 − Cv u1 ∂x2 − Cv u2 ∂x2 + Cv u ∂x2 2) 1) . . . + µu1 ∂(ρu − µu1u2 ∂(ρ) + µu1 ∂(ρu − µu21 ∂(ρ) ∂x1 ∂x1 ∂x2 ∂x2 . . . + 4µ u ∂(ρu2 ) − 4µ u2 ∂(ρ) − 2µ u ∂(ρu1 ) + 2µ u u ∂(ρ) 3 2 ∂x2 3 2 ∂x2 3 2 ∂x1 3 1 2 ∂x1 0 2) 1) − µu2 ∂(ρ) + µ ∂(ρu − µu1 ∂(ρ) µ ∂(ρu ∂x1 ∂x1 ∂x2 ∂x2 ∂(ρ) ∂(ρ) 4µ ∂(ρu2 ) 4µ 2µ ∂(ρu1 ) 2µ − 3 u2 ∂x2 − 3 ∂x1 + 3 u1 ∂x1 3 ∂x 2 1 ∂(ρ) µ = κ ∂(ρe) κ , 2 2 + (u − e) − µu − u u 2 2 ρ Cv ∂x2 Cv 3 ∂x2 ∂(ρu1 ) ∂(ρu2 ) 4µ κ κ . . . + µ − + − u u 1 2 Cv ∂x2 3 Cv ∂x2 ∂(ρu2 ) ∂(ρ) ∂(ρu1 ) µ 2µ . . . + µu1 ∂x1 − 3 u1 u2 ∂x1 − 3 u2 ∂x1 M. Behr (36) with terms coded blue-green contributing to the K21 coefficient matrix, and terms coded purple contributing to the K22 matrix. 6 Block (2D Space-Time Compressible NS) Derivation I M. Behr The diffusive coefficient matrices can now be derived as: 0 0 0 4µ 4µ 0 1 − 3 u1 3 K11 = ρ −µu2 0 µ µ µ µ̄u2 c3 − 3 u1 u1 3 + µ̄ u1 K12 = 1 ρ K21 = 1 ρ K22 = 1 ρ 0 0 0 0 0 µ µu2 0 − 2µ 3 0 2µ − 3 u1 0 0 0 0 0 −µu2 2µ u 3 1 µ − 3 u2 u1 0 0 − 2µ 3 − 2µ u 3 2 0 µ 0 µu1 0 0 0 0 0 −µu1 − 4µ u 3 2 µ c3 − 3 u 2 u 2 0 µ 0 µ̄u1 0 0 0 0 0 µ 3 + µ̄ u2 , (37) κ Cv 0 2µ u 3 2 −µu1 − µ3 u1 u2 4µ 3 , (38) , (39) . (40) κ Cv Given these coefficient matrices, the element-level matrices are derived in a standard fashion as for any generalized advective-diffusion system. 4. Implementation The above system is implemented in the standard generalized advective-diffusive framework in the blkcns2dst.F subroutine. The following variables are used in the code: 7 Block (2D Space-Time Compressible NS) Derivation I Variable name Quantity dr ρ ru ρu1 rv ρu2 re ρe vels ||u||2 difq µ/ρ µ di13 /ρ 3 4µ di43 /ρ 3 c1 c1 /ρ c3 c3 /ρ M. Behr Variable name Quantity du dv de u1 u2 e kapq di23 dbar c2 κ /ρ Cv 2µ /ρ 3 µ̄ c2 /ρ History April 29, 1999 April 30, 1999 January 25, 2000 May 3, 2001 Written (a separate note about element-level matrices will follow). Implemented. Corrections in expressions for E1 . Added implementation section. References [1] S.K. Aliabadi, Parallel Finite Element Computations in Aerospace Applications, Ph.D. thesis, University of Minnesota, Department of Aerospace Engineering and Mechanics, 1994. [2] S. Mittal and T.E. Tezduyar, “A unified finite element formulation for compressible and incompressible flows using augmented conservation variables”, Computer Methods in Applied Mechanics and Engineering, 161 (1998) 229–243. 8