Docsity

Navier-Stokes Equations and Finite Volume Methods in Computational Fluid Dynamics, Slides of Fluid Dynamics

Toggle sidebar
bg1
Navier-Stokes Introduction March 1, 2010
ME 692 – Computational Fluid Dynamics 1
Introduction to Solution of Navier
Introduction to Solution of Navier-
-
Stokes Equation
Stokes Equation
Larry Caretto
Mechanical Engineering 692
Computational Fluid Dynamics
March 1, 2010
2
Homework for March 3
• Download the Excel workbook from the
course web site for the sample
convection problem with Pecell = 1.25
– Shows results for Central and Upwind on
separate worksheets
• Add similar worksheets to get results for
Hybrid, Power Law, and QUICK
• Add error results for these algorithms to
the error chart
• Any questions?
3
Outline
• Review finite-volume convection
– Central, upwind, power law, QUICK, TVD
• False diffusion
• Solving the Navier-Stokes Equations
– Approaches
–Grids
– Pressure terms and the need for staggered
grids
– Derivation of momentum equations
4
Review Algorithm Properties
• Conservative schemes – conserve
properties in finite difference equations
– Requires exit flux from one face to be
same as input flux in adjacent cell
• Transportive schemes – have correct
balance between diffusion and
convection
• Accuracy – need schemes that have a
good truncation error
5
Review Algorithm Properties II
• Limit on coefficient magnitude for
iteration schemes (boundedness)
– Absolute value of diagonal coefficient must
be greater than the sum of absolute values
of all other coefficients
• For simple equations here |aP| ≥|aE| + |aW|
– Deferred correction separates coefficients
into two parts
• Adjus tment leaves |aP| ≥|aE| + |aW|
• Places part removed from adjusted coefficients
into source term
6
Review Convection Terms
• Steady equation with
convection and diffusion
terms in one dimension dx
d
dx
d
dx
ud
ϕ
Γ=
ϕ
ρ
0=
ρ
dx
ud
• Steady continuity
equation in one dimension
• Apply finite volume approach to
integrate small volume
dV
dx
d
dx
d
dV
dx
ud ∫∫
ϕ
Γ=
ϕ
ρ
0=
ρ
∫dV
dx
ud
pf3
pf4
pf5
pf8

Partial preview of the text

Download Navier-Stokes Equations and Finite Volume Methods in Computational Fluid Dynamics and more Slides Fluid Dynamics in PDF only on Docsity!

Introduction to Solution of NavierIntroduction to Solution of Navier--

Stokes EquationStokes Equation

Larry Caretto Mechanical Engineering 692 Computational Fluid Dynamics

March 1, 2010

2

Homework for March 3

  • Download the Excel workbook from the course web site for the sample convection problem with Pecell = 1. - Shows results for Central and Upwind on separate worksheets
  • Add similar worksheets to get results for Hybrid, Power Law, and QUICK
  • Add error results for these algorithms to the error chart
  • Any questions?

3

Outline

  • Review finite-volume convection
    • Central, upwind, power law, QUICK, TVD
  • False diffusion
  • Solving the Navier-Stokes Equations
    • Approaches
    • Grids
    • Pressure terms and the need for staggered grids
    • Derivation of momentum equations 4

Review Algorithm Properties

  • Conservative schemes – conserve properties in finite difference equations - Requires exit flux from one face to be same as input flux in adjacent cell
  • Transportive schemes – have correct balance between diffusion and convection
  • Accuracy – need schemes that have a good truncation error

5

Review Algorithm Properties II

  • Limit on coefficient magnitude for iteration schemes (boundedness) - Absolute value of diagonal coefficient must be greater than the sum of absolute values of all other coefficients - For simple equations here |aP | ≥ |aE | + |aW | - Deferred correction separates coefficients into two parts - Adjustment leaves |aP | ≥ |aE | + |aW | - Places part removed from adjusted coefficients into source term 6

Review Convection Terms

  • Steady equation with convection and diffusion terms in one dimension dx

d dx

d dx

d u ϕ = Γ ρϕ

= 0 ρ dx

  • Steady continuity du equation in one dimension
  • Apply finite volume approach to integrate small volume

dV dx

d dx

d dV dx

du ∫ ∫

ϕ = Γ ρ ϕ = 0 ρ ∫ (^) dxdV

du

7

Review Integrated PDE

  • Constant area result
    • Define F = ρu and D = Γ/δx

Fe ϕ e − Fw ϕ w = De ( ϕ E −ϕ P ) − Dw (ϕ P −ϕ W )

  • Different approaches for φe and φw
    • Central difference, upwind, hybrid, power- law, QUICK, TVD
    • All get relations among neighbor nodes
      • Three nodes for all but QUICK
      • Special treatment for boundary nodes

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

Review Example Problem

  • Constant ρ, u, and Γ with φ = φ 0 at x = 0 and φ = φL at x = L

dx

d dx

d dx

ud dx

d dx

d dx

d u ϕ

