Title: Direct Numerical Simulations of Multiphase Flows
1Numerical Methods for Wave Equations Part I
Smooth Solutions
Instructor Hong G. Im University of Michigan
Fall 2005
2Outline
Solution Methods for Wave Equation
- Part I
- Method of Characteristics
- Finite Volume Approach and Conservative Forms
- Methods for Continuous Solutions
- - Central and Upwind Difference
- - Stability, CFL Condition
- Various Stable Methods
- Part II
- Methods for Discontinuous Solutions
- - Burgers Equation and Shock Formation
- - Entropy Condition
- - Various Numerical Schemes
3Method of Characteristics
41st Order Wave Equation
The characteristics for this equation are
51-D Wave Equation (2nd Order Hyperbolic PDE)
Define
which leads to
6In matrix form
Can it be transformed into the form
?
Find the eigenvalue, eigenvector
7Eigenvalue
Eigenvector
For
For
The solution (v,w) is governed by ODEs along
the characteristic lines
8On
If
(Riemann Invariant), we have
(If c const)
9On
If
(Riemann Invariant), we have
(If c const)
103
P
2
1
11Finite difference approximation to determine
P
2
1
Nonlinear system iterative procedure
12Numerical Methods Finite Volume Approach
13When using finite volume approximations, we work
directly with the integral form of the
conservation principles. The average values of f
over a small volume are stored
x
xj?1/2 xj1/2
14In finite volume method, equations in
conservative forms are needed in order to satisfy
conservation properties.
As an example, consider a 1-D equation
where F denotes a general advection/diffusion
term, e.g.
15Integrating over the domain L,
If F 0 at the end points of the domain, f is
conserved.
16In discretized form
xj?1/2 xj1/2
x
17Examples of Conservative Form
Discretize
Conservative
18Examples of Non-conservative Form
Discretize
Non-conservative
19Finite Volume Method for Conservative Equations
Advection
Diffusion
Advection/Diffusion
20Finite Volume Formulation
j1
j?1
j
x
Fj?1/2 Fj1/2
211-D Advection-Diffusion Equation
FVM Equation
Approximating
22Substituting
Rearranging the terms
Which is exactly the same as the finite
difference equation if we take the average value
to be the same as the value in the center of the
cell
23Numerical Methods for 1-D Advection
Equation Stability Consideration (Finite
Difference Approach)
24We will start by examining the linear advection
equation
The characteristic for this equation are
Showing that the initial conditions are simply
advected by a constant velocity U
25Finite difference equation
A forward in time, centered in space (FTCS)
discretization yields
n1
n
j?1 j j1
26This scheme is O(?t, ?x2) accurate, but a
stability analysis shows that the error grows as
Since the amplification factor has the form 1i()
the absolute value of this complex number is
always larger than unity and the method is
unconditionally unstable for this case.
27Alternative Scheme Upwind Difference
A forward in time but upwind (windward) in
space discretization yields
This scheme is O(?t, ?x) accurate.
n1
n
j?1 j
28To examine the stability we use the von Neumans
method
Substituting into the modified equation,
29Amplification factor
or
30Amplification Factor
Im(G)
Stability Condition
1
Stable
G
Re(G)
kh
1
CFL Condition (Courant-Friedrichs-Lewy 1932)
1??
?
31Stability
Implication of the CFL Condition (Hirsch, vol.1,
p. 288)
The domain of dependence of the differential
equation should be contained in the domain of
dependence of the discretized equations.
32Stability Consideration (Finite Volume Approach)
33Finite Volume Formulation
j1
j-1
j
x
Fj-1/2 Fj1/2
34Approximating the advective fluxes
Taking the average (Central)
j1
j-1
j
x
Upwind
35Central Differencing and Stability
Consider the following initial conditions
36Central Differencing and Stability
Next time step (n2)
Cell j will overflow immediately !!!
37By considering the fluxes, it is easy to see why
the centered difference approximation is always
unstable.
Always !
38Upwind Differencing and Stability
Consider the following initial conditions
U
39Upwind
U
Upwinding is effectively an averaging process!
40Average
41Advect
42Average
43Advect
44Average
45Advect
46Upwind Differencing Unstable Case
Consider the following initial conditions
During one time step, U?t of f flows into cell j,
increasing the average value of f by U?t/h.
47Integration using upwind scheme
48(No Transcript)
49Taking a third step will result in an even larger
positive value, and so on until the compute
encounters a NaN (Not a Number).
50If U?t/h gt 1, the average value of f in cell j
will be larger than in cell j?1. In the next
step, f will flow out of cell j in both
directions, creating a larger negative value of
f. Taking a third step will result in an even
larger positive value, and so on until the
compute encounters a NaN (Not a Number).
51Consideration of Modified Equations Why is
upwind scheme stable? (Ref Tannehill et al., Ch.
4)
52Derive modified equation for upwind difference
method
Using Taylor expansion
53Substituting
Therefore,
It helps the interpretation if all terms are
written in
54Taking further derivatives
55Similarly, we get
Final form of the modified equation
56By applying upwind differencing, we are
effectively solving
Numerical dissipation (diffusion)
Also note that the CFL condition
ensures a positive diffusion coefficient
Dissipation
Dispersion
57Dissipation vs. Dispersion
Dissipative
Exact
Dispersive
The nature of the numerical scheme depends on
the nature of the lowest order truncation error
term.
58Generalized Upwind Scheme (for both U gt 0 and U lt
0 )
Define
The two cases can be combined into a single
expression
59Or, substituting
central difference artificial viscosity
General representation of various flux formula
60While the first-order upwind scheme was found to
be stable, it is in general too dissipative
(smoothes out all the steep gradients).
Stable and accurate methods - Lax-Wendroff (I
and II) - Leapfrog - Lax-Friedrichs -
MacCormack - 2nd order upwind - etc., etc.,
61Implicit Method
1. Implicit (Backward Euler) Method
- Unconditionally stable - 1st order in time, 2nd
order in space - Forms a tri-diagonal matrix
(Thomas algorithm)
62Implicit Method
Thomas Algorithm
63Implicit Method
Thomas Algorithm The Algorithm
Forward Sweep
Backward Sweep
64Lax Method
2. Lax (Lax-Friedrichs) Method
The forward Euler method can be made stable by
Modified equation
- Stable for
- Not uniformly consistent
- Still 1st order (dissipative)
65Leap Frog Method
3. Leap Frog Method
The simplest stable second-order accurate (in
time) method
Modified equation
- Stable for
- Dispersive (no dissipation) error will not
damp out
- Initial conditions at two time levels
- Oscillatory solution in time (alternating)
66LW-I Method
4. Lax-Wendroffs Method (LW-I)
First expand the solution in time
Then use the original equation to rewrite the
time derivatives
67LW-I Method
Substituting
Using central differences for the spatial
derivatives
2nd order accurate in space and time
Stable for
68LW-II Method
5. Two-Step Lax-Wendroffs Method (LW-II)
LW-I into two steps
Step 1 (Lax)
Step 2 (Leapfrog)
- Stable for
- Second order accurate in time and space
For the linear equations, LW-II is identical to
LW-I (prove it!)
69MacCormack Method
6. MacCormack Method
Similar to LW-II, without
Predictor
Corrector
- A fractional step method - Predictor forward
differencing - Corrector backward
differencing - For linear problems, accuracy and
stability properties are identical to LW-I.
702nd Order Upwind Method
7. Second-Order Upwind Method
Warming and Beam (1975) Upwind for both steps
Predictor
Corrector
Combining the two
- Stable if - Second-order accurate in time and
space
71And the list goes on
72(No Transcript)
73(No Transcript)
74Closing Remarks
75Summary by CFD School A
In solving inviscid flow equations as found in
many gas dynamic applications, central
differencing scheme is inherently unstable and
thus cannot be used. One should use more robust
methods such as upwind or other higher order
methods in order to ensure stability and
accuracy. In general, central differencing
scheme is a deficient method in capturing true
physical behavior and should be avoided if at all
possible.
76Summary by CFD School B
Upwind-type schemes applied to the Navier-Stokes
equations inherently introduce numerical
dissipation which depends on numerical
parameters, not on actual physical processes.
Sometimes these uncontrolled numerical
dissipation may interfere with physical solution,
thereby degrading the fidelity of simulation.
Central differencing does not suffer
from artificial dissipation and thus is preferred
as an accurate numerical method.