Turbulence Model: Understanding Prandtl Number and Derivative Expressions, Slides of Fluid Dynamics

Guidance on choosing a turbulence model, focusing on the turbulent prandtl number (σt). It discusses common models like k-ε, spalart-allmaras, and reynolds stress models. The document also covers derivative expressions and their errors, including forward, backward, and central differences. It explains the concept of roundoff error and uneven step sizes, and provides examples of second derivative calculations.

Typology: Slides

2013/2014

Uploaded on 02/01/2014

savitri_122
savitri_122 🇮🇳

4.6

(14)

184 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Review of Numerical Analysis February 10, 2010
ME 692 – Computational Fluid Dynamics 1
Review of Numerical Analysis
Review of Numerical Analysis
Larry Caretto
Mechanical Engineering 692
Computational Fluid Dynamics
February 10, 2010
2
Outline
Review last week
Numerical analysis basics
Derivative expressions
Round-off and truncation errors
Order of the error
Solutions of ordinary differential equation
boundary value problems
Finite differences and finite elements
Accuracy of results
3
Turbulence Models
Cannot compute turbulence exactly
except for simple flows
Need to use turbulence models
Based on combination of theory and
empirical measurements
Many models available
No model correct for all flows
Basic approach is to model turbulent
viscosity
Averages of turbulent fluctuation
products are assumed to be proportional
to mean gradients 4
General Equation
Reynolds (time) averaged Navier-Stokes
(
)
()
i
t
ii
i
iii
ii
xxx
u
xxx
uu
+
=
=
+
ϕ
γγ
ϕ
ϕ
γ
ϕϕ
ϕϕϕ
)()()(
''
Turbulence models obtain values for νt
Dimensionally nt= C l V, e.g., Cμ(k3/2/ε)k1/2
Turbulent Prandtl number, σt(φ), is
empirical constant in turbulence models
()
it
t
lam
ii
i
i
j
t
iii
ji
xxx
u
x
u
xx
p
x
uu
+
=
+
+
=
ϕ
σ
ν
γ
ϕ
νν
ρ
ϕ
ϕ
)(
)(
1
5
Model Guidance
Choosing a model
Previous work at your organization or from
literature research
User’s manual for code
Use default constants
Unusual features: non-equilibrium
turbulence, high strain rates, adverse
pressure gradients, rotating machinery,
compressible flows
Check y+values for correct spacing with
wall functions or laminar sublayer 6
More Guidance
Common models
–k-εstandard model and variants for internal
simple flows
Solve two PDEs
Spalart-Allmaras for aerospace
applications with wall-bounded flows
Only one PDE
Reynolds stress model for complex flows
Requires solution of seven PDEs
Several other models
No one right model for all applications
pf3
pf4
pf5
pf8

Partial preview of the text

Download Turbulence Model: Understanding Prandtl Number and Derivative Expressions and more Slides Fluid Dynamics in PDF only on Docsity!

Review of Numerical AnalysisReview of Numerical Analysis

Larry Caretto

Mechanical Engineering 692

Computational Fluid Dynamics

February 10, 2010

2

Outline

  • Review last week
  • Numerical analysis basics
    • Derivative expressions
    • Round-off and truncation errors
    • Order of the error
    • Solutions of ordinary differential equation

boundary value problems

  • Finite differences and finite elements
  • Accuracy of results

3

Turbulence Models

  • Cannot compute turbulence exactly

except for simple flows

  • Need to use turbulence models
  • Based on combination of theory and

empirical measurements

  • Many models available
    • No model correct for all flows
  • Basic approach is to model turbulent

viscosity

  • Averages of turbulent fluctuation

products are assumed to be proportional

to mean gradients

4

General Equation

  • Reynolds (time) averaged Navier-Stokes

i

t i i

i

i i i

i i

x x x

u

x x x

u u

'

  • Turbulence models obtain values for νt
    • Dimensionally n (^) t = C l V, e.g ., Cμ(k 3/2^ /ε)k 1/
  • Turbulent Prandtl number, σ t

(φ) , is

empirical constant in turbulence models

t i

t lam i i

i

i

j t i i i

i j

x x x

u

x

u

x x

p

x

uu

∂ ϕ

σ

ν γ

ϕ ν ν ρ

ϕ

ϕ ( )

5

Model Guidance

  • Choosing a model
    • Previous work at your organization or from

literature research

  • User’s manual for code
  • Use default constants
  • Unusual features: non-equilibrium

turbulence, high strain rates, adverse

pressure gradients, rotating machinery,

compressible flows

  • Check y+^ values for correct spacing with

wall functions or laminar sublayer

6

More Guidance

  • Common models
    • k-ε standard model and variants for internal

simple flows

  • Solve two PDEs
  • Spalart-Allmaras for aerospace

applications with wall-bounded flows

  • Only one PDE
  • Reynolds stress model for complex flows
  • Requires solution of seven PDEs
  • Several other models
  • No one right model for all applications

7

Numerical Analysis

  • Want to express derivatives and

integrals in terms of discrete data points

  • Use different methods
    • Develop interpolation polynomial and

integrate or differentiate this result

  • Use Taylor series to get expressions for

derivatives

  • Want expressions and measure of error

with their use

8

Finite Difference Grids

  • Subdivide region into discrete points
  • Spacing between the points may be

uniform or non-uniform

  • Example: grid for x min

≤ x ≤ x max

with N+

nodes numbered from zero to N

  • Initial node value, x 0

= x min

  • Final grid node value, x N

= x max

  • Node spacing between Δx i

= x i

and x i-

  • Uniform spacing, h = Δxi = (xmin – x (^) max)/N
  • N+1 nodes give N spaces

9

Finite Difference Grids II

  • Non-uniform grid illustrated below

●---●------●----------●---~ ~----●------●---●

x 0

x 1

x 2

x 3

x N-

x N-

x N

  • Two space dimensions require x and y

grids (M+1 y nodes)

x 0

= x min

x N

= x max

x i

  • x i-

= Δx i

y 0

= y mjn

y M

= y max

y j

  • y j-

=Δy j

  • Most general case has three space

dimensions (x, y, z, and time)

10

Finite Difference Grids III

  • Grid notation for four independent

variables: x, y, z and t

x 0

= x min

x N

= x max

x i

  • x i-

= Δx i

y 0

= y mjn

y M

= y max

y j

  • y j-

= Δy j

z 0

= z mkn

z K

= z max

z k

  • z k-

= Δz k

t 0

= t min

t L

= t max

t n

  • t n-

= Δt n

  • Dependent variable u(x,y,z,t) at discrete

points u(x i

, y j

, z k

, t n

)

  • Use notation below for this value of u

( , , , ) i j k n

n

ijk

u =u x y z t

11

Derivative Expressions

  • Obtain from differentiating interpolation

polynomials or from Taylor series

  • Series expansion for f(x) about x = a

( -) .... 3!

1 ( -) 2!

1 ( ) () ( )

3 3

3 2 2

2

= + − + + + = = =

x a dx

df xa dx

df x a dx

df fx fa

xa xa xa

= (^) =

= 0

( -) !

1 ( ) n

n

xa

n

n

xa dx

df

n

fx

  • Note: d

0 f/dx

0 = f

and 0! = 1

  • What is error from truncating series?

12

Truncation Error

  • If we truncate series after m terms

∑ ∑

= (^) = = + =

0 1

nm

n

xa

n

m n

n

n

xa

n

n

x a dx

df

n

x a dx

df

n

fx

Terms used Truncation error, εm

  • Can write truncation error as single term

at unknown location (derivation based

on the theorem of the mean)

1 1

1

1

=

∞ +

= (^) ∑ =

m

x

m

m

nm

n

xa

n

n

m xa

dx

d f

m

x a

dx

d f

n

ξ

19

Order of the Error Notation

  • Write the error term for n

th error term as

O(h

n )

  • Big oh notation, O, denotes order
  • Recognizes that factor multiplying h

n

may

change slightly with h

' 1 1 2 Oh h

f f f

i i i +

' (^1)

Oh

h

f f

f

i i

i +

()

' (^1) Oh h

f f f

i i i +

First order forward First order backward

Second order central

20

Higher Order Derivatives

  • Add fi+1 and fi-1 expressions

'' 2 ''' 3 '

  • 1 = + + + +

fh f h f f fh

i i i i i

..... 2! 3!

'' 2 ''' 3 ' − 1 = − + − +

fh f h f f fh

i i i i i

( )

2 2

1 1

''' 2 ''''' 4

2

Oh h

fh f h f f f

h

f f f f

i i i i i i i i i +

  • − + −
  • f’’ is second-order, central difference

'' 2 '''' 4 '''''' 6

+ 1 +^ − 1 = + + + +

fh f h f h f f f

i i i i i i

21

Higher Order Directional

  • We can get higher order derivative

expressions at the expense of more

computations

  • Get second order forward and backward

derivative expressions from f (^) i+2 and f (^) i-2,

respectively

  • Combine with previous expressions for

f (^) i+1 and fi-1 to eliminate first order error

term

22

Specific Taylor Series

  • General

equation

'' 2 ''' 3 ' += + + + +

f kh f kh f f fkh

i i ik i i

'' 2 ''' 3 '

  • 2 = + + + +

fh f h f f fh

i i i i i

  • k = -
  • k = 2

'' 2 ''' 3 ' − 2 = − + − +

fh f h f f fh

i i i i i

  • k = -
  • k = 3 ..... 3!

'' 2 ''' 3 '

  • 3 = + + + +

fh f h f f fh

i i i i i

'' 2 ''' 3 ' − 3 = − + − +

fh f h f f fh

i i i i i

23

Second Order Forward

  • Subtract 4f (^) i+1 from f (^) i+2 to eliminate h

2 term

+−^ += + + + +

3 '''

2 ' ''

3 '''

2 ' '' 2 1

h f

h f fh f

h f

h f f f fh f

i i i i

i i i i i i

3 ' '''

+ 2 −^ + 1 + =− + +

h

f i fi fi hfi fi

2 ' 2 1 '''

+ + h

f

h

f f f

f

i

i i i i

Second

order

error

24

Second Order Backwards

  • Add 4f (^) i-1 to –fi-2 to eliminate h

2 term

3 '''

2 ' ''

3 '''

2 ' '' 2 1

h f

h f fh f

h f

h f f f fh f

i i i i

i i i i i i

3 ' '''

h

f i fi fi hfi fi

2 ' 2 1 '''

+ + h

f

h

f f f

f

i

i i i i

Second

order

error

25

Other Derivative Expressions

  • Can continue in this fashion
    • Write Taylor series for fi+1 , fi-1 , fi+2 , fi-2 , fi+3,

fi-3 , etc.

  • Create linear combinations with factors that

eliminate desired terms

  • Eliminate f (^) i term to obtain central difference
  • Keep only terms in f (^) k with k ≥ i for forward

difference expressions

  • Keep only terms in f (^) k with k ≤ i for forward

difference expressions

  • See results for different expressions in

common numerical analysis texts

26

Order of Error Examples

  • Table 2-1 in notes shows error in first

derivative for e

x around x = 1

  • Using first- and second-order forward and

second-order central differences

  • Step h = 0.4, 0.2, and 0.
  • Error ratio for doubling step size
    • 4.01 to 4.02 for central differences
    • 2.07 to 2.15 for first-order forward differences
    • 4.32 to 4.69 for second-order forward

log( ) log( )

log( ) log( )

log

log

2 1

2 1

1

2

1

2

h h h

h

n −

⎟ ⎠

⎞ ⎜ ⎝

⎟ ⎠

⎞ ⎜ ⎝

ε ε ε

ε

27

Roundoff Error

  • Possible in derivative expressions from

subtracting close differences

  • Example f(x) = e

x : f’(x) ≈ (e

x+h

  • e

x-h )/(2h)

and error at x = 1 is (e

1+h

  • e

1-h )/(2h) - e

3

  1. 718282 4. 510 2 ( 0. 1 )

  2. 004166 2. (^722815) − − =

− E= x

9

  1. 718281828459 4. 510 2 ( 0. 0001 )

E= x

9

  1. 718281828 5. 910 2 ( 0. 0000001 )

E= x

Second order error

28

Figure 2-1. Effect of Step Size on Error

1.E-

1.E-

1.E-

1.E-

1.E-

1.E-

1.E-

1.E-

1.E-

1.E-

1.E-

1.E+

1.E+

1.E-17 1.E-15 1.E-13 1.E-11 1.E-09 1.E-07 1.E-05 1.E-03 1.E-

Step Size

Error

Roundoff

Error

Second-order

Truncation

Error

2 log 100

510

log^510

log

log (^7)

3

1

2

1

2

= = =

x

x

h

h

n

ε

ε

29

Uneven Step Sizes

  • Apply general Taylor series for f k

= f(x k

)

in terms of f i

= f(x i

) for k = i + 1 and i – 1

( ) ..... 3!

''' ( ) 2!

'' ' ( )

3 1

2

  • 1 =^ + + 1 − + + 1 − + i+−i +

i i i

i i i i i i x x

f x x

f f f f x x

( ) ..... 3!

''' ( ) 2!

'' ' ( )

2 3 = + − + − + k−i +

i k i

i k i i k i x x

f x x

f f f f x x

( ) ..... 3!

''' ( ) 2!

'' '( )

3 1

2 − 1 =^ + − 1 − + − 1 − + i−−i +

i i i

i i i i i i x x

f x x

f f f f x x

  • Subtract (or add) the last two equations

to get an expression for f i

’ (or f i

) 30

First Derivative

  • Solve subtraction for f i

’ and rearrange

  • If x i+ - x i

= x i

  • x i-

= h, we have second

order central difference

  • Uneven step size gives first order error

of f i

’’[(x i+

  • x i

) – (x i

  • x i-

)]/[2(x i+

  • x i-

)]

[ ] [

] [ ( ) ( )] ..... 3!

''' ( )

( ) 2!

'' '( ) ( )

3 1

3 1

2 1

2 1 1 1 1 1

− − + − − − +

− = − − − + −

− + −

  • − + − +

i i i i

i i i

i i

i i i i i i i i

x x x x

f x x

x x

f f f f x x x x

.....

( ) ( )

3!

( ) ( ) '''

2!

'' ' 1 1

3 1

3 1

1 1

2 1

2 1

1 1

1 1

− − − − −

− − − − −

i i

i i i i i

i i

i i i i i

i i

i i i x x

f x x x x

x x

f x x x x

x x

f f f

37

Proof of Same Result

1

1

1

1

1

1

1 1

1

1

1

1

i

i

i i

i

i i

i

i i

i i

i i

i i

i i

i i

i

x

x

x x

x

f f

x

f f

x x

x x

f f

x x

f f

f

( )

[( ) ] (^) ( )

i

i

i

i i

i

i i i i

i i

i

i i i i

i i i

i i i

i

x

x

x

x x

x

x f f x

x f

x

x x x x

f f x

x f f

f

1

2 (^21)

1 1

1 1

2

1

2 1

1

1 1 1

'' 2 2

( )

2 2

1 1

i i i

i ii i i i r r x

f rf r f f

Δ

38

Finite-volume Approach

  • Integrate PDE over a small volume
  • Where derivatives occur, replace them

by finite-difference expressions

  • Where source terms occur, replace

terms like ∫ (^) ΔVSdV by SavgΔV

  • Savg is average S for control volume
  • Finite Volume grid notation

●-------------- | --------------●----------------- | -----------------●

xW = xi-1 xw = xi-1/2 xP = xi xe = xi+1/2 xE= xi+

δxWP = xP – xW , δxwP = xP – x (^) w , δxPe = xe – xP , δxPE = xE – xP

Variables

defined at

Nodes

Volume

boundaries

at Faces

39

Finite Volume Example

  • Consider 1D diffusion and source only

Γ +S= 0 dx

d

dx

d ϕ

  • Integrate over finite-volume grid

⎟ =^0 ⎠

⎞ ⎜ ⎝

⎛ ⎟ = Γ + ⎠

⎞ ⎜ ⎝

⎛ Γ +

SAdx dx

d

dx

d SdV dx

d

dx

d ϕ ϕ

⎟+Δ = 0 ⎠

⎞ ⎜ ⎝

⎛ ⎟−Γ ⎠

⎞ ⎜ ⎝

⎛ ⎟+Δ =Γ ⎠

⎞ ⎜ ⎝

⎛ ∫ Γ^ +∫ = ∫ Γ SV dx

d A dx

d SV A dx

d dx SdV Ad dx

d

dx

d A e w

x

x

e

w

ϕ ϕ ϕ ϕ

●-------------- | --------------●----------------- | -----------------●

xW = xi-1 xw = xi-1/2 xP = xi xe = xi+1/2 xE= xi+

δxWP = xP – xW , δxwP = xP – x (^) w , δxPe = xe – xP , δxPE = xE – xP

  • What are Γ and dφ/dx at w and e faces?

40

Finite Volume Example II

  • Use mean value for coefficient
    • Γe = (ΓP + ΓE)/2 and Γw = (ΓW + ΓP)/
  • Use central difference for dφ/dx
    • dφ/dx|e = (φE – φP)/δx dφ/dx|w = (φP – φW )/δx
  • Substitute into
    • Define

⎟+Δ = 0 ⎠

⎞ ⎜ ⎝

⎛ ⎟−Γ ⎠

⎞ ⎜ ⎝

⎛ Γ SV dx

d A dx

d A e w

ϕ ϕ

= 0 ⎟

⎟ ⎠

⎞ ⎜

⎜ ⎝

Γ

Γ

Γ

Γ

    • =

− −Γ

− Γ (^) p P WP

ww

PE

ee u WP

wwW

PE

eeE u pP WP

P W ww PE

E P e e S x

A

x

A S x

A

x

A S S x

A x

A ϕ δ δ δ

ϕ

δ

ϕ ϕ δ

ϕ ϕ

δ

ϕ ϕ

SΔV=Su +Sp ϕ P

p E W p WP

ww

PE

ee P WP

ww W PE

ee E S a a S x

A

x

A a x

A a x

A a − = + −

Γ

Γ

Γ

Γ

δ δ δ δ

  • Define

aE ϕE + aW ϕW+Su−aP ϕP= 0 aE ϕE+aWϕW−aPϕP=−Su

aP ϕP=aEϕE+aWϕW+S u

41

Finite-Volume Example III

  • This represents equation for one node
    • Need to write equations for all nodes
    • Simple for one-dimensional problem
    • Here is where i, i+1, i-1 notation is easier
      • aW,iφi-1 – ap,iφi + aE,iφi+1 = –Su,i
      • Apply this result for nodes from i = 1 to i = N – 1
      • Nodes i = 0 and i = N are boundary conditions
      • Look at constant Γ, A, and δx such that ΓA = 1
      • Let Su = 0 and Sp = –10δx for all nodes

x x

a a a S x x

A a x x

A a (^) P E W p WP

ww W PE

ee E + δ δ

= + − = δ

= δ

Γ

δ

= δ

Γ = 10

1 1 2

10 0

2 ,

(^1 1) = = δ

ϕ ⎟ϕ− ⎠

⎞ ⎜ ⎝

  • δ δ

− δ

ϕ Eϕ E+WϕW−PϕP= i−^ i i+ Sui x

x x x

a a a 42

Finite-Volume Example IV

  • Need to handle boundary conditions
    • Assume φ = 2 at x = 0 and φ = 3 at x = L

= 1

  • Nodes numbered from 0 to N
    • x 0 = 0 and xN = L = 1 (assumed); φ 0 = 2 and φN = 3
    • At i = 1 (1 node in from left boundary) φ 0 – [2 +

(δx) 2 ]φ 1 + φ 2 = 0 with φ 0 = 2 gives –[2 + (δx) 2 ]φ 1 +

φ 2 = –

  • At i = N – 1 (1 node in from right boundary) φN-2 –

(2 + δx)φN-1 + φN = 0 with φN = 3 gives φN-2 – [2 +

(δx)

2 ]φN 1 = –

10 0 [ 2 10 ( )] 0

2 1

2 1

(^1 1) = ⇒ϕ − + δ ϕ+ϕ = δ

ϕ ⎟ϕ− ⎠

⎞ ⎜ ⎝

  • δ δ

− δ

ϕ − +

− + i i i

i i

i (^) x x

x x x

43

Finite-Volume Example V

  • System of equations to solve
  1. 4 3

  2. 4 0

  3. 4 0

  4. 4 2

3 4

2 3 4

1 2 3

1 2

φ − φ = −

φ − φ +φ =

φ − φ +φ =

− φ +φ =−

  • Matrix form

=

φ

φ

φ

φ

3

0

0

2

0 0 1 2. 4

0 1 2. 4 1

1 2. 4 1 0

  1. 4 1 0 0

4

3

2

1

44

Numerical and Exact Solution

0

0.

1

1.

2

2.

3

0 0.2 0.4 0.6 0.8 1 x

÷

Exact

Numerical

45

Numerical Error

0.

0.

0.

0.

0.

0.

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

x

Absolute Error

N = 5

N = 10

N=

46

Error in Gradient

dΗ/dx Error dΗ/dx Error

N = 5 -5.0175 0.5252 -3.7719 1.

N = 10 -5.3713 0.1713 -4.6014 0.

N = 20 -5.5024 0.0403 -5.0648 0.

dΗ/dx Error dΗ/dx Error

N = 5 8.1181 0.8664 6.3976 2.

N = 10 8.7104 0.2741 7.5899 1.

N = 20 8.9184 0.0661 8.2704 0.

Second order First Order

Exact dΗ/dx at x = 0 is -5.

Second order First Order

Exact dΗ/dx at x = L is 8.