ϕ Γ

ρ ⇒ ϕ = Γ ρϕ

1

1 0

0 −

= − ϕ −ϕ

ϕ −ϕ Γ

ρ

Γ

ρ

uL

ux

L e

x e

Pe = ρuL/Γ Pecell = ρuδx/Γ = F/D

  • Exact solution below with plot on next slide

9

Exact Solution

0

0.

0.

0.

0.

0.

0.

0.

0.

0.

1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 x

( ξ

-^ ξ^0

)/( ξ L

-^ ξ^0 )^ Pe = - Pe = - Pe = - Pe = - Pe = 1 Pe = 2 Pe = 5 Pe = 10

10

Review Central Difference

  • Here δx, ρu and Γ are constants
    • F (^) e = F (^) w = ρu = F De = D (^) w = Γ / δx = D 0 2 2 2 ⎟ϕ = ⎠

⎜ ⎞ ⎝

⎟ϕ − ϕ +⎛^ − ⎠

⎜ ⎞ ⎝

ϕ − ϕ + ϕ =⎛^ + W W PP E E W P E

D F F D a a a F

  • Boundary conditions at x = 0 and x = L

( F D ) left

F

D D

F

⎟ϕ =− + ϕ ⎠

ϕ+⎛^ − ⎟ ⎠

− ⎛^ + 2

1 2

D F N D F ⎟ϕ N =− ( D − F )ϕ right

⎠

⎜ ⎞ ⎝

⎟ϕ −⎛^ − ⎠

⎜ ⎞ ⎝

⎛ (^) + 2 −^232 −^12

| -----●----- | -----●----- | -----●----- | -----●----- | -----●----- | -----●----- | left 1 2 3 4 5 6 right

11

Review Upwind Differences

  • Computational formulas aW = Dw +max( Fw , 0 ) aE = De +max(− Fe , 0 ) aP = aE + aW + Fe − F w

| ----------●---------- | ----------●---------- | ----------●---------- | W w P e E

  • Left boundary

− ( a E + aW *+ Fe − Fw )ϕ P + aE ϕ E =− aW *ϕ left

aW *^ = 2 Dw +max( Fw , 0 )

  • Right boundary

aW ϕ W − ( a E *+ aW ++ Fe − Fw )ϕ P =− aE *ϕ right

a * E^ = 2 De +max(− Fe , 0 )

12

Review Hybrid Difference

  • Computational Formulas

⎥ ⎦

⎤ ⎢ ⎣

⎡ ⎟ ⎠

⎜ ⎞ ⎝

= − ⎛^ + ⎥ ⎦

⎤ ⎢ ⎣

⎡ ⎟ ⎠

⎜ ⎞ ⎝

= ⎛^ + , 0 2 , 0 max , 2 W max^ w , w w E e e e

F a F D F a F D aP = aE + aW + Fe − Fw

  • Left boundary

− ( a E + aW *+ Fe − Fw )ϕ P + aE ϕ E =− aW *ϕ left

  • Right boundary

aW ϕ W − ( a E *+ aW + Fe − Fw )ϕ P =− aE *ϕ right

aW * = max[ 2 Dw , ( 2 Dw + Fw )]

aE * = max[ 2 De , ( 2 De − Fe )]

TVD Flux Limiters

0

1

2

3

0 1 2 3 4 5 6 7 8 r

ψ (r)

Van Leer Van Albada min-mod SUPERBEE UMIST^20

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

21

Navier-Stokes Equations

  • Continuity and x-momentum

= 0 ∂

∂

∂

∂

∂

∂

∂

∂ z

w y

v x

u t

ρ ρ ρ ρ

S ( u^ ) z

u y z

u x y

u x x

P

z

wu y

vu x

uu t

u

⎥⎦

⎤ ⎢⎣

⎡ (^) − Δ ∂

∂

∂

∂ ∂

∂

∂

∂ ∂

∂

∂

∂ ∂

∂ = + ) 3

