Docsity

Stokes Equation, False Diffusion - Computational Fluid Dynamics - Lecture Slides, Slides of Fluid Dynamics

Toggle sidebar
bg1
Navier-Stokes Part Two March 3, 2010
ME 692 – Computational Fluid Dynamics 1
Solution of Navier
Solution of Navier-
-Stokes
Stokes
Equations. Part Two
Equations. Part Two
Larry Caretto
Mechanical Engineering 692
Computational Fluid Dynamics
March 3, 2010
2
Outline
• Review basics of integrating Navier-
Stokes and continuity
• Pressure and the staggered grid
• Finite-volume momentum equations
– Momentum equation coefficients
• Finite-volume continuity
• Finite-volume momentum and continuity
combine into an equation for pressure
• Solving the equations
3
Review False Diffusion
• Upwind differencing causes errors
similar to having a “diffusion” coefficient
that is too large
• Causes smearing of results
• Especially noticeable in flows with sharp
gradients and shock waves
• Effect is reduced if flow is aligned with
grid (not always possible to do this)
• Different from artifical diffusion
4
Review Navier-Stokes
• Continuity and momentum equations
• Apply previous work for general
variable, φ, to finding u, v, and w
• Must consider nonlinearity (e.g., uφcan
be uu, uv, or uw for momentum)
– Use “outer iteration process”
• As sume values for u, v, and w
• Use these values to compute the con vec-
tion/diffusion coefficients aE, aN, etc.
• Use new u, v, w values to update aE, aN, etc.
5
Review Navier-Stokes Approach
• Compressible flows
– Solve continuity and momentum for three
velocity components and density
– Get pressure from equation of state
• Incompressible flows
– Mach number is low
– Density is a problem input, often related to
temperature (may or may not be constant)
– Solve continuity and momentum for three
velocity components and pressure
6
Review Incompressible Flows
• Mach number is low (< ~0.3)
• Density (e.g., ρ= p/RT) may depend on
mean, but not local pressure
• Can have equations like ρ= ρ0( 1 + βT)
for where β= –(1/ρ)(∂ρ/∂T)P
• Density may be constant, but need not
be for incompressible flows
– Furnace flows a good example of this
• Basic idea is that density does not
depend on local pressure
pf3
pf4
pf5

Partial preview of the text

Download Stokes Equation, False Diffusion - Computational Fluid Dynamics - Lecture Slides and more Slides Fluid Dynamics in PDF only on Docsity!

Solution of NavierSolution of Navier--StokesStokes

Equations. Part TwoEquations. Part Two

Larry Caretto

Mechanical Engineering 692

Computational Fluid Dynamics

March 3, 2010

2

Outline

  • Review basics of integrating Navier-

Stokes and continuity

  • Pressure and the staggered grid
  • Finite-volume momentum equations
    • Momentum equation coefficients
  • Finite-volume continuity
  • Finite-volume momentum and continuity

combine into an equation for pressure

  • Solving the equations

3

Review False Diffusion

  • Upwind differencing causes errors

similar to having a “diffusion” coefficient

that is too large

  • Causes smearing of results
  • Especially noticeable in flows with sharp

gradients and shock waves

  • Effect is reduced if flow is aligned with

grid (not always possible to do this)

  • Different from artifical diffusion

4

Review Navier-Stokes

  • Continuity and momentum equations
  • Apply previous work for general

variable, φ, to finding u, v, and w

  • Must consider nonlinearity (e.g., uφ can

be uu, uv, or uw for momentum)

  • Use “outer iteration process”
    • Assume values for u, v, and w
    • Use these values to compute the convec- tion/diffusion coefficients aE , aN, etc.
    • Use new u, v, w values to update aE , aN, etc.

5

Review Navier-Stokes Approach

  • Compressible flows
    • Solve continuity and momentum for three

velocity components and density

  • Get pressure from equation of state
  • Incompressible flows
  • Mach number is low
  • Density is a problem input, often related to

temperature (may or may not be constant)

  • Solve continuity and momentum for three

velocity components and pressure

6

Review Incompressible Flows

  • Mach number is low (< ~0.3)
  • Density (e.g., ρ = p/RT) may depend on

mean, but not local pressure

  • Can have equations like ρ = ρ 0

( 1 + βT )

for where β = –(1/ρ)(∂ρ/∂T) P

  • Density may be constant, but need not

be for incompressible flows

  • Furnace flows a good example of this
  • Basic idea is that density does not

depend on local pressure

7

Review Steady 2D Problem

∂ρ

∂

∂ρ

y

v

x

u

( u )

S

y

u

x y

u

x x

P

y

vu

x

uu

( v )

S

y

v

x y

v

y x

P

y

vv

x

uv

  • Continuity and momentun equations
    • Have x and y direction convection-diffusion
    • Now have source term and pressure

gradient

8

Review Problem with Pressure

  • Consider the x momentum equation for

the u velocity component at point P

50 100 50 100 50 ●------- | -------●------- | -------●------- | -------●-------- | -------● WW ww W w P e E ee EE

  • Second-order expression

for pressure gradient at P x

