Sei sulla pagina 1di 31

Computational Fluid Dynamics I

P PP PI II I W WW W
Numerical Methods for
the Navier-Stokes
Equations
Instructor: Hong G. Im
University of Michigan
Fall 2001
Computational Fluid Dynamics I
P PP PI II I W WW W
Summary of solution methods
- Incompressible Navier-Stokes equations
- Compressible Navier-Stokes equations
High accuracy methods
- Spatial accuracy improvement
- Time integration methods
Outline
What will be covered
What will not be covered
Non-finite difference approaches such as
- Finite element methods (unstructured grid)
- Spectral methods
Computational Fluid Dynamics I
P PP PI II I W WW W
Incompressible
Navier-Stokes Equations
Computational Fluid Dynamics I
P PP PI II I W WW W
Incompressible Navier-Stokes Equations
!
!
!
"
#
$
$
$
%
&
w
v
u
= u
0 = u

p
t

+ =

u u u
u
2
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.
Computational Fluid Dynamics I
P PP PI II I W WW W
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)
Computational Fluid Dynamics I
P PP PI II I W WW W
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)
Computational Fluid Dynamics I
P PP PI II I W WW W
Back to a system of ODE by
With properly-chosen , solve until
Originally developed for steady problems
The term artificial compressibility is coined from
equation of state
Possible numerical difficulties for large
Artificial Compressibility - 1
0
2
= +

u c
t
p

p
t

+ =