2 () ρ μ μ μ (κ μ x x

w x z

v x y

u x S u Bx

22

y-momentum Equation

S ( v^ ) z

v y z

v x y

v y x

P

z

wv y

vv x

uv t

v

()

μ κ μ

ρ μ μ

y y

w z

y

v y y

u x

S v By

23

z-momentum Equation

S (^ w^ ) z

w y z

w x y

w z x

P

z

ww y

vw x

uw t

w

()

μ κ μ

ρ μ μ

z z

w z

z

v z y

u x

S w Bz

24

Navier-Stokes Equations

  • Continuity and momentum equations
  • Up to now we have been assuming that the velocity field was known and we could find the general variable, φ
  • This background is necessary for solving Navier-Stokes, but now we have to solve for φ = u, v, and w
  • This gives a set of nonlinear equations (e.g., uφ becomes uu for x-momentum)

25

Navier-Stokes Equations II

  • Have to find way to solve nonlinear equations
  • Basic approach requires “outer” iteration process - Assume values for u, v, and w - Use these values to compute the convec- tion/diffusion coefficients a (^) E, aN , etc. - Solve finite difference forms of the Navier- Stokes equations for new values of u, v, and w using these “old” aE, aN , etc. 26

Navier-Stokes Equations III

  • Once new values of u, v, and w are known update aE, aN , etc. iterate again
  • Consider steady-state flows now and transient flows later
  • Some transient methods can use nonlinear terms at old time step to get new values for aE, aN, etc.
  • For steady flows the iterations on the nonlinear terms becomes part of the overall iteration process

27

Finding Pressure and Density

  • For compressible flows we solve continuity and momentum for density, u, v, and w - Get pressure from equation of state (e.g., p = ρRT) for compressible flows
  • For incompressible flows find u, v, w, and p to satisfy three momentum equations and continuity - Density is an input parameter or depends on variables other than local pressure 28

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

29

Navier-Stokes Problems

  • 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 30

The Steady 2D Problem

= 0 ∂

∂ρ

∂

∂ρ y

v x

u

S ( u^ ) y

u x y

u x x

P

y

vu x

uu

∂

μ ∂

μ ∂

∂ρ

∂

∂ρ

S ( v^ ) 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

37

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

38

Finite Volume Equations III

  • Have similar equations for u and v
  • b represents integrated source term
  • Note that aK coefficients vary from node to node and are different for u and v

( 1 ) ()

1 1 1 1 u iJ i J iJ iJ

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

p p A b

a u au a u a u a u

−

  • − + −

( 1 ) ()

1 1 1 1 v Ij Ij Ij Ij

N Ij SiJ E I j W I j P Ij

p p A b

a v a v a v a v a v

−

  • − + −

1

( ) iJ +

u

a N iJu

1

( ) Ij +

v

aN Ijv

39

Control Volume for u (e face) PIJ+

PI-1J

vIj

uiJ

PIJ-

PIJ ui+1J

vIj+

vI-1j

vI-1j+

uiJ-

ui-1J

equations for e face at IJ

⎥ ⎦

⎤ ⎟ ⎠

⎜ ⎞ ⎝

+⎛^ ρ +ρ

⎢ ⎣

⎡ ⎟ ⎠

⎞ ⎜ ⎝

⎛ ρ +ρ

= + =

−

iJ I J IJ

IJ I J i J

e l J iJ

u

u

F F F

2

2 2

1

2

1

(^11)

1

i i

e De (^) x − x

  • 1

uiJ+

40

Control Volume for u (w face) PIJ+

PI-1J

vIj

uiJ

PIJ-

PIJ ui+1J

vIj+

vI-1j

vI-1j+

uiJ-

ui-1J

equations for w face at I-1J

⎥ ⎦

⎤ ⎟ ⎠

⎜ ⎞ ⎝

+⎛^ ρ +ρ

⎢ ⎣

⎡ ⎟ ⎠

⎞ ⎜ ⎝

⎛ ρ +ρ

= + =

−

− − −

−

iJ I J IJ

I J I J i J

w l J iJ

u

u

F F F

2

2 2

1

2

1

(^211)

1

1

1 −

− −

i i

I J Dw (^) x x

uiJ+

41

Control Volume for u (n face) PIJ+

PI-1J

vIj

uiJ

PIJ-

PIJ ui+1J

vIj+

vI-1j

vI-1j+

uiJ-

ui-1J

equations for n face at yj+

⎥ ⎦

⎤ ⎟ ⎠

⎞ ⎜ ⎝

⎛ ρ +ρ

⎢⎣

⎡ ⎟ + ⎠

⎜ ⎞ ⎝

⎛ ρ +ρ

=

=

− − + − +

  • −+

(^11111)

1 1

1 1 1

2

2 2

1

2

I J I J I j

Ij IJ IJ

Ij I j n

v

v

F F F

( (^) J J )

I J I J IJ IJ Dn (^) y − y

− − + + 1

1 1 1 1 4

uiJ+

42

Control Volume for u (s face) PIJ+

PI-1J

vIj

uiJ

PIJ-

PIJ ui+1J

vIj+

vI-1j

vI-1j+

uiJ-

ui-1J

equations for n face at yj+

⎥ ⎦

⎤ ⎟ ⎠

⎞ ⎜ ⎝

⎛ ρ +ρ

⎢⎣

⎡ ⎟ + ⎠

⎜ ⎞ ⎝

⎛ ρ +ρ

=

=

− − − −

−

−

(^1111)

1

1

2

2 2

1

2

I J I J I

Ij IJ IJ

Ij I j s

v

v

F F F

( 1 )

1 1 1 1 (^4) −

− − − − −

J J

I J I J IJ IJ Ds (^) y y

uiJ+

43

Where to Next

  • Have similar equations to give various F and D terms for v control volume
  • Get finite volume representation of continuity by integration over control volume centered about pIJ s
  • Substitute finite difference momentum equations into finite difference continuity equation to get finite difference equation for pressure
  • Develop solution procedure for u, v, p