Você está na página 1de 31

WPI Computational Fluid Dynamics I

Numerical Methods for


the Navier-Stokes
Equations
Instructor: Hong G. Im
University of Michigan
Fall 2001
WPI Computational Fluid Dynamics I
Outline

What will be covered


Summary of solution methods
- Incompressible Navier-Stokes equations
- Compressible Navier-Stokes equations
High accuracy methods
- Spatial accuracy improvement
- Time integration methods

What will not be covered


Non-finite difference approaches such as
- Finite element methods (unstructured grid)
- Spectral methods
WPI Computational Fluid Dynamics I

Incompressible
Navier-Stokes Equations
WPI Computational Fluid Dynamics I

Incompressible Navier-Stokes Equations


u
u p
= u u + u
2
u = v
t w

u = 0
The (hydrodynamic) pressure is decoupled from the
rest of the solution variables. Physically, it is the pressure
that drives the flow, but in practice pressure is solved such
that the incompressibility condition is satisfied.
The system of ordinary differential equations (ODEs)
are changed to a system of differential-algebraic equations
(DAEs), where algebraic equations acts like a constraint.
WPI Computational Fluid Dynamics I

Vorticity-stream function formulation

Advantages:
- Pressure does not appear explicitly (can be obtained later)
- Incompressibility is automatically satisfied
(by definition of stream function)

Drawbacks:
- Limited to 2-D applications
(Revised 3-D approaches are available)
WPI Computational Fluid Dynamics I

Solution Methods for Incompressible N-S Equations in


Primitive Formulation:

Artificial compressibility (Chorin, 1967) mostly steady


Pressure correction approach time-accurate
- MAC (Harlow and Welch, 1965)
- Projection method (Chorin and Temam, 1968)
- Fractional step method (Kim and Moin, 1975)
- SIMPLE, SIMPLER (Patankar, 1981)
WPI Computational Fluid Dynamics I
Artificial Compressibility - 1

Back to a system of ODE by


u p
= u u + u
2

t
p
+ c u = 0
2
c 2 : arbitrary constant
t
p
2
With properly-chosen c , solve until 0 ( p = p ( x) )
t
Originally developed for steady problems
The term artificial compressibility is coined from
equation of state p = c
2

Possible numerical difficulties for large c 2


WPI Computational Fluid Dynamics I
Artificial Compressibility - 2

The concept can be applied to a time-accurate method


by using pseudo-time stepping at every sub-steps.
u u p
+ = u u + u
2

t
p
+ c 2 u = 0

At every real time step, take pseudo-time stepping


using explicit time integration until u p
0, 0

Since the pseudo time scale is not physical, we can
accelerate the integration however we want.
WPI Computational Fluid Dynamics I
Pressure Correction Method - 1

Marker-and-Cell (MAC) Method Harlow and Welch (1965)


Originally derived for free surface flows with staggered grid
u p
= u u + u
2
and u = 0
t
Explicit integration
n +1
u u n
h p
= u hu + hu
n n 2 n

t
Taking divergence of momentum equation,
n +1
h u h u n
p 2
+ h (u hu ) =
n n
+ 2h ( h u n )
h
t
p = h (u hu ) Poisson equation
2
h
n n
WPI Computational Fluid Dynamics I
Pressure Correction Method - 2

Projection Method Chorin (1968), Temam (1969)


Originally derived on a colocated grid
Identical to MAC except for the Poisson equation

u n +1 u t 1 n +1 t
= h p u = u h p
t

t
h u n +1 = 0
0
n +1 t
h u = h u h h p
t



p=
2
h u t

t
h
WPI Computational Fluid Dynamics I
Pressure Correction Method - 3

MAC vs. Projection


1. Integration without pressure

un = un u = u + t A + D
t n
( n n
)
2. Poisson equation


p = h (u hu ) p= h ut
2 n n 2

t
h h

3. Projection into incompressible field


t t
u n +1 n
(
= u + t A + D
n n
)
h p u n +1
=u
t


h p
WPI Computational Fluid Dynamics I
Pressure Correction Method - 4

SIMPLE Algorithm Patankar (1981)


(Semi-Implicit Method for Pressure Linked Equations)
- Iterative procedure with pressure correction p = p0 + p

1. Guess the pressure field p0


