<<

Lecture 3 - Conservation

Applied Computational Dynamics

Instructor: André Bakker

http://www.bakker.org © André Bakker (2002-2006) 1 Governing equations

• The governing equations include the following conservation laws of : – Conservation of . – Newton’s second law: the change of equals the sum of on a fluid particle. – First law of (conservation of ): rate of change of energy equals the sum of rate of addition to and done on fluid particle. • The fluid is treated as a continuum. For length scales of, say, 1µm and larger, the molecular structure and motions may be ignored.

2 Lagrangian vs. Eulerian description

A fluid flow can be thought Another view of fluid motion is of as being comprised of a large the Eulerian description. In the number of finite sized fluid Eulerian description of fluid particles which have mass, motion, we consider how flow momentum, , and properties change at a fluid other properties. Mathematical element that is fixed in space laws can then be written for each and time (x,y,z,t), rather than fluid particle. This is the following individual fluid Lagrangian description of fluid particles. motion.

Governing equations can be derived using each method and converted to the other form. 3 Fluid element and properties Fluid element for conservation laws • The behavior of the fluid is described in terms of macroscopic properties: – u. – p. δδδ (x,y,z) z – ρ.

T. δδδy – Energy E. δδδx z • Typically ignore (x,y,z,t) in the notation. y • Properties are averages of a sufficiently x large number of molecules. Faces are labeled • A fluid element can be thought of as the North, East, West, smallest for which the continuum South, Top and Bottom assumption is valid. Properties at faces are expressed as first two terms of a Taylor series expansion, ∂p1 ∂ p 1 e.g.forp:pp=− δ δ x and pp =+ x W∂x2 E ∂ x 2 4 Mass balance

• Rate of increase of mass in fluid element equals the net rate of flow of mass into element. ∂ ∂ρ • Rate of increase is: (ρδx δyδz) = δxδyδz ∂t ∂t • The inflows (positive) and outflows (negative) are shown here:

∂(ρw ) 1  δ δρ w+ . zxy  ∂z 2  ∂(ρv ) 1  δ δ δρ v+ . yxz  ∂y 2 

∂(ρu ) 1   ∂(ρu) 1  δ δρ u+ . xyz   ρu − . δx δyδz ∂x 2   ∂x 2 

 ∂(ρv) 1   ρv − . δy δxδz z  ∂y 2  y  ∂(ρw) 1  x  ρw − . δz δxδy  ∂z 2  5 Continuity

• Summing all terms in the previous slide and dividing by the volume δxδyδz results in:

∂ρ ∂ ρ ∂ ρ ∂ ρ + ( u) + ( v) + ( w) = 0 ∂t ∂x ∂y ∂z

• In vector notation: ∂ρ + div (ρ u) = 0 ∂t Change in density Net flow of mass across boundaries Convective term • For incompressible ∂ρ /∂ t = 0, and the equation becomes: div u = 0. ∂ ∂ ∂ ∂u u + v + w = i = • Alternative ways to write this: ∂ ∂ ∂ 0 and ∂ 0 x y z xi

6 Different forms of the

Finite control volume Finite control volume fixed fixed in space mass moving with flow ∂ D ∫∫∫ ρ dV + ∫∫ ρ U ⋅dS = 0 ∫∫∫ ρ dV = 0 ∂t V S Dt V form Integral form Conservati on form Non − conservati on form

U

Infinitesimally small Infinitesimally small fluid element of fixed element fixed in space mass (“fluid particle”) moving with the flow ∂ρ Dρ + ∇ ⋅ (ρU) = 0 + ρ∇ ⋅ U = 0 ∂t Dt Differenti al form Differenti al form Conservati on form Non − conservati on form 7 Rate of change for a fluid particle

• Terminology: fluid element is a volume stationary in space, and a fluid particle is a volume of fluid moving with the flow. • A moving fluid particle experiences two rates of changes: – Change due to changes in the fluid as a function of time. – Change due to the fact that it moves to a different location in the fluid with different conditions. • The sum of these two rates of changes for a property per unit mass φ is called the total or substantive derivative Dφ /Dt : φ ∂φ ∂φ ∂φ ∂φ D = + dx + dy + dz Dt ∂t ∂x dt ∂y dt ∂z dt

