<<

An Introduction to Modeling for CFD

Gerald Recktenwald∗

February 19, 2020

∗Mechanical and Materials Engineering Department Portland State University, Portland, Oregon, [email protected] Turbulence is a Hard Problem

• Unsteady

• Many length scales

• Energy transfer between scales: → Large eddies break up into small eddies

• Steep gradients near the wall

ME 4/548: Turbulence Modeling page 1 Engineering Model: Flow is “Steady-in-the-Mean” (1)

2

1.8

1.6

1.4

1.2 u 1

0.8

0.6

0.4

0.2

0 0 0.5 1 1.5 2 t

ME 4/548: Turbulence Modeling page 2 Engineering Model: Flow is “Steady-in-the-Mean” (2)

Reality: Turbulent flows are unsteady: fluctuations at a point are caused by convection of eddies of many sizes. As eddies move through the flow the velocity field changes in complex ways at a fixed point in space. Turbulent flows have structures – blobs of fluid that move and then break up.

ME 4/548: Turbulence Modeling page 3 Engineering Model: Flow is “Steady-in-the-Mean” (3)

Engineering Model: When measured with a “slow” sensor (e.g. Pitot tube) the velocity at a point is apparently steady. For basic engineering analysis we treat flow variables (velocity components, pressure, temperature) as time averages (or ensemble averages). These averages are steady (ignorning ensemble averaging of periodic flows).

ME 4/548: Turbulence Modeling page 4 Engineering Model: Enhanced Transport (1)

Turbulent eddies enhance mixing. • Transport in turbulent flow is much greater than in laminar flow: e.g. pollutants spread more rapidly in a turbulent flow than a laminar flow

• As a result of enhanced local transport, mean profiles tend to be more uniform except near walls.