2. Solve the momentum equation (implicitly)
u0 un p0
= u 0 u 0 + u 0
2

t
3. Solve the pressure correction equation

p =
2
( u 0 )
t
WPI Computational Fluid Dynamics I
Pressure Correction Method - 5

4. Correct the pressure and velocity


p = p0 + p
t
u = u0 p

5. Go to 2. Repeat the process until the solution converges.

Notes:
- Originally developed for the staggered grid system.
- The corrected velocity field satisfies the continuity equation
even if the pressure correction is only approximate.
- Sometimes p tends to be overestimated
p = p0 + p ( 0.8) underrelaxation
WPI Computational Fluid Dynamics I
Pressure Correction Method - 6

SIMPLER (SIMPLE Revised)


- Incorporating the projection method (fractional step)

1. Guess the velocity field u 0


2. Solve momentum equation (implicitly) without pressure
u u 0
= u u + u
2

t
3. Solve the pressure Poisson equation

p =
2 *
( u )
t
WPI Computational Fluid Dynamics I
Pressure Correction Method - 7

*
5. Solve the momentum equation with p
u* u 0 1
= u u + u p *
* * 2 *

t
6. Pressure correction equation

p =
2

t
( u ) *

7. Correct the velocity, but not the pressure


t
u=u *
p

8. Go to 2. Repeat the process until solution is converged.
WPI Computational Fluid Dynamics I
Stability Consideration

Explicit time integration in 2-D requires the stability condition:


4 h2
t < and t <
(u + v )
2
4
t =
4 (u + v )
2

1/
t t =
h2
High-Re flow: advection-controlled 4

Low-Re flow: diffusion-controlled

Use implicit schemes for


appropriate terms! 1 / ~ Re
t 0 at both limits!
WPI Computational Fluid Dynamics I
Accuracy Improvement Spatial 1

Spatial Accuracy
Explicit differencing - use larger stencils
f j +1 f j 1
f j = + O(h 2 )
2h
f j 2 8 f j 1 + 8 f j +1 f j + 2
f j = + O(h 4 )
12h
Tridiagonal - Pad (compact) schemes

f j1 + 4 f j + f j+1 = ( f j +1 f j 1 ) + O(h 4 )
3
h
Pentadiagonal
f j2 + f j1 + f j + f j+1 + f j+ 2 = af j 2 + bf j 1 + cf j + df j +1 + ef j + 2 + L
WPI Computational Fluid Dynamics I
Accuracy Improvement Spatial 2

3
Exact
2E
4E
6E
6T
8E
2 8T
k'

0
0 1 2 3
k

Ref: Kennedy, C. A. and Carpenter, M. H.,


Applied Numerical Mathematics, 14, pp. 397-433 (1994) .
WPI Computational Fluid Dynamics I
Accuracy Improvement Temporal 1

Temporal Accuracy
u 1
= A(u) + D(u) p
t
Implicit Crank-Nicolson
n +1
u u = n
[(
t
2
n
)
n +1 2 n
]
2 n +1 t
A(u ) + A(u ) + ( u + u ) p n +1/ 2

Nonlinear advection term requires iteration.
WPI Computational Fluid Dynamics I
Accuracy Improvement Temporal 2

Linearization of Advection Terms


For example, a 2-D equation
U E F
+ + =0
t x y
u v
2
U = u E = u + p xx F = uv xy
v
uv xy v + p
2
yy

can be linearized as
U U U
+ [A] + [B ] =0
t x y
E F
where [A] = , [B] = Jacobian matrix
U U
WPI Computational Fluid Dynamics I
Accuracy Improvement Temporal 3

Fractional Step Method Kim & Moin (1985)


Projection method extended to higher accuracy
ut u n
t
1
[ n 1
= 3A(u ) A(u ) +
2
n 1
2 Re
] 2 (u t + u n )
Adams-Bashforth (AB2) Crank-Nicolson

u n +1 u t
= 2 1
t = u t

t
u n +1 = 0
Note that is different from the original pressure
t 2
p =
2 Re
WPI Computational Fluid Dynamics I
Accuracy Improvement Temporal 4

Treatment of implicit viscous terms


ut u n
t
1
[
= 3A (u ) A (u ) +
2
n n 1
] 1
2 Re
2 (u t + u n )

