Numerical Methods for the Navier-Stokes Equationsphoenics/SITE_PHOENICS/Apostilas/CFD-1_U... ·...
Transcript of Numerical Methods for the Navier-Stokes Equationsphoenics/SITE_PHOENICS/Apostilas/CFD-1_U... ·...
Computational Fluid Dynamics IPPPPIIIIWWWW
Numerical Methods forthe Navier-Stokes
Equations
Instructor: Hong G. ImUniversity of Michigan
Fall 2001
Computational Fluid Dynamics IPPPPIIIIWWWW
• 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 IPPPPIIIIWWWW
Incompressible Navier-Stokes Equations
Computational Fluid Dynamics IPPPPIIIIWWWWIncompressible Navier-Stokes Equations
wvu
=u
0=⋅∇ u
ρα p
t∇−∇+∇⋅−=
∂∂ uuuu 2
The (hydrodynamic) pressure is decoupled from the rest of the solution variables. Physically, it is the pressurethat drives the flow, but in practice pressure is solved suchthat the incompressibility condition is satisfied.
The system of ordinary differential equations (ODE’s) are changed to a system of differential-algebraic equations (DAE’s), where algebraic equations acts like a constraint.
Computational Fluid Dynamics IPPPPIIIIWWWWVorticity-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 IPPPPIIIIWWWWSolution Methods for Incompressible N-S Equations inPrimitive 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 IPPPPIIIIWWWWBack 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
02 =⋅∇+∂∂ uc
tp
ρα p
t∇−∇+∇⋅−=
∂∂ uuuu 2
2c : arbitrary constant
2c ( ))(0 xpptp =→
∂∂
ρ2cp =2c
Computational Fluid Dynamics IPPPPIIIIWWWWThe concept can be applied to a time-accurate methodby using “pseudo-time stepping” at every sub-steps.
Artificial Compressibility - 2
02 =⋅∇+∂∂ ucpτ
ρα
τβ p
t∇−∇+∇⋅−=
∂∂+
∂∂ uuuuu 2
At every “real” time step, take “pseudo-time stepping”using explicit time integration until
0,0 →∂∂→
∂∂
ττpu
Since the pseudo time scale is not physical, we canaccelerate the integration however we want.
Computational Fluid Dynamics IPPPPIIIIWWWWMarker-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∇−∇+∇⋅−=
∂∂ uuuu 2
)()( 221
nhh
hnh
nh
nh
nh p
tuuuuu ⋅∇∇+∇−=∇⋅⋅∇+
∆⋅∇−⋅∇ +
αρ
)(2 nh
nhh p uu ∇⋅⋅∇−=∇ ρ
Taking divergence of momentum equation,
Poisson equation
ρα p
thn
hn
hn
nn ∇−∇+∇⋅−=∆−+
uuuuu 21
and
Explicit integration
Computational Fluid Dynamics IPPPPIIIIWWWWProjection Method – Chorin (1968), Temam (1969)
• Originally derived on a colocated grid • Identical to MAC except for the Poisson equation
Pressure Correction Method - 2
ptpt h
tnh
tn
∇∆−=⇒∇−=∆− +
+
ρρuuuu 1
1 1
01 =⋅∇ +nh u
pthh
th
nh ∇⋅∇∆−⋅∇=⋅∇ +
ρuu 1
thh t
p u⋅∇∆
=∇ ρ2
0
Computational Fluid Dynamics IPPPPIIIIWWWWMAC vs. Projection
1. Integration without pressure
Pressure Correction Method - 3
pth
tn ∇∆−=+
ρuu 1
( )nnnt t DAuu +−∆+=
thh t
p u⋅∇∆
=∇ ρ2
2. Poisson equation
3. Projection into incompressible field
)(2 nh
nhh p uu ∇⋅⋅∇−=∇ ρ
nn uu =
( ) ptt hnnnn ∇∆−+−∆+=+
ρDAuu 1
Computational Fluid Dynamics IPPPPIIIIWWWWSIMPLE Algorithm – Patankar (1981)
(Semi-Implicit Method for Pressure Linked Equations)
- Iterative procedure with pressure correction
Pressure Correction Method - 4
ppp ′+= 0
1. Guess the pressure field2. Solve the momentum equation (implicitly)
3. Solve the pressure correction equation
0p
ρα 0
02
000 p
t
n ∇−∇+∇⋅−=∆− uuuuu
( )02 u⋅∇
∆=′∇
tp ρ
Computational Fluid Dynamics IPPPPIIIIWWWWPressure Correction Method - 5
4. Correct the pressure and velocity
5. Go to 2. Repeat the process until the solution converges.
ppp ′+= 0
pt ′∇∆−=ρ0uu
Notes:- Originally developed for the staggered grid system. - The corrected velocity field satisfies the continuity equationeven if the pressure correction is only approximate.
- Sometimes tends to be overestimatedp′
)8.0(0 ≈′+= ωωppp underrelaxation
Computational Fluid Dynamics IPPPPIIIIWWWWSIMPLER (SIMPLE Revised)
- Incorporating the projection method (fractional step)
Pressure Correction Method - 6
1. Guess the velocity field2. Solve momentum equation (implicitly) without pressure
3. Solve the pressure Poisson equation
0u
uuuuu ˆˆˆˆ 20 ∇+∇⋅−=∆− α
t
( )u*2 ⋅∇∆
=∇t
p ρ
Computational Fluid Dynamics IPPPPIIIIWWWWPressure 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∇−∇+∇⋅−=
∆−
ρα uuuuu
( )*2 u⋅∇∆
=′∇t
p ρ
*p
pt ′∇∆−=ρ
*uu
Computational Fluid Dynamics IPPPPIIIIWWWWStability Consideration
Explicit time integration in 2-D requires the stability condition:
( ) αα
4and4 2
2ht
vut <∆
+<∆
t∆α4
2ht =∆
( )α/1
4 2vut
+=∆
Re~/1 α0→∆t at both limits!
High-Re flow: advection-controlledLow-Re flow: diffusion-controlled
Use implicit schemes for appropriate terms!
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy Improvement – Spatial 1
Spatial Accuracy
• Explicit differencing - use larger stencils
)(2
211 hOh
fff jj
j +−
=′ −+
)(12
88 42112 hOh
fffff jjjj
j +−+−
=′ ++−−
• Tridiagonal - Padé (compact) schemes
( ) )(34 41111 hOff
hfff jjjjj +−=′+′+′ −++−
• Pentadiagonal
L+++++=′+′+′+′+′ ++−−++−− 21122112 jjjjjjjjjj efdfcfbfaffffff εδγβα
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy Improvement – Spatial 2
Ref: Kennedy, C. A. and Carpenter, M. H., Applied Numerical Mathematics, 14, pp. 397-433 (1994) .
k∆
k'∆
0 1 2 30
1
2
3Exact2E4E6E6T8E8T
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy Improvement – Temporal 1
Temporal Accuracy
• Implicit – Crank-Nicolson
( )[ ] 2/112211 )()()(2
++++ ∇∆−∇+∇++−∆=− nnnnnnn pttρ
α uuuAuAuu
pt
∇−+−=∂∂
ρ1)()( uDuAu
Nonlinear advection term requires iteration.
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy Improvement – Temporal 2
Linearization of Advection Terms
• For example, a 2-D equation
can be linearized as
0=∂∂+
∂∂+
∂∂
yxtFEU
=
vu
ρρρ
U
−−+=
xy
xx
uvpu
u
τρτρ
ρ2E
−+
−=
yy
xy
pv
uvv
τρ
τρρ
2
F
[ ] [ ] 0=∂∂+
∂∂+
∂∂
yB
xA
tUUU
[ ] [ ]UF
UE
∂∂=
∂∂= BA ,where Jacobian matrix
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy Improvement – Temporal 3
Fractional Step Method – Kim & Moin (1985)
• Projection method extended to higher accuracy
[ ] )(Re21)()(3
21 21 ntnn
nt
tuuuAuAuu +∇+−−=
∆− −
Adams-Bashforth (AB2) Crank-Nicolson
t
n
tn
tt u
u
uu⋅∇
∆=∇
=⋅∇
−∇=∆−
+
+
1
0
2
1
1
φφ
Note that is different from the original pressureφ
φφ 2
Re2∇∆−= tp
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy Improvement – Temporal 4
Treatment of implicit viscous terms
[ ] )(Re21)()(3
21 21 ntnn
nt
tuuuAuAuu +∇+−−=
∆− −
Factorizing,
( )=−
∆−∆−∆−⇒ nt
zzyyxxttt uuδδδ
Re2Re2Re21
[ ] ( ) nzzyyxx
nn tt uuAuA δδδ ++∆+−∆− −
Re)()(3
21
( )=−
∆−
∆−
∆− nt
zzyyxxttt uuδδδ
Re21
Re21
Re21
[ ] ( ) nzzyyxx
nn tt uuAuA δδδ ++∆+−∆− −
Re)()(3
21
TDMA in three directions
Computational Fluid Dynamics IPPPPIIIIWWWWAccuracy 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) wherePoisson equation becomes
Ref: Rutland, Ph. D. Thesis, Stanford University (1989)Bell, Collela and Glaz, JCP, 85:257 (1989)
( )
∂
∂+⋅∇∆
=∇tt
ttt ρρφ u12 1=Tρ Eq. of State
Computational Fluid Dynamics IPPPPIIIIWWWWBoundary Conditions
Boundary Conditions for Incompressible Flows
• In general, boundary condition treatment is easierthan for the compressible flow formulation due to theabsence of acoustics
• Typical boundary conditions:- Periodic: etc. - Inflow conditions: - Outflow conditions: convective outflow condition
211, ffff NN == +
),,()0( tzyFxf ==
Lxx
Ut ==∂∂+ at0uu
= ∫udA
AU 1
Computational Fluid Dynamics IPPPPIIIIWWWW
Compressible Navier-Stokes Equations
Computational Fluid Dynamics IPPPPIIIIWWWW
0=∂∂+
∂∂+
∂∂+
∂∂
zyxtGFEU
=
Ewvu
ρρρρρ
U
++−
−−+
=
x
xz
xy
xx
upEuwuv
puu
ψρτρτρ
τρρ
)(
2
E
++
−
−+
−
=
y
yz
yy
xy
vpEvw
pv
uvv
ψρτρ
τρ
τρρ
)(
2F
++−+
−−
=
z
zz
yz
xz
wpEpvw
vwuww
ψρτρ
τρτρ
ρ
)(
2
G
TchTceRTp pv === ,,ρ
ReTepRcv
)1(,)1(,1
−=−=−
= γργγ
orConstitutive relations
zzzyzxzz
yyzyyxyy
xxzxyxxx
qwvuqwvuqwvu
+−−−=
+−−−=
+−−−=
τττψτττψτττψ
where
Computational Fluid Dynamics IPPPPIIIIWWWWSolution methods for compressible N-S equations
follows the same techniques used for hyperbolic equations
zyxt ∂∂+
∂∂+
∂∂=
∂∂ GFEU
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 numericaldissipation, hence provides stability, but accuracybecomes a concern.
Computational Fluid Dynamics IPPPPIIIIWWWW
- 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 higherorder method (both explicit and implicit).
Computational Fluid Dynamics IPPPPIIIIWWWWMost of the time, an implicit integration method involvesnonlinear advection terms
which are linearized as
zyxt ∂∂+
∂∂+
∂∂=
∂∂ GFEU
[ ] [ ] [ ]z
Cy
Bx
At
nnnnn
∂∂+
∂∂+
∂∂=
∆− ++++ 1111 UUUUU
[ ] [ ] [ ]nnn
CBA
∂∂=
∂∂=
∂∂=
UG
UF
UE ,,
+ ADI, factorization, etc.
Computational Fluid Dynamics IPPPPIIIIWWWWUltimately, compressible Navier-Stokes equations can be written as a system of ODE’s
zyxt ∂∂+
∂∂+
∂∂=
∂∂ GFEU
( )
00 )(
)(,
UU
UU
==
=⇒
tt
ttFdtd
Initial condition
Solution techniques for a system of ODE applies.- Explicit vs. Implicit (Nonstiff vs. Stiff)- Multi-stage vs. Multi-step
Computational Fluid Dynamics IPPPPIIIIWWWWBoundary Conditions
Boundary Conditions for Compressible Flows
• In general, boundary condition for the compressible flow is trickier because all the acoustic waves must beproperly taken care of at the boundaries.
• Typical boundary conditions:- Periodic: still easy to implement - Both inflow and outflow conditions require treatment ofcharacteristic waves(hard-wall, nonreflecting, sponge, etc).