• With dx/dt=u , dy/dt=v , dz/dt=w , this results in:

Dφ ∂φ = + u.grad φ Dt ∂t 8 Rate of change for a stationary fluid element

• In most cases we are interested in the changes of a flow property for a fluid element, or fluid volume, that is stationary in space. • However, some equations are easier derived for fluid particles. For a moving fluid particle, the total derivative per unit volume of this property φ is given by: Dφ  ∂φ  (for moving fluid particle) ρ = ρ  + u.grad φ  (for given location in space) Dt  ∂t 

• For a fluid element, for an arbitrary conserved property φ:

∂ρ ∂(ρφ) + div (ρ u) = 0 + div (ρφ u) = 0 ∂t ∂t Continuity equation Arbitrary property

9 Fluid particle and fluid element

• We can derive the relationship between the equations for a fluid particle (Lagrangian) and a fluid element (Eulerian) as follows:

∂(ρφ) ∂φ  ∂ρ  Dφ + div (ρφ u) = ρ + u.grad φ + φ + div (ρu) = ρ ∂t  ∂t   ∂t  Dt

zero because of continuity

∂(ρφ) Dφ + div (ρφ u) = ρ ∂t Dt

Rate of increase of Net rate of flow of Rate of increase of = φφφ of fluid element φφφ out of fluid element φφφ for a fluid particle

10 To remember so far

• We need to derive conservation equations that we can solve to calculate fluid and other properties. • These equations can be derived either for a fluid particle that is moving with the flow (Lagrangian) or for a fluid element that is stationary in space (Eulerian). • For CFD purposes we need them in Eulerian form, but (according to the book) they are somewhat easier to derive in Lagrangian form. • Luckily, when we derive equations for a property φ in one form, we can convert them to the other form using the relationship shown on the bottom in the previous slide.

11 Relevant entries for Φ

x-momentum u Du ∂(ρu) ρ + div (ρuu) Dt ∂t

y-momentum v Dv ∂(ρv) ρ + div (ρvu) Dt ∂t

z-momentum w Dw ∂(ρw) ρ + div (ρwu) Dt ∂t

Energy E DE ∂(ρE) ρ + div (ρEu) Dt ∂t

12 Momentum equation in three dimensions

• We will first derive conservation equations for momentum and energy for fluid particles. Next we will use the above relationships to transform those to an Eulerian frame (for fluid elements). • We start with deriving the momentum equations. • Newton’s second law: rate of change of momentum equals sum of forces. • Rate of increase of x-, y-, and z-momentum: ρ Du ρ Dv ρ Dw Dt Dt Dt • Forces on fluid particles are: – forces such as pressure and viscous forces. – Body forces, which act on a volume, such as gravity, centrifugal, Coriolis, and electromagnetic forces.

13 Viscous stresses

• Stresses are forces per area. Unit is N/m 2 or Pa. • Viscous stresses denoted by τ. τ • Suffix notation ij is used to indicate direction. • Nine components. τ τ τ – xx , yy , zz are normal stresses. τ E.g. zz is the stress in the z- direction on a z-plane. – Other stresses are shear τ stresses. E.g. zy is the stress in the y-direction on a z-plane. • Forces aligned with the direction of a coordinate axis are positive. Opposite direction is negative.

14 Forces in the x-direction ∂τ 1 τ + zx δ δ δ ( zx . z) y z ∂τ ∂τ ∂ yx 1 yx 1 z 2 − τ − δ δ δ τ + δ δ δ ( yx . y) x z ( yx . y) x z ∂ ∂y 2 y 2

∂p 1 ∂p 1 ( p − . δx)δyδz − ( p + . δx)δyδz ∂x 2 ∂x 2 ∂τ xx 1 ∂τ − τ − δ δ δ xx 1 ( xx . x) y z (τ + . δx)δyδz ∂x 2 xx ∂x 2

