Numerical Solution of Partial Differential Equations governing compressible flows Praveen. C praveen@math.tifrbng.res.in Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in 31 January 2009 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 1 / 45
Description of flow Gas treated as a continuum At every point of space occupied by gas, define density ρ(x, y, z, t) = lim volume 0 mass volume Velocity vector u(x, y, z, t) v(x, y, z, t) w(x, y, z, t) Pressure p(x, y, z, t) = Force lim area 0 area Praveen. C (TIFR-CAM) CFD Jan 31, 2009 2 / 45
Description of flow Temperature: T (x, y, z, t) Thermodynamics: relates ρ, p, T Five quantities: ρ, u, v, w, p completely specify the state of the fluid Require five equations to describe the evolution of the state Praveen. C (TIFR-CAM) CFD Jan 31, 2009 3 / 45
Divergence theorem In Cartesian coordinates, q = (u, v, w) q = u x + v y + w z Divergence theorem dv n V V qdv = V q ˆndS Praveen. C (TIFR-CAM) CFD Jan 31, 2009 4 / 45
Conservation laws Basic laws of physics are conservation laws: mass, momentum, energy, charge Control volume n Streamlines Rate of change of φ in V = -(net flux across V ) φdv = F ˆndS t V V Praveen. C (TIFR-CAM) CFD Jan 31, 2009 5 / 45
Conservation laws If F is differentiable, use divergence theorem φdv = t F dv or V [ ] φ t + F dv = 0, V V φ t + F = 0 In Cartesian coordinates, F = (f, g, h) φ t + f x + g y + h z = 0 for every control volume V Praveen. C (TIFR-CAM) CFD Jan 31, 2009 6 / 45
Mass conservation equation φ = ρ, F = ρ q F ˆndS = amount of mass flowing across ds per unit time Using divergence theorem ρdv + t or ρdv + ρ q ˆndS = 0 t V V V V V (ρ q)ds = 0 [ ] ρ t + (ρ q) dv = 0 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 7 / 45
Mass conservation equation Differential form ρ t + (ρ q) = 0 In Cartesian coordinates, q = (u, v, w) ρ t + x (ρu) + y (ρv) + z (ρw) = 0 Non-conservative form ρ t + u ρ x + v ρ y + w ρ ( u z + ρ x + v y + w ) = 0 z or in vector notation ρ + q ρ + ρ q = 0 t Praveen. C (TIFR-CAM) CFD Jan 31, 2009 8 / 45
Momentum conservation Newton s law of motion Rate of change of = Total body force + Total surface force momentum Body forces like gravity Surface forces: pressure and viscous shearing x, y, z momentum equations t (ρu)+ x (p+ρu2 )+ y (ρuv)+ z (ρuw) = x τ xx+ y τ xy+ z τ xz t (ρv)+ x (ρvu)+ y (p+ρv2 )+ z (ρvw) = x τ yx+ y τ yy+ z τ yz t (ρw)+ x (ρwu)+ y (ρwv)+ z (p+ρw2 ) = x τ zx+ y τ zy+ z τ zz Praveen. C (TIFR-CAM) CFD Jan 31, 2009 9 / 45
Energy conservation Energy E = internal + kinetic + etc. Rate of Flux of Work done by Transfer of change = energy due + surface and + heat by of energy to flow body forces conduction Energy equation E t + x [(E + p)u] + y [(E + p)v] + [(E + p)w] = etc. z Praveen. C (TIFR-CAM) CFD Jan 31, 2009 10 / 45
Navier-Stokes equations Mass: Momentum: Energy: t ρ t + (ρ q) = 0 (ρ q) + (ρ q q) + p = τ E t + (E + p) q = ( q τ) + Q Praveen. C (TIFR-CAM) CFD Jan 31, 2009 11 / 45
Convection and diffusion Mass: Momentum: Energy: t ρ t + (ρ q) = 0 (ρ q) + (ρ q q) + p = τ E t + (E + p) q = ( q τ) + Q Praveen. C (TIFR-CAM) CFD Jan 31, 2009 12 / 45
Convection and diffusion Continuity equation in non-conservative form ρ t + u ρ x + v ρ y + w ρ ( u z + ρ x + v y + w ) z = Linear convection equation x momentum equation u t + u u x +... = µ 2 u x 2 +... = Non-linear convection and diffusion phenomena = 0 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 13 / 45
Differential and integral form Differential form φ t + F = 0 This is the basis of Finite Difference Methods (conserved quantity) + divergence(flux) = 0 t Integral form φdv = F ˆndS t V V This is the basis of Finite Volume Methods Praveen. C (TIFR-CAM) CFD Jan 31, 2009 14 / 45
Flow with shocks Praveen. C (TIFR-CAM) CFD Jan 31, 2009 15 / 45
Flow with shocks X-15 model at mach = 3.5 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 16 / 45
Computational domain (Josy P. P., CTFD, NAL) Praveen. C (TIFR-CAM) CFD Jan 31, 2009 17 / 45
Grids and finite volumes Praveen. C (TIFR-CAM) CFD Jan 31, 2009 18 / 45
Structured grid Praveen. C (TIFR-CAM) CFD Jan 31, 2009 19 / 45
Unstructured grid Praveen. C (TIFR-CAM) CFD Jan 31, 2009 20 / 45
Unstructured hybrid grid Praveen. C (TIFR-CAM) CFD Jan 31, 2009 21 / 45
Unstructured hybrid grid Praveen. C (TIFR-CAM) CFD Jan 31, 2009 22 / 45
Cartesian grid Saras (Josy) Praveen. C (TIFR-CAM) CFD Jan 31, 2009 23 / 45
Block-structured grid Fighter aircraft (Nair) Praveen. C (TIFR-CAM) CFD Jan 31, 2009 24 / 45
Forces on an airplane http://www.aviation-history.com Lif t = W eight Drag = T hrust Praveen. C (TIFR-CAM) CFD Jan 31, 2009 25 / 45
Wing and Airfoil http://www.centennialofflight.gov Praveen. C (TIFR-CAM) CFD Jan 31, 2009 26 / 45
Effect of Mach number: M = fluid speed/sound speed http://www.centennialofflight.gov Praveen. C (TIFR-CAM) CFD Jan 31, 2009 27 / 45
CFD process Given PDE, initial condition, boundary condition Define computational domain Divide computational domain into a grid Solve using a numerical scheme Compute quantities of interest lift force and drag force Praveen. C (TIFR-CAM) CFD Jan 31, 2009 28 / 45
Flow over NACA0012 airfoil: M = 0.63, α = 2 Pressure Praveen. C (TIFR-CAM) CFD Jan 31, 2009 29 / 45
Flow over NACA0012 airfoil: M = 0.85, α = 1 Pressure 5 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 30 / 45
Flow over Suddhoo-Hall airfoil Pressure contours Praveen. C (TIFR-CAM) CFD Jan 31, 2009 31 / 45
Flow over Suddhoo-Hall airfoil Pressure on airfoil 5 KMM Exact 4 3 2 -Cp 1 0-1 -2-3 -2-1 0 1 2 3 4 x Praveen. C (TIFR-CAM) CFD Jan 31, 2009 32 / 45
Flow through scramjet intake Density Praveen. C (TIFR-CAM) CFD Jan 31, 2009 33 / 45
CFD example: Falcon Mach = 0.85 Grid: 455160 nodes, Solver: Num3sis Praveen. C (TIFR-CAM) CFD Jan 31, 2009 34 / 45
Applications of numerical simulation Forward problem Given initial and boundary conditions, shape of computational domain solve for the flow Inverse problem Given the flow solution compute initial and/or boundary condition, and/or shape of computational domain Optimization problem Given some measure of system performance compute initial and/or boundary condition, and/or shape of computational domain to maximize the performance measure = Optimization of systems governed by PDE Praveen. C (TIFR-CAM) CFD Jan 31, 2009 35 / 45
Example of optimization: RAE2822 Initial shape Solver: euler2d Praveen. C (TIFR-CAM) CFD Jan 31, 2009 36 / 45
Example of optimization: RAE2822 Optimized shape Optimizer: Torczon Simplex, 20 Hicks-Henne parameters Praveen. C (TIFR-CAM) CFD Jan 31, 2009 37 / 45
Example of optimization: RAE2822 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 38 / 45
Shape optimization Very small shape modifications: cannot be obtained using trial and error methods Transonic wings: possible to obtain shock-free flow with small shape changes 1% - 3% reduction in drag = significant fuel savings Many other applications Turbomachinery Ship hull design Automobiles Chemical industry Praveen. C (TIFR-CAM) CFD Jan 31, 2009 39 / 45
Wing optimization Initial shape Praveen. C (TIFR-CAM) CFD Jan 31, 2009 40 / 45
Wing optimization Optimized shape Praveen. C (TIFR-CAM) CFD Jan 31, 2009 41 / 45
Shape optimization problem Cost function J = J(S, u) u satisfies the flow equations (Euler or Navier-Stokes) N(S, u) = 0 u depends on shape S Minimization problem min S S ad J(S, u), s.t. N(S, u) = 0 S ad = Set of admissible shapes Praveen. C (TIFR-CAM) CFD Jan 31, 2009 42 / 45
Classical method Let the shape S be given by a function F (x). Variation in cost function: F F + δf δj = G(x)δF (x)dx G: Shape gradient Steepest descent: choose δf = λg, λ > 0 δj = λ G 2 (x)dx 0 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 43 / 45
Steepest descent method 1 Choose an initial shape S o = S(F o ) 2 Set n = 0 3 Solve the flow equations N(S n, u n ) = 0 4 Compute shape gradient G n 5 Change the shape S n+1 = S(F n + δf n ), δf n = λg n 6 If G n < TOL, then STOP, else n = n + 1, go to step 3 Praveen. C (TIFR-CAM) CFD Jan 31, 2009 44 / 45
The End Theory + Experiment + Simulation John D. Anderson: Introduction to Computational Fluid Dynamics Thank You You can download these slides from http://pc.freeshell.org Praveen. C (TIFR-CAM) CFD Jan 31, 2009 45 / 45