u u u
u
2
2
c : arbitrary constant
2
c
( ) ) ( 0 x p p
t
p
=

2
c p =
2
c
Computational Fluid Dynamics I
P PP PI II I W WW W
The concept can be applied to a time-accurate method
by using pseudo-time stepping at every sub-steps.
Artificial Compressibility - 2
0
2
= +

u c
p

p
t

+ =

u u u
u u
2
At every real time step, take pseudo-time stepping
using explicit time integration until
0 , 0


p u
Since the pseudo time scale is not physical, we can
accelerate the integration however we want.
Computational Fluid Dynamics I
P PP PI II I W WW W
Marker-and-Cell (MAC) Method Harlow and Welch (1965)
Originally derived for free surface flows with staggered grid
Pressure Correction Method - 1
0 = u

p
t

+ =

u u u
u
2
) ( ) (
2
2 1
n
h h
h
n
h
n
h
n
h
n
h
p
t
u u u
u u
+

= +

) (
2 n
h
n
h h
p u u =
Taking divergence of momentum equation,
Poisson equation

p
t
h
n
h
n
h
n
n n

+ =

+
u u u
u u
2
1
and
Explicit integration
Computational Fluid Dynamics I
P PP PI II I W WW W
Projection Method Chorin (1968), Temam (1969)
Originally derived on a colocated grid
Identical to MAC except for the Poisson equation
Pressure Correction Method - 2
p
t
p
t
h
t n
h
t n

= ' =

+
+

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

=
+

u u
1
t
h h
t
p u

=

2
0
Computational Fluid Dynamics I
P PP PI II I W WW W
MAC vs. Projection
1. Integration without pressure
Pressure Correction Method - 3
p
t
h
t n

=
+

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

=

2
2. Poisson equation
3. Projection into incompressible field
) (
2 n
h
n
h h
p u u =
n n
u u =
( ) p
t
t
h
n n n n

+ + =
+

D A u u
1
Computational Fluid Dynamics I
P PP PI II I W WW W
SIMPLE Algorithm Patankar (1981)
(Semi-Implicit Method for Pressure Linked Equations)
- Iterative procedure with pressure correction
Pressure Correction Method - 4
p p p

+ =
0
1. Guess the pressure field
2. Solve the momentum equation (implicitly)
3. Solve the pressure correction equation
0
p

0
0
2
0 0
0
p
t
n

+ =

u u u
u u
( )
0
2
u

t
p

Computational Fluid Dynamics I
P PP PI II I W WW W
Pressure Correction Method - 5
4. Correct the pressure and velocity
5. Go to 2. Repeat the process until the solution converges.
p p p

+ =
0
p
t

0
u u
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 tends to be overestimated
p

) 8 . 0 (
0

+ = p p p
underrelaxation
Computational Fluid Dynamics I
P PP PI II I W WW W
SIMPLER (SIMPLE Revised)
- Incorporating the projection method (fractional step)
Pressure Correction Method - 6
1. Guess the velocity field
2. Solve momentum equation (implicitly) without pressure
3. Solve the pressure Poisson equation
0
u
u u u
u u

2
0
+ =

t
( ) u

* 2

=
t
p

Computational Fluid Dynamics I
P PP PI II I W WW W
Pressure Correction Method - 7
5. Solve the momentum equation with
6. Pressure correction equation
7. Correct the velocity, but not the pressure
8. Go to 2. Repeat the process until solution is converged.
* * 2 * *
0
*
1
p
t
+ =

u u u
u u
( )
* 2
u

t
p

*
p
p
t

*
u u
Computational Fluid Dynamics I
P PP PI II I W WW W
Stability Consideration
Explicit time integration in 2-D requires the stability condition:
( )

4
and
4
2
2
h
t
v u
t <
+
<
t
4
2
h
t =
( )
/ 1
4
2
v u
t
+
=
Re ~ / 1
0 t at both limits!
High-Re flow: advection-controlled
Low-Re flow: diffusion-controlled
Use implicit schemes for
appropriate terms!
Computational Fluid Dynamics I
P PP PI II I W WW W
Accuracy Improvement Spatial 1
Spatial Accuracy
Explicit differencing - use larger stencils
) (
2
2
1 1
h O
h
f f
f
j j
j
+

+
) (
12
8 8
4
2 1 1 2
h O
h
f f f f
f
j j j j
j
+
+
=

+ +
Tridiagonal - Pad (compact) schemes
( ) ) (
3
4
4
1 1 1 1
h O f f
h
f f f
j j j j j
+ =

+ +
Pentadiagonal
! + + + + + =

+ + + + 2 1 1 2 2 1 1 2 j j j j j j j j j j
ef df cf bf af f f f f f
Computational Fluid Dynamics I
P PP PI II I W WW W
Accuracy Improvement Spatial 2
Ref: Kennedy, C. A. and Carpenter, M. H.,
Applied Numerical Mathematics, 14, pp. 397-433 (1994) .
k
k
'

0 1 2 3
0
1
2
3
Exact
2E
4E
6E
6T
8E
8T
Computational Fluid Dynamics I
P PP PI II I W WW W
Accuracy Improvement Temporal 1
Temporal Accuracy
Implicit Crank-Nicolson
( ) [ ]
2 / 1 1 2 2 1 1
) ( ) ( ) (
2
+ + + +

+ + +

=
n n n n n n n
p
t t

u u u A u A u u
p
t
+ =

1
) ( ) ( u D u A
u
Nonlinear advection term requires iteration.
Computational Fluid Dynamics I
P PP PI II I W WW W
Accuracy Improvement Temporal 2
Linearization of Advection Terms
For example, a 2-D equation
can be linearized as
0 =

y x t
F E U
!
!
!
"
#
$
$
$
%
&
=
v
u

U
!
!
!
"
#
$
$
$
%
&

+ =
xy
xx
uv
p u
u

2
E
!
!
!
!
"
#
$
$
$
$
%
&
+
=
yy
xy
p v
uv
v

2
F
[ ] [ ] 0 =

y
B
x
A
t
U U U
[ ] [ ]
U
F
U
E

= B A ,
where
Jacobian matrix
Computational Fluid Dynamics I
P PP PI II I W WW W
Accuracy Improvement Temporal 3
Fractional Step Method Kim & Moin (1985)
Projection method extended to higher accuracy
[ ] ) (
Re 2
1
) ( ) ( 3
2
1
2 1 n t n n
n t
t
u u u A u A
u u
+ + =


Adams-Bashforth (AB2) Crank-Nicolson
t
n
t n
t
t
u
u
u u

=
(
)
(
*
+
=
=

+
+
1
0
2
1
1

Note that is different from the original pressure


2
Re 2

=
t
p
Computational Fluid Dynamics I
P PP PI II I W WW W
Accuracy Improvement Temporal 4
Treatment of implicit viscous terms
[ ] ) (
Re 2
1
) ( ) ( 3
2
1
2 1 n t n n
n t
t
u u u A u A
u u
+ + =


Factorizing,
( ) =
!
"
#
$
%
&

'
n t
zz yy xx
t t t
u u
Re 2 Re 2 Re 2
1
[ ] ( )
n
zz yy xx
n n
t t
u u A u A + +


Re
) ( ) ( 3
2
1
( ) =
!
"
#
$
%
&

!
"
#
$
%
&

!
"
#
$
%
&

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


Re
) ( ) ( 3
2
1
TDMA in three directions
Computational Fluid Dynamics I
P PP PI II I W WW W
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
Ref: Rutland, Ph. D. Thesis, Stanford University (1989)
Bell, Collela and Glaz, JCP, 85:257 (1989)
( )
,
-
.
/
0
1

=
t t
t
t t

u
1
2
1 = T
Eq. of State
Computational Fluid Dynamics I
P PP PI II I W WW W
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: etc.
- Inflow conditions:
- Outflow conditions: convective outflow condition
2 1 1
, f f f f
N N
= =
+
) , , ( ) 0 ( t z y F x f = =
L x
x
U
t
= =

+ at 0
u
u
,
-
.
/
0
1
=
2
udA
A
U
1
Computational Fluid Dynamics I
P PP PI II I W WW W
Compressible
Navier-Stokes Equations
Computational Fluid Dynamics I
P PP PI II I W WW W
0 =

z y x t
G F E U
!
!
!
!
!
!
"
#
$
$
$
$
$
$
%
&
=
E
w
v
u

U
!
!
!
!
!
!
!
"
#
$
$
$
$
$
$
$
%
&
+ +

+
=
x
xz
xy
xx
u p E
uw
uv
p u
u



) (
2
E
!
!
!
!
!
!
!
"
#
$
$
$
$
$
$
$
%
&
+ +

=
y
yz
yy
xy
v p E
vw
p v
uv
v



) (
2
F
!
!
!
!
!
!
!
"
#
$
$
$
$
$
$
$
%
&
+ +
+

=
z
zz
yz
xz
w p E
p vw
vw
uw
w



) (
2
G
T c h T c e RT p
p v
= = = , ,
R
e
T e p
R
c
v
) 1 (
, ) 1 ( ,
1

= =

or
Constitutive relations
z zz yz xz z
y yz yy xy y
x xz xy xx x
q w v u
q w v u
q w v u
+ =
+ =
+ =



where
Computational Fluid Dynamics I
P PP PI II I W WW W
Solution methods for compressible N-S equations
follows the same techniques used for hyperbolic equations
z y x t

G F E U
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.
Computational Fluid Dynamics I
P PP PI II I W WW W
- MacCormack method
- Leap frog/DuFort-Frankel method
- Lax-Wendroff method
- Runge-Kutta method
Explicit Methods
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).
Computational Fluid Dynamics I
P PP PI II I W WW W
Most of the time, an implicit integration method involves
nonlinear advection terms
which are linearized as
z y x t

G F E U
[ ] [ ] [ ]
z
C
y
B
x
A
t
n n n n n

+ + + + 1 1 1 1
U U U U U
[ ] [ ] [ ]
n n n
C B A
!
"
#
$
%
&

=
!
"
#
$
%
&

=
!
"
#
$
%
&

=
U
G
U
F
U
E
, ,
+ ADI, factorization, etc.
Computational Fluid Dynamics I
P PP PI II I W WW W
Ultimately, compressible Navier-Stokes equations
can be written as a system of ODEs
z y x t

G F E U
( )
0 0
) (
) ( ,
U U
U
U
= =
= '
t t
t t F
dt
d
Initial condition
Solution techniques for a system of ODE applies.
- Explicit vs. Implicit (Nonstiff vs. Stiff)
- Multi-stage vs. Multi-step
Computational Fluid Dynamics I
P PP PI II I W WW W
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).

Potrebbero piacerti anche