z ∂τ 1 y − τ − zx δ δ δ ( zx . z) x y x ∂z 2

Net in the x-direction is the sum of all the force components in that direction. 15 Momentum equation

• Set the rate of change of x-momentum for a fluid particle Du/Dt equal to: – the sum of the forces due to surface stresses shown in the previous slide, plus – the body forces. These are usually lumped together into a source term S : M Du ∂(− p +τ ) ∂τ ∂τ ρ = xx + yx + zx + S Dt ∂x ∂y ∂z Mx τ – p is a compressive stress and xx is a tensile stress. • Similarly for y- and z-momentum:

Dv ∂τ ∂(− p +τ ) ∂τ ρ = xy + yy + zy + S Dt ∂x ∂y ∂z My Dw ∂τ ∂τ ∂(− p +τ ) ρ = xz + yz + zz + S ∂ ∂ ∂ Mz Dt x y z 16 Energy equation

• First law of thermodynamics: rate of change of energy of a fluid particle is equal to the rate of heat addition plus the rate of work done. • Rate of increase of energy is ρDE/Dt. • Energy E = i + ½ (u 2+v 2+w 2). • Here, i is the internal (). • ½ (u 2+v 2+w 2) is the . • (gravitation) is usually treated separately and included as a source term. • We will derive the energy equation by setting the total derivative equal to the change in energy as a result of work done by viscous stresses and the net heat conduction. • Next we will subtract the kinetic energy equation to arrive at a conservation equation for the internal energy.

17 Work done by surface stresses in x-direction ∂(uτ ) 1 (uτ + zx . δz)δyδz ∂(uτ ) 1 zx ∂ ∂ τ τ + yx δ δ δ z 2 (u yx ) 1 (u yx . y) x z − (uτ − . δy)δxδz ∂y 2 yx ∂y 2

∂(up ) 1 (up − . δx)δyδz ∂(up ) 1 ∂x 2 − (up + . δx)δyδz ∂x 2 ∂(uτ ) 1 − τ − xx δ δ δ (u xx . x) y z ∂(uτ ) 1 ∂x 2 (uτ + xx . δx)δyδz xx ∂x 2

z y ∂(uτ ) 1 x − (uτ − zx . δz)δxδy zx ∂z 2 Work done is force times velocity. 18 Work done by surface stresses

• The total rate of work done by surface stresses is calculated as follows: – For work done by x-components of stresses add all terms in the previous slide. – Do the same for the y- and z-components. • Add all and divide by δxδyδz to get the work done per unit volume by the surface stresses:

∂(uτ ) ∂(uτ ) ∂(uτ ) ∂(vτ ) − div ( pu) + xx + yx + zx + xy ∂x ∂y ∂z ∂x ∂(vτ ) ∂(vτ ) ∂(wτ ) ∂(wτ ) ∂(uτ ) + yy + zy + xz + yz + zz ∂y ∂z ∂x ∂y ∂z

19 Energy due to heat conduction ∂q 1 ∂ + z δ δ δ q 1 (qz . z) x y (q + y . δy)δxδz ∂z 2 y ∂y 2

∂ qx 1 ∂ − δ δ δ qx 1 (qx . x) y z + δ δ δ ∂ (qx . x) y z x 2 ∂x 2

z y x ∂ ∂ q y 1 qz 1 − δ δ δ (q − . δz)δxδy (q y . y) x z z ∂z 2 ∂y 2

The heat flux vector q has three components, q x, q y, and q z. 20 Energy flux due to heat conduction

• Summing all terms and dividing by δxδyδz gives the net rate of to the fluid particle per unit volume:

∂q ∂q ∂q − x − y − z = − div q ∂x ∂y ∂z

• Fourier’s law of heat conduction relates the heat flux to the local temperature : ∂T ∂T ∂T q = − k q = − k q = − k x ∂x y ∂y z ∂z