• Near walls, gradients of velocity, temperature (and other scalars (e.g., chemical concentration) are steep. Visualize two-layer: high viscosity in core of pipe and low viscosity near the wall – Cartoon view only!

ME 4/548: Turbulence Modeling page 5 Engineering Model: Enhanced Transport (2)

Turbulence models are a way to account for enhanced mixing while treating the flow as steady-in-the-mean • Apparent effect of turbulence is to increase the effective viscosity, thermal conductivity, and diffusivity.

• Enhanced transport coefficients are properties of the flow, not real thermophysical transport coefficients.

• Most commonly used turbulence models provide a way to compute the effective transport coefficients, e.g. the turbulence viscosity.

ME 4/548: Turbulence Modeling page 6 Computational Models (1)

1. Direct Numerical Simulation (DNS) • No modeling of turbulence • Resolve all time scales and spatial scales • Useful for fundamental research • Don’t scale to highest Re and hard to implement in complex geometries

Rodi1 cites a DNS simulation in 2015 With increasing computer power, channel-flow simulations with ever-increasing R were carried out over the years, and at the time of writing, the largest calculation is that of Lee and Moser (2015) at R = 125, 000. This employed 242 × 109 grid points and ran for several months on the Peta-FLOP/S computer Mira.

1Journal of Hydraulic Engineering, 2017, 143(5)

ME 4/548: Turbulence Modeling page 7 World’s Fastest computers as of November 2018

See https://www.top500.org/lists/2018/11/. Mira is now #21 with Rmax = 0.06Rmax(Summit) Note: the average US home uses ≈1 kW.

ME 4/548: Turbulence Modeling page 8 Trend in the Top 500

https://www.top500.org/lists/2018/11/

ME 4/548: Turbulence Modeling page 9 Computational Models (2)

2. (LES) • Model the small scale (sub-grid) turbulence • Larger, energy-containing eddies are resolved in unsteady flow • Transient data needs to be averaged to obtain engineering quantities • Useful for rigorous engineering analysis • StarCCM+ can do LES and DES (Detached Eddy Simulation)

ME 4/548: Turbulence Modeling page 10 Computational Models (3)

3. Reynolds-Averaged Navier Stokes (RANS) • Turbulence effects are replaced by enhanced mixing – eddy viscosity • Standard approach for basic engineering computations • Extremely limited ability to capture complex structure

ME 4/548: Turbulence Modeling page 11 Reynolds Averaged Navier Stokes RANS

ME 4/548: Turbulence Modeling page 12 Reynolds Averaged Navier-Stokes (RANS)

• Average the Navier-Stokes equations in attempt to solve equations that are steady in the mean.

• Averaging creates additional unknowns: the Reynolds stresses

• Use a turbulence model to compute the Reynolds stresses. . Simplest models are based on the Boussinesq eddy viscosity . Additional equations are necessary to compute the eddy viscosity . The k − ε model is the standard engineering model

ME 4/548: Turbulence Modeling page 13 Reynolds Decomposition (1)

Instantaneous velocity is

u(x, y, z, t) = ˆexu(x, y, z, t) + ˆeyv(x, y, z, t) + ˆezw(x, y, z, t)

Decompose each component into a mean and fluctuating component

u = U + u0 v = V + v0 w = W + w0

ME 4/548: Turbulence Modeling page 14 Reynolds Decomposition (2)

Reynolds averaging rules

1. f + g = f¯+g ¯

2. af = af¯ (a is a constant)

∂f ∂f¯ 3. = ∂s ∂s

4. fg¯ = f¯g¯

ME 4/548: Turbulence Modeling page 15 Reynolds Decomposition (3)

Substitute into the Navier-Stokes equations and average. Consider one of the convection terms in the x-direction momentum equation

∂ ∂ h i (ρuu) = ρ(U + u0)(U + u0) rule 3 ∂x ∂x ∂ = ρ UU + 2Uu0 + u0u0 rule 2, with ρ = constant ∂x ∂   = ρUU + ρu02 by definition of U, and Uu0 = Uu0 = 0 ∂x

ME 4/548: Turbulence Modeling page 16 Reynolds Decomposition (4)

The averaging process has the important property that although u0 = 0,

u0u0 6= 0

0 0 Terms like uiuj are called Reynolds stresses, and arise from the process of Reynolds averaging of the momentum equations.

ME 4/548: Turbulence Modeling page 17 Reynolds Decomposition (5)

There are six Reynolds stresses, which can be represented by the following matrix. u0u0 u0v0 u0w0  u0v0 v0v0 v0w0  u0w0 v0w0 w0w0 The matrix is symmetric because u0v0 = v0u0 and v0w0 = w0v0. The Reynolds stresses are field variables, i.e., each term in the matrix is a function of space in the flow.

ME 4/548: Turbulence Modeling page 18 Turbulence Kinetic Energy

Another important quantity is the turbulence kinetic energy

1 1 k = u0 u0 = u0u0 + v0v0 + w0w0  (1) 2 k k 2

If the turbulence is isotropic, then u0u0 = v0v0 = w0w0, and2

3 k = u0u0 (2) 2

2Equality of normal stresses is a consequence of isotropy, not the definition of it.

ME 4/548: Turbulence Modeling page 19 Turbulence Intensity(1)

Turbulence Intensity is a measure of the velocity associated with the fluctuations in the flow relative to the mean flow. We start by defining the turbulence intensity in each coordinate direction √ √ √ u0u0 v0v0 w0w0 TIx = ,TIy = ,TIz = , (3) Ux,0 Uy,0 Uz,0 where U0 is a representative length scale The total turbulence intensity is

r1 (u0u0 + v0v0 + w0w0) 3 TI = (4) U0

ME 4/548: Turbulence Modeling page 20 Turbulence Intensity(2)

If the turbulence is isotropic, then from

r 1 q (u0u0 + u0u0 + u0u0) 0 0 3 (u u ) TI = = (5) U0 U0 and from Equation (2), r2 k 3 TI = (6) U0 thus, another interpretation of turbulence intensity is that it is a measure of (the square root of) local turbulence kinetic energy.

ME 4/548: Turbulence Modeling page 21 Turbulence Models

ME 4/548: Turbulence Modeling page 22 Kinds of turbulence models

1. Large eddy simulation a. Resolve unsteady large scale motions b. Model small scale (sub-grid scale) motions

2. Reynolds stress models a. Treat flow as steady (no large scale motions) b. Solve model equations for the Reynolds stresses

3. Two-equation models a. Treat flow as steady (no large scale motions) b. Use Boussinesq eddy viscosity to represent Reynolds stresses c. Solve model equations to compute eddy viscosity

ME 4/548: Turbulence Modeling page 23 Boussinesq model (1)

The viscous stress tensor is    ∂Uj ∂Ui 2 ∂Uk τij = µ + − δij (7) ∂xi ∂xi 3 ∂xk

Assume (wish, hope) that the Reynolds stresses have the same form as the viscous stresses.    0 0 ∂Uj ∂Ui 2 ∂Uk 2 −ρ uiuj = µt + − δij − ρ δijk (8) ∂xi ∂xi 3 ∂xk 3 where k is the turbulence kinetic energy

ME 4/548: Turbulence Modeling page 24 Boussinesq model (2)

In practice, the Boussinesq model involves replacing the viscosity in the momentum equations with an effective viscosity

µeff = µ + µt where µ is the physical or moleclar viscosity, and µt is a turbulence viscosity simulates the enhanced mixing due to turbulence. General observations

• µt is a point value. µt has no direction, so therefore the Boussinesq model assumes that the turbulence is isotropic

• µt needs to be estimated by some other model

ME 4/548: Turbulence Modeling page 25 Prandtl’s Mixing Length Hypothesis

Prandtl made the direct analogy with the the molecular model of viscosity from the kinetic theory of gases.

molecular viscosity of gases turbulence viscosity 1 µ = ρ` V µ = ρ` V 3 f m t m t

`f = mean free path `m = mixing length

Vm = velocity of molecules Vt = velocity scale of turbulence

The mixing length is taken as an appropriate length scale for the flow.

The mixing length can vary in proportion to distance from a wall.

ME 4/548: Turbulence Modeling page 26 Estimate of Eddy Viscosity for Pipe Flow (1)

We can estimate the magnitude of the eddy viscosity in a pipe. Prandtl’s model is µt ∼ ρVt`m Turbulent fluctuations are small compared to the mean velocity in the pipe, say, u0 0.01 ≤ ≤ 0.15 U 0 0 To estimate µt, take u /U ∼ 0.1 and Vt ∼ u so that

Vt ∼ 0.1U

ME 4/548: Turbulence Modeling page 27 Estimate of Eddy Viscosity for Pipe Flow (2)

To make a somewhat arbitrary choice of a single length scale that characterizes the turbulent mixing, take

D ` ∼ m 4 Combining the preceding expressions gives the following estimate of turbulence viscosity

µt = ρ(0.1U)(0.25D) = 0.025ρUD

From the estimate of µt we can compute an effective Reynolds number ρUD ρUD Reeff = = = 40 µt 0.025ρUD

ME 4/548: Turbulence Modeling page 28 The k − ε model

ME 4/548: Turbulence Modeling page 29 How do we compute µt?

Short answer: k2 µ = C ρ t µ ε where k is the turbulence kinetic energy, ε is the turbulence dissipation rate, and Cµ is a constant. We need to estimate k and ε In the k − ε model, we solve two transport equations: one for the k field and one for the ε field. Then, the effective viscosity in the Boussinesq model is

µeff = µ + µt

ME 4/548: Turbulence Modeling page 30 k − ε model Standard equations. See [3]. Transport equation for k

      3/2 Dk ∂ µeff ∂k ∂Ui ∂Uj 2 ∂Uj ρ k = + µt + − ρ δijk − cD Dt ∂xi σk ∂xi ∂xj ∂xi 3 ∂xi `m | {z } | {z } diffusion | production{z } dissipation

Transport equation for ε

      2 Dε ∂ µeff ∂ε ∂Ui ∂Uj 2 ∂Uj ρ ε = + cε,1 µt + − ρ δijk − cε,1 Dt ∂xi σε ∂xi ∂xj ∂xi 3 ∂xi k | {z } | {z } diffusion | production{z } dissipation

ME 4/548: Turbulence Modeling page 31 What is ε? Use a simple scaling argument to set an upper bound on the dissipation rate (see Panton [1, § 22.10]).

velocity scale of largest eddy ∼ u0 2 kinetic energy of the eddy ∼ u0 length scale of the eddy ∼ L L turn-over time of the eddy ∼ u0 An upper estimate of the dissipation rate, ε is

kinetic energy of an eddy u2 u3 ε ∼ = 0 = 0 (9) time for one rotation L/u0 L

ME 4/548: Turbulence Modeling page 32 What is ε?

But . . . dissipation happens on the smallest scale. u3 Thus, ε ∼ 0 gives an upper bound, but not a good scale L At the smallest scales the turbulence is (tends to be) isotropic. The turbulence kinetic energy of isotropic turbulence is

3 k = u0u0 isotropic turbulence 2 Thus, we can estimate the velocity scale as

√ k3/2 |u0| ∼ k so that ε ∼ L

ME 4/548: Turbulence Modeling page 33 What is ε?

Introduce a dissipation length scale, `ε such that the dissipation rate is

k3/2 ε ∼ CD (10) `ε where CD corrects ( ) any error in the scale estimate. , But. . . now we need to estimate `ε Turn Equation (10) around

k3/2 ` ∼ C (11) ε D ε Use Prandtl’s mixing length hypothesis to estimate ε from the mixing length

ME 4/548: Turbulence Modeling page 34 Prandtl’s mixing length hypothesis

`m is the length scale for the eddies responsible for mixing, i.e., the most energetic eddies. `m > `ε. 0 `m = C `ε

Prandtl’s estimate of the turbulence viscosity (eddy viscosity) is

µt ∼ ρVt`m where Vt is the velocity scale At the dissipation scale, which is isotropic √ Vt ∼ k

ME 4/548: Turbulence Modeling page 35 Prandtl’s mixing length hypothesis

Combine estimates of Vt, `ε in Prandtl’s expression for eddy viscosity

 k3/2   µ = Cρ C k1/2 t D ε or k2 µ = C ρ (12) t µ ε where Cµ is a constant adjusted from experimental values

ME 4/548: Turbulence Modeling page 36 Calculation of the eddy viscosity, µt, in a CFD code

1. Solve equations for velocities and pressure, using current guess at µeff.

2. Solve the k and ε equations

3. At each point in the flow compute

k2 µ = C ρ t µ ε

4. Update µeff = µ + µt.

5. Return to step 1 until convergence.

ME 4/548: Turbulence Modeling page 37 Wall Functions

ME 4/548: Turbulence Modeling page 38 Wall Functions

In many engineering flows, we don’t have the computational power to resolve the velocity profile near the wall. One solution is to fudge it with wall functions

Expand the y scale

ME 4/548: Turbulence Modeling page 39 Wall variables Scaling arguments lead to the inner (near-wall) coordinates yu y+ = ∗ (13) ν rτ u = w friction velocity (14) ∗ ρ u u+ = (15) u∗ In the viscous sublayer u+ = y+ In the log-law (inertial) sublayer

+ + u = c1 ln y + c2 (16)

ME 4/548: Turbulence Modeling page 40 Wall treatment

Wall functions are used to compute μeff near solid surfaces.

k -ε model is used to compute μeff in the central region of the flow

Remember the prism layer cells in StarCCM+?

ME 4/548: Turbulence Modeling page 41 Wall treatment

Adjust the near-wall mesh spacing so that near-boundary cells have good values of y+, where good depends on the wall treatment.

+ + In StarCCM+, the value of yI is called the “wall y ”.

I

yI ures B

ME 4/548: Turbulence Modeling page 42 Wall treatment models in StarCCM+

The main wall treatment models in StarCCM+ are

• High y+: Classic wall treatment

• Low y+: Extend cells into the viscous sublayer

• All y+: Recommended model that blends low y+ and high y+

Wall treatment is considered in another slide deck.

ME 4/548: Turbulence Modeling page 43 References

[1] Ronald L. Panton. Incompressible Flow. Wiley, New York, second edition, 1996.

[2] Stephen B. Pope. Turbulent Flows. Cambridge University Press, Cambridge, UK, 2000.

[3] John C. Tannehill, Dale A. Anderson, and Richard A. Pletcher. Computational Fluid Mechanics and Heat Transfer. Taylor and Francis, Washington, D.C., second edition, 1997.

ME 4/548: Turbulence Modeling page 44