p p

x

p E W

P δ

−

∂

∂

2

  • With this expression the velocity at P is

not affected by the pressure at P

  • Also a checkerboard pattern of pressure

would compute as zero pressure gradient

9

Review Staggered Grid

P

N

W

S

E

s

n

w e

nw ne

sw (^) se

P, φ locations

location of u

location of v SE

NW

10

Review Staggered Grid II

PIJ+

PI-1J

P

I+1J

v

Ij

uiJ

P, φ locations

location of u

location of v

P

IJ-

PIJ

u

i+1J

vIj+

Δy

Δx

v

I-1j

vI-1j+

uiJ-1 ui+1J-

x (^) I-1 x i

x (^) I x x (^) i+1 I+ y (^) J+

y (^) j+

y (^) J

y (^) J-

y (^) j

11

Finite Volume Equations

  • Extend previous results for one

dimension to two dimensions

  • Can use any of the difference methods

discussed for convection and diffusion

  • Have four faces, n, e, s, w, in 2D
  • Apply same relations to get coefficients a N

aS, aE, and aW , using F = ρu and D = Γ/δ for

each face

  • As before aP = (aN + aS + aE + aW + ΔF)
    • Here ΔF = (Fn – Fs ) + (Fe – F (^) w)

12

Finite Volume Equations II

  • Integration of pressure terms

( p p ) A ( p p )( y y ) z

x x A x x

p p dV x

p

IJ I J iJ IJ I J j j

I I iJ I I

IJ I J

V iJ

= − = − − Δ

− − +

− −

−

Δ

∫

1 1 1

1 1

1

( p p ) A ( p p )( x x ) z

y y A y y

p p dV y

p

IJ IJ Ij IJ I J i i

J J Ij J J

IJ IJ

V Ij

= − = − − Δ

− − +

− −

−

Δ

∫

1 1 1

1 1

1

19

Control Volume for v (w face)

vIj

u

iJ

PIJ-

PIJ ui+1J

v

Ij+

vI-1j

v

Ij-

uiJ-

equations for

w face at x (^) i

vI+1j

ui+1J-

⎛ ρ +ρ

⎛ ρ +ρ

−

− − −

−

−

1

1 1 1

1

1

iJ

I J IJ

iJ

I J IJ

iJ iJ w

u

u

F F

F

( ) 1

1 1 1 1

−

− − − −

I I

I J I J IJ IJ w

x x

D

20

Control Volume for v (n face)

vIj

u

iJ

PIJ-

PIJ ui+1J

v

Ij+

vI-1j

v

Ij-

uiJ-

equations for

n face at y (^) J

vI+1j

ui+1J-

⎛ ρ +ρ

⎛ ρ +ρ

−

IJ

IJ IJ

Ij

IJ IJ

Ij Ij n

u

v

F F

F

1

1

1

1

j j

IJ n

y y

D

  • 1

21

Control Volume for v (s face)

v

Ij

uiJ

P

IJ-

P

IJ

u

i+1J

vIj+

v

I-1j

vIj-

u

iJ-

equations for

s face at y J-

v

I+1j

ui+1J-1 ⎥

⎛ ρ +ρ

⎛ ρ +ρ

−

− −

−

−

1

1 2

1

1

Ij

IJ IJ

Ij

IJ IJ

Ij Ij n

v

v

F F

F

1

1

−

−

j j

IJ s

y y

D

22

Rest Stop

  • Now have F and D terms for momentum
    • Can use any method (central, upwind, etc .)

to compute aE, aN , etc.

  • Get finite volume representation of

continuity by integration over control

volume centered about pIJ

  • Substitute finite difference momentum

equations into finite difference continuity

equation to get finite difference equation

for pressure

23

Rest Stop II

  • Solve u momentum equation for u iJ
  • Define a (^) P for this equation as aiJ

( )

() 1

1 1 1 1 u IJ I J iJ iJ

N iJ S iJ E i J W i J PiJ

p p A b

a u au au a u au

= − +

      • −

−

  • − + −

( )

() 1

1 1 1 1 u IJ I J iJ iJ

iJ iJ N iJ S iJ E i J W i J

p p A b

a u a u au au a u

− − −

= + + +

−

  • − + −

iJ

u iJ

iJ

iJ I J IJ iJ

nb

nbnb

iJ a

b

a

A

p p a

a u

u

( )

1

−

∑

iJ

iJ iJ a

A

d =

24

Rest Stop III

  • Solve v momentum equation for v Ij
  • Define a (^) P for this equation as aiJ

Ij

u iJ

Ij

Ij IJ IJ Ij

nb

nbnb

Ij a

b

a

A

p p a

a u

v

( )

= + − 1 − −

∑

Ij

Ij Ij a

A

d =

( )

() 1

1 1 1 1 v IJ IJ Ij Ij

N Ij S iJ E I j W I j PIj

p p A b

a v av a v a v av

= − +

      • −

−

  • − + −

( )

() 1

1 1 1 1 v IJ IJ Ij Ij

P Ij N Ij SiJ E I j W I j

p p A b

a v a v av av a v