• In vector form: q = − k grad T • Thus, energy flux due to conduction: − div q = div (k grad T ) • This is the final form used in the energy equation.

21 Energy equation

• Setting the total derivative for the energy in a fluid particle equal to the previously derived work and energy flux terms, results in the following energy equation: ∂ τ ∂ τ DE ∂(uτ ) (u yx ) ∂(uτ ) (v xy ) ρ = − div ( pu) +  xx + + zx + Dt  ∂x ∂y ∂z ∂x ∂ τ ∂ τ ∂ τ (v yy ) (v zy ) ∂(wτ ) (w yz ) ∂(uτ ) + + + xz + + zz  ∂y ∂z ∂x ∂y ∂z  + + div (k grad T ) SE

• Note that we also added a source term S E that includes sources (potential energy, sources due to heat production from chemical reactions, etc.).

22 Kinetic energy equation

• Separately, we can derive a conservation equation for the kinetic energy of the fluid. • In order to do this, we multiply the u-momentum equation by u, the v-momentum equation by v, and the w-momentum equation by w. We then add the results together. • This results in the following equation for the kinetic energy:

D[1 (u 2 + v2 + w2 )]  ∂τ ∂τ ∂τ  ρ 2 = − u.grad p + u xx + yx + zx  Dt  ∂x ∂y ∂z   ∂τ ∂τ ∂τ   ∂τ ∂τ ∂τ  + v xy + yy + zy  + w  xz + yz + zz  + u. S  ∂x ∂y ∂z   ∂x ∂y ∂z  M

23 Internal energy equation

• Subtract the kinetic energy equation from the energy equation. • Define a new source term for the internal energy as

Si = S E - u.SM. This results in:

 ∂ ∂ ∂ ∂ ρ Di = − + τ u + τ u + τ u + τ v p div u  xx yx zx xy Dt  ∂x ∂y ∂z ∂x ∂ ∂ ∂ ∂ ∂  + τ v + τ v + τ w + τ w + τ u yy zy xz yz zz  ∂y ∂z ∂x ∂y ∂z  + + div (k grad T ) Si

24 equation

• An often used alternative form of the energy equation is the total enthalpy equation. – Specific enthalpy h = i + p/ ρ. 2 2 2 ρ. – Total enthalpy h 0 = h + ½ (u +v +w ) = E + p/

∂(ρh ) 0 +div()(ρ hu = divk grad T ) ∂t 0 τ ∂τ ∂ τ ∂()uτ ()uyx ∂ () u () v xy + xx + + zx +  ∂x ∂ y ∂ z ∂ x τ ∂ τ τ ∂ ∂ ()()vyy v zy τ ∂(wτ ) () w yz ∂( u )  + + +xz + + zz  ∂y ∂ z ∂ x ∂ y ∂ z  + Sh

25 Equations of state

• Fluid motion is described by five partial differential equations for mass, momentum, and energy. • Amongst the unknowns are four thermodynamic variables: ρ, p, i, and T. • We will assume thermodynamic equilibrium, i.e. that the time it takes for a fluid particle to adjust to new conditions is short relative to the timescale of the flow. • We add two equations of state using the two state variables ρ and T: p=p( ρ,T) and i=i( ρ,T) . ρ • For a perfect , these become: p= RT and i=C vT. • At low (e.g. Ma < 0.2), the fluids can be considered incompressible. There is no linkage between the energy equation, and the mass and momentum equation. We then only need to solve for energy if the problem involves heat transfer.

26 Viscous stresses

τ • A model for the viscous stresses ij is required. • We will express the viscous stresses as functions of the local rate (strain rate) tensor. • There are two types of deformation: – Linear deformation rates due to velocity . • Elongating stress components (stretching). • Shearing stress components. – Volumetric deformation rates due to expansion or compression. • All and most fluids are isotropic: is a scalar. • Some fluids have anisotropic viscous stress properties, such as certain and dough. We will not discuss those here.

27 Viscous stress tensor

