Loading...

PPT – Direct Numerical Simulations of Multiphase Flows PowerPoint presentation | free to view - id: 8d121-ZDc1Z

The Adobe Flash plugin is needed to view this content

Numerical Methods for Wave Equations Part I

Smooth Solutions

Instructor Hong G. Im University of Michigan

Fall 2005

Outline

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

Method of Characteristics

1st Order Wave Equation

The characteristics for this equation are

1-D Wave Equation (2nd Order Hyperbolic PDE)

Define

which leads to

In matrix form

Can it be transformed into the form

?

Find the eigenvalue, eigenvector

Eigenvalue

Eigenvector

For

For

The solution (v,w) is governed by ODEs along

the characteristic lines

On

If

(Riemann Invariant), we have

(If c const)

On

If

(Riemann Invariant), we have

(If c const)

3

P

2

1

Finite difference approximation to determine

P

2

1

Nonlinear system iterative procedure

Numerical Methods Finite Volume Approach

When 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

In 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.

Integrating over the domain L,

If F 0 at the end points of the domain, f is

conserved.

In discretized form

xj?1/2 xj1/2

x

Examples of Conservative Form

Discretize

Conservative

Examples of Non-conservative Form

Discretize

Non-conservative

Finite Volume Method for Conservative Equations

Advection

Diffusion

Advection/Diffusion

Finite Volume Formulation

j1

j?1

j

x

Fj?1/2 Fj1/2

1-D Advection-Diffusion Equation

FVM Equation

Approximating

Substituting

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

Numerical Methods for 1-D Advection

Equation Stability Consideration (Finite

Difference Approach)

We 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

Finite difference equation

A forward in time, centered in space (FTCS)

discretization yields

n1

n

j?1 j j1

This 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.

Alternative 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

To examine the stability we use the von Neumans

method

Substituting into the modified equation,

Amplification factor

or

Amplification Factor

Im(G)

Stability Condition

1

Stable

G

Re(G)

kh

1

CFL Condition (Courant-Friedrichs-Lewy 1932)

1??

?

Stability

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.

Stability Consideration (Finite Volume Approach)

Finite Volume Formulation

j1

j-1

j

x

Fj-1/2 Fj1/2

Approximating the advective fluxes

Taking the average (Central)

j1

j-1

j

x

Upwind

Central Differencing and Stability

Consider the following initial conditions

Central Differencing and Stability

Next time step (n2)

Cell j will overflow immediately !!!

By considering the fluxes, it is easy to see why

the centered difference approximation is always

unstable.

Always !

Upwind Differencing and Stability

Consider the following initial conditions

U

Upwind

U

Upwinding is effectively an averaging process!

Average

Advect

Average

Advect

Average

Advect

Upwind 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.

Integration using upwind scheme

(No Transcript)

Taking a third step will result in an even larger

positive value, and so on until the compute

encounters a NaN (Not a Number).

If 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).

Consideration of Modified Equations Why is

upwind scheme stable? (Ref Tannehill et al., Ch.

4)

Derive modified equation for upwind difference

method

Using Taylor expansion

Substituting

Therefore,

It helps the interpretation if all terms are

written in

Taking further derivatives

Similarly, we get

Final form of the modified equation

By applying upwind differencing, we are

effectively solving

Numerical dissipation (diffusion)

Also note that the CFL condition

ensures a positive diffusion coefficient

Dissipation

Dispersion

Dissipation vs. Dispersion

Dissipative

Exact

Dispersive

The nature of the numerical scheme depends on

the nature of the lowest order truncation error

term.

Generalized Upwind Scheme (for both U gt 0 and U lt

0 )

Define

The two cases can be combined into a single

expression

Or, substituting

central difference artificial viscosity

General representation of various flux formula

While 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.,

Implicit Method

1. Implicit (Backward Euler) Method

- Unconditionally stable - 1st order in time, 2nd

order in space - Forms a tri-diagonal matrix

(Thomas algorithm)

Implicit Method

Thomas Algorithm

Implicit Method

Thomas Algorithm The Algorithm

Forward Sweep

Backward Sweep

Lax 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)

Leap 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)

LW-I Method

4. Lax-Wendroffs Method (LW-I)

First expand the solution in time

Then use the original equation to rewrite the

time derivatives

LW-I Method

Substituting

Using central differences for the spatial

derivatives

2nd order accurate in space and time

Stable for

LW-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!)

MacCormack 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.

2nd 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

And the list goes on

(No Transcript)

(No Transcript)

Closing Remarks

Summary 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.

Summary 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.