− − −

= + + +

−

  • − + −

25

Integrated Continuity Equation

PIJ+

P

I-1J P

I+1J

vIj

uiJ

PIJ-

P

IJ

ui+1J

v

Ij+

= 0 ⎟ ⎟ ⎠

⎞ ⎜ ⎜ ⎝

⎛

∂

∂ρ

∂

∂ρ ∫ Δ V

dV y

v

x

u

∂ρ

∂ρ

∫

∫

Δ

Δ

V

V

dxdydz y

v

dxdydz x

u

δ δ ( ρ) +δδ ( ρ) = 0 ∫ ∫

n

s

e

w

yz d u xz d v

δ δ[ (^ ρ ) −(ρ ) ]^ +δδ[(^ ρ ) −( ρ )]^ = 0 e w n s

y z u u xz v v

26

Integrated Continuity Equation II

PIJ+

P

I-1J

P

I+1J

vIj

uiJ

PIJ-

P

IJ

ui+1J

v

Ij+

[ ( ) ( )]

[( ) −( )] = 0

− +

n s

e w

xz v v

yz u u

δδ ρ ρ

δδ ρ ρ

[( ) ( )]

[( ) 1 ( )] 0

1 − =

− +

Ij Ij

i J iJ vA vA

uA uA

ρ ρ

ρ ρ

1

1

1

1

1

1

−

−

Ij

IJ IJ

Ij

IJ IJ

iJ

IJ I J

i J

I J IJ

vA

vA

uA

uA

27

The Rest is SIMPLE

  • Now need to find way to solve for

pressures and velocity components

  • Use SIMPLE algorithm due to Patankar

and Spalding (1971)

  • Semi-Implicit Method for Pressure-Linked

Equations

  • Started with guessed pressures, p*
  • Solve momentum equations for u* and

v* based on p* pressures

28

SIMPLE Two

  • Define correction terms: u’, v’, p’
    • u = u* + u’
    • v = v* + v’
    • p = p* + p’

( )

iJ

u iJ I J IJ iJ iJ

nb

nbnb

iJ

a

b

p p d

a

a u

u

( )

1

∑

( )

Ij

u iJ IJ IJ Ij Ij

nb

nbnb

Ij

a

b

p p d

a

a u

v

( )

1

∑

Now subtract the momentum

equations with u* and v* from

the momentum equations

with u and v

29

SIMPLE Three

iJ

u iJ I J IJ iJ iJ

nb

nbnb

iJ a

b p p d a

au

u

( )

= + − 1 − −

∑

( )

iJ

u iJ I J IJ iJ iJ

nb

nbnb

iJ

a

b

p p d

a

a u

u

( )

1

∑

( )

[( ) ( )] I J IJ I J IJ iJ iJ

nb

nb nb nb

iJ iJ p p p p d a

a u u

u u

1 1

  • − − −

− −

∑

( ) I J IJ iJ iJ

nb

nb nb

iJ p p d a

a u

u

' ' 1

'

' = + − −

∑

30

SIMPLE Four

( )

Ij

u iJ IJ IJ Ij Ij

nb

nbnb

Ij

a

b

p p d

a

a u

v

( )

1

∑

( )

[( (^) IJ IJ ) ( (^) IJ IJ )] (^) Ij Ij

nb

nb nb nb

Ij Ij p p p p d a

a u u

v v

1 1

  • − − −

∑

( (^) IJ IJ ) (^) Ij

Ij

nb

nb Inb

Ij p p d

a

a u

v

' ' 1

'

'

∑

Ij

u iJ IJ IJ Ij Ij

nb

nbnb

Ij a

b p p d a

a u

v

( )

= + − 1 − −

∑

37

Final Equation for p’

IJ IJ IJ IJ IJ IJ IJ

I J IJ I J I J IJ I J

a p p a p p b

a p p a p p

IJ I J I J IJ IJ

a a a a a

IJ IJ IJ IJ IJ

I J I J I J I J IJ IJ

a p a p b

a p a p a p

  • − =

  • Solve final equation for p’

38

Using Corrections

  • Use of p = p* + p’ can lead to

divergence

  • Use underrelaxation: p = p* + αp p’, where

αp is the underrelaxation factor (0 < αp < 1)

  • Similar underrelaxation factors

(between 0 and 1) for velocity correction

( ) iJ iJ u I J IJ iJ

u u p p d

' ' 1

−

( ) Ij Ij v IJ IJ Ij v v p p d

' ' 1

= +α − −

39

Putting it All Together

0. Start with initial guesses for p, u, v*

1. Start iterations

2. Compute coefficients in finite volume

equations for momentum and pressure

3. Do an iteration on u* and v* equations

4. Get p’ source term

5. Do an iteration on p’ equation

6. Use p’ to correct p, u, and v

7. Check convergence; if not converged

return to step 1

40

Conclusion

  • Wasn’t that simple?
  • Next week we will look at another

method called SIMPLER (for SIMPLE

Revised)

  • It is more complex than SIMPLE
  • Will also look at other methods for

solving continuity and momentum

– SIMPLEC

– PISO