• Using an isotropic (first) dynamic viscosity µ for the linear deformations and a second viscosity λ=-2/3 µ for the volumetric deformations results in: τ τ τ   xx xy xz  τ = τ τ τ  yx yy yz  τ τ τ   zx zy zz   ∂u 2  ∂u ∂v   ∂u ∂w  2µ − µ div u µ +  µ +    ∂x 3  ∂y ∂x   ∂z ∂x     ∂u ∂v  ∂v 2  ∂v ∂w  = µ +  2µ − µ div u µ +   ∂ ∂ ∂ ∂ ∂    y x  y 3  z y     ∂u ∂w  ∂v ∂w ∂w 2   µ +  µ +  2µ − µ div u   ∂z ∂x   ∂z ∂y  ∂z 3 

Note: div u = 0 for incompressible fluids. 28 Navier-Stokes equations

• Including the viscous stress terms in the momentum balance and rearranging, results in the Navier-Stokes equations:

∂(ρu) ∂p x − momentum : + div (ρuu) = − + div (µ grad u) + S ∂t ∂x Mx ∂(ρv) ∂p y − momentum : + div (ρvu) = − + div (µ grad v) + S ∂t ∂y My ∂(ρw) ∂p z − momentum : + div (ρwu) = − + div (µ grad w) + S ∂t ∂z Mz

29 Viscous

• Similarly, substituting the stresses in the internal energy equation and rearranging results in:

∂(ρi) Internal energy : + div (ρiu) = − p div u + div (k grad T ) + Φ + S ∂t i

• Here Φ is the viscous dissipation term. This term is always positive and describes the conversion of to heat.

2 2   ∂u 2  ∂v   ∂w2   ∂u ∂v  Φ = µ 2  +   +    +  +   ∂ ∂ ∂ ∂ ∂   x   y   z    y x  2  ∂u ∂w2  ∂v ∂w  2 +  +  +  +  − µ(div u)2 ∂ ∂ ∂ ∂   z x   z y   3 30 Summary of equations in conservation form ∂ρ Mass : + div (ρ u) = 0 ∂t ∂(ρu) ∂p x − momentum : + div (ρuu) = − + div (µ grad u) + S ∂t ∂x Mx ∂(ρv) ∂p y − momentum : + div (ρvu) = − + div (µ grad v) + S ∂t ∂y My ∂(ρw) ∂p z − momentum : + div (ρwu) = − + div (µ grad w) + S ∂t ∂z Mz ∂(ρi) Internal energy : + div (ρiu) = − p div u + div (k grad T ) + Φ + S ∂t i Equations of state : p = p(ρ,T ) and i = i(ρ,T ) = ρ = e.g. for perfect gas : p RT and i CvT 31 General transport equations

• The system of equations is now closed, with seven equations for seven variables: pressure, three velocity components, enthalpy, temperature, and density. • There are significant commonalities between the various equations. Using a general variable φ, the conservative form of all fluid flow equations can usefully be written in the following form:

∂(ρφ) + div ()()ρφ u = div Γ grad φ + Sφ ∂t

• Or, in words: Net rate of flow Rate of increase Rate of increase Rate of increase of φφφ out of of φφφ of fluid of φφφ due to of φφφ due to + fluid element = + element sources ()

32 Integral form

• The key step of the finite volume method is to integrate the shown in the previous slide, and then to apply Gauss’ , which for a vector a states: ∫ div adV = ∫n ⋅adA CV A • This then leads to the following general conservation equation in integral form: ∂  ρφ  + ⋅ ρφ = ⋅ Γ φ +  ∫ dV  ∫n ( u)dA ∫n ( grad )dA ∫ Sφ dV ∂t  CV  A A CV Net rate of Net rate of Rate of Net rate of decrease of φφφ due increase of φφφ due increase creation + to convection = to diffusion + of φφφ of φφφ across boundaries across boundaries • This is the actual form of the conservation equations solved by finite volume based CFD programs to calculate the flow pattern and associated scalar fields. 33