t t t

1 xx yy

(
zz u t u n = )
2 Re 2 Re 2 Re

t
2
[
3A (u ) A(u ) +
n n 1
]
t
Re
( xx + yy + zz )u n
Factorizing,
t t t

1

xx 1

yy 1
t
(
zz u u n = )
2 Re 2 Re 2 Re

t
2
[
3A (u ) A(u ) +
n n 1
]
t
Re
( xx + yy + zz )u n
TDMA in three directions
WPI Computational Fluid Dynamics I
Accuracy Improvement Temporal 5

Notes on Fractional Step Method


Originally implemented into a staggered grid system
Later improved with 3rd-order Runge-Kutta method
Ref: Le & Moin, J. Comp. Phys., 92:369 (1991)
The method can be applied to a variable-density problem
(e.g. subsonic combustion, two-phase flow) where
Poisson equation becomes

( )
t
1 T = 1 Eq. of State
=
2
u +
t t

t t
Ref: Rutland, Ph. D. Thesis, Stanford University (1989)
Bell, Collela and Glaz, JCP, 85:257 (1989)
WPI Computational Fluid Dynamics I
Boundary Conditions

Boundary Conditions for Incompressible Flows


In general, boundary condition treatment is easier
than for the compressible flow formulation due to the
absence of acoustics
Typical boundary conditions:
- Periodic: f N = f1 , f N +1 = f 2 etc.
- Inflow conditions: f ( x = 0) = F ( y, z , t )
- Outflow conditions: convective outflow condition
u 1
ut + U = 0 at x = L U = udA
x
A
WPI Computational Fluid Dynamics I

Compressible
Navier-Stokes Equations
WPI Computational Fluid Dynamics I

U E F G
+ + + =0
t x y z
u v w
2
u u + p xx uv xy uw xz
2
U = v E = uv xy F = v + p yy G = vw
yz

w uw vw vw2 + p
E xz
yz zz

( E + p)u + ( E + p)v + ( E + p) w +
x y z

where Constitutive relations


x = u xx v xy w xz + q x
p = RT , e = cvT , h = c pT or
y = u xy v yy w yz + q y
R ( 1)e
z = u xz v yz w zz + q z cv = , p = ( 1) e, T =
1 R
WPI Computational Fluid Dynamics I

Solution methods for compressible N-S equations

U E F G
= + +
t x y z
follows the same techniques used for hyperbolic equations
For smooth solutions with viscous terms, central differencing
usually works.
No need to worry about upwind method, flux-splitting,
TVD, FCT (flux-corrected transport), etc.
In general, upwind-like methods introduces numerical
dissipation, hence provides stability, but accuracy
becomes a concern.
WPI Computational Fluid Dynamics I

Explicit Methods
- MacCormack method
- Leap frog/DuFort-Frankel method
- Lax-Wendroff method
- Runge-Kutta method
Implicit Methods
- Beam-Warming scheme
- Runge-Kutta method
Most methods are 2nd order.
The Runge-Kutta method can be easily tailored to higher
order method (both explicit and implicit).
WPI Computational Fluid Dynamics I

Most of the time, an implicit integration method involves


nonlinear advection terms
U E F G
= + +
t x y z
which are linearized as
U n +1 U n U n +1 U n +1 U n +1
= [A] + [B ] + [C ]
t x y z

E F G
n n n

[A] = , [B] = , [C ] =
U U U
+ ADI, factorization, etc.
WPI Computational Fluid Dynamics I

Ultimately, compressible Navier-Stokes equations


can be written as a system of ODEs

U E F G
= + +
t x y z

= F (t , U(t ) )
dU

dt
U(t = t0 ) = U 0 Initial condition

Solution techniques for a system of ODE applies.


- Explicit vs. Implicit (Nonstiff vs. Stiff)
- Multi-stage vs. Multi-step
WPI Computational Fluid Dynamics I
Boundary Conditions

Boundary Conditions for Compressible Flows


In general, boundary condition for the compressible flow
is trickier because all the acoustic waves must be
properly taken care of at the boundaries.
Typical boundary conditions:
- Periodic: still easy to implement
- Both inflow and outflow conditions require treatment of
characteristic waves
(hard-wall, nonreflecting, sponge, etc).

Você também pode gostar