Introduction and Equations January 20-25, 2010
Overview
Course Introduction
• Review course syllabus
Fluid Dynamics Equations – Goals, grading, assignments, schedule
• What is computational fluid dynamics?
Larry Caretto – Partial differential equations of fluid
Mechanical Engineering 692 dynamics for “conservation” of mass,
momentum, energy, and chemical species
Computational Fluid Dynamics – Special models for turbulent flow
January 20-25, 2010 – Techniques used to develop algorithms for
numerical solution of equations
– Creation of grids for numerical solutions
– Other physical models for radiation heat
transfer, chemical reaction, etc.
2
Instructor and Course Data Basic Course Goals
•
[email protected] 818.677.6448 • Understand equations, models, and
• Office JD 3333, office hours MW 5–6 numerical methods used in
pm, TTh 2–3 pm, email, drop in, phone computational fluid dynamics
call, or appointment • Be able to use commercial codes with
• Text: Versteeg and Malalasekera, An good understanding of code inputs and
Introduction to Computational Fluid outputs and ultimate accuracy
Dynamics The Finite Volume Method • Course will be combination of learning
• Grading based on homework (10%), background material and code
midterm (25%) project (25%) and final applications using commercial code,
(40%) Fluent, available in classroom and other
• See grading criteria in outline ME Department computing labs
• http://www.csun.edu/~lcaretto/me692 3 4
Course Learning Objectives Course Learning Objectives II
• Understand how the basic differential • Recognize the processes (finite
equations of CFD are derived, and the differences, finite volumes, and finite
similar form of these equations elements) that transform differential
• Apply the knowledge gained in the equations into algebraic equations.
course in the operation of commercial • Be able to convert partial differential
CFD codes. equations into finite difference relations
• Understand the overall process by which and find the order of the truncation error.
numerical solutions of differential • Be familiar with turbulence models and
equations are obtained be able to choose an appropriate model
for a specific problem.
5 6
ME 692 – Computational Fluid Dynamics 1
Introduction and Equations January 20-25, 2010
Course Learning Objectives III Project
• Be able to use concepts of stability to • Several options to apply course material
determine appropriate relaxation factors – Run commercial code at workplace
and dimensionless parameters used as – Run Fluent in ME lab (most common)
inputs to commercial codes. – Run available free software
– Write own CFD code for simple problem
• Understand algorithms of computational – Other project with approval of instructor
fluid dynamics and be able to determine
• Requirements and dates
appropriate ones to obtain solutions from – Proposal March 8
commercial codes. – Presentation to class May 3 and 5
– Written report May 12 (two days after final)
7 8
Course Materials What is CFD?
• Web site: • Numerical solution of basic partial
http://www.csun.edu/~lcaretto/me692 differential equations of fluid dynamics
• Lecture presentations supplemented (in • Applications to problems with heat and
some cases) by course notes mass transfer including chemical
– Idea of presentations is to allow students reactions
to listen and think about lecture material • Main research areas in 1960-1980
without having to take detailed notes
developed into commercial codes used
• Reading assignments in text should be
for current CFD practice
done prior to class
• Download presentations prior to class
9 10
Equations of CFD Common Variable
• Conservation of mass • The “Source = Outflow – Inflow +
• Rate of momentum change equals Storage” equation often called a
applied force conservation or balance equation
• Rate of energy change equals heat – Variables are density, velocity
components, thermodynamic energies,
added plus work done
chemical species fractions
• Rate of chemical species change is due • Similar form for all equations leads to
to chemical reactions use of common variable, φ, to in general
• Source = Outflow – Inflow + Storage equation for all variables
• One, two and three dimensions – Leads to common algorithms
11 12
ME 692 – Computational Fluid Dynamics 2
Introduction and Equations January 20-25, 2010
Coordinates and Variables Common Variable Notation
y, v
• Use Cartesian • Source = Outflow – Inflow + Storage
coordinate system • Different physical quantities, Φ: mass,
• Velocity components in momentum, energy, species K mass = m(K)
x, y, and z directions and • Per unit mass quantity φ = Φ/m
x, u denoted as u, v, and w
• Differential volume ΔV; m = ρΔV
z, w – Velocity vector is V = ui +
vj + wk; KE = V2/2 • In this differential volume, Φ = ρ φ ΔV
• Will see other coordinate systems later Φ m mu mv mw E + mV2/2 m(K)
• Use density, ρ = mass per unit volume
φ 1 u v w e+ V2/2 W(K)
• e = E/m = thermodynamic internal energy
13 W(K) = m(k)/m is mass (weight) fraction
14
Equations of CFD II Turbulence
• Basic three-dimensional equation for all • Partial differential equations apply to all
variables flows (laminar and turbulent)
∂ρφ ⎛ ∂ρ uφ ∂ρ vφ ∂ρ wφ ⎞
+ ⎜⎜ + + ⎟ = S φ* • Cannot solve turbulent flows for
∂t ⎝ ∂x ∂y ∂z ⎟⎠
Storage Outflow – Inflow Source engineering systems with foreseeable
generations of computers
• Common form for source terms: viscous
• Requires turbulence models
forces, heat conduction, species
diffusion called “diffusive” terms with Γ(φ) • Several models available; must select
coefficient like viscosity appropriate model for application
∂ (φ ) ∂φ ∂ (φ ) ∂φ ∂ (φ ) ∂φ • Grid implications of turbulence models
Γ + Γ + Γ
∂x ∂x ∂y ∂y ∂z ∂z 15 16
Numerical Analysis Finite-Volume Methods
• Finite-difference, finite-volume, and • Approach that uses elements of both
finite-element methods finite differences and finite elements
– All seek to replace differential equations for – Expressions for derivatives taken from
a continuous variable in a region by finite-difference expressions
algebraic equations that apply to a set of – Differential equations integrated over finite-
discrete points in the region volumes linking grid nodes.
T −T
• Errors in representation of differential equations Finite Volume qleft = k i −1 i
by discrete equations Ti-1 Ti Δx
• Can also lead to unstable or physically Ti+1 Ti − Ti +1
qleft qright
qright = k
unrealistic numerical algorithms Δx
∫ dx dAdx = (qright − qleft18)A
• Limits on step sizes allowed Δx dq
Δx
17
vol
ME 692 – Computational Fluid Dynamics 3
Introduction and Equations January 20-25, 2010
Grids Computing Derivatives
• Set of finite volumes with grid nodes at • Usual (second-order) approach for more
intersections or center of volumes accurate derivatives leads to physically
– Need to find grid to give desired accuracy unrealistic solutions for larger grids
• Variety of grids • Alternative known as upwind
possible in differencing gives physically realistic
current CFD results with large errors
codes to get • Seek alternative differencing schemes
complex to provide balance of accuracy and
geometries physical realism
19 20
Simultaneous Solutions Solving the Equations
• Have to solve momentum equations • Algebraic equations that result from finite
and continuity simultaneously volume approach form sparse matrix
– For incompressible flows with known • Solved by iteration
density find velocity components and – Need criterion to halt iterations
pressure
• Different solution processes available
– For compressible flows, use p = ρRT and
solve for density and velocity components • Will examine simple approaches
• Have different approaches for linking • Multigrid approach is currently
solution of momentum equations and considered best approach
continuity to give desired variables
21 22
Post Processing Deriving Equations
• CFD solutions result in value for each • Have simple physical principles
variable at each grid node – Mass is conserved
• Often interest is in computed quantities – Newton’s second law: force is rate of
such as wall shear and heat flux change of momentum
• CFD codes allow post-processing to – Conservation of energy
compute desired quantities – Balance of chemical species
• Can also obtain plots of desired • Derive differential equations for each of
quantities and videos showing how flow these simple principles
evolves • Equations have common form – an
important idea for numerical algorithms
23 24
ME 692 – Computational Fluid Dynamics 4
Introduction and Equations January 20-25, 2010
Differential Volume ΔV = ΔxΔyΔz Storage Term
y, v
z-direction face at z; area = ΔxΔy • Storage term: transient change in Φ
∂Φ ∂ (mϕ ) ∂ ( ρΔxΔyΔzϕ ) ∂ ( ρϕ )
Storage = = = = ΔxΔyΔz
y + Δy ∂t ∂t ∂t ∂t
z
x, u • Dimensions of this term are Φ
z, w
y z + Δz dimensions over time
x x + Δx
• We will later divide the entire equation
z-direction face at z+Δz; area = ΔxΔy by ΔxΔyΔz so that the final equation will
• Differential volume has six faces for flow have dimensions of Φ divided by time
and surface terms and length cubed
25 26
x-Direction Inflow and Outflow Total Inflow and Outflow
x-direction outflow at x + Δx Area for y- and z- y
Cross-sectional area for
direction flows are x
x-direction flow is ΔyΔz
ΔxΔz and ΔxΔy
Δy
x-direction
Δx
mass flow rate Δy y- and z-direction z
Δx
is ρuΔyΔz x-direction Φ flow rates are Δz
inflow at x Δz x
ρvφΔxΔz and ρwφΔxΔy
• x-direction Φ flow rate is ρuφΔyΔz
– Dimensions for flows of mass and Φ: Inflow = ρ u ϕ x Δy Δz + ρ v ϕ y Δx Δz + ρ w ϕ z Δy Δ x
mass/time and (Φ units)/time Outflow = ρ u ϕ Δ y Δz + ρ vϕ Δx Δz + ρ w ϕ z + Δ z Δ y Δx
x + Δx y + Δy
• Will later divide by ΔxΔyΔz
27 28
Source Term Basic Balance Equation
• Conventionally the source term for Φ is • Storage + Outflow – Inflow = Source
the source of Φ per unit volume, Sϕ ∂ (ρϕ)
– Source term has dimensions of Φ divided Storage = ΔxΔyΔz
∂t
by length cubed divided by time Inflow = ρ u ϕ x Δy Δz + ρ v ϕ y Δx Δz + ρ w ϕ z Δy Δ x
• Example: for Φ as energy in SI units the source
term will have units of Joules per second per Outflow = ρ u ϕ x + Δx
Δ y Δz + ρ vϕ y + Δy
Δx Δz + ρ w ϕ z + Δ z Δ y Δx
cubic meter or watts per cubic meter
– In the derivation, the dimensions of the Source = S ϕ Δx Δy Δz
source term, before division by ΔxΔyΔz,
are Φ dimensions divided by time • Substitute terms into balance equation
Source = S ϕ Δx Δy Δz and divide by ΔxΔyΔz
29 30
ME 692 – Computational Fluid Dynamics 5
Introduction and Equations January 20-25, 2010
Basic Balance Equation II Basic Balance Equation III
• Storage + Outflow – Inflow = Source • Limit as Δx, Δy, and Δz approach zero is
∂ρϕ
ΔxΔyΔz + ρ u ϕ x + Δx ΔyΔz + ρ v ϕ y + Δy ΔxΔy + + ρ w ϕ z + Δz ΔxΔy partial derivative
∂t
f ( x + Δx, y, z ) − f ( x, y, z ) ∂f
Lim =
− ρ u ϕ x ΔyΔz − ρ v ϕ y ΔxΔz − ρ w ϕ z + Δz ΔxΔy = Sϕ ΔxΔyΔz Δx→0 Δx ∂x
• Let Δx, Δy, and Δz in balance equation
• Divide by ΔxΔyΔz and rearrange approach zero simultaneously
∂ρϕ ρ u ϕ x+ Δx − ρ u ϕ x ρ v ϕ y + Δy − ρ v ϕ y ρ w ϕ z + Δz − ρ w ϕ z
+ + + = Sϕ ∂ρϕ ρ u ϕ x + Δx − ρ u ϕ x ρ v ϕ y + Δy − ρ v ϕ y ρ w ϕ z + Δz − ρ w ϕ z
∂t Δx Δy Δz + + + = Sϕ
∂t Δx Δy Δz
• Next step: take limit as Δx, Δy, and Δz ∂ρϕ ∂ρ uϕ ∂ρ vϕ ∂ρ wϕ
approach zero + + + = S ϕ* = Lim Sϕ
∂t ∂x ∂y ∂z Δx,Δy ,Δz →0
31 32
Simplified Notation General Balance Equation
• Define directions as x1, x2, and x3 • Gives storage, transient and outflow–
• Velocity components as u1, u2, and u3 inflow terms for any quantity, φ
• Summation convention: if two subscripts • Appropriate source term must be
are repeated there is an implied sum constructed for different quantities
∂ρ uϕ ∂ρ vϕ ∂ρ wϕ ∂ρ u1ϕ ∂ρ u2ϕ ∂ρ u3ϕ • Show with and without implied
+ + = + + summation
∂x ∂y ∂z ∂x1 ∂x2 ∂x3
∂ρϕ ∂ρ uϕ ∂ρ vϕ ∂ρ wϕ
3
∂ρ uiϕ ∂ρ uiϕ + + + = Sϕ*
=∑ = Implied summation ∂t ∂x ∂y ∂z
i =1 ∂xi ∂xi over repeated i index
∂ρϕ ∂ρ uiϕ
+ = Sϕ*
33
∂t ∂xi 34
Continuity Equation Transport Equation Forms
• Expresses conservation of mass • Two equivalent mathematical forms
• For this equation φ = 1 and Sφ∗ = 0 from product rule ∂ρϕ ∂ρ ui ϕ
• Conservation form ∂t + ∂xi = Sϕ
*
∂ρϕ ∂ρ uiϕ ∂ρ ∂ρ ui
+ = Sϕ* + =0 ∂ϕ ⎡ ∂ρ ∂ρ ui ⎤ ∂ϕ Equivalent
∂t ∂xi ∂t ∂xi ρ +ϕ⎢ + ⎥ + ρ ui ∂x = Sϕ
*
forms
∂t ⎣ ∂t ∂xi ⎦ i
∂ρ ∂ρ ∂u Dρ ∂u Dρ = 0 from continuity
0= + ui +ρ i = +ρ i = +ρΔ = 0
∂t ∂xi ∂xi Dt ∂xi Dt ∂ϕ ∂ϕ
• Non-conservation form ρ + ρ ui = Sϕ*
• Substantive derivative: D/Dt = ∂/∂t + ui∂/∂xi ∂t ∂xi
• Dilatation: Δ = ∂ui/∂xi • Conservation form generally preferred
in CFD
35 36
ME 692 – Computational Fluid Dynamics 6
Introduction and Equations January 20-25, 2010
Where are we? Handling Source Terms
• We have two general transport • Remember that our balance equation
equations for φ, a conservation form and has modified source term S ϕ* that is
a nonconservation from source per unit volume (ΔxΔyΔz) in limit
• We have a conservation equation for as volume shrinks to zero
*
mass, the continuity equation • Steps in getting source terms S ϕ
• We now have to get other conservation – Get equation for original source term, e.g.,
equations (momentum, energy, species) force in momentum equation
with more complex source terms – Divide by ΔxΔyΔz
• Next is momentum where source terms – Take limit as volume shrinks to zero
are the forces on the fluid element
37 38
Forces on a Fluid Element Body Force Terms
• Body forces such as gravity and • Start with body force as acceleration, Bj
electromagnetic forces act throughout – Force is ρBjΔxΔyΔz
the body of the fluid element • Dimensions are (mass/volume)(acceleration)
(volume) = (mass)(acceleration) = force
– Represented as j-direction acceleration, Bj,
(typically gravity) so that force is ρBjΔxΔyΔz – Divide by unit volume ΔxΔyΔz to get force
as ρBj
• Surface forces from action of fluid
– As volume shrinks to zero ρ and Bj become
elements on each other act at surfaces
density and acceleration at a point
– At each of the six faces on a volume • No other effect in equation from taking limit
element we have stresses acting in all
three coordinate directions (18 terms!) • Contribution to S ϕ* from body force is ρBj
39 40
Surface Stresses, σ(face)(direction) Net Surface Force Example
y Upper face in y y
• Positive stress, Upper face in y direction
x direction x
x direction stress σ(face)(direction), x direction force on this
z z
here is σyx|y+Δy exerted by face is σyx|y+ΔyΔxΔz
element above on
Δy element below Δy Lower face in y direction
• Force is stress x direction force on this
Δx Δz times area Δx Δz face is -σyx|yΔxΔz
Lower face in y
direction • σyx is stress on y
x direction stress
face in x direction Net yFace, xDirection force σ yx y + Δy − σ yx σ yx y + Δy
− σ yx
here is -σyx|y = ΔxΔz =
y y
Unit Volume ΔxΔyΔz Δy
41 42
ME 692 – Computational Fluid Dynamics 7
Introduction and Equations January 20-25, 2010
Net Surface Force Source Term Surface Force Source Terms
• Source term in transport equation • Get terms for other directions by
requires limit as ΔV approaches zero analogy with x-direction terms
• Expression becomes derivative • Introduce numerical subscripts 1, 2, and
Limit Net yFace, xDirection force ∂σ yx
3 for x, y, and z
= • Use implied summation equation and
Δy → 0 Unit Volume ∂y
substitute result into momentum
• Also have x-direction forces on faces in
equation
x and z directions so total is
• Show results with and without
Net x − direction ∂σ xx ∂σ yx ∂σ zx
= + + summation convention
surface force source ∂x ∂y ∂z
43 44
Net Surface Force Source Term Momentum Balance
Net x − direction ∂σ xx ∂σ yx ∂σ zx ∂σ i1 • Use general transport equation with φ = uj
= + + =
surface force source ∂x ∂y ∂z ∂xi and Sφ = j-direction force per unit volume
• Have three equations like this for j = 1, 2,
Net y − direction ∂σ xy ∂σ yy ∂σ zy ∂σ i 2
= + + = 3 (corresponding to x, y, z momentum)
surface force source ∂x ∂y ∂z ∂xi • Implied summation over i subscript
Net z − direction ∂σ xz ∂σ yz ∂σ zz ∂σ i 3 • See notes and first homework problem for
= + + =
surface force source ∂x ∂y ∂z ∂xi full equations with u, v, w, x, y, z
Net j − direction ∂σ ij ∂ρu j ∂ρ u i u j ∂σ ij
= + = + ρB j j = 1,K 3
surface force source ∂xi ∂t ∂xi ∂xi
45 46
What are Stress Terms? Momentum Equation
• How do we relate σij to fluid properties? • Substitute Newtonian relations into
• Most common relationship is for momentum balance equation at bottom
⎧1 i = j of slide 46
Newtonian fluid δ ij = ⎨
⎩0 i ≠ j ∂ρu j ∂ρ ui u j
+ = j = 1,K 3
⎡ ∂ ui∂uj ⎤ 2 ∂t ∂xi
σ ij = − Pδ ij + μ ⎢ + ⎥ + (κ − μ )Δδ ij
⎣⎢ ∂x j ∂xi ⎦⎥ 3 ∂P ∂ ⎡ ⎛⎜ ∂ ui ∂ u j ⎞⎟⎤ ∂ ⎡ 2 ⎤
• Here μ and κ are dynamic and bulk − + ⎢μ + ⎥+ ⎢⎣(κ − 3 μ ) Δ ⎥⎦ + ρB j
∂x j ∂xi ⎢⎣ ⎜⎝ ∂x j ∂xi ⎟⎠⎥⎦ ∂x j
viscosities and Δ is dilatation
• Three momentum balance equations
– (κ – 2μ/3) term important in high frequency
known as Navier-stokes equations
acoustics only ∂uk ∂u ∂v ∂w
Δ= = + +
∂xk ∂x ∂y ∂z 47 48
ME 692 – Computational Fluid Dynamics 8
Introduction and Equations January 20-25, 2010
Energy Balance Heat Rate
• Start with the general transport equation • Heat flux in direction j is qj (power/area)
• For total energy equation, φ is • Net heat in direction j is [qj|in – qj|out ]ΔAj
thermodynamic internal energy plus • Sum over all directions and let ΔV → 0
kinetic energy, both per unit mass
Net Heat q x − q x x + Δx qy − qy
y + Δy
• Here the source term is the heat added = x ΔyΔz +
y
ΔxΔz
unit volume ΔxΔyΔz ΔxΔyΔz
plus the work done
qz z − qz qx x − qx qy − qy qz z − qz
• Since transport equation gives rate of + z + Δz
ΔxΔy = x + Δx
+
y y + Δy
+ z + Δz
change, heat and work terms must be ΔxΔyΔz Δx Δy Δz
heat rate and work rate or power Net Heat ∂q ∂q ∂q ∂q
=− x − y − z =− i
49
unit volume ∂x ∂y ∂z ∂xi 50
Work Terms Surface Force Work
y
• dW = F·dx = Fidxi Upper y face work is uσyx|y+ΔyΔxΔz
• dW/dt = F·dx/dt = Fidxi/dt = Fiui x + vσyy|y+ΔyΔxΔz + wσyz|y+ΔyΔxΔz
z
• Body force work = ρΔxΔyΔzBiui
Lower y face work is – uσyx|yΔxΔz
• Surface force work has similar Fiui – vσyy|yΔxΔz – wσyz|yΔxΔz
Δy
formulation, but must consider work
• Look at net work per unit
done on upper face and lower faces
Δx volume from both surfaces
Δz
• Upper face work adds energy in limit as ΔV → 0
• Lower face work removes energy Net yFace Surface ∂ (uσ yx + vσ yy + wσ yz ) ∂uiσ 2i
• Term: σ(face)(direction)ΔA(face)u(direction) = =
Force Work ∂y ∂y
51 52
Total Surface Force Work Energy Balance Equation
• Add results from all three sides • Start with general ∂ρϕ ∂ρ uiϕ
+ = Sϕ*
xFace Surface yFace Surface zFace Surface transport equation ∂t ∂xi
+ + =
Force Work Force Work Force Work • For energy, φ = e + V2/2 and source is
∂ (uσ xx + vσ xy + wσ xz ) ∂ (uσ yx + vσ yy + wσ yz ) heat plus work added
+
∂x ∂y ∂qi ∂uiσ ji
Sϕ* = − + + ρui Bi
∂ (uσ zx + vσ zy + wσ zz ) ∂uiσ 1i ∂uiσ 2i ∂uiσ 3i ∂xi ∂x j
+ = + +
∂z ∂x1 ∂x2 ∂x3
∂ρ (e + V 2 / 2) ∂ρ ui (e + V 2 / 2) ∂q ∂uiσ ji
+ =− i + + ρui Bi
Total Surface ∂uiσ ∂t ∂xi ∂xi ∂x j
=
ji
Force Work ∂x j
53 54
ME 692 – Computational Fluid Dynamics 9
Introduction and Equations January 20-25, 2010
More Energy Equations? Kinetic Energy Balance
• There are several variations of the • Comes from momentum equations only
energy equation used in practice • Problems in numerical methods when
– Separate kinetic energy from difference schemes for momentum do
thermodynamic energy not conserve kinetic energy
– Substitute enthalpy for internal energy
• Derivation done by multiplying each
– Use temperature instead of internal energy momentum equation by its velocity and
or enthalpy as dependent variable
summing results
• With constant pressure heat capacity
• With constant volume heat capacity ∂ ( ρV 2 / 2) ∂ ( ρui V 2 / 2) ∂σ ij
+ = uj + u j ρB j
• Derivation details in notes ∂t ∂xi ∂xi
55 56
Thermodynamic Balances Thermodynamic Balances II
• Subtract kinetic energy balance from
∂ρe ∂ρ u i e ∂q ∂u
total energy balance + = − i + σ ji i [1-41]
∂t ∂xi ∂xi ∂x j
• Use thermodynamics to introduce
∂ρh ∂ρu i h ∂q ∂u DP
enthalpy (h = e + P/ρ) and temperature + = − i + σ ji i + + PΔ [1-57]
∂t ∂xi ∂xi ∂x j Dt
• Continuity equation for density is tool
⎡ ∂ρT ∂ρu i T ⎤ ∂qi ∂u DP
De Dh 1 DP P Dρ Dh DT 1 − β PT DP cp ⎢ + ⎥=− + σ ji i + β P T + PΔ [1-58]
= − + = cp + ⎣ ∂t ∂xi ⎦ ∂xi ∂x j Dt
Dt Dt ρ Dt ρ 2 Dt Dt Dt ρ Dt
⎡ ∂ρT ∂ρu i T ⎤ ∂qi ∂u ⎛ Tβ ⎞
De DT 1 ⎛ Tβ P ⎞ Dρ 1 ⎛ ∂ρ ⎞ 1 ⎛ ∂ρ ⎞ cv ⎢ + ⎥=− + σ ji i + ⎜⎜ P − P ⎟⎟Δ [1-59]
= cv + ⎜ − P ⎟⎟ βP = − ⎜ ⎟ κT = ⎜ ⎟ ⎣ ∂ ∂ i ⎦ ∂ ∂ κ
⎝ T ⎠
Dt ρ 2 ⎜⎝ κ T
t x x x
Dt ⎠ Dt ρ ⎝ ∂T ⎠ P ρ ⎝ ∂P ⎠T i j
57 58
Stress and Heat Flux Dissipation
• Equations on previous chart valid for • Stress work terms involve
any heat transfer or stress relationship pressure and viscous stresses − Pδ ∂ui =
∂x j
ij
• Look at Newtonian fluid for stress • Latter are only important in high
• Heat transfer more complex Mach number flows ∂u
−P i =
– Fourier law heat conduction is simplest • Define dissipation, ΦD, for ∂xi
– Radiation heat transfer these terms − PΔ
– Diffusion-thermo in mixtures ∂ui ⎡ ⎛ ∂u ∂uj ⎞ ⎤
σ ji = ⎢− Pδ ij + μ ⎜ i + ⎟ + (κ − 2 μ ) Δδ ij ⎥ ∂ui = − PΔ + ΦD
• Consider only Fourier ∂T ∂x j ⎢⎣ ⎜ ∂x ∂ ⎟
⎦⎥ ∂x j
qi = − k ⎝ j xi ⎠ 3
law conduction here ∂xi ⎛ ∂u ∂uj ⎞ ∂ui 2
ΦD = μ ⎜ i + ⎟ + (κ − μ )Δ2
⎜ ∂x ⎟ ∂x
⎝ j ∂xi ⎠ j 3
59 60
ME 692 – Computational Fluid Dynamics 10
Introduction and Equations January 20-25, 2010
One More Substitution Energy Balance Equations
• Replace temperature gradient in Fourier ∂ρe ∂ρ u i e ∂ k ∂e ∂ 1 ⎡ Tβ P ⎤ 1 ∂ρ
Law by gradient of internal energy or + = − PΔ + ΦD + ⎢ − P⎥ 2 [1-68]
∂t ∂xi ∂xi cv ∂xi ∂xi cv ⎣ κ T ⎦ ρ ∂xi
enthalpy using general thermodynamic
equations for these variables ∂ρh ∂ρu i h ∂ k ∂h ∂ ⎡1 − Tβ P ⎤ ∂P DP
1 ⎛ ∂ρ ⎞ + = + ΦD + ⎢ ⎥ + [1-69]
βP = − ⎜ ⎟ ∂t ∂xi ∂xi c p ∂xi ∂xi ⎢⎣ ρc p ⎥⎦ ∂xi Dt
– de = cvdT – (TβP/κT – P)dρ/ρ2 ρ ⎝ ∂T ⎠ P
– dh = cpdT + (1 – TβP)dP/ρ 1 ⎛ ∂ρ ⎞ ⎡ ∂ρT ∂ρu i T ⎤
κT = ⎜ ⎟ ∂ ∂T DP
ρ ⎝ ∂P ⎠T cp ⎢ + ⎥= k + ΦD + β P T [1-70]
∂T 1 ∂e 1 ⎡ Tβ P ⎤ 1 ∂ρ ⎣ ∂t ∂xi ⎦ ∂xi ∂xi Dt
= + ⎢ − P⎥ 2
∂xi cv ∂xi cv ⎣ κ T ⎦ ρ ∂xi ⎡ ∂ρT ∂ρuiT ⎤ ∂ ∂T Tβ
cv ⎢ + ⎥= k + ΦD + P Δ [1-71]
∂T 1 ∂h 1 − Tβ P ∂P ⎣ ∂t ∂xi ⎦ ∂xi ∂xi κT
= −
∂xi c p ∂xi ρc p ∂xi 61 62
Species Balance Equations General Equation
• Species mass fractions W(K) can change • Look at general transport equation in
by convection and diffusion that occurs same form as species transport equation
with and without motion ⎡ ∂ρφ ∂ρ ui ϕ ⎤ ∂ (ϕ ) ∂ϕ
c⎢ + = Γ + S (ϕ )
• Diffusion effect given by second ⎣ ∂t ∂xi ⎥⎦ ∂xi ∂xi
Transient Convective Diffusive " Source"
derivative term
– Derivation details in notes • c = 1 or c = heat capacity if φ = T
∂ρW(K )
∂ρ W ui(K )
∂ ∂W (K ) • General transport coefficient, Γ(φ) (e.g.,
+ = D K ,Mix + r (K ) viscosity) has same dimensions as
∂t ∂xi ∂xi ∂xi
Transient Convective Diffusive Source xi2cρ/t (for c = 1 this is mass/length/time)
– For φ = T, Γ(φ) = thermal conductivity, k
63 64
General Equation II Momentum Equations
• This general equation adds a second • General momentum equation shows
order term to the equation we started pressure gradient explicitly
with as general transport equation
• Terms in “Source” are true source terms ∂ρu j ∂ρ ui u j ∂P ∂ ∂u j
plus other terms that are not the pure + =− + μ + S *j*
second derivative terms
∂t ∂xi ∂x j ∂xi ∂xi
• Examine each equation to determine
the contents of the “Source” term ∂ ∂ui ∂ ⎡ 2 ⎤
S *j* = μ + ⎢( κ − 3 μ)Δ ⎥ + ρB j
– Separate pressure gradient in momentum ∂xi ∂x j ∂x j ⎣ ⎦
• Source often zero for simple problems
65 66
ME 692 – Computational Fluid Dynamics 11
Introduction and Equations January 20-25, 2010
Momentum Source Zero? Other “Source” Terms
• We can show that S *j* is zero for constant • Have seen terms for species and
density (when Δ = 0) and viscosity and momentum balance
no body force terms (Bj = 0) • Energy source terms depend on equation
– For constant viscosity we have used
∂ ∂ui ∂ ∂ui ∂ ∂ui ∂Δ • For φ = T we have c = cp or cv and Γ(φ) = k
μ =μ =μ =μ
∂xi ∂x j ∂xi ∂x j ∂x j ∂xi ∂x j
∂Δ ∂ ⎡ ⎤
S *j* = +
2
( κ − μ)Δ ⎥ + ρB j • With cp S (φ ) = S (T ) = ΦD + β PT DP
∂x j ∂x j ⎢⎣ 3 ⎦ Dt
– This is zero for Δ = Bj = 0 Tβ P
• With cv S (φ ) = S (T ) = ΦD + Δ
κT
67 68
Internal Energy and Enthalpy Simplifications
• For φ = e, Γ(φ) = k/cv and • Constant property flows
∂ 1 ⎡ Tβ P ⎤ 1 ∂ρ – Constant density (Δ = 0)
S ( φ ) = S ( e ) = − P Δ + ΦD + − P⎥ 2
∂xi cv ⎢⎣ κ T ⎦ ρ ∂xi
– Constant transport properties
– Combination of both (can show S(uj) = ρBj)
• For φ = h, Γ(φ) = k/cp and • Low Mach number flows (no dissipation)
∂ ⎡1 − Tβ P ⎤ ∂P DP • Ideal gases βP = 1/T and κT = 1/P
S ( φ ) = S ( h ) = ΦD + ⎢ ⎥ +
∂xi ⎢⎣ ρc p ⎥⎦ ∂xi Dt • Boundary layer flows – predominant
flow direction with no recirculation
69 70
Integral Equations Another General Approach
• General integral balance equation over • Typically used for compressible flows in
volume, Ω, enclosed by surface, Σ aerodynamics calculations
• Split stress term, σij, into sum of pressure
∂Φ ∂
∂t ∂t Ω∫
= ρϕdV = − ∫ ρϕv ⋅ ndS − ∫ dϕ ⋅ ndS + ∫ Sϕ dV and viscous stress, τij = σij + Pδij
Σ Σ Ω
⎡ ∂ ui ∂uj ⎤ 2
τ ij = μ ⎢ + ⎥ + (κ − μ )Δδ ij
• dφ is diffusive flux of φ ⎢⎣ ∂x j ∂xi ⎥⎦ 3
• n is outward pointing normal
∂ρu j ∂ρ ui u j ∂p ∂τ ij
• Use equations for finite volume method, + =− + + ρB j
∂t ∂xi ∂x j ∂xi
especially in complex geometries
71 72
ME 692 – Computational Fluid Dynamics 12
Introduction and Equations January 20-25, 2010
Another General Approach II Another General Approach III
• Equation without summation convention • Cast continuity, momentum, total
∂ρu j ∂ρ uu j ∂ρ vu j ∂ρ wu j energy, and species balance into form
• General + + + of vector equation
∂t ∂x ∂y ∂z
direction j ∂U ∂E ∂F ∂G
equation = − ∂p + ∂τ xj + ∂τ yj + ∂τ zj + ρBx + + + =H
∂x j ∂x ∂y ∂z ∂t ∂x ∂y ∂z
∂ρu ∂ (ρ uu + p − τ xx ) • Each conservation equation is one
• x-direction + + component of the vector equation
equation ∂t ∂x
∂ (ρ vu − τ yx ) ∂ (ρ wu − τ zx ) • Get components by reviewing equations
+ = ρBx
∂y ∂z
73 74
Another General Approach IV Another General Approach V
∂U ∂E ∂F ∂G ∂U ∂E ∂F ∂G
+ + + =H + + + =H
∂t ∂x ∂y ∂z ∂t ∂x ∂y ∂z
⎡ ρ ⎤ ⎡U1 ⎤ ⎡ 0 ⎤ ⎡ h1 ⎤ ⎡ ρu ⎤ ⎡ e1 ⎤
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢h ⎥ ⎢ ρuu + p − τ xx ⎥ ⎢e ⎥
ρu U ρ B ⎢ ⎥ ⎢ 2⎥
⎢ ⎥ ⎢ 2⎥ ⎢ x ⎥ ⎢ 2⎥
⎢ ρv ⎥ ⎢U 3 ⎥ ⎢ ρB y ⎥ ⎢ h3 ⎥ ⎢ ρuv − τ xy ⎥ ⎢ e3 ⎥
U=⎢ ⎥ = ⎢U 4 ⎥ H = ⎢ ⎥ = ⎢h4 ⎥ E=⎢ ⎥ = ⎢e ⎥
ρw ρBz ρwu − τ xz
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ 4⎥
⎢ ρ (e + V / 2)⎥ ⎢U 5 ⎥ ⎢ ρ (uBx + vB y + wBz )⎥ ⎢ h5 ⎥ ρ + + − τ − τ − τ +
2
⎢ x⎥
2
u[ ( e V / 2 ) p ] u xx v xy w xz q ⎢ e5 ⎥
⎢ ρW ( K ) ⎥ ⎢U ⎥ ⎢ r( K ) ⎥ ⎢h ⎥ ⎢ ρuW + jx
(K ) (K ) ⎥ ⎢ ⎥
⎣ ⎦ ⎣ 6⎦ ⎣ ⎦ ⎣ 6⎦ ⎣ ⎦ ⎣e6 ⎦
75 76
Another General Approach VI Another General Approach VII
∂U ∂E ∂F ∂G ∂U ∂E ∂F ∂G
+ + + =H + + + =H
∂t ∂x ∂y ∂z ∂t ∂x ∂y ∂z
⎡ ρv ⎤ ⎡ f1 ⎤ ⎡ ρw ⎤ ⎡ g1 ⎤
⎢ ρuv − τ yx ⎥ ⎢ ⎥ ⎢ ⎥ ⎢g ⎥
⎢ ⎥ ⎢ f2 ⎥ ρuw − τ zx
⎢ ⎥ ⎢ 2⎥
⎢ ρvv + p − τ yy ⎥ ⎢ f3 ⎥ ⎢ ρvw − τ zy ⎥ ⎢ g3 ⎥
F=⎢ ⎥=⎢f ⎥ G=⎢
ρwv − τ yz ρww + p − τ zz ⎥ = ⎢g ⎥
⎢ ⎥ ⎢ 4⎥ ⎢ ⎥ ⎢ 4⎥
⎢v [ ρ ( e + V / 2) + p ] − uτ yx − vτ yy − wτ yz + q y ⎥ ⎢ f 5 ⎥
2
⎢ w[ ρ ( e + V / 2) + p ] − uτ zx − vτ zy − wτ zz + qz ⎥ ⎢ g5 ⎥
2
⎢ ρvW ( K ) + j y( K ) ⎥ ⎢f ⎥ ⎢ ⎥ ⎢g ⎥
⎣ ⎦ ⎣ 6⎦ ⎣ ρwW ( K ) + jz( K ) ⎦ ⎣ 6⎦
77 78
ME 692 – Computational Fluid Dynamics 13
Introduction and Equations January 20-25, 2010
Another General Approach VIII Another General Approach IX
∂U ∂E ∂F ∂G ρ = U1
+ + + =H
∂t ∂x ∂y ∂z U2
u=
• Compute vectors E, F, G, and H from U1
flow variables and use numerical v=
U3
integration over time step to get U U1
• Update flow variables from components U
w= 4
of U vector, Uk. U1
– These are not velocity components e=
U5
−
1
U 1 2U 12
(
U 22 + U 32 + U 42 )
– Details next chart
U
79
W (K ) = 6 80
U1
Finding the Pressure Finding the Pressure II
• Pressure gradient in momentum • Define new momentum source term that
equations is part of “Source” treats pressure as a separate term
• For compressible flows solve for density • For compressible flows solve for density
and find P from equation of state and find P from equation of state
• For incompressible flows • For incompressible flows
– density is given – density is given
– have four equations (continuity and three – have four equations (continuity and three
momentum equations) to solve for momentum equations) to solve for
pressure and velocity components pressure and velocity components
81 82
Summary Summary Continued
• Equations of fluid dynamics express • Similar form we can use only one
simple physical principles general algorithm for all equations
– Mass is conserved • Must also find way to include pressure
– Newton’s second law for incompressible flows
– First law of thermodynamics • General equation below modified for
– Species mass balance momentum to show pressure explicitly
• Result is a system of linked, nonlinear, ⎡ ∂ρφ ∂ρ ui ϕ ⎤ ∂ (ϕ ) ∂ϕ
partial-differential equations c⎢ + = Γ + S (ϕ )
⎣ ∂t ∂xi ⎥⎦ ∂xi ∂xi
• All equations have similar form Transient Convective Diffusive " Source"
83 84
ME 692 – Computational Fluid Dynamics 14
Introduction and Equations January 20-25, 2010
Homework
• Problems 1 and 2 convert summation
convention to full terms
• Problem 3 shows dissipation not
important for low Mach numbers
• Problem 4 introduces variables vorticity
and stream function used in some older
algorithms for 2D flows
• Problem 5 looks at CFD review
publication from online library access
85
ME 692 – Computational Fluid Dynamics 15