Vous êtes sur la page 1sur 116

# NASATechnicalMemorandum100010 _

!
I I

t
,-

I
|

i i
i
i

## Lecture Series in Computational Fluid Dynamics

Kevin W. Thompson

(llASl-_II'l-

1000 10)

LEC'I_S

N87-29_

14

Uncla_ 00978C6

August

1987

NASA Technical

Memorandum

100010

## Lecture Series in Computational Fluid Dynamics

Kevin W. Thompson, Ames Research Center, Moffett Field, California

August

1987

RI/ .SA
NationAl Aeronautics and Space Administration Ames Research Center Moffett Field. California 94035

Contents

Introduction 1 Conservation 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 Finite 2.1 2.2 Conservation Wave The Shock The Equations Breaking Waves Inviscid Continuous Laws, Laws Analytical of Waves Burger's Shocks Systems and Wave Equations, and Shocks 3 3 4 ....................... 5 6 7 8 ................ 9 10 11 Equations ................... Methods ..................... ..................... ................. ................... ................... ............. 13 13 16 16 17 18 20 21 24 26 27 Condition Method and Analysis Analysis Condition Schemes and the the Lax Equivalence Analysis Wave Equation Theorem .............. ........... ....... ............. ...... 27 29 29 30 31 32 ................ 32 34 34

............................... Solutions

## .................................. Entropy Dimension

Expansion Nonlinear Exercises Difference Basic A Brief 2.2.1 2.2.2 Finite First

.................................... Solutions Difference Order vs. of Wave Approximations Solution Methods Methods

Survey Explicit

## 2.2.3 Two The Method Dissipation The Method Exercises

Popular Second Order Schemes of Lines .............................. and Discontinuous of Lines in Two .................................... Solutions Dimensions

Stability 3.1 The 3.2 The 3.2.1 3.2.2 3.2.3 3.3 3.4 3.5 3.6

for Finite

Difference

Approximations

Methods

Simple

of Lines

ii

CONTENTS

Analysis Limits

## .................... ................... ................ Problems

36 37 38 39 41 41 42 ............... 43 46 46 48 50 51 51

Method

of Lines

in Two

. , , , . . and Laws and Conservation Tensor and Fields Metric Laws ..................... Tensors

Conservation

## ................................. Systems Tensors Fields Differentiation Fields ........................... ....................... .........................

............................. .............................. .............................. Coefficient Three ...................... .................. ................ Equations ........... ......................... Dimensions Problems Difference

Dissipation for Tensor 4.3.1 Scalar Fields 4.3.2 Vector on the Fields Dissipation in One in Two for and

## 4.4 4.5 4.6 4.7 4.8 4.9 4.10 4.11 6

More

52 53 55 59 59 62 64 69 71 71

Dimension

## ............................ Hyperbolic of Finite

. . . . .

- . . . . Boundary in One in Two Dimension Boundary Dimensions Boundary Solution Conditions of the Equations Conditions ............................ Conditions Conditions Interior for Fluid for Fluid in One in Two Problem Dynamics Dynamics Dimension Dimensions ................. ................ .................. ........... .......... ...........................

Nonreflecting 5.1 Waves 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 Waves Numerical

Nonreflecting Nonreflecting Characteristic Boundary Test Problems Exercises Equations Coordinate The A.3.1 A.3.2 Rectangular The Coordinate

73 75 76 77 79 81 83

..................................
" " " " " " " " '

94

## The A.1 A.2 A.3

of Fluid Geometries

Dynamics and Metric Fluid Tensors ................. .................. Equations ........................ withDissipation ............................ ........................ with Dissipation ................ ................

## 95 95 97 98 98 99 99 100 100 101

Invariant Coordinates

............................

Connection Fluid

A.4

## Cylindrical A.4.1 A.4.2 The

Coordinates Fluid

Connection Coordinates

A.5

Spherical

.............................

.,

CONTENTS

## 102 102 105

List
1.1 3.1 4.1 4.2 5.1 5.2 5.3 5.4 5.5 5.6

of Figures
Characteristic Stability Shock Spherical Shock Spherical Homologous Angled Angled Angled shock shock shock tube regions tube Diagram for Nonlinear Waves methods ................. of order p ............ 6

for Runge-Kutta 60

35 65 67 86 87 89 91 92 93

at step

## 0 ............................. ........................... ...........................

List
S.1

of Tables
Reflections for Subsonic Shocks ........................ 85

Introduction
This fluid text was Center written problems, in July to accompany which and August a series in the of 1986. of lectures Space Each chapter on Science computational Division in the text at methods NASA corresponds for Ames to a

dynamics

I gave

Research

particular lecture. Sufficient interest was User Services Manager of the Numerical me to prepare interested a series Center, series of videotaped these Anyone in obtaining

expressed in the subject Aerodynamic Simulator lectures to be distributed NAS should contact

that Lynda Haines, the (NAS) Project, asked along User with this text. Services fluid at NASA (ab-

tapes

Ames Research This lecture breviated person of fluid way constructed As there to consider in which implicit gence majority of time, the as flow,

Moffett Field, CA 94035. covers the basic principles throughout). The dimensions. models, the number and lectures I say the

dynamics

## an inexperienced numerical there which have model been is no unique

everything to construct

## he or she or more exceeds numerical

needs

to know

to create number

"a model"

of such in the

of practitioners

are so many different approaches what will and will not be covered computational will states explicit as some be and grid moves with but clever are basic and which are rigor not mentioned, boundary schemes, of them are the

to simulating fluid by these lectures. the fluid, will not described theory complicated. in detail.

flow, it is appropriate Lagrangian methods, at all. the due Time convergreat to lack course scheme. have While a in Accelerated Finally, a survey CFD and in use!).

be covered

stability quite

or otherwise,

be examined

are simple,

important,

usability

methods

is equally

will be on the

## than their proof. solution methods devoted to the techniques problems

Indeed, mathematically rigorous statements can seldom for CFD problems. Virtually all rigorous mathematical simpler of nonlinear for a field problems systems, is the principles. of linear simpler even systems or single usually nonlinear work on developed for these problems

Fortunately, complicated

## should do so. of maturity a small number

degree By

of basic

this

standard,

computational

INTR

OD UCTION

fluid getting

dynamics a widely

a mature methods.

field. These

been will

by

## collection by the In this to get

of complicated

maturity

applicable

approach

a small

of basic which

sense it departs from best possible solutions Acknowledgment. search Ames Division the NAS Associate, Research Project doing Center.

while in the

Council Space

Re-

research

## into astrophysics NRC, work. I would

Science

at NASA Science to

NASA also

for supporting

in this the

## like to express videotapes.

appreciation

of the

Chapter Conservation
,w !

1 Laws and
with most between when as the are the general what function nonlinear

Wave

i
i

Equations
This laws, close that shock waves that chapter of which relationship the concept deals the It begins

Shocks
properties encountered one means and laws of hyperbolic example by wave and are solution systems the and of conservation fluid dynamics the discover equation concept of and all shock describes

frequently

equations.

by defining

conservation

as the

## We will also physically may

valid

solutions, occur.

those

an entropy

condition

actually

1.1
The

Conservation
equations of fluid laws. a single The dynamics simplest

Laws
are one one and Suppose length, and example may of the conservation be written dimension) mathematical law as either that the formulation equation, equation density two of the of

dimensional

## is a single an integral u is the rate between

conserved

quantity, equation.

## flux of u (i.e., density

at which

u flows x2,

a given satisfies

x coordinate).

integrated

points

x2 < xl,

## - f(x2,t)]. in the limit as x2 _ xl x, Eq.

(1.1)

(1.1)

0u 0/=0. a-T+
Eq. (1.2) is said to be in conservation time derivative of a density plus the form. More generally, divergence of a flux any equals

(1.2)
equation in which the inhomogeneous local

CHAPTER

1.

CONSERVATION

LAWS,

WAVE

EQUATIONS,

AND

SHOCKS

(i.e., non-derivative) divergence is Of/Ox, The a density volume. propagation single linear to nonlinear conservation in a small Alternatively, of wave equations; systems

source terms is in conservation and the source terms are zero. form volume one amplitudes. however such of an equation to the may The they flux recast the or system of that problem different,

form. relates

In the the

of (1.2), rate

the

flux of the to

quantity

through

of that

## two approaches are quite dynamics

when

as the fluid

equations. context,

## are usually called called characteristic

characteristic velocities.

equations

in this

while

velocities

are

1.2
We begin

Wave

Equations
the wave amplitude exists u, which a curve is a function of the time t and the by

by introducing

## Suppose there the relations

C in the

xt plane,

parameterized

x = x(a), where along each the point curve on C corresponds to a unique du do-_ where the subscripts is constant denote along derivatives C, we have
du

(1.3) of u

If u(x,t)

## -0, of u. Eq. (1.5)

(1.5) is called

the characteristic curve, or simply characteristic, equation, and may be cast in different forms.

## A common form for the du/da = 0) by to (implicitly always an increasing function Ou

characteristic equation is obtained by dividing assuming that to is never zero; we will assume of a, as in t = e), Ou = O, a = Xo/to and wave u are = dx/dt, is simply equation. equivalent the slope giving

velocity

## xt plane. Eq. (1.6) The speed

If a is constant, Eq. (1.6) is a linear is a nonlinear wave equation. conservation and wave equations for by

If a = a(u) provided

that

a is given

dI

1.3.

CONTINUOUS

ANALYTICAL

SOLUTIONS

If a = constant,

the

problem u(x,t)

and

the

solution

characteristics

in the

## = a, along each The characteristics exists derivative as defined du/da The

of which u = constant, although cover the entire xt plane in the for all x and on the t >_ 0. of (1.4) Ou is often left side du d---[-

u varies from one line to the region t >_ 0, implying that the written with a t, as in

solution

case the

## it is called time rate

the

total

time

of change

of u as measured

velocity

1.3
Now along next, Those Figure each Each

Continuous
consider each the are general straight and the which in the from characteristic

Analytical
case curve lines. where a(u) xt C in the

Solutions
is not plane, constant. hence We know a(u) from is also one that u is constant and the to the constant

characteristics

However,

as u varies

characteristic

## so does a(u), characteristics not seen 1.1, reproduced

slopes of the characteristics also vary from one to the next. are initially separate will either diverge or converge, leading linear page problem. 21 of the be given intersects slope defined A typical book by the characteristic [1]. diagram is shown in by Whitham

to behavior

## value problem curve which curve. The is therefore

Eq. (1.6) with u(x,O) --- f(x). Then for x axis at x --- _ at time t = 0, u = f(_) curve is a(f (_)) _ value, = f(_) and has and is also known. as its equation

everywhere

of a given

by a unique

x=
The complete the solution set of _ values is defines a whole

+
family of characteristics, along each

(1.10)
of which

u=
Now let's check the solution. We find

a= 1 F()
at respect Ou Ox 1 + F'(_)t' to _, and f'(_) 1 + F'(_)t' therefore

(1.11)

## c_x where the primes denote

1 + F'(_)t' with

(1.12)

derivatives au at

F(_)f'(_) 1 + F'(_)t'

(1.13)

and

Eq.

(1.6)

is satisfied.

CHAPTER

1.

CONSERVATION

LAWS,

WAVE

EQUATIONS,

AND

SHOCKS

('ON[IN[;OUS

._(}I_UTION S

t3

tB

tl

0
( (a x

Figure Wiley

1.1:

## Characteristic Inc. Reprinted

Diagram

for

Nonlinear of John

Waves. Wiley

## (_) 1974 Inc.

by

John

& Sons,

by permission

Saying that u is constant is equivalent to saying that velocity a(u) a(u), which the is the the = constant, solution

along a characteristic each particular value wavelike behavior above from changes obtained

curve whose slope is a(u) = dz/dt of u propagates at a characteristic seeking. to the to point In the simple and the linear form wave case of Eq. where (1.8). a

## In the nonlinear case, nonlinear distortion.

velocity

exhibits

1.4
Difficulties the istics solution wave

The
arise

Breaking
when the which wave i.e., are

of Waves
undergoes in any initially This compression, region separate difficulty slope) _ -at the for which will cross is apparent time _B for which which F'(_) occurs < 0. at some in the F'(_) in any Any later region time, Breaking IF'(_)l where giving occurs is the a the

velocity in this

two

character-

which "breaks"

of (1.13):

an infinite

t = -1/F'(_).

tB=

F'C_B)"

(1.14)

An extreme

case

of breaking

occurs

when

the

initial

state

is a step

function

at x -- 0,

1.5.

SHOCK

WAVES

with

a2 = a(u2),

x > O,
X < O.

(1.15)

## If a2 > al the A different

solution result

breaks occurs

immediately. of a2 < al. The wave undergoes between expansion expansion, and a continuous out and along a must al and a2 spread fan is continuous,

solution results. At times t > 0 all values of F(0) fan of characteristics passing through _ = 0. This satisfy (1.10) and (1.11), hence x
a2<

## a=_, and the complete solution for a is

_x
t <al,

(1.16)

a=

x/t,

a2

<

X/t

<

al;

a_,
a2,

a_ < x/t;
x/t < a2.

The

solution

for u(x,

t) is then

obtained

by inverting

the

known

relationship

a = a(u).

1.5

Shock
the reality must

Waves
nonlinear must be rejected. wave Yet equation valued, solution and we wish the (1.10)-(1.13) to solve represents solution up until a process produced the whose by wave derivatives

## In practice, physical breaking

be single

multi-valued

is valid

solutions which are single valued, and have a finite become infinite, so we must modify our concept lation of the wave problem as a partial differential solutions, the and because the derivatives are defined law waves integral formulation of conservation it is to this form we turn now. Stable i _ discontinuities in nonlinear (1.1)

number of discontinuities. The formuof a solution to include discontinuous equation is not valid for discontinuous for is valid continuous even when functions. However, u is discontinuous, or shocks. On either

only

are called

shock

waves,

side of the shock the solution position xo(t) and moves with the integral equation

## is continuous and velocity vs, where

differentiable. If the shock is located at x2 < x_(t) < xx at time t, we may write

for u as [1]
d fz_" . .

## :_l dx, (1.18)

f(xu,t)-

f(xx,t)

-_ J_]

utx,

t) dx + -_ J_[+ u(x,t)

| =
i
=_

cz:o

. . dx +

CHAPTER

1.

CONSERVATION

LAWS,

WAVE

EQUATIONS,

AND

SHOCKS

In the

limit

as x2 _

## + this x_-, xl --_ x 8 f2 -

becomes f, = v,(u2

the

shock

jump

condition (1.20)

- ul), 1 of the by system. and taking shock (taken to be the the the as the across

are

the

flux the

and values

## value may frame around

of u on 2. be also

side

right

u2 are jump

on side

is at rest;

i.e., which

original

## uv8 must (1.20). as f(ul)

be continuous

= fs - u2v,,

Rewriting

velocity vs = f(u2)-

u 2 -- u 1

limit

where

]usshock,

ul]

-= a(u).

weak

travels

## however, for the

a velocity

that

a = constant.

1.6
Perhaps

The
the most

Inviscid
well known Ou

Burger's
nonlinear i)u =0, or wave

Equation
equation au -_-+Ozz equation form of dust the is the inviscid Burger's equation

c3 [u2"_ _-2-) appears the =0, in most velocity texts field (1.22) on nonlinear of a gas pressure Its of

O---/+u_x which has f(u) = uS/2, particles Burger's initial a(u) and (such

## = u. Burger's in the inviscid as a cloud

hyperbolic non-interacting
gas).

equations,

## represents particles general

in a vacuum, solutions

or a zero

The solution

## inviscid for an fan

equation

satisfies

obtained

above.

discontinuity

at z = 0, with

u = u2 at x < 0, u = ul at

x > 0, is

an expansion

uCx,t) =

x/t,
u2,

x/\$ < u2;

(1.23)

ul < x/t;

## x < vst; (1.24) x > v_t;

1.7.

EXPANSION

SHOCKS

AND

THE

ENTROPY

CONDITION

where

the

shock

velocity

is obtained

from 1

(1.21):

v,
The of one the constant distortion. equation linear wave equation planar velocity. if the to the and fluid Density pressure inviscid the flow. density

(u2 + ul).
Burger's fluid to (1.6), constant with equation with represent density by the velocity. special with and the

(1.25)

cases x, then

## v is constant u the along fluid

continuity

equation However,

for the

a = v = velocity

## inhomogeneities Burger's equation,

flow without

(c3p/Ox u the

=- 0), then

reduces

1.7
The a step The the into

Expansion
preceding function being case with constant The an shock analysis initial a shock

Shocks
found condition. wave two which up into

and

the

Entropy
to the shock nonlinear

Condition
wave given with problem the by Eq. time) with dis(1.21).

solutions with

a step

function,

continuity

## propagates an expansion side. says nothing since

velocity widens

a2 < al breaks states jump also u2 and condition fan. a shock u. expansion destroying must It propagate

the

breakup between

expansion Such

## a2 < al could condition. decreased It turns shock stable.

as a shock,

is permitted it leaves

is known

as an expansion

a state

Small

## to an expansion other hand, are

solution Stable

Compression condition

r,

(1.26)
, ,, r_

cross

at the

the

shock

the

slope

of the

shock

in the

slopes point

of the

which

## no characteristic every to a point on the

of decreasing case

t intersects

## be connected (1.26) equations of the as well

drawn Burger's

initial

at t = 0. In the satisfies

## v, = (u2 + ul)//2, for systems shock laws criteria would such

u2 > ul,

as expected. shocks of fluid time, It are and is for solutions by the that of nonlinear cause as the as well. flow to as stability as entropy dynamics, an expansion entropy are known

Expansion

In the decrease

case

with

of thermodynamics (1.26)

considerations. conditions.

10

CHAPTER

1.

CONSERVATION

LAWS,

WAVE

EQUATIONS,

AND

SHOCKS

1.8
In this

Nonlinear
section we consider

Systems
systems

in

One

Dimension
laws of the
(

of conservation
f

form

Ul

fl

It2
U =

f2
, f= (1.27)

Un k i k

f.
densities here in the

where of the

f is a vector vector u.

## a function the term

of the vector

conserved is used

which

are the

components sense to

linear

algebra

represent any set of unknowns, As in the previous section, 2 (1 for the Eq. (1.27) in section right 1.5. side, 2 for the form, n jump
fi2

and not, for example, let the states on either left). The are
I), (Ui2

as a velocity vector.) side of a shock be numbered conditions region are obtained containing the

1 and shock, as

shock over

jump

by writing

in integral The

and

integrating

a small

conditions
-fil :

therefore
-Uil),

1,...,

(1.28) shock

fil

_--

fi(Ul)

ith

1 of the form

shock,

and

## for all n jump be written

conditions.

0u A 0u O---/+ Ox :0'

or

0u, _+

_
j=l

0u i aij-ff_-x =0,

i=l,...,n,

(1.29)

where

A is the

Jacobian

matrix

of elements

aij defined

by

0I,
aij -- au i. The which velocities system is defined so that signals to be propagate hyperbolic in the if the < _,,. medium matrix The A has n real are the eigenvalues characteristic The charactersingle curve (1.30) A_,

## ,kl < ,k2 < .-.

eigenvalues described

by (1.27).

istic velocities wave equation. no longer curves of the The which need

are the slopes of the However, constancy constancy equations velocities class of allowed of the no longer be straight, and

## curves, amplitude along that

as was the case for the along a characteristic curve, (A more for the [3], is that so the detailed nonlinear to Eq. for some

implies

(1.31)

## for nonlinear determine shock system,

_k(U2) >

systems an entropy

in Chapter

waves

in a fashion

(1.26).

as given
1), > _k(Ul)

1.9.

EXERCISES

11

must

V2

the

> Vl

velocities speed

are

v is the

velocity by the
> V\$

c is the k = 3:
-_- el,

of sound.

-3t- C2

(1/\$

>

0),

## (1.32) of the shock intersect the

which shock.

means If the

that shock

right-moving speed

sound

waves then

on

either

side

is negative,
V2 -C2 >

Vs >

V 1 --

el,

(v s <

0),

(1.33) sound waves region) shock pre-shock are limit, simply the velocity intersect travel the faster

which shock.

is the

k = 1 condition, case, and than waves at the sound catch the waves

and

implies the

that shock

## all left-moving (in the by it. shock fluid.

In either than more relative weak and travel the slowly shock

behind

shock to the

sound supersonic

waves

in front Thus

shock

## post-shock speed the

relative

(characterized same.

to the

in (1.32)

become

1.9

Exercises
that case the the where shock solution F(_) jump of (1.10)-(1.11) = a = constant. condition for the equation satisfies the integral equation (1.1), for the

## 1. Verify linear 2. Find

o(1) u2 +Ozz
Is it the Comment: number equations jump to the same as (1.25) for Burger's conservation upon equation? law, such multiplication condition such A particular of other are physics and conditions. equations The of the physically correct problem, equivalent for u a continuous jump

u 3 =0.
Does this result seem unusual? to an infinite The resulting shock are both

## rise to different which and

be determined quantities

i.e., by working

conserved
,

meaningful,

momentum,

The

general

## expansion fan u = (z-xo)/(t-to)

Consider an initial t = 0. The the shock value point problem

## is a solution to the inviscid

given initial x, and by u = x/(l+t) shock location. vs. shock velocity x0 is the

(1.22).

## for x < x0,

u = 0 for x > x0, at time for t > 0, including constant with time.)

location

12

CHAPTER

1.

CONSERVATION

LAWS,

WAVE

EQUATIONS,

AND

SHOCKS

4.

The

fluid

equations

for

a perfect

gas

in one

dimension

are

aT + (pv) +

(pv) = 0, (pv' + p) = 0,

where

p is the

mass

density,

v is the

p = (7 -

1)e is the

P2

## ratio of specific Show that 1)

4- 1)"

('t 4- 1)p2/pl
('l1)p2/Pl

4- ('14('l

Pl

If P2/Pl can range from one to infinity, what values can the density ratio p2/pl on? (Hint: Although there are now three shock jump conditions, there is still one
.

take only

shock the

velocity.) shock jump conditions derived in the previous problem, let pl -- pl -- 1, Compute P2, v2, and show that

Using

vl = 0, "_ = 5/3, and p2/pl = 5. The speed of sound and vo, draw a diagram of the pre- and post-shock condition (1.32) is satisfied. (1.31) k? with k -3.

is c = _/_. characteristics,

For

this

problem,

is condition

## 2 Difference Solutions of Wave

The first chapter considered tions in one dimension. This imate interest The toward without However, our ultimate sented shocks the duce of the need solution numerical the solution since the obscuring goal, of wave are partial differential techniques of the them solution the after very the for the

the general properties of conservation chapter will cover the basic concepts by finite equations to be difference in one time described equation, systems methods. and one chapter

laws and wave equainvolved in the approxThe conservation spatial be the spatial oriented basic laws at of coordinates. first concepts systems. dimension techniques 4 we will find systems will and will that with introis pre-

equations

or more will

linear by the

wave

## complexity of nonlinear technique problem in problems under 4.

nonlinear

of nonlinear each

in more systems

## solution nonlinear chapter solutions

will be discussed of the determine suited will for artificial will a form form

## In Chapter This the

consideration

of multidimensional discontinuous

of an artificial

demonstrate justification

viscosity

problems to Chapter

discussion,

fundamental

be deferred

2.1
We begin we would restricted terms distance

Basic

Finite

Difference

Approximations

## by considering like to know to knowing f(x) apart,

a piecewise continuous function f(x), defined for all x. Ideally, the exact value of f for all x values, but in practice we will be f at a finite points number is known of discrete at the set points. of grid Describing points a function sake, a uniform (2.1) spacing, which leads to more complicated in we as discretization. For convenience x_, spaced

of its values Ax

at discrete by recording

will discretize

its values

xi = lax, although finite in general difference one can have arbitrary Denote grid the

approximations.

values

of f at x_ by f_: (2.2)

f, = f(x,). 13

14

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

## Given The starting

the

fi values, point

we need

to approximate approximations

various is the

derivatives discrete

of f at the series

grid [4],

points.

Taylor's

= fi + nAx f(x)

, +

m!

dx,n function.

+..., If f(x)

## (2.3) is not for that

a continuous

differentiable

continuous, this approximation breaks down and difficulties dealing with discontinuous functions will be discussed later. all functions are continuous. Setting n = +1, we see immediately that

## may occur. Techniques For now we will assume

_
Eqs. (2.4) and for the low order formally of first of the grid proximation one n:l: sided (2.5) are called upwind schemes order accuracy.

1 Ax 1
Ax

(/,+, _ f,) +
(fi -- fi-1) -4- O(Ax). and sided

(2.4)
(2.5) are the basis formulas are by the power apthe with

one sided difference approximations, to be discussed later. These one The order of an approximation error limit term, as Ax since _ 0.

is given

spacing Ax appearing in the leading vanishes as that power of Ax in the approximations are first order accurate

by solving

for df/dxl_

df _x

i --

1 (f_+'ZXx

f_)-

(AX)

m! m-1 hence

## dmfi dx '_ Eq.

.... (2.4) as at

"

(2.6)

For a sufficiently order approximation The ary, properties available. first order where

## small Ax, the to df/dx],, approximations located undesirable in Eq. them

leading error term as is Eq. (2.5). are data in most and useful are not

## is a first a boundare the

in certain available),

(such their

symmetrically make

slow

convergence

instances the

if more difference

accurate of the

(2.3)

taking

_ the

dxdfI i+ second

3! order

dx 3

5!

d 5fl dx +

(2.7)

approximation

df dx

## --- fi+l 2Ax

fi-'

-4- O(Ax_). order approximation. to df/dx[, the for best The any choice.

that the

is not

the only

centered order

second case

defined

(2.7),

is a second

approximation

in n, so the

n = 1 is clearly

2.1.

BASIC

FINITE

DIFFERENCE

APPROXIMATIONS

15

first

and For

second example,

order Eq.

Higher

order of the

## be constructed T_. The

by taking following

combinations a fourth

an exact combination

for the

error

## approximation to df/dxl_: n2T_ T: =-T_ 1 term

order

n2error

df d---xiis again

(2.9)
that n

The may

## 1), giving (2.10)

as the

best

fourth

order

approximation

to df/dxli:

--

1 12Ax

[8(fi+x_fi_x)_(fi+2_fi_2)]_4_O(Ax4). are obtained by computing taking linear combinations error term. of Richardson can extrapolation, to obtain or the improved,

## (2.11) lower order approximations of the results with coeffideferred higher

over

Higher order approximations different intervals nAx, chosen above to cancel approach [4]. out The is an

then the

cients approach

to limit

Richardson

extrapolation

be used

order estimates discretization using linear higher tion Eq. obtained (2.6), Another to obtain different

## of any quantity parameter. One discretization

whose error is known to consist of a power series in some computes the lowest order approximation to the quantity parameters (such as nAx in the above example), then takes a

## combinations of the order approximation. parameter very appeared quickly. order

two most accurate lower order approximations to obtain In the above example, only even powers of the dlscretizain the power series, so that such parameter a fourth as the appear first and order order more approximation approximations work is required was circumstances,

of

## all powers a given common

discretization of Richardson

of accuracy. extrapolation a sequence then takes The amount formula - 2f, may resulting is Romberg's method for apre-

proximating definite integrals. to the integral, using different sults more to eliminate accurate the by itself. leads leading approximation

## One computes interval sizes, error for terms. a given

of trapezoidal approximations linear combinations of the approximation than does derivative yields the trapezoidal

a much

approximation

## to the following 1 (f,+l Ax 2 terms, which

second

of a function, (2.12)

+ f,-1)

+ O(Ax2). as

be approximated

## and which reduces to Eq. (2.12) for the

- f,) case _ = 1.

- f,-1)] + oCaz2),

(2.13)

16

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

2.2

A Brief ods
mastered the one the dimensional

Survey

Solution

Meth-

Having solve

basics

## of finite linear au ot wave

difference equation

approximations,

we will now

attempt

to

## au + a_x -- o, a -- constant, (2.14)

on a grid in the xt plane, at the points but" not necessarily in the t direction. to the We qua.htity solution equation. sequence The tiofi but and more exact are solution given u(x,t) at the a partial At later differential is obtained

(x_, t"), spaced evenly in the x direction (x_ =iAx) Let U_ - U(x_, t") be the numerical approximation points. equation from which data relates the time variations The to the yield the in a for all x values. approximation approximation once value we have value problem, approximate differential at equaa solutions

grid

u to its spatial at a time Repeated of advancing solution to the data; the initial complicated,

a numerical

## defineCl is called boundary

differential in which

an initial

problem.

## A related, boundary I will at the laws Instead because may be is

conditions as well as initial conditions over a finite spatial domain are specified. return to the issue of boundary conditions in Chapter 5, but for now we will look finite very difference literature and look large, solution of wave equations examination and commonly over _an infinite wave used solutions of all such domain. and chosen also conservation not only they is not feasible. because The we will describing a comprehensive methods for solving equations methods but methods,

a few representative

## concepts of numerical of problems.

2.2.1
The order first

First
simplest "upwind" order and

Order
least

Upwind
accurate Replacing yields four

Methods
methods time and for the space linear equation in Eq. are (2.14) the first

solution the

methods.

derivatives

by their

approximations

possible

solutions: 1 -

V/n+1=
U/n+l =

V_ - a(V_
V_ u(Vi__

V__l),
U/n),

(2.15)
(2.16)

_
where

u,"+1= u," - oCv, "+' - U"+'), ,-1 u: +1=u_-, ore-+' _,., - u,-+_),
At

(2.17)

(2.1s) (2.10)

o=._
is called waves the and Courant their number, forms after the Richard foundation Courant, whose work in linear today. and solution for much of the field

nonlinear

2.2.

A BRIEF

SURVEY

OF

SOLUTION

METHODS

17

glance

these of the

may

seem to

equally be

they any

## from were step be

approximations 3, but

of which

## However, Stability analysis

guaranteed to Chapter

## unstable for now

deferred

it will simply

stated that Eqs. (2.16) and (2.18) are unstable if a > 0, while Eqs. unstable if a < 0. "Instability" means that the numerical solution with to the the number initial of time value steps, problem. illustrate as follows: even though exponential growth given

## (2.15) and (2.17)are grows exponentially is not a valid solution

The stability criteria for the upwind methods numerical solution methods, which can be stated

a very general property of The domain of dependence equation must include For example, a rightpoint to the of the which curves may the include stability of

of the numerical approximation to the solution of the the domain of dependence of the original differential moving wave (with is governed by the right. grid grid the more Therefore point, points differential points which should than the a > 0) has a solution whose spatial variation of the wave numerical (2.16) but actually contribute are solution and (2.18) to the for now required, must do solution perhaps make not. by Eqs.

differential equation.

time evolution at a particular to the left of that point-not use One of information can define the to state more that to the left precisely one but

examining to improve

characteristic

equation,

it will be sufficient

accuracy,

requirements will depend in detail scheme is so named because the are Eq. value "upwind" Assuming (2.17) satisfying from that is stable the for current any a > 0, we find

On the particular scheme chosen. Note that the upwind points to be included in the first order approximation grid point. that If the Eq. (2.15) is stable stable Ax At < a,,_az la I At < (2.20) while and (2.17) (2.17) is stable when for any a < 0. At. lal provided is a,,,_, 0 < a < 1, while we may use any At largest

a >_ 0.

Thus Similar

approximation stability

(2.15) criteria

is stable

for

Ax/lal,
(2.16)

apply

to approximations

2.2.2
The method. at only previous implicit, values are

Explicit
approximation An explicit one grid point at values

vs.
of Eq. method

Implicit
(2.15) formula The method. by a set

Methods
is an example U_+I), implicit than one of a time value is given (2.17) point and of Eq. method grid explicit, at time explicitly is an in the rather in which than or simply step in terms the by explicit, of the an unknown n + 1 appears of a time unknown and a set of are

in the n.

step

example

implicit,

is one

## n + 1 appear equations. methods

approximation,

determined Explicit

## methods equations. than

to implement,

as they require

do not

entail

methods because

much

to evaluate,

implicit usually

simultaneous

equations

schemes

18
require for the step, similar computer problems. much error

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

## lengthy larger in the explicit time.

calculations time time scheme Thus there of "stiff" effects are largest role in the by the Mach state in which to follow small

to solve.

On

the

other

hand,

implicit

methods

are

stable

steps (often infinite, dependent numerical an implicit to achieve explicit are scheme the same are

as above) than explicit methods. solution increases as some power would level almost require always roughly but the same at a much of accuracy,

## However, of the time step as a in higher cost

so that

in general

time

methods

preferable

for time

dependent One scheme phenomena a time much step larger waves). One let the case is

Nevertheless, is the limited play small than Flows way and Once than solution by a major enough that Another to model evolve not again, need problem at very the corresponding

## methods time may step then

are preferable. velocities for an explicit the associated with but be used (such state solution

contain

large

characteristic

whose

or not

## of interest of unimportant fit into this

as convection),

dictated case

phenomena is in steady a set of initial dependent state expensive quite Thus solution steps

as sound

a small

carefully from

problem

while focus

now

on the

discussion

methods.

Two order

## Order from two This

Schemes deficiencies. is smeared smearing The out tendency because the first is low resolution. over many as numeridifferential In subsonic velocities be unstable, equation is useful points attempt the for

sharp

function)

## intervals viscosity, was

solution

is a nonphysical

effect

(nonphysical

equation

The second deficiency concerns the nature of the upwind stability criteria. fluid flow there is no simple upwind direction, as the flow has characteristic in all directions. unless the equations by boundary difference criteria method, series the approximated specifying Finite stability symmetric with order A direct are put application of the upwind but which is still make widely upwind form form. The complex flow is the scheme first, and will each therefore characteristic form problems. data early scheme after in characteristic

appropriate conditions,

## use of symmetrically direction.

possess at second a

independent

Lax-Wendroff time

[5]. We start

a Taylor's term:

approximation

t ", truncated

U: 1 = U: + At Ov Ot

(2.21)

2.2.

A BRIEF

SURVEY

OF

SOLUTION

METHODS

19

## (2.14) for the

may wave

be solved velocity.

## by substituting The result is the

-af/ax

for

au/at

in (2.21),

and

using

approximation

u,-+' = u,- - At
where a = a(U) in general. Making the approximations

+
spatially 1 centered,

,
order finite difference

second

Ofax ,
(

2Ax(fi+l-

fi-1),

(2.23)

a
gives When an explicit applied

(aaf
i-to Eq. wave

1
Ax 2 [a,+x/2(f,,x(2.14) which f,)is second the a,-,/2(f,order f,-,)], in time gives (2.25) of the sign of a: (2.26) one dimensional with a tedious simpler an unknown Jacobian if not for the of the method wave equations. vector 0f/0u task. sysand (2.24) space. accurate method

equation, -

Lax-Wendroff

method function

in one

dimension,

impossible

## MacCormack tems case. but is not MacCormack

an apparently

method reduces to Eq. (2.25) for the linear L:ax-Wendroff method for more complicated to Eq. (2.14 i maybe written

## wave equation, problems. The

solution

U,
U?+I

=
=

U? U/t*

At A---x(f;+xAt
2_--x

f?),
?i-1)

(f/

At - , 2-_-X (f_+l

-- fin),

(2.27)

=
This sided One the they is a two step explicit it is not to Ofn/ax chosen for but f. the the The two left method and function. could right are However, have direction opposed,

+
which a left a symmetric direction choice possible

At (/' - - ?,-1).
does method: direction not Eq. one for will the give require (2.27) sided for terms slightly the uses the Jacobian a right derivative is arbitrary, different of the direction of f" so long results flux one and as when

approximation

approximation

to O'f/Ox.

approximation choices

of direction

## problem. time steps schemes of the

MacCormack advocated switching the direction in order to restore symmetry. Switching entails in succession Lax-Wendroff in m dimensions, scheme. which can lead to

as those

20

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

2.3

The

Method
methods, while quite complex as the fluid

of Lines
simple to formulate for single one dimensional and tricky to implement for multidimensional The difficulties stem from the use wave equanonlinear of one-sided

## The preceding tions, become systems such

equations.

difference approximations in the case of the upwind schemes, and ous approximations of space and time derivatives in the Lax-Wendroff methods. These readily applicable We are initial data expressions :us to integrate More solution m is the components difficulties can be avoided by the method to any time dependent partial differential equations the spatial changes the o.f lines equation

## from the simultaneand MacCormack approach, solution. which is

given a set of partial differential at time t = 0. Approximating in turn the tells time suppose (For density, only us how derivatives we have and in the the solution to obtain a system e is the first

in space and time, along with the derivatives with finite difference in time at each grid time the time can point, step. components derivatives of a density, of the as allowing at a new describing If the system

solution

example,

we might

uj appear

degree,

be written

o_U

Ot

-- Pu,

(2.28)

any

of the

## coordinates no time u, and appropriate a spatially

x and derivatives Pu

t, as well of uj.

as In

spatial with

derivatives,

but

## approximate yielding the

derivatives approximation

in Pu

formulas,

numerical

## (PU)i point Then i:

centered

imation such as (PU), = -(fi+l - fi-1)/2Ax). for dUi/dt, the time derivative of U at grid

we have

a semi-discrete

dUi
dt (PU),. (2.29)

in principle,

any

ordinary

differential

equation

solution

technique

may

be used

to solve

the coupled set of ordinary properties of the algorithm are available. The reduction

## (2.29), as long as the stability sizes At. Many such methods

of a system

of partial system

differential by an ordinary

equations

to semi-discrete equation

form, solver, is

followed by the integration of the known as the method of lines. One effective integration method

differential

## for Eq. (2.29)

is the

classical,

four

step,

fourth

order

2.4.

DISSIPATION

AND

DISCONTINUOUS

SOLUTIONS

21

Runge-Kutta

method

[4], written = = = =

as:

1)
U_ 2) U_ 3)

U_ + _At(PU"),, U'_ + _At(PU(1)),, U_ + At(PUO))i, '_ + 2PU o[_'ste_l_'U_, Since below), the the (1) + 2PU the (2) + pU(S)), step U_ k), to Ax (2.30)

This and

## requires total error stability

the

current in the At

## intermediate last step. contributes is proportional

running

of the

of operators (given

appearing time

in (2.30)

is O(At4).

maximum

criterion

integration

an error

## spatial approximations involved in the time

should integration

## approximations use a second The following

are at best second order order time stepping scheme four step, second order

accurate (common in fluid problems), which requires less work to perform method is suited for such problems

1)
U_ 2) U_ s) U_ +i Not allows ' At only does Eq. steps (2.31) require

= = = = less

U'_ + At(PU"),, U_. + _At(PUO)),, U'_ + _At(PU(2)),, U_ + At(puCs))_. storage than master Eq. loop, (2.30), using and but its simpler struc'ture for

(2.31)

all four

by one

## a different the second

coefficient order

method

of (2.30)

method

the wave Pu

## criterion ]a I = If a second order operator, order

a_ At order such

<__amaz

(2.32) approximation is made, with integration.) is made then e,_z to Ou/Ox, -- 2.06. only

## centered as aOu/Ox, time

a,_z

-- 2V_;

centered

approximation

a = constant-and

also

a fourth

accurate

2.4
Consider

Dissipation
the initial value

and
problem

Discontinuous

Solutions

Ou Ou 0-'t- + aoxx = 0,

a = constant

> 0;

(2.33)

22

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

(
u(x,O) = Uo(X) = I

(
This to solve which many innocuous-seeming numerically. number and are grid monotonic intervals, The but problem techniques badly of a -- 0.5. 2) solutions is in reality previously The results with which fall the contain

1 0

x <_ O, x>O. with velocity a. We would discussed so far. most give difficult wave poor spread

(2.34)

The solution is a step function of unit height, moving solve this problem using the finite difference methods

like to

uniformly

say, a Courant

## 1) solutions out especially

smeared,

the discontinuity, but where the discontinuity is more sharply resolved than 1. The first order (upwind) methods yield the diffuse monotone solutions, higher order methods yield the oscillatory solutions. TheSe scheme This methods results which theorem which are explained by the to preserve following theorem [8]: Any linear first finite is guaranteed monotonicity is no more than

order

## high order solution The diffuse solu-

tions produced by first order methods solutions for discontinuous problems linear finite difference scheme will and resolution. Therefore we must the properties accomplished We begin semi-discrete of nonlinear by the careful by examining form: schemes blending more

## however, highly oscillatory The theorem states that no

satisfy the conflicting requirements of monotonicity turn to nonlinear schemes for improvement. While can seldom be analyzed of experience and linear the first and second analytically, theory. order much can be in

closely

approximations

dUi
dt _ The choice of time practice. Note that integration Eq. (2.35)

1 _xta(Ui 1 a(ui+l At 2 Ui-1) Ui-1) (First (Second order), order). but Eq. (2.31) plus a correction (2.35) (2.36) will do in term:

dt (The above

At

-5(

i+1 is in fact

U/-1)

(Ui+l upwind

(First

order).

equation

a general

## the appropriate of as the finite

direction difference

## sign of a.) The correction to the dissipative term

Oz
with a diffusion At. The coefficient added defined by the

At -_x
Courant (i.e.,

'
number the a and spurious the grid parameters which

Ax and

dissipation

damps

prevents)

oscillations

2.4.

DISSIPATION

AND

DISCONTINUOUS

SOLUTIONS

23

## be generated particular choice completely,

by the while

second

order coefficient

difference not

to to

of diffusion

## rl.l a,_) is exactly _ 2 -T

do so.

oscillations

a smaller

also smears (diffuses) imation to first order. dissipative consistent The good

the solution badly, and reduces the overall accuracy of the approxIn the limit as Ax ---, 0 and At ---* 0, with a = aAt/Ax fixed, the finite difference but it vanishes therefore approximation as a first order to remain term. for a

term vanishes (as it must, for the with the original inviscid equation), quest for a good coefficient. nonlinear We can scheme write the may

be considered as

as a quest

diffusion

equation

to be solved

a-7
with the understanding In the limit as Ax and c_ At, instead? time, units, come also in order Because

\ ax]'
our grid Therefore intervals are nonzero. we explicitly define

## that _ is nonzero only because At vanish, _ must also vanish.

that _ vanish in the appropriate to do so leads to confusion and problems, as we'll see later.

limit. (Why do we not define _ o Ax the violation of an isotropy condition in while At always has units of to We be are in different problems-angular Thus it would be difficult to the and These grid spacing.) terms dissipative

multidimensional

the spatial grid parameter for example, in problems up with require a general that the of the time expression relative step,

may have different units with cylindrical geometry. for _ which they sizes of the convective are a2

## independent met for

as indeed

requirements

= kate,
where and k is a dimensionless, is independent of the non-negative sign of a. The constant. case Note that _ is never the less than first k -- 1/2 recovers monotone

(2.39)
zero, order

result of (2.37). the best of both Note Burger's position, in order Eq. that equation, although to ensure (2.39)

The case 0 < k < 1/2 reveals that worlds, it can achieve the worst: the above where scheme a(u) works = u. just Then a, as

## while a linear an oscillatory well on

scheme may not achieve first order scheme! equation, are such as of functions 1).

a nonlinear

_,and

a = a(u)At/Ax

## At is not. conservation be converted

In this case a c3u/ax should be written as of/ax, and the correct shock jumps (as in Chapter into a nonlinear a_ ,: = kathy, scheme by defining

f = u2/2,

may

(2.40)

v depends

on the

local

solution

U.

We can

define

_ in such

a way

as to to In

## discontinuities and oscillatory regions, and where U is a smooth, continuous function.

0_/0 l _ Az x_ Oz \ az] i

24

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

for which 1 (2.42) a? _i = kAt_v_, Of the many possibilities we could pick At a_ = ai Ax" for v_, one of the most useful is (2.43)

## Iu,+l - 2U, + u,-l[

vi -- IUI+ x _ Ui[ + ]U_ This definition has vi = 1 if U_ is a i0cal_maximum a maximum only if Ui and U_+I are both local extremes, oscillation appear, varying to be so that wave damped. the above Note The that the may local wave prescription quantity be applied Ui-x[" (2:44) or minimum. Thus _+1/2 will be which is by definition a spurious speed ai and the Courant case number of spatially coefficient solution is (and ai to the general

velocities.

aUlo,I

la,I; hence

diffusion

## is as it should be, since the in regions where a_ is large.

The constant k sets an upper limit to the diffusion coefficient, and is left as a free parameter to be set by the user. Different problems will give the best results for different k values. The choice k = 1/2 cases k = 1/2 will be excessive, The preceding for analysis the (2.11), has approximation approximation solution cgu/cgx in which which should eliminate spurious oscillations; and a smaller value should be chosen. focused (or case the on the above choice scheme of a second One could would still order choose reduce Of/Ox) term. however, central the in many difference order order require

fourth to a first

for _, _= 1, but

is not guaranteed

to be monotonic.

one finds

## which do occur are more easily when second order approximations

2.5

The

Method

of Lines

in Two

Dimensions
is straightforward.

The extension of the preceding techniques We begin with a single conservation law cgu Of ag

## c9--[ + -_x + Oy =0'

or

f = f(u),

g = g(u),

(2.45)

Ou Ou b i)u c3---[ + aox + Oy =0' The two equations are equivalent. If a and

(2.46)

= u0 speed,

## ax _-+ + b' by with velocity

t) , components a in the

(2.47) x direction

2.5.

THE

METHOD

OF

LINES

IN

TWO

DIMENSIONS

25

The

second

order

semi-discrete dUii dt _

approximation

to Eq.

(2.45}

is (2.48) '

fi+lj

fi-lj

gij+l

gij-1

in the x, :

absence

of dissipation.

## to be uniformly (2.45) in the

spaced, form

with

lAx, Yi = jAy, and U_] =-- U(x_, Yi, t'_) Dissipation is introduced by adding diffusive

to Eq.

a--i+_ + a-_-a_\
where
tTij,

a_J+_\
_ in terms

ay]'
i

_ ---} 0 as At

--} 0, as before.

We define

of the

local

Courant

number
i

## Ay]' and the largest

local velocity component eli = max(]aij[, ]bij]):

## c.2. _ij = kAt-s__Lu_j,

o_j

(2.51)
;_

where

a useful

(but

not

unique}

definition

for

v,j is

(
v,y = The ness same
max _klV,+ly

## IV,+ly - 2v,y+ v,-xyl

_ Viyl -_ IViy Vi-ld]'

## iv,y+,- 2v,y + v,y_l]

[Viy+l Viy] _ IVid Vid-llJ "

(2.52)

definition definition

## for _ is used of s is required

in both by the

dissipative transformation

terms

in Eq. properties

(2.49).

This

uniquefields, a

in the

of scalar

subject The

## which will be taken up in detail in Chapter second order semi-discrete approximation

fi+ly -fi-11 giy+l --

4. to Eq.
giy-1

(2.49)

is then

2Ax 1 1 [_,_+l/,(V,., + Ay-----_ _ _ where 1 #i+1/2i = _(tciy The stability 2.3, 2.3. properties and with of this maxa, + tCi+lj), are

2Ay (2.53)

## [_,+,/_(u,+ly - v,y) - _,_,/_y(u,y - u,_,y_]

U,y) _,y_,/,CV, i U,y_l)]

## 'Y + _'i+')" the Eq. one (2.50), dimensional and a,na,

(2.54) case of

scheme

as for by

section in section

y < a,_:,,

for a as defined

as given

26

CHAPTER

2.

FINITE

DIFFERENCE

SOLUTIONS

OF

WAVE

EQUATIONS

2.6

Exercises
approximation to

1. Using the fourth order sixth order approximation. 2. Compute the first

df/dxl_

given

in Eq.

(2.9),

compute

the

second and third order one sided approximations order one sided approximation of Eq. (2.6). exercises are numerical solutions O' of the

to dfldx]_,

starting

with

The

following

two initial

value

problems

Ou Of 0-_ + ox

f = au,

a = l,

or
Ul(X ) :

e-[("-o.15)/o.ll _,
_ 1 x<_0.25, x > 0.25. solution Ui for grid through 102 from the new 100 time time steps. steps

u2(x)

t
In all points initial (In conditions, words, but hold do not the recompute

cases let Ax = 0.01, x_ =iAx, and compute the numerical i = 0 through 100. Define initial values for U_ for i = -2 U-i, values U-l, fixed boundary with time.)

## U101, or U102 at the Compute

other

at a Courant number a = 1/2. At time step 100, plot the analytic solution ul(x - at) or u2(x - at) as a continuous unmarked curve, and the numerical solution U/", n = 100, as dots at the positions (xi,U_'), i = 0,..., 100. Use the computer to plot as well as compute the results. 3. 4. One sided (upwind) method scheme scheme (2.22) (2.31) (2.15) with with with ul and (PU), ul and u2 as initial data. - fi-1)/2Ax, using ul and u2 data.

Lax-Wendroff

u2 as initial = -(fi+l

.

Same

as 3, but

the

## dissipative 3), with

term _ given

of (2.41) by Eqs.

to the

right

hand and

side

(i.e.,

to 0.2,

.

in problem

(2.42)-(2.44)

k =0,

using using

the

fourth

order equation

Burger's

size at the

boundary = -U1,

## antisymmetry, given match the analytical

by U-1 solution?

Chapter Stability
Chapter 2 presented conservation laws. accuracy, racy ter and I will stability and limits present efficiency for

3 Analysis
several approximate The criteria used to Of these are methods equations. stability irrelevant for in Chapter of a method the a general for wave finite select difference solutions for one dimensional an appropriate technique are stability, most stated the important, is unstable without stability proof. as the formal In this accuThe chapif the 2 were determining method in practice. of finite

efficiency.

is the

technique

difference

approximations

3.1

The alence

Consistency Theorem
equations

Condition
we wisht solve may

and

the

Lax

Equiv-

The

partial

differential

be written

in the

general

form (3.1)

0__uu = Pu, at where P is an operator which acts on u to give its time be nonlinear and contain any combination ofpowers or unknown contain data domain time are given, with Replacing yields the elements derivatives and the the spatial uk, or any of u. only the pure initial value problem, for which over difference the spatial derivatives derivative. The quantity of the spatial coordinates, combinations, but Pu may

## may time, not

of these

As in Chapter

2, we consider time

initial spatial

dependent or boundary

solution in P with

## is to be obtained, suitable finite

an infinite

no boundaries

conditions. approximations

derivatives approximation

semi-discrete

dU, dt where Ui Given the new is the approximate data at time level value

_ (PU),,

(3.2)

solution for U at the ith grid point. t", we integrate Eq. (3.2) to time level function of the 27 old values

## t n+l = t _' + At. co.

Thus The

of U_ +1 is some

U_+ k, k = -co,...,

28
functional relationship between the new and

CHAPTER

3.

STABILITY

ANALYSIS

old values

may

be written (3.3)

U_ '+I = C(At)U_', where the operator C(At) acts on Ui and the depends on At. is an approximation

We know from section (2.1) that to the time derivative of Ui, hence

quantity

(U_ +1 - U_)/At

C(at)U"-U"
At must be an approximation The consistency condition to PU. therefore requires that

it{c t,,} p I
At P U,(t) where The intuitively

_0

as

At-v0,

(3.4)

Ilfll

is any

valid

norm=of concept,

I is the that

## identity but the finite

operator difference

## [5]. a formal statement equation methods of an which in of of may approximations

consistency meaningful

condition

imposing,

it is simply

are used in the numerical solution of a differential equation must yield that the limit as all grid spacings go to zero (i.e., as Ax --. 0 and At --, 0 for the Chapter 2). The derivatives consistency by valid condition finite is automatically we saw in Chapter to discontinuous satisfied by any so the one-to-one

replacement

difference

approximations,

insistence

on consistency

seem redundant. However, the finite difference solution represent differential must spacing problem be

2 that dissipative terms were required in problems, even though these terms do not terms appearing in the these added dissipative in the limit original terms grid

finite difference approximations to derivative equations. Thus an approximation containing defined in such a way that the dissipation in order to retain consistency different from the one whose

vanishes

of zero

(otherwise our finite difference method is solving a solution we want). The dissipative terms in section defined g so that inconsistent, and g # 0 as At _ 0, guaranteed not to

2.4 vanish as At _ 0, because Ax --, 0, then the approximation converge to the correct answer

## g 0 At. If we had would have been in this limit.

The definition of consistency given Given a properly posed initial-value that satisfies the for convergence. The proof consistency theorem condition, assumes

above leads to the Lax Equivalence Theorem problem and a finite difference approximation stability is the necessary operator, provided will and but the sufficient in practice dissipation to the

[5]: to it

of the

to hold

## for nonlinear stable

established next

that

schemes stability

converge

we proceed

to define

of finite

difference

3.2.

THE

VON

NEUMANN

METHOD

FOR

STABILITY

ANALYSIS

29

3.2

The sis

Von

Neumann

Method

for

Stability

Analy-

## According t + At. Thus

to Eq. initial

(3.3), data

the

operator data

C(At) at time

the

solution the

from repeated

time

t to time application

U yield

through

of c(At),
A scheme

.....
U_'--[c(At)l"v . (3.5)
is stable if there exists a r > 0 such that the set of operators [C(At)] n is for 0 <_ At _< r. In other words, the numerical solution may not grow without

bounded

bound (provided that the correct solution does not). Conversely, a numerical scheme which is unstable will exhibit unbounded growth, and this growth is virtually always
..... L -

exponential. Note that computing a bound for [C(At)] _ isnot trivial, as C(At) isan operator, not a number. Fortunately, a straightforward{echnique for transforming the operator C(At) into a number the Von does exist,when method C(At) is a linear operator. The technique is known as

Neumann

## and is described below.

.... _ . _.i ,_._ _i ' !.

3.2.1

Fourier
once

Analysis
again the linear

and
wave

the

.Linear

Wave

Equation

We consider

equation (3.6)

Ou Ou 0-7 + aoxx = 0, ! and to be is the f(w,t). f(x, ! i bound. The Fourier transform of the examine frequency and If in turn the behavior tool spectrum we take f(w,t) for of the this of the the numerical function,

a = constant, solution The f(w), and for Fourier u. Fourier transform analysis of the the turns frequency spectrum frequency

a convenient

examination.

of a function

If f = f(x,t)

Fourier

## transform increasing since the

of the frequency

is a monotonically function,

of t for some

t) will be an unbounded

w0 grows

without

x dependenters: _ :_ 1

of,. a function

u(x,t)

may

be written (3.7)

e-'WZu(x,t)

dx =- _(w,t),

-" i

and out.

is finite

if u(x,

t) _

0 sufficiently

quickly

as x _

_c_,

which

we will assume

through-

The

derivative

Ou/cgx

transforms

according

to

i
which
=

## {0_ is obtained upon

)} integration

oo

_x

(3.8)

by parts.

30
Taking the Fourier transform of the linear

CHAPTER

3.

STABILITY

ANALYSIS

wave

equation

(3.6)

gives

a--t -t- {waft = O. Notice w. The equation The that effect with solution Eq. (3.9) is an ordinary differential equation for any particular partial choice

(3.9) of

## been to replace a single differential equations.

differential

_@,t) = e-'_'"',_(w,o),
and therefore

(3.1o)

_@,t) _@,0) = 1.

(3.11)

Although the phases of the components of the frequency spectrum change with time, their magnitudes do not. Indeed, this is the behavior we would expect, since we know the solution to be a traveling wave of constant shape.

3.2.2
Previously the but point

Fourier
we have (x_, tn).

Analysis
taken For the

for

Finite
numerical of this that

Difference
approximation we will Uik is a function

Approxlrnations
to the adopt defined exact by solution different, at

chapter,

a slightly

equivalent,

interpretation,

assume

## U_+ ,,k _ U(x which

as

-I- kAx,t

)j,
Zi'

(3.12)

we happen

to sample

at discrete

points.

Thus

any

derivative

approximation,

such

ov .
Ox is also a continuous Ax Assuming

i _

## v_+l- u?___ v(x + Ax,t") - U(=- Ax, t-)l

2Ax = 2Ax and we may compute we have its Fourier constant,

I,,'

(3.13)

function, to be a fixed

transform.

z{u(x,t)}=O,
7U(x The variable ( is referred (hence dimensionless). + kAx, t)} = eikeO, _ =_-wax. frequency, and is an angular

(3.14)
(3.15) quantity Let sided

to as the

dimensionless

We can now compute the Fourier transforms of finite difference approximations. A--6(")U,_= = , be an ruth order approximation to cgU/cgxli. Then we represent the one approximations by 6(I)-U_ = Ui - Ui-1, 6(1)+Ui = Ui+i - Ui,

(3.16)

3.2.

THE

VON

NEUMANN

METHOD

FOR

STABILITY

ANALYSIS

31

and

the

centered

approximations

## _C,)v, , : 118(u,+, - U,_l) - (v,+, - v,__)].

The have second derivative, i)2U/cgx21_ is approximated by 1 2 ('_)U_, to order m,

(3.18)
and we

## 6_ {_)U_= U_+l - 2U_ + U__l.

The transforms are f{6_X)-V,} = (1e-'_)_ r, 7{6,(*)*U,} = (e '_1)Lr,

(3.19)

## _{6_)v,} = (isin )0,

7{6(4)U_} = il[8sin _sin(2_)]0,

## r{_: C2)v,} = -4sin_(_/2)0.

3.2.3
We can the linear

Stability
now state wave (3.6), the equation. implicit

Condition
Von Neumann All one or explicit,
oo

for
step can

Numerical
condition finite difference as

Methods
for numerical solutions approximations to the linear to wave

stability linear

equation

be written
oo

l_v_'=
k=-oo

_
k=-oo

r_v?,_,
transform of Eq. (3.24) gives

(3.24)

where

the

lk and

rk are

constants.

Taking

the

Fourier

(3.25)

from

which

we see

0 "+' =g()O",
_._=-oo where g(_) is known The Von Neumann approximation C3.\$4) as the Fourier amplification stability condition is the requires that g(_), rk eit_ .factor. following by Eq. -Tr<

(3.26)
(3.27)

of finite

difference

as defined

## satisfy (3.28) number of time to steps. _ in

[g(_)]_l, Otherwise The practice, the as the numerical following solution may examples

## for all,in grows appear show. exponentially

with but

the

preceding

formalism

complicated,

is simple

implement

1A more general condition allows for exponential growth when such growth is a valid solution, and requires g(_) < 1 + O(At) [5]. This situation occurs when a source term bu is added to the right hand side of (3.6). For most problems condition (3.28) is sufficiently general, and will be used in these notes.

32

CHAPTER

3.

STABILITY

ANALYSIS

3.3
Let Eq. us (2.15)

Simple
first is consider

Upwind
the upwind

Schemes
schemes of section - e-ie)]0 2.2.1. ", The Fourier transform of

0 "+1 -- [1 - a(1

(3.29)

g(()

= =

(3.31)

## by its complex [g(()[2

conjugate

_- 1 - 4a(1

a)sin2((/2).

The

worst

case

has

_ -- _r, for which Ig(r)[ 2 : a(1 143(1- a) > O, (2.15) to be stable. (2.16) on the of Eq. -- e-'_)0 sign (2.17). "+', is -1 of the Its A similar < a < 0. a. is (3.35) (3.36) velocity a) _< 1, (3.33) (3.34) calculation Thus the

and shows

we must that

_n+l ---- 0n

__

stability

of the

Consider

Fourier

transform

a(1

## g = 1 -- a(1 -- e-'_)g, 1 g(_) = 1 + a(1 - cos _) + iasin _'

(3.37)

ig(5)l 2=
1 + 43(1 Again the worst case occurs at _ = _r, and the

1
+ a) sin2(_/2)" condition Ig(_)] -< 1 implies (3.38)

o(1 + o) _> o,
and the a<0. method is stable for any a >__ 0, Similarly, approximation (2.18) is stable

(3.39)
for any

3.4
The

Simple
simplest centered

Centered
method we can

Methods
have
1

is the
n

approximation

(3.40)

3.4.

SIMPLE

CENTERED

METHODS

33

The 1 [i_!!i

Fourier

transform

of (3.40)

## Ig(OI = = I+ o=sin 2f,

so that approximation (3.40) is unconditionally In Chapter 2 we found a dissipative term difference for suitable integration approximation, time steps. is of (2.37) produced The dissipative an upwind term unstable! which, when scheme is given in Eq. added (2.37), to the and simple a first

which

we now

know

to be stable

(3.43)

The

Fourier

transform

of (3.43)

## 9(f) = 1 -[,_1(1- cosf)

la(01==
and the stability condition is

1 q- 4(a 2 --]a[)

sin2Cf/2),

o=-Iol < 0,
which original may is satisfied one-sided for that a stable [a I < adding scheme. 1, and is independent to a centered we now consider of the sign of the which general velocity, is originally scheme unlike schemes. dissipation Thus scheme a more

(3.46) the

We conclude produce

## u?+1= u? where Fourier a = _At/Ax 2 and of Eq. transform (3.47)

1 , o(V?+l- u"_,) + 5,_(v;+, - 2u? + U'* ,_1), diffusion coefficient, as in Eq. (2.38).

(3.47)

_ is a constant gives _-

The

g = 1 - iasin

2ct(1-

(3.48) (3.49)

+ 1632 sin4({/2)

= [2a-a

2+(a

>0 Analyzing

specifies

a relationship

## limits on the a maximum of a.

approximation

34

CHAPTER

3.

STABILITY

ANALYSIS

3.5

The

LaxoWendroff

and

MacCormack
when

Methods
applied to the linear

The Lax-Wendroff and MacCormack wave equation. The corresponding g(_) Using Eq. (3.50) with a = as2

methods yield Eq. (2.25) Fourier transform gives + as(1 cos _).

= 1 - iasin_ gives

(3.51)

(a s - 04) sinS(_/2) or [cr[ < 1 for stability. These methods have the although Eq. (3.43) is a first order accurate method, Cormack schemes are second order accurate.

## (3.52) Eq. (3.43), and Mac-

3.6
In the value

The
previous

Method
sections explicitly

of Lines
we have analyzed of the the stability of a method U/". Obtaining by writing such the new

of U, U/"+I,

in terms

old values

an expression

for a method of lines the many substitutions of the added semi-discrete begin dissipation We'll

## integration (substeps) first, and the

such as (2.30) or (2.31) is a tedious business, due to involved. It is simpler to take the Fourier transform then impose and a time form (2.41), integration of the linear algorithm wave [9]. with semi-discrete (2.39) equation,

form given

by considering

by formulas

dV,
dt
L

d_Cm)Vi "[-

lg 2 (v/+l _-_X

--

2vi

Vi-1)'

(3.53)

a s

= kAt_l, where (3.18). _("_) is an rnth order undivided Eq. (3.53) may be written dUi dt and its Fourier transform 1 difference operator, as given in equations

(3.54) (3.16)-

_
is

At

dt -

(3.55)

1
At

AU, sinS(_/2),

(3.56) (3.57)

- 4klo[

pCS)(_)

= sin(_),

P(')(_)

= l[8sin(_)

-sin(2_)].

(3.58)

3.6.

THE

METHOD

OF LINES

35

3O

2O

IO

0 L
-41

30

20 Re(A)

I0

"t-I0

3.1:

regions

## for Runge-Kutta by permission

methods

of order

1971

by

Reprinted

Press,

At (3.56)

this with

point either

we have method

two (2.30)

options. or (2.31),

The

first both

## is to perform of which give

the

time

integration

of

g= I+A+
The condition [g(_)] region, such that the Much the limit to the Eq. gives the Page Fourier second 120 of the effort transform option, of the regions plane

h 2+6 1A _ + 1A4"24
plane stability known as the region. avoided effort the involved equations. here the as Figure

(3.59)
stability

_< 1 defines a region in the complex method is stable if A lies within the of obtaining before a non-trivial which on the book for by the a stability time t_k, is to look numerical Lapidus several and up and limit a desire the integration. stability of ordinary [10], figure The methods

## for A remains (3.56) in a book

integration

solution

Selnfeld

reproduced shows

stability complex

methods.

stability

regions The

of A for Runge-Kutta

of order

p, p -- 1,...,5.

curve applies for methods (2.30) and (2.31). z -- +2V_i, and real intercepts at z -- 0,-2.785. real axis implies that the sign of the velocity and If k = 0, no dissipation lie in -i2v_ < A < i2v/2. is added Hence

on the

A = -iaP(m)(_)

is purely

<_ 2v ,

(3.60)

36

CHAPTER

3.

STABILITY

ANALYSIS

and

the

value P(_a}z =

by and

the a <

largest 2.0612

value

## of P('_)(_). for stability order stability the

We quickly if a second

= 1.3722,

hence will

## a _< 2v_ decrease with

if a fourth

approximation is made. (In limit even though it improves At the other extreme and replace h _< 0, from conduction stable spacing spaced to be time mesh stable, kla I in (3.57) by which we see that problems, step may which more by a factor where of two therefore suggests difficult is proportional

## k = 0. Dissipation of the solution.) purely dissipative

we consider

problem,

a = a = 0,

2. Then h = -4_a-_sin2(_/2), 2 < 0.6963 for stability. In real nonzero square allowed function of the time small scheme of the grid step time might by solution a factor step be more spacing.

and -2.785 <_ diffusion or heat u, the Reducing of four. efficient, maximum the grid A finely scheme though

## _ is some decreases require that

a prohibitively implicit

for an explicit

considerably

to implement. we are considering a purely dissipative here, _At/Ax 2 = k[a[, which vanishes problem while a is nonzero. However, that the second term of Eq. (3.57) k is restricted by the requirement of k as a function of the Courant If lal does enough to from

For the added dissipation as a ---* 0, so we cannot obtain if a is sufficiently dominates over kla I <_ 0.6963 A general

small, we can make k large enough the first, and we may conclude that relating the maximum value

for stability. expression cannot be derived half of its upper The practical analytically, but is not really necessary. limit, one can in practice make k large condition is to compute the time step

## number a probably not exceed roughly damp any oscillations.

at = axe,
where optimum a is a Courant value obtained number which is less than the maximum value, and to set by experimentation (e.g., lal = 1, k = 0.3).

(3.61)
k to an

3.7
Stability and we

Stability
analysis can use the one

Analysis
dimensional in two

in Two
dimensions results dimensions is very with

Dimensions
similar only to the one dimensional t), which case, may slight modifications. u(x,y, We start

## with the Fourier be defined

(x, y) of a function

## _'{u(x,y,t)} It follows that

= _

O0

dx

dye-iC_x*+_'_)uCx,

y,t)

=- _(wx,wv,t

).

(3.62)

+ mz ,y +
where =-- wzAz,

= eim e'n"O,
77 = w_Ay.

(3.63)

(3.64)

3.8.

THE

METHOD

OF LINES

IN

TWO

DIMENSIONS

37

(3.24),

any

one

step

linear

finite

difference

solution

to the

linear

equation

be written
oo oo

s_,v,+k,j+,=
TTr_-t-1 k,|=-vo

_
k,l=-oo

n rk,VLk,j+,.

(3.65)

where by

the

## ski and the

rkl are

constants. transform of Eq. (3.65) and define the amplification factor g(_, ,7)

We take

Fourier

0-+, = g(_,,,)O-.
The Von Neumann condition is then --_r_< _ <_ r, -_ <_ _ _< _r.

(3.66)

i9(_,.)I <I,
3.8
As in the discrete

(3.67)

The
one from dUij dt

Method
dimensional first, case

of Lines
of section

in Two
3.6, we write the

Dimensions
differential equation in semi-

I

## n +_-_(u,+,_ - 2u,_ + u,_l_) + h-_y_ (v,i+, - 2u,i + u_i-_),

i c2

(3.68)

n = kAt--,

o"

e = max(lal,

Ibl),

.....(3.60).,
to get

with

a to be defined

below,

and

then

take

its Fourier

transform

"-d7-- _
i
# a_t

dr} (m" '(_)we simply integration by Eq. the case values imaginary ib_--_fP ('_) 4_

1 AU At sin'(_/2)4_A_-_2 sin_(rl/2 Y complex or (2.31) (3.71). imaginary, Since -I-i2V_, the ). plane

## A=-,_-xP Once again particular get Consider achieves values time

_Y (,7)_x 2 look up the stability region method (3.59), of no for r/= axis we use. but with dissipation q-_ such for which If either (_; -- 0). that the P('_)(_) method

is used,

A as defined

## in Eq. A is purely are

is maximized. is stable

extreme

we see that

lal Ax

(3.72)

38

CHAPTER

3.

STABILITY

ANALYSIS

(The signs,

value case

signs the

are most

used

in (3.72)

the Courant

case

## a and P("_)(r/) in two

b have

opposite in by

extreme

A occurs

p(m)(_)

maximum dimensions

magnitude

of opposite

sign.)

If we define

a
we recover the familiar stability

## = (lol Ibl t, \Az + Ay]

of (3.60), written as aP(_a)__< 2V/2.

(3.73)
(3.74)

limit

## If m = 2, a < 2V_; from

if m = 4, a < 2.0612.

We select
O

a stable

value

for a and

compute

At

## At The case where dissipation dominates

--

I_1 +
Az

Ibl"
Ay

(3.75) result

to the

_
which versa: for _ as defined by Eq. (3.69)

+
puts

## ,_At _< 0.6963,

an upper limit on k for any given At,

(3.76)
or vice

3.9

Stability
into the fluid a value

Limits
5, the an equivalent velocity, and velocity

for
three set

Fluid
of coupled of the speed compute Ax the

Dynamics
of one system, time At from step dimensional wave namely for the nonlinear of sound.

Problems
fluid equations. v c, v, dynamics The and system. to expect may wave v + e, that We

As we will see in Chapter be transformed velocities where the therefore largest are v is the pick

equations

characteristic

## velocities c is the determines

It is reasonable whole

characteristic

## for a < a,n_z and

At

= amax(c_

),

(3.78) (3.79)

c, = Ivl + c,
where the the maximum dimensions velocities is over the are all points vv on the grid. velocities we set are In two x direction characteristic
a

v= - c, vz, v= + c, while

y direction

c, vv, v v + c. Hence At =

max

(_

Az

(3.80)
_y

## _, = lv=l+ _, c_= Iv_l + _,

where The previous given the maximum section. in Chapter is over properties A more 4. all points of the detailed on the two dimensional are grid, and the a <am,=. same systems stability dissipative discussion terms essentially

(3.81)
as in the will be

of dissipation

for nonlinear

3.10.

EXERCISES

39

3.10
1. Verify

Exercises
Eq. (3.11) and Eqs. the in the one given and two dimensional 2. cases, using the explicit solutions

for u(x,t)

u(x,y,t)

in Chapter

i
2. 3. Derive Compute (3.20)-(3.22). stability limit for the approximation
G

## u,-' = v,- - _(v,- - UL2).

Could 4. Derive 5. Find Eq. you Eq. the (3.59), have (3.50). and imaginary intercepts of the complex equation number. Ig(A)l = 1, with g given by predicted this result?

real and

A taken

to be a general

i
i

i !

Ill

the terms,

need

## for artificial The acted

viscosity artificial

in finite viscosity

approximations

discontinuous

to damp

numerical

## a few grid dissipation in the

requirement dissipative

satisfy

is the intervals

consistency go to zero.

condiCon-

tion.

The

## as all grid dissipation, satisfy the

sistency is a necessary condition for valid artificial One could define an infinite number of terms which which The viscosity. dissipative begin. do not have the of this and appropriate chapter first it is with behavior. is to the define the the

## behavior" of the dynamics

for

artificial nonthat we

we must

understand system

original

of inviscid

equations

4.1
Tensor quantities

Conservation
calculus because is the natural one

Laws
language to write

and
in which general

Tensor
to express

Fields
conservation are coordinate laws for field

it allows

equations

which

invariant,

i.e., which are valid in all coordinate suffice to describe the conservation properties tensor following text. tensor The of vector description sections, interested for the calculus, fields. will but be reader details. As the employed.

## systems. of scalar momentum A brief to the

The simpler techniques fields, but are inadequate density review book of the by is a conserved of tensor formulas Weinberg calculus

of vector calculus to describe the vector possible or any field, the is given in the in this text on

a comprehensive is referred

derivation

is not [11],

41

42

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

4.1.1 A tensor

## Tensors is represented symbolically by a symbol (such as a Greek or Roman letter) as to the

followed by some number of upper and lower indices (superscripts and in T"bcae. The indices may be either letters or numbers. A numerical a particular understanding The total tensor that number component, giving the of indices while index is the a letter rank index value refers singles (The a numerical of the out a particular

tensor.

## a rank from of A_. have

of 5.) In a coordinate 1 to n 1, and a tensor the one and second index, are rank and tensor zero are Tensors of rank referred in matrix are

syste m with n dimensions, of rank r has n" components: A_ in 3 dimensions have no indices, as tensors. and called and vectors. are are Tensors as objects Tensors treated A_,

each index represents For example, the A_, A_, scalars. two, satisfy systems, of which rectangular in which to relate of higher of rank which A_, rank AI, Tensors have however, certain A_,

## a number 9 components A_, A_, of rank no special and one

called

usually format,

names,

to generically defined

2;11

are sometimes

## as matrices. one of which has coordinates coordinate the two

Tensors

mathematically

properties. Suppose we have two coordinate written as x a = (xl, x2, xS), and the other One the example and of two the such systems coordinate are the x" = (x, y, z), following spherical

2 r ,x3').

## in which can define

system, matrices

x _' = (r, #, ).

coordinate

transformation

A_, = Ox_,, A tensor tensor ...... where to n), repeated so that indices, Eq.(4.2) with one up Tb_ in the Tb_, ' in the unprimed coordinate according T_,' and
=

ax"
system to

ax,,' Oz _ .
be transformed into

(4.1)
an equivalent

may

primed

system

A,_' ._bf.Lb ,"Va _L a,_,b ' one down, are of summed over their range

(4.2) (i.e., 1

is a compact

representation
Tt n

T_l

(4.3)

a=lb=l

with

upper

indices which

only

An to

example

is the

coordinate

u _ = dx'/dt,

## u_' = A tensor since with only lower

dx _' dt -

_, A a u_. s_ of a scalar

(4.4) S is covariant,

indices OS so,-

is covariant. cgx _ OS

The

O_;"' -

Ox"' O:_" -

A:,s,,.

(4.5)

4.1.

CONSERVATION

LAWS

AND

TENSOR

FIELDS

43

The and

coordinate

## transformations systems 2 about are The the

defined same.

above Translations

assume

that

the

origins

of the which

## original move the

transformed

(transformations are coordinate of C1) and systems 2+y2+z 2 (1) rotations geometry (2). are related of a rectangular

allowed some

## of a particular system to another by about (e.g.,

axis (e.g.,

a 45 rotation

x = y -- z); (2) transformations to spherical); rectangular x or (3) any and example, spherical

rsinScos,

## y = r sin 0 sin , z = r cos 8,

_,
Z

(4.6)

y/x.

4.1.2

Coordinate

Systems

and
and for

Metric

Tensors
spatial denoted coordiby x a that it

Let t represent the time coordinate, nates. The vector x a is a contravariant need all has not be rectangular coordinates; while cylindrical coordinates,

x a = (xl,x 2, x 3) represent the vector. The coordinate system example, the choice spherical our with coordinates. At

x a = (r,,z)

## x a = (r, 0, ) represents is moving coordinates ua _ through change dxa dt ' The

indices run from 1 to n.) Now consider an object which spatial coordinates x a, but velocity the a coordinate u a by

system. time.

any

time

Consequently

we may (4.7)

define

i.e., ant

## is a contravarlcoordinates. throughout The by

derivatives physical

## coordinate va, which a tensor! the physical Clearly physical

[]

is the rate For example, velocity with we velocity. metric tensor need To spanned respect

of change of distance along the coordinate axes the coordinate velocity in spherical coordinates components to time. the coordinate have tensor from Intensor metric moves of the velocity some way calculus, coordinates. position of small to the to these relate two second more to relate do by g_b. particle where
spacetlme

and which is not is (_,/_, ), while the dot denotes notion changes are tensor, related whose (x _ + so,
time

derivatives

intuitive

of to

so, The

we must

## coordinate quantities rank

the

distances

them.

by the

is a symmetric

components Suppose

## are usually our test

functions

x a = (x 1, x 2, x 3) to x _ + dx a = coordinate
more

dx 1, x 2 + dx 2, x 3 + dxS),
2The four dimensional

dx a is a set
of general

differentials.
general transformations,

In doing
as

relativity

involves

is one of the coordinates to be transformed. Lorentz transformations assume coincident origins for the original and transformed spacetime coordinate systems, which means that the spatial origins of the two systems coincide at time t = 0. Lorentz boosts are particular transformations which relate two systems moving with respect to each other, and thus produce time dependent translations.

44
the particle

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

traverses

a distance

ds given

by b. that only n(n + 1)/2 A general of its metric similar (4.8) n 2 compoin three to a matrix,

ds 2 = gabdx"dx The nents dimensions symmetry may be may unique of the (six be written metric tensor implies in three

components schematically

dimension_).

by a 3 3 array

of numbers,

g "b=

g2t gn g31

## g_s gls ) g33

(4.9)

where

by symmetry

= g o.
In orthogonai each other, the coordinate metric tensor systems, is diagonal, where :the coordinate be written axes are perpendicular and may

(4.1o)
to

gab

(4.11)

where

factors

directions

(and

the

## superscript to know the

2 represents the square of the number, A diagonal metric simplifies tensor contravariant (inverse) metric

we need

(4.12)

where

is the

Kronecker

delta,

g,_b is simply

gab = hi -2

h_ 2 h_ 2

(4.14)

The

inverse

of a general

tensor

is considerably

more

complicated.

4.1.

CONSERVATION

LAWS

AND

.TENSOR

FIELDS

45

tensor

## importance, but and index same because vice-versa,

not

only

because

it defines to as where

the

If a is a lower

we wish

b index

U b = gabub,

## Aab cd = gaegbfA eyed,

(4.15)

and

so forth. We can per by the The not now compute in the diagonal distance the affect the metric traversed others iis ds = hjdx j physical velocity, directions Let by a motion defined the above as the rate have jth of change system components of (des by dx j time, coordinate of an orthogonal physical changes which the coordinate

## distance, scribed and does (vl, v2, v3).

of (4.11)).

velocity

coordinate

(not summed),

(4.16)

hence vj = hju j = uj/hj Thus in spherical velocity metrics below. x a = (z, y, z) The given coordinates Ua is (_,r20, and inverse the metrics contravariant and the for the three (not summed). velocity velocity used (4.17) u a is (._, 0, ), Va iS (_,r0, coordinate rsin0). are systems the

## (coordinate) physical most often

covariant

r2 sin 2 0),

Rectangular

gab =

Cylindrical

x" = (r, , z)

i i 3Remember,

gab =

(1/ /1) / } / }
1 , gab __-1 , 1 1 1 1 r2 , gab = r_ 2 , 1 1

(4.18)

(4.19)

## the physical velocity is not a tensor!

46
Spherical

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

x a = (r, 0, )

gab --=

/1 / /1 /
r2 , gab = r- _ . r 2 sin 2 0 r -2 sin -2 0

(4.20)

4.1.3
New same

Combining
tensors type may may

Tensors
from old tensors of that in a variety type: (4.21) tensor of rank m + n, (4.22) (one rank up, one down) less than are the the same, of ways. Two tensors of the

to give

a third

Ab_ = Bb_ + ebb. The product of two tensors of rank rn and n is a new

Aab cd -_ Bab Cod, provided the implied as in no two indices are the same. a new If two tensor indices whose

summation

produces

is two

## original, (4.23) (4.24)

R_' = S _ be, Tab : The tensor the sum produce summation calculus. increases a scalar As R, process the is often called Fade Gbc de. contraction, involved contraction the and increases, is a frequent the number occurrence

in in to

number

of indices

of terms itself

## rapidly. For example, according to R

=

of a tensor

R_b_d with

Rabcd

Rabcd,

(4.25)

has

34 = 81 terms

in 3 dimensions.

4.1.4
Another

Covariant
way to generate

Differentiation
new tensors is to differentiate same old type ones. as the The first, derivative as in Eq. is usually notation, of a (4.7) not or by as in a a

tensor with respect to a scalar for the coordinate velocity. 5 The tensor. subscript derivative Such an comma of a tensor object followed

of the

## to a coordinate by the the usual direction

direction derivative

is represented by an index

either indicating

of differentiation,

Of _x a = f,_,

OTab c Ox e-=

TabC,e.

(4.26)

4Such an operation occurs in 4 dimensions in the calculation of tidal forces near black holes, and the corresponding sum has 256 terms! 5In relativistic calculations, the time coordinate is part of the four dimensional coordinate vector, not a scalar, and a different definition for velocity is used.

4.1.

CONSERVATION

LAWS

AND

TENSOR

FIELDS

47

Note
I

that One

the can

while yield

of tensors

in general

## tensors. operator of (4:26) Fa be, (4.27)

a more

tensor results when applied is known as the covariant when the original The definition tensor of the

to a tensor (i.e., which is coordinate invariant). The derivative and it reduces to the ordinary derivative is a scalar, or when covariant derivative the coordinate involves the system connection is rectangular. coefficients

r b0 =
Note that the metric cylindrical, fact that the of the The script ;a.

0g.o 09 o)
o d)"

(4.2s)
convenience I have used coefficients for rectangular,

F_ is not itself a tensor, although to raise and lower its first index. the and spherical connection are coordinate coefficients on the of a tensor useful

## for computational The connection

systems are given in Appendix A. It is a convenient for rectangular coordinates are all zero. Note that last two indices (_ = _b), due direction to the symmetry by the sub-

## coefficients metric. covariant The

symmetric derivative

in coordinate

a is denoted

following

are

;b=B a a

"

(4.31)

t_ab _-_ ;c

_ab _'

,c _ 7-

_ Cab,c --

'_ raeCdb

--

for tensors

## of all ranks, above. of c0variant

but

more of the possibilities than given One useful property of the definition of the metric is always zero:
gab;e

derivative

gab;e

O.

(4.35)

metric such

commutes as

with

the

covariant

operator,

and

we

may

write (4.36)

Covariant

derivatives

also

obey

the

usual

sum

and

product

rules

as ordinary

derivatives.

48

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

## a single covariant (lower) by raising the derivative

index index

to a with (4.37)

Tab ;e _ gdeTabc;d = (gdeTabc);d. The called so forth. derivatives, contraction the covariant While there the the are of a covariant divergence. preceding some metric special derivative Examples formulas apply then relatk)ns with an index just which as well simplify of the divergence to the the original divergence divergence its determinant. tensor

of covariant

are Va;s,

If we write

gab as a matrix,

we can ].

compute

## 10g 0 Fb_ = g Oxg -- _x _ In g, and the divergence of a vector V s is 1 0

(4.39)

"V._ = g Ox s (gVS).

(4.40)

4.2
Three (p), tu_

Fluids
types a,nd total (first scalar density of fields energy (rna rank

as

Tensor

Fields
in inviscid scalar mass The flux fluid dynamics. The (puS), coordinate and total flux (puSub energy are The density velocity energy + p6_) flux (p), pressure (uS), momenrank ([e -+- p]u a)

= pus

is a second

conservation

for density

total

## : Oe . The momentum equations momentum flux tensor [12] are

Op O---t+ (PUS);s

= O,

(4.41)

## (4.42) (symmetrical) (4.43)

Tsb = puau b + pgsb, or, _quivalently, Tba = pusu b + p6_. The momentum equations are then
Om a

(4.44)

O---'-i+ Tab;b = O,
eIf but it weren't alas, for is not the the momentum case. flux, we could get by With the simpler formalism of vector

(4.45)
calculus,

such,

4.2.

FLUIDS

AS

TENSOR

FIELDS

49

Oma

0---7+ (m.e +
The velocity system magnitude; is not complete without
l) 2 _

= o.
auxiliary
b.

the
Ua ua =

following
gabualz

For

a perfect

gas,

the

pressure

is given

by the

equation

p=
1 E = e

1),,
_pv2_ Z

where The

## e is the above writing relations

thermal equations

energy are

density. useful for formal analysis, but their numerical solution rediver-

quires gence

the equations explicitly in terms of ordinary derivatives. of the preceding sections gives the more familiar-looklng Op 1 0 + 0---_ -_ff-_(gpu
3--

## Using the results:

,, ) = 0, (4.50)

i_

0e

0 + p)ua] = 0, (4.51)

## 0"-'[+ g-_x _[g(e

"i

a--It + Y_'" The last term in (4.52) of the geometries. Integral by the velocity

(grnaub)

Ox"

= O. arises

I
i "

## is a "centrifugal conservation laws

which

forms

may be obtained

by multiplying volume

volume element gdxldx2dx s and integrating goes to zero at the boundary of the volume, d'"t

## over the we get s = O,

,
] and the total mass and energy

-

P g dx'dx'dx

(4.53)

d---t

## s = 0, The momentum integral

(4.54) is

constant.

-_

d f fvf

magdxldx'dxS=

f fvf (Op
_

q-

10ged'_ _pueud---_Xa

gdxldx'dx

3,

(_4.55)

" ,

## the momentum field individual components of momentum density

as a whole is. Note, however, that the rectangular of momentum density are not conserved in general, are conserved, since in rectangular coordinates g = 1

Og_'_/Ox a = 0, so that -_ ma gdx'dx'dx over the is impatient A, where systems. s = 0 (rectangular coordinates) (4.56)

i
i

aff,,f constant
who

the

## complete are written

set

of fluid

equations

looks three

like most

to Appendix coordinate

out

## in full for the

50

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

4.3

Dissipation

for

Tensor

Fields
or tensor) and F = F(U) be a generalized

## (scalar, vector, equation 0U 0--/- + div(F)

= 0, in the shock previous waves are we sections. likely may still to Eq. arise have

(4.57) (4.57) is

defined

relationship

in the contact

## solution of Eq. (4.57). Even discontinuities in the solution,

is linear,

Therefore the numerical solution to Eq. (4.57) is likely to require artificial viscosity, or dissipation, to prevent nonphysical oscillations and bilities in the presence of discontinuities. The added dissipation must physically meaningful solutions. damp oscillations but introduce We add dissipation to the

## the addition of nonlinear insta-

be formulated with care, in such a way as to produce One could define many dissipative terms which would nonphysical behavior into the solution. solution by replacing Eq. (4.57) with the equation

numerical aU

a--T + div(F) where D is the dissipative nun/erical solutions to the 1._ D does any finite volume; 2. D acts not contribute

= D,

(4.58)

term. For the presence of D in Eq. (4.58) to give meaningful inviscid Eq. (4.57), we require the following conditions: as a source it may term for conserved a flux fields across when the integrated boundary over of that

volume,

although

contribute

to diffuse

out) form

sharp which

## gradients is valid coordinate Ax=)

and

damp

oscillations; systems;

3. D is written

in a general

## in all coordinate directions; (consistency

4_ D is isotropic-there 5.. D vanishes The second higher The scalar, some must first point than fourth not point first. point a tensor

## as all grid requires that third The

go to zero

condition). kind of flux. of order in tensor in the that grid flux be The no a to form.

as the

## divergence one, involving which requires

of some

requires

be a diffusive

derivatives appears

## automatically coefficient point point Ax a.

if D is written that

requires

of nonzero

D be proportional interval

power of a grid interval, and for the fourth be At, and not one of the spatial intervals

to be satisfied

4.3.

DISSIPATION

FOR

TENSOR

FIELDS

51

In equations

Chapter could

2 we found be obtained

that by

## (oscillation right side

free) of the

solution equation

for the

single term

wave

At /

'

Iol az _ However, we now require that which is a diffusive term with diffusion coefficient 2 --_-' Ax not appear explicitly in the coefficient, so as to preserve isotropy in the multidimensional case where we will have multiple grid intervals Ax a. We write D as a diffusive term of the form D = div[_ where favor _ is a function of a, a, and of position. Eliminating grad(U)] Ax
a2

## (4.59) the above diffusion coefficient in

from

At gives

= kate,
where systems a is the Courant section. number. This definition will be extended in a later

(4.60)
to multidimensional

4.3.1

Scalar field

Fields U, the flux F is a vector may be written OV O'---t-+ f';o ;a = (_U);_, (4.61) with components F _, and the conservation

## If U is a scalar equation with

dissipation

OU "-_

1 O . a" + g-_x_ C gF ) -

1 O (gtcU;a) g O'-xa

(4.62)

OU 1 O . at + g_x _ (gf

(4.63)

4.3.2 If U

## Vector is a covariant with

Fields vector is OU, 0----[+ F"b;b = (K;U: b) ;b" (4.64) use of relation (4.39) gives fielJ U_, and the flux F is a tensor F_, the conservation

equation

dissipation

Working

out

the

covariant

derivatives

on the

right

and

making

## O----t- + Fab;b -- g Ox ggbCr_ _, OX b

7Similar expressed results in terms apply to contravariant fields,

ouo

1o

(ouo
vector

r2 vd -r:0
fields, only but the the momentum case density here. is most covariant

"
conveniently

of covariant

so we consider

52

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

Unfortunately expressions,

## of simpler coefficients of In field hold

produces the inhomogeneous term on the right, which implies that the components Ua are not conserved in general, except when rectangular coordinates are chosen. rectangular conserved. as does in both systems. the cases geometry The original is not all F_c = 0, and operator but momentum an accident, we see that conserves That is a basic the the rectangular those of the same components components geometry dissipative precisely property of the properties

of Ua are

equation!

conservation

of coordinate

4.4

More

on

the

Dissipation

Coefficient
in full in Appendix of the dissipation A, and coefficient will not be _ in more

## The fluid equations repeated here. Now detail. As shown

with dissipation are given we will look at the definition 2, the choice

in Chapter

## a2 = kate, reproduces the monotone first order scheme

,, = a(u)
of (2.37)

,
when have k the = 1/2, but does conservation,

(4.86)
this isotropy J

## definition (and and coordinate The uniquely answer at each

its generalization to higher dimensions) invariance properties we seek? is a qualified yes. Isotropy grid point, so that dissipation

## by defining in all coordinate dissipative should it be. term, The

directions. Conservation is guaranteed by the divergence form so only coordinate invariance needs to be investigated further. The dissipation condition, grid changes problems _:. Thus What ical definition of _ given above is not coordinate invariant,

depends on the choice of grid, as it must in order to satisfy and will change as the grid parameters change. Thus _: is not in any given geometry. Moreover , coordinate components, rotations, and a coordinate in both rotations will alter the characteristic velocity _ is not invariant under coordinate happens, and then, solve when the They exactly at we do perform numerically provided obvious problem will, (an

## the consistency invariant under a, and on some hence physthe

in multidimensional

## changing a and is not a scalar. transformation coordinate

problem

systems?

Will

two solutions agree? I do not mean agree even or so, be computed except possibly

## both have impossibility, but The the diffusion

adequate resolution. By "agree" since the two solutions will not solutions should the agree i adjusts correct to within automatiamount of 1% coefficient

at the

same

discontinuities.

## cally to changes in the grid and dissipation needed in each case.

system

so as to apply

Although strict coordinate invariance is neither necessary is both. If _ is computed differently in the diffusive terms rections, then it is really "simulating" a tensor _. For any

## strict isotropy coordinate dithe results

4.5.

DISSIPATION

IN

ONE

DIMENSION

53

may

appear

reasonable.

However,

would require transforming the transformation is not transformation be an explicit a diagonal Tensor and heat is performed, function

to reproduce those results in a new coordinate system ,' A,'Ab and using t%, in the new system. If t;_ into _;v = ", "-v%, performed, the two solutions will in general not agree. If the
a #

the

new

_;v is likely

_W

## off diagonal though real world the

elements original

of the

## tensor with constant diffusion coefficients conduction

(such

as diffusion viscosity.
:. %

in anisotropic

materials),

## are of no use in artificial

4.5
This fluid by a globally

Dissipation
section illustrates second v(U) order To get which

in One
one method accurate a second is also solution, order first

Dimension
the order simply of the dissipative equations multiply and the the terms one definition for single scheme, order,
a 2

.
to provide dimensional of (4.66)

for raising

equations.

a function

= k_t_,,
where v _ 1 in oscillatory One definition regions which and near has proved

(4.67)
quantity

otherwise.

## Iu,+,- 2u, + u,-,I " = Iu,+, - u,I + Iu, - u,-,l'

where U_ is the numerical we make solution a finite at grid difference point x_. to the dissipative In summary, approximation

(4.6s)
._ equation

"
as in Chapter 2. The

: -_+,_
semi-discrete

0:

_ k a_]'
approximation 1 is

:=/('4'

(4.69)

dtZ,
dt
|

--

Ax

-16c_)/, +
_ _ for

## [_,+,/_(u,+,- u,) - _,_,/_(u, - v,__)],

the wave velocity a = df/du, and the

(4.70)
constant (The are "'

using

the

definition

(4.67)

_;, where

| i

k is constrained by k]a] < 0.6963, for choice k = 0.3 is often effective.) Note local functions Now spherical (A.45) consider geometry gives i:3p _+;z of U and the more will generally difficult

the integration schemes (2.30) and (2.31). that the quantities f, to, a, and a = aAt/Ax vary from place to place. in one terms dimension, from Eqs. radial of fluid dynamics

problem

chopsing (A.43)-

Retaining

only the

1____ ("'"':)-

(_I.71)

54

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

0--; +
am, where

## [r_(e+ P)_'] = r' Or r_

_ , ap 1 a _r2 arn,._

'
2

## (4.72) ;Z_m'' (4.73)

(4.74)

1 a

aT + _(r

m,_ ) + ar - # _r _
u':m,./p,

ar /

## p = ('_and _ is a constant happens to be the The semi-discrete dpi dt (5/3 same

1) (e -- _pu 1 ,2)

= ('_--

1 1) (e -- _m,,u

,) velocity,

(4.75) which

gas). velocity

## Here u" is the coordinate v, in this case. equations is

approximation r_ 1Ar6(rm}(r_piu_') 1

to these

-_-_r_ Ar 2

[ri+l/21i+l/2(Pi+l

--

Pi)-

ri-1/2t_i-1/2(Pi

- Pi-,)]

(4.763

dei d-T

--

1 r_Ar

## 8(,.,.,) " [r_(e,

+pi)u_]

-_-_r_Ar 2
dmr i

2 [r,+ln_,+ln(_;+l _d-

ri-l/2_i-,/2Cei

--

ei-1)]

(4.77)

"f-r_Ar-"'-'_

i+,

m,i-1)]

(4.78)

2
r2 Eimri. i

## To compute the case we have three

the

diffusion equation,

to define value

wave current

speed

a.

In in

of a single

of df/du.

problem

equations,

are three

characteristic

## velocities are u'-c, of dissipation needed quantity

u', and u'+ c, where c : _-p/p is governed by the most rapidly of the greatest wave (4.79)

## wave. Hence we define in the r direction,

c, to be the magnitude

ai : and set
ai = Cr i.

Ate" Ar'

(4.80)
(4.81)

Then

the

dissipation

coefficient

is given

by

a, _
_, : kAtie, iv,,
/_i-t-1/2 :

1
_(/_i-_ /_i+1),

(4.82)

4.6.

DISSIPATION

IN

TWO

AND

THREE

DIMENSIONS

55

where tion).

v_ may The

a function has

solution

component

(p, m,

e, or some

combina-

choice

v = v(p)

## to be effective, 2p, + p,-l[

so we define (4.83)

]p,+l -

## _' = Ip,+l- p,l + Lp,- p,-II"

Note The time that the equations become are undefined infinite at at r = 0, because r = 0 unless u'(r of the coordinate = singularity. case derivatives rule gives = 0,t) 0, in which

L'Hopital's

ap a-; +3

## a _arr (P"') = 3b-;r

[(e + p)u'] = 3_r

(o )t
\ Or] that near

,=o'
,=o'

(4.)
(4,,)
(4.86) and p are symmetric conditions symmetry

0,
We know from the the finite condition m, and functions to evaluate of r, while

a---t + 3

.._.0"

## symmetry and at and

p, e, r = 0.

u r are antisymmetric,

## can use these

difference

4.6
The to which

Dissipation
simplest two dimensional dissipation we add

in Two
problem as follows:

and
is the single

Three
conservation

Dimensions
law of Eqs. (2.45)-(2.46),

## a-/+_-_x+a_The x direction characteristic velocity

axk
is a to (4.68)

a=)+_\
= df/du, is and

oH'
the y direction velocity is

approximation

dU_j
dt
_T, z J'3

+_=_['q+l/=
1

iCU,+,

i -

U,i) -

_,-,/2

j(U,i

- U,-1

i)]

(4.88)

## +-E_y_i_,_+,/=(u,_+, - u,i) - _,__l/2(u,j - u,i-,)].

The local Courant number is

Ay]
Now select the dissipation on the basis of the maximum velocity component,

c, = max(la,jl, Ib,,I),

(4.9o)

56

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

## _,+,1,i = _(,_,i+ _,+, D, _,J+,l, = _(_,_+ _,;+,),

IUi+, j-2Uij + Ui-z j[ IUii+, 2U, i + Vii',] and _ '

(4.92)
(4.93) coor-

_'ii = max Iui+,s - uiil + Iu,- u,_, iJ' Juii+,- u,J+ Iuii - u,j-,I]
Finally we consider the fluid equations in three dimensions, dinates (r, , z). The equations, with dissipation, are Op o-7 1 O (rp=) r + + 7_ _ 1 0 rlCor-r O (P=+) + _(p= ) m + m

in cylindrical

O_

r Or
1___ r 1 O

+----

r 2 0

_z

'

(4.94)

Oe 0-7

4_

[r(e

4- p)u']

4- _

## O [(e 4- p)u _] 4- -_z[(e 4- p)u =] _ 4(4.95)

r or

(o,) l O(b
r_orr 4-----

r_0

_z t Oz]'

at- +

('_.")

(m.,+) +

(,,.=') + _ - rp,,+,

r-_ _

4- rrVir

at

4-

(rm@u')

4-

(m@u +) 4-

(re+u*)

4- a--

--

r Or

,o[ to-,
r_ t Or

4- r--_a-- _ t

,o[ro., )]
De 4- rm,

(4.97)

+_
at Ore= +

'_ az )+r
4- _

toe
(re'u+)

_)'
O (m'u) = 4- Oz Op 4- -_z

1 =_r 0 (rm=u) , r

-where

r Or

r_

4- r-lO-

4- azz t_C-_z

) '

(4.98)

"'= "',lp,
P = --

"" = ""+l("'p),

"" = "".:lp,

(4.99)

(,-l)[e-2P(u'i-l-riu+'4-u=,)] ("'/1) [e

4.6.

DISSIPATION

IN

TWO

AND

THREE

DIMENSIONS

57

and have

(5/3 than

## for a monatomic the physical form

gas). v, when

The

coordinate velocities at

velocity summed),

equations,

velocity

## less singular) approximation

coordinate equations

## are used. grid

is an angular where

momentum, Cj = jag?,

## rn_ = pu = g_pu the

semi-discrete r_ = iAr,

(r_,j,zk),

dt

1 [r,+,/.,_,+,/_ _(.,+,_.- p,_)- .,-,/.,_,-,/. J_(.,_. - p,-,;_)] 1 [_,_+,/, ,C,,_+,, - p,_,) - _,i-,/,,(.,_,- .,_-,,)]
+_z_z 2
deijk dt 1 z 6(,,_)[(eij, + pok)ui_, ] (4.102)

(4.101)

+,,-7_,'

+-_-_z_

dfflr

ijk

dt

(4.103)
i I !

58

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

dt

riAr

';* ,*) X_ s _ s

ijkUZj.k)

## 1 6(,_)_." a s t',jk 1 [ri+ll2tCi+ll2

[ (mS iik--rn s i-1 yk ms iik-_-rnsi-1 jk)l

jk

ms

--ri-x/21i-1/2

J_ \

Ar

--

2ri-1/2

/J
2

"_r2-_

I_iy+l/2

A_

4-

ri

(4.104)

--''ii-1/2 + _ 1

k \

_; s iik+l -

+ ri

2 ,P, -

/l rns ii*-l)]

[gij,+t/2(rn

## rns iik) -- giyk-1/2(rns

ri _,jk

2A

2Ar

'

drn. dt

ijk m Ur

ri a r

az"
1

1 6C,,,)pi .k

'

(4.105)

+,,-Z_,, ["'+'"+"

## +,-ta_--_l [,,,+,/, ,(m.,+, . - r_.._)- _,_,, _(m.,_,- m. ,___ _)] +X-_z'

This direction; direction, define the system ru where largest has the

## ,i*) - '_,_-,,('_.,, - m. ,__,)].

velocity components and To compute in each ur c, u', u" + c in the u = + c in the we first to (4.106) r z direction; of sound. magnitude u _ - c, u _, and the

## c, ru s, ru s + c in the c = V/_ characteristic c,.= I""l+c, as

dissipation, according

velocity

direction

c s=l,-,,sl+c,

c,=lu=l+c;

define

the

Courant

number

o=at
and select the largest of the three values

_+-h-_+_
Cr Cs

Cz )

;
effective velocity a:

(4.1o7)

in (4.106)

as the

a = max(c,,

cs, c,).

(4.108)

4.7.

COORDINATE

SINGULARITIES

59

The

dissipation

coefficient

k'

where

uii_ is taken

to be

]Pi+I

jk-

2pijk

_-

Pi-1

_kl

Ipi_+lk

-- 2Piik + Plj-1

k[

[' (4.110)

## Ip,j_+l - p,_,l+ lp,_ - p,i_-lb "

where by 1 1 1 (4.111) p is the pressure. As usual, the dissipation coefficients at the half points are given

_,+1/2 j_ = _(_,_ + _,+1_), ,_,i+1/2 , = _(,_,i_+ '_,_+1 _), _,_,+1/2 = _(_i_ + '_,_,+1).

4.7
The larity to use cannot fluid at

Coordinate
equations r = 0. given In the that rule that each one the

Singularities
above for cylindrical spherical term term in each limiting in an equation coordinates case equation form contain with a coordinate the singularity allowed generally when We which singuat us dimensional divergence we dealt

## r = 0 by requiring L'Hopital's require

be finite, at the

to get

a non-singular

origin.

divergence

be finite

at a singularity

dealing with two or three dimensional of all divergence terms be finite. (This coordinates, values.) even The divergence on the other finite remain for the though which It is quite the best at the hand completely is singular possible sum general handled singular particular by that three points, then of all such at any

## problems, problem all term

as it is only necessary that the sum becomes particularly acute in spherical 8 values, may tend and is finite. in non-rectangular coordinate are known dictate be used that to obtain to become coordinates definition individual a limiting for the If form infinite. terms at 8 = 0, 0 = r for as at the all r to infinity singularity,

## dimensional to the if individual of the L'Hopital's

is probably

reverting symmetries

at singularities,

equations.

4.8
i So far used 4 how

Dissipation
we above have may looked be stated in any dissipative only

for
at the in very number terms

General
fluid general of spatial dynamics terms

Hyperbolic
equations. for any first order in three

Problems
However, system section spatial the formalism of hyperbolic I will describe dimensions,

conservation

laws,

dimensions. system

In this

to construct

for an arbitrary

60

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

laws

for

conserved than

scalar three

and

covariant

fields.

The

## in less (or more!) changes.

dimensions

no trouble

Our system will have I conservation equations for the scalar densities off_), involving I flux vectors ]'(i) a, f(2) _, ..., f(0a, where the subscripts are different densities, not tensor indices, s The equations are of the form

## a0) , a(2), ..., names for the

Ot

= 0.

(4.112)

We also have rn conservation laws for the covariant vector densities _(1),, f_(2)o, ..., D(,_),, involving m flux tensors F(1), b, F(2), b, ..., F(,_)ab) Note that tensor indices run from 1 to 3, so there are 3rn such equations, of the form + F(,),b;a = 0. derivatives _f(,),) gives = O, i= the 1,. scalar "" ,l, equations as (4.114) (4.113)

0t Using the definitions for covariant Ot and the vector equations as + 1 0._0 g Ox =

r,_F(,)o -0,
The are, some of state.) associated total number of differential equations

a = 1,2,3,
is n = l + 3rn.

i= 1,...,m.
(There may be, and

(4.115)
usually

number of algebraic equations required to close the system, such as the equation It is convenient to define a single unknown variable vector U and the three flux vectors F_ by
0/(1)

( I(%
..a

## a(0 _(1)1 U = _(1)2

Fea

Fi_)l

F(_)2
(4.116)

8(1)3
o..

F(2)1

_(,,)2 _(,,)3
SFor the fluid problemsdiscussed so fax, I= 2, _(1) = P and a(2) = e. The fluid problem has m = 1, with fl(1)a = m_.

Fi2) Fi )s

4.8.

DISSIPATION

FOR

GENERAL

HYPERBOLIC

PROBLEMS

61

so that

the

complete

set of conservation

laws

may

be written (4.117) , in this The instance objects U, I mean Fa, and any D set do

OU OF1 aF2 + aFs a---T + _-x-i-xl + -a-_x_ a--_x a+D=0 where not D is a vector in the tensor of inhomogeneous sense of linear coordinate may terms. algebra, not (By vector a tensor.

## of variables satisfy The

transformations.)

equations

also be written aU OU + OU O---T + A_x-_xl B_x2 OU + C_x3 coefficient (4.118) +D = 0, with components (4.119)

where

A,

B,

and

C are

the

n x n Jacobian

matrices

OF1 _
A_ iNow let the eigenvalues are the characteristic the are cl = maxl_il, and the largest , The dissipation of these is _ x 1 direction,/z_ au i, Bii-

OF2 _
au i, c_i=-au

aFs _
i

ues

of A, B, and C be _,/_, and rh, i 1,..., n. These eigenvalvelocity components for the associated coordinate directions: for the x _ direction, c_ = max and I#,1, rh for the x s direction. The extreme (4.120)

_. -- maxl,7,1,

## " a = ni_x(c,,c2,cs). is therefore

a2

(4.121)

coefficient

t = kAt--_,
G

(4.122)

where

the

Courant

number

is
cI c 2 ' + h--_. c3 ) ,, = :,t ( h--_=. + _-_

(4.123)

The

quantity

v at grid

point

(x_,x_.,x_)

is then

l//jk

----

( If,+. _ - 2f,_ + f,'. _1 If,_+._- 2f,_ + f,_-__l max_,lf,+,;_ - f,_l + ]f,J_- f'-' ikl' I/,i+l _- f,;,.I + If,i_ -/',_-1 ,.1'
If,i*+1 If, i*+1 2fok + f, ik-II '_ (4.124)

## f,i_l + Ifo'_ - f, ik-_l]

variable which in the reliably fluid are then

'
indicates the presence of discontinuities and

where The

f is any equations

scalar

oscillations,

such

as pressure with

case.

dissipation

aa(_) at

+ ___ 1 (9 (gf(,)_) g ax =

## 1 a ( g_g_b Oa(0 _ g ax = Oxb )

(4.125)

62

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

for the

scalar

fields,

and

(4.126)

g cox c

g_gb

_ tac_g_ b (O_(i)e

\ azb
to semi-discrete

## fields, as in Eqs. (4.63) and as in the previous sections.

(4.65).

The

approximation

4.9

Conservation tions
fluid equations may

Properties

of Finite

Difference

Equa-

The

be written

in a variety

of forms,

such

as the

conservative

forms

## described 5. Finite the same

in this chapter, and the characteristic and primitive forms given in Chapter difference approximations may be made to the equations in any form, with formal accuracy, yet all approximations in this text have been made to the to be had equations in using for their

conservative forms. The reader may wonder if there is an advantage the conservative form in numerical work. The answer is yes. First of all, the artificial viscosity terms require defined, viscosity though the conservative definition. other form, approximations form. However, once the terms are so the necessity for artificial be in conservative form, one could does not they are

write the equations in anrequire that the numerical simply written in that

more

More important proximation to the analogous is for this A field to the reason

## original conservation that the conservative to be conserved 0u

law embodied by the differential form is preferred in numerical if it satisfies 1 a i)--_xi(gf = O, direction. over the volume The the equation

equations, work.

u is said

(4.127)

conservation

property

is

by integrating

## a 1 < x 1 < b t, a 2 g x 2 < b 2, _ (4.128)

//vf

gdx'dx'dx'[_t

1 0 i +g-_x_(gf) ] =0,

-b_

b'

f f. f
bI b2

-:.:']., (,:').,.x',.'
b2 %1 bs

(4.129)

4.9.

CONSERVATION

PROPERTIES

OF

FINITE

DIFFERENCE

EQUATIONS

63

The the

rate surface

of change bounding

volume volume.

integral

## of u is given to Eq. approximation

by

the

integral retains

of the

fluxes

over con-

A properly servation

chosen

numerical If the

approximation semi-discrete jk
--

(4.127)

an analogous as
2

property dUiik dt

is written
2

1 Fi+l/2 1 giik
3

F,1-1/2 jk
3

Fii+l/2

kAx2

Fiy-t/2

AxI = 0,

giik

1 f;sk+,l, - F, k-i/2
giik Ax3

(4.130)
elements giikAxlAx_AxS gives

where

F l = gfl,

then

its summation

over

the

volume I,K

d S;,K -dt _
i,j,k= I,K l

## Uiik giik Axl Ax2 AxS

-I,J

_
j,k= l

(F;+,/2 1

ik-

F:/,

i_)AxiAx

(Fu+l/2 2
i,k=l

k _ Fi,/2 2 cancel

sums,

_
i,j=l

(F_iK+I/2 s only

## _ F_.l/2)Ax,Ax the sums an

n. of normal exact

(4.131)

fluxes

leaving

The

scheme

of (4.130)

yields

numerical

A numerical

## to a nonconservative approximations of the

equation form

a conserved makes

of finite

_ F_+l/1 - Fi-V2 Ax

(4.132) ' fluxes F_. The dissipative flux is F = gt c3u/Ox, for (4.133)
+ :

## which terms which

involve naturally

Fi+I/2

gi+l/2tCi+l/2

Ax

order the

in Az. mid-point

The

convective

terms

have

grid

F+ proof

g+fi, above

fluxes

F++I/+ must

## be constructed 1 (Fi+l + Fi)

recovers

the

familiar

second

order

result,

while

=
recovers order. Note numerical servative, and (4.135), that it is not necessary The the finite by the numerical the fourth order result. Zalesak

## + expressions as given used such up through above, are as (4.133),

(4.135)
eighth to ensure con(4.134),

properly

conservation

64

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

For example,

consider

the

single

equation

## 0. 10 10 0-7+ _ (gf) = _o-_ _

where using

o_/ '
semi-discrete

4.136/
approximation,

_ is the artificial dissipation coefficient. The standard a fourth order formula for the convective flux, is dUd dt -1 1 1 - g,-lf,-1) -

g, 12Ax[8(g,+lf,+l 1

(g,+2f,+2

gi-2fi-2)]

## +-h-_ [_,+1/2W,+1 - v,) - _,_l/,(u, - V,_l)], g_

v

which

is exactly

equivalent

to
dud F/+l[2 F/_l/2

dt where 7
F/+l/2 : "_(gilfi-t-1 Jr gifi) -

ZXx

'

(4.138)

1
-_(gi+2fi+2 __i-lfi-1) -_i+1/2

Vi+

1 -

V i

(4.139)

and

is therefore

numerically

conservative.

4.10
We some now

Test
have at fluid the

Problems
our disposal for which all the problems. the will problems Ax show the of nontrivial tools For boundary boundary be needed the sake values to obtain may with the be held until spatial numerical we consider constant Chapter coordinates of unit lines) density length, equation and rn, solution only with 5. Both of one time, rectr,

typical

dynamics

of simplicity,

dimensional postponing angular and respectively. These into is 5/3 solutions velocity one

problems spherical

discussion

conditions

dimensional The

## 100 subintervals throughout.

(I = 100,

= Ar = 0.01). analytical

of "7 in the

solutions

(dots) for the density p, the pressure v, at a time t. The Courant number a, czAt Ax'

momentum

the

## a= is set to 1 throughout, first example where is the c= -- max(Ivz] shock tube

(4.140) the grid (and similarly as a test for c,). for hydrody-

+ c) over

The

problem,

## frequently is given stationary right

used

namical codes (as in Sod [24]), and whose solution t = 0 the system consists of two spatially constant, The left state (x < 0) has p = p = 1, while the

## by Thompson [25]. At time states, adjoining at x - 0. has p = 0.125, p = 0.1.

state

4.10.

TEST

PROBLEMS

65

ol

to -o

"o

c_

o o

o o

o
r_

-6 l e_ ,.o
0"I

g"o

9'b

,"o

9
0'0 0"1 8"0 9"0 _'0 _'0 0"0

IIIO073A
to

,q
o

o
I o ao o_ o r_ o o o o "o o

p_

f
X Z o o

c3

r_ i

r_ "o l

## _r o t O' I 8 "*0 9 "0 I_ "0 _ "0 0"0 S'O

_"0

_"o

_'b

_"o

0'0

IIISN]O

WFIIN3WOW

66

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

As time progresses, a rarefaction wave forms and discontinuity and a shock wave move to the right. Figure any waves The oscillations 4.1 shows reach the wave the solution boundaries. is located the at time at x = 0.5 shock. These step and

moves

to the with

left,

while

the just

## 60, t = 0.265, is resolved could

k = 0.3,

shock

in _

3 grid

intervals.

occur

around

oscillations

be eliminated

by increasing

k, at the expense of spreading out the shock (and other features in the solution). The contact discontinuity at x = 0.23 is spread out over _ 10 grid intervals. Unlike shock waves, which keep a constant width, contact discontinuities in the numerical solution widen steadily with time. The to steepen which is countered constant. has no diffused However, the contact nonlinear by the nature artificial of the shock wave produces a tendency viscosity, so the shock width remains is a discontinuity spreads in a linear with wave, time which as it is monotonically

discontinuity therefore

steepening tendencies, and by the artificial viscosity. technique for obtaining and it is beyond the methods the the presence spreading which of such rate. have

A general be formulated, experimental to detect to reduce near the although spread The sion, have The

## sharply resolved scope of this text developed. and some

contact discontinuities has yet to to describe any of the numerous attempt, the artificial one may viscosity attempt there

been

As a first decrease

a discontinuity However,

viscosity

is needed

to prevent

oscillations

## discontinuity, be slowed. absence Landau 2).) An

so the spreading cannot be eliminated It should also be mentioned that such of artificial is the Lifshitz and amount viscosity, Sedov [12]. as well (N.B. solution Eq. as producing (99.10) solution for a spherically

by this technique, discontinuities will oscillations. symmetric reference at time origin exploshould t = 0. spherical

in the problem by -

considered

of the

## of energy a self similar

E is deposited bounded

at the

explosion

produces

by an outgoing

shock wave. The density off rapidly for decreasing flattens out and becomes near the origin, but as long as the shock its maximum value.

## and pressure curves r. The density goes constant with r away

are sharply peaked at the shock, falling to zero at the origin, while the pressure from the shock. The velocity is linear is valid achieves The jump similarity solution across the shock of energy Let the

steepens is very

## somewhat near the shock. strong, so that the density

The numerical solution is produced by distributing an amount the innermost five grid intervals, in the form of thermal energy. volume elements for the first five points be
5

----47tAr

_
i=0

r_,

(4.141)

## The resultant k = 0.35.

solution

4.2 at step

4.10.

TEST

PROBLEMS

67

68
The a small increasing should is _ peaked density peak 3.25, that peak. shock

CHAPTER

4.

ARTIFICIAL

VISCOSITY

AND

CONSERVATION

LAWS

wave

is very expense at by

strong,

and

in two shock,

grid

Once eliminated

amount

of ringing

a value

problem; change

numerical

density of the

## solution the the the

to achieve

calculation

increasing

grid points is achieved The origin, solution perature. speed the the while has

would reduce even though solution the pressure small very cannot a very The

## height. solution wave the

However, the correct is not attained. has the density goes origin. and going to infinity. Instead a high Note

exact

to the

## temperature at the center, the in the

numertemsound in at

ical solution

reproduce

singular center

## numerical finite the present of sound

nonzero at the

density center,

pressure

represented. largest

is therefore

is Win fact

velocity speed

## calculation. center, and

The allowed time step is therefore determined not by the post-shock velocity, which is much

by the smaller.

4.11.

EXERCISES

69

4.11
1. Let and 2. Using

Exercises
x= = A_'. the results of u='= the time of problem (_,0,), derivatives and 1, write vice of Eqs. down versa. (4.6)? and let x ' = (x', y', z') be same, while A_, and a different the Do coordinate the results velocities match what u = = (5, I), _) you obtain (x,y,z) Using be rectangular the relationships coordinates, of Eqs. and (4.6), let x =' = the (r, 0,) be spherical A_,

coordinates.

compute

transformations

## in terms by taking 3. Let

x a = (x, y, z) be rectangular

coordinates,

## rectangular the x axis

coordinate system. The z and z' axes are the to the x e axis is 0. Compute the transformations to express Are the metric the velocity _vhat its inverse you x_ = (_,_,_) expect?

## transformations and 4. vice versal the

in terms

of x _' =

results

Verify (4.11)

that and

g_ and

g_ satisfy

relationship

(4.12),

using

metrics

(4.14). the connection coefficients and F_c for cylindrical derivatives, coordinates. in cylindrical coordinates.

5. 6.

Compute Write

of T%

## its ordinary metrics.

7. Verify 8. 9. Derive If the meaning 10. Show first 11. Show and

## spherical does that order that the

of the

momentum have?

density

are

not

conserved,

what

"conservation choice

diffusion

coefficient

to the

monotonic

scheme the

of Eq.

mid-point finite

(4.134)

and

(4.135)

the in the

standard formula

second

fourth

order

approximations

## a__(F = F +lli - F -Vi '

Ox Ax

Chapter Nonreflecting

5 Boundary Conditions

Numerical

solutions

to hyperbolic

systems

of differential

equations, The to the not conditions. flows while in the Beam past the and

such

as the

fluid

dynamics equations, are usually obtained have focused on techniques for obtaining system. the However, of the types velocity or may boundary [16]), One and not the time evolution but interior Many as airplanes) normal may wall Shih region, also by the conditions wall" must are be zero discussed here. is the across system free are

over a finite region. the solution interior system is governed choice of boundary Fluid

of the

## of boundary require "solid component be zero conditions will not boundary

possible. conditions

solid

objects interface.

## (such The velocity Solid and

boundary if viscosity

at the

fluid-object boundary

at such elsewhere

a boundary, (e.g.,

is important

[15],

common

boundary,

which

## to no solid are the

wall

or other physical interface, In this case the evolution outside while the It often a boundary out tions, systems of the the boundary. waves that the incoming happens interior have condition

which matter and depends on waves waves are is not in the described which known, interior These one

The

outgoing

may

which without

waves) boundary

## nonreflccting dimensional case

originally

postulated been

in rectangular coordinate

geometry,

## generalized [18], and

multidimensional

in arbitrary

by Thompson

discussed

5.1
Consider coordinates.

Waves
first the

in
one

One
dimensional a system

Dimension
case in orthogonal (but not the necessarily behavior rectangular) of n dependent

We have

of n equations 71

describing

t_R_tNG

PAGE

BLANK

NOT

FILMED

72

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

variables.

Let

I3 be the vector

1 of conservative

variables,

satisfying

au

OF
o, term not containing Eq. (5.1) derivatives (5.1) de-

a-T- + _xx + c'= where (which F is the often flux arises vector, from and C _ is an inhomogeneous terms

divergence

in nonrectangular

geometry).

## scribes the conservation of the integral of a field boundaries.

properties of the system; that is, it relates the rate of change over a small volume to the flux of that field across the volume (5.1) 0U is the primitive system, with a vector of dependent

## An alternate form for Eq. variables U, which satisfies

a--_+

A0U

ax + c = 0,

(5.2)

where A is an n x n matrix. The choice of primitive variable vector U is not unique (although the choice of conserved variables is), and could be defined as the conservative vector. The following analysis assumes that U and U are distinct. The two systems are related by

aO _ v au at at '
OF ax with aU -- q-_x '

(5.3)
(5.4)

P'_= 5_'
aF_

(5.5)
(5.6)
(5.7) (5.8)

e,_ = o--_'
and A = P-'Q, C = p-lc', where P and Q are also n x n matrices. Now satisfying

let li and ri be the set of left (row) and right (column) eigenvectors of A, liA Ari = Ail_, = A_ri, so that A1 _< As < ... < A,. (The Then we obtain a diagonal matrix (5.9) (5.10) system is A by the (5.11)

## S.A.S -l= tln this chapter, the term described in Chapter 4.

A,

avector_ refers to any set of variables, and isnot a vector in the tensor sense

5.2.

NONREFLECTING

BOUNDARY

CONDITIONS

IN

ONE

DIMENSION

73

## where vectors follows

the

rows

of S are

the

left

eigenvectors

li, the

columns

of S -1 are the

right

eigen-

r_, and the matrix A is diagonal, with from the orthogonality of the normalized Eq. (5.2) by S gives

## that the transformation eigenvectors: lirj = _ij.)

Multiplying

sU --_-+
or

As0U Oz +sc
+hili _ + liC

= 0,

......(5..12:)
(5.13) corresponding to the original

= 0,

equation

## forms (5.1) and (5.2). If we can define a new

function

+ l_Cdt,

(5.14)

then

(5.13)

becomes

oy, 0-5+
which !. is a set wave of wave amplitude the the definition equations for waves Each V_ is constant of (5.14) than in (5.14) functions characteristic

or,
with

=0,
characteristic the can curve velocities Ci in the only on the not true met xt if A right for the independent plane and

(5.15)
,_i, as in Chapter defined C are by conof equa-

## dx / dt = hi. However, stant Otherwise differential tions.

everywhere, forms

## differentials satisfy exist Pfaff's

side

of (5.14). fluid

must V/to

condition holds

integrability of (5.14).

## [1], a condition of (5.13)

for the

Nevertheless,

form

5.2 i
In The region the because the

Nonreflecting mension
one dimensional is an initial time posed. case we

Boundary

Conditions

in

One

Di-

wish

to value

solve

Eq.

(5.1)

over at

the both

region initial

b. for

## problem problem Eq.

boundary dependent

in the

conditions

## x -- a, b are condition boundaries,

Difficulty

specification implying

generally

contains

at the

## that waves work with wave

propagating characteristic

into and out of the domain. It is therefore more fruitful to form at the boundaries, since we can then consider each

separately. The outgoing waves (those with hi _< 0 at x = a, and ,_i _> 0 at x = b) depend only on information at and within the boundaries. Thus those equations in the form of (5.13) which designed sided therefore represent numerical finite difference be stable. outgoing waves can be solved to (5.13) involving as is, or in any for outgoing only interior equivalent which and boundary form. depend Properly on onewill points, approximations approximations waves,

| i |

74

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

incoming on

waves data

## ,ki < 0 at x = b) are numerical we need to know

another something

depend involving

approximations

## in order to specify state aerodynamics and the appropriate

useful boundary conditions. In some problems, problems, the far field solutions are known to a values can be specified [19], [20].

approximation,

For time dependent desirable to use so-called property tempted and the ing Turkel desired waves). of minimizing to create steady which Engquist for linear absorbing for the Hedstrom's one [21] formulated state

problems (and many steady state-problems as well) it is often nonreflecting or radiation boundary conditions, which have the reflections from outgoing which in terms waves nonlocal waves. have this A number nonreflecting the then the they case. dependent They of authors property. perturbations imposed generation derived As the have atconditions a perturbation were and expressed the outgoing Majda From conditions. [22], their Bayliss about boundary of incomboundary a sequence boundary nonlinear It will be below. only of

boundary

approach (i.e.,

of waves.

[23] developed

## dimensional is by far the

to multidimensional

problems

non-rectangular

coordinate

systems

Hedstrom's amplitudes

## nonreflecting boundary of the incoming waves

condition [17] can be stated in the following way: are constant, in time, at the boundaries. This is as it is the is change in amplitude

## v' If = o, cgt z=_,b

in terms of the wave amplitude Vi of (5.14), or

(5.16)

+ ],c
in general, for those waves whose

)l

z=a,b

: o,
velocities are for the directed outgoing inward waves

(5.17)
at the comin
i

characteristic and

## boundary. Eqs. pletely determine Note fact that

(5.17) for the incoming waves the solution at the boundaries. will not waves. Fortunately, a general and give the Eq. desired (5.17)

(5.13)

behavior

which

should

contain

In such

a case

## to be adequate automatically general form

equation

which The

to Eq.

for incoming

outgoing

waves.

1,-_

+ , + liC

z=a,b

= 0,

(5.18)

5.3.

WAVES

IN

TWO

DIMENSIONS

75

where

I:, =
Thus natural The to (and section the characteristic way, set 6). along The unlike with) of equations that function and other

-,,, a,
{_.10 .U for for outgoing incoming boundary methods, by a method equations at the discrete of lines approach, interior in a way positions in the waves, waves. can be combined conditions

(5.t9)
in a very r similar in (as described "

(5.18) values

for the

conservative

are obtained

coordinate

## xi, where (5.20)

xi = a + lax,

_ = (b- a)/z.
Eq. (5.1) is solved (in the two (An one at the interior points sided interior (5.25) scheme at each difference points, below) which defined is solved uses by fourth The 0 < i < I, boundary finite order spatial while the equation requires evaluated form of Eq. at the points, difference

(5.21)
boundary defined operators in (5.19) are by

## i < 0 or i > I. using

boundary

boundary.)

derivatives

approximations

az

_ -

x(U_+, - u_)

i < o,

_
To get vector whose an equation components for the are/_i,

_(u,

- u,_,)
variables,

i > z.
we first define /_ as the

(5.23)
column

## conservative and write

s0_V_ U Ot ++SC=0,

(5.24)

aO o-T + P(s-1 + C) = 0.

(5.25)

5.3
In two

Waves
dimensions

in Two
the conservative

Dimensions
system is

au
I

a-T+ _+
with terms the C_ and matters; one C v representing the sum has case.)

OF

OG

-_ + c', +%=0,
terms, as before. into two terms

(5.26)

## (Only the sum of the C' to retain consistency with

dimensional

relations

0____ = v 0u
Ot Ot '

(5.27)

76

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

OF 0-7= Q av o='
A = p-IQ,
-I l

aG ac 0%-=R a_-'
B : C v=P p-1R,
-I l

(5.28)
(5.29)

C,=P

C,,

C_,

(5.30)

whichrelate the conservativef0rmof (5.28)to the foil0wing primitive form: au a---i+ A Ou a= + B0U ay + C" + c_ = o.
Now ilarly, let li, ri, and si, and A and B Ai be the #_ be the can be SAS The rows of S (T) are the left left left put and and in the right right eigenvectors eigenvectors forms -1 = M. the matrix columns of S -1 (T -1) Ai (#,). and and eigenvalues eigenvalues M by the of A. of B. let mi,

(5:31)
SimThen

A and

## similarity (5.32) are the

-1 = A, eigenvectors is the

of eigenvalues

Then

+ T-1MT form

## + C_ + C v = 0. as we can come unless

(5.33) S and

in one dimension

T are the same (i.e., unless A and B are simultaneously diagonalizable), be referred to as a characteristic form due to the presence of the diagonal velocity matrices.

## and which will characteristic

5.4

Nonreflecting mensions
two be (Ax, dimensional is now Uij The (x, y), Ay) problem a curve boundary solution

Boundary

Conditions

in Two

Di-

## allows enclosing curvilinear at the form points

for an a two

arbitrary dimensional

## number system (not

of boundary Let the necessarily grid points each Away direction corner points side from with

## points, spatial equal

since coordispacrectanat be

space.

## in a general is obtained boundaries or more of which has between

coordinate in each

## rectangular). have 0 < i < I, intersect the corners, would direction

points

(xi, Yi) on a rectangular direction. xy plane, The corner Interior and boundary points. in the points. or more and while

## a rectangle of boundary of one normal

of the

of one each

surfaces (there

point

an associated

tangential at the

dimensions),

each

## system defined the

of equations is given in (5.26). For by the surfaces y=constant, which which is in the tangential

j < 0 or j > J.

Then

x derivative,

5.5.

NUMERICAL

SOLUTION

OF

THE

INTERIOR

PROBLEM

77

## as an interior we write Eq.

term. form as

The

y term the

is in the

normal

direction,

however, can

in characteristic

so that

appropriate

boundary

conditions

(5.26)

## -_+_--X-x+C'+P at the evaluate y boundaries. aU/Ot Abbreviating by OU MTOU the

T-_MT quantity

+C_ in parentheses

=0 as -cgU/at

(5.34)

v, we must

v, as given

T_7_, +
to provide boundary conditions

_-y + TCv: 0,
Next define the quantity

(5.35)
}_k:

for (5.34)

at y boundaries.

Nk

#k 0 m

k-_v au

## for outgoing for incoming

waves, waves,

(5.36)

and

compute

OU/Ot

v from 0U

n_o-_,+ _ + m_C,= 0.
The spatial derivative in (5.36) is approximated by the one sided difference

(5.37)
formulas

Oy

,y

Y(U'Y+I

- Uiy)

j < 0,

(5.38)

## Given OU/cgt_, we compute

z_y(u,; - u,i-1)
from

y > j.

(5.3o)

OU/Ot

'
At the x boundaries approximations, the difference

j o0

o-7 + _ + c, = P t o --;
are evaluated terms in conservative are put form the x direction in characteristic

oF

ou

(5.40)
by centered form as

y derivatives while

form, i above.

as in (5.33). At the corners both directions are normal, and all terms are put in characteristic

5.5
The fluid two

Numerical
problems dynamics dimensional considered problem, problem

Solution
in this chapter in either in rectangular

of the

Interior
The In both first

Problem
is the one The the dimensional second is a may

## are of two types. or spherical coordinates.

rectangular

coordinates. cases

solutions

78

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

be

discontinuous,

and

it is necessary

to

## terms around with

to

the

finite

difference as

approximations in order to damp discussed in Chapters 2 and 4. may The one dimensional be written system,

nonphysical in conservative

the

dissipative

Op

1 O 0-7+ _("

,.,

## 1 0 [',., Opl p') - ,. Or _,"_. '

(5.41) (5.42)
(5.43) (m The = pv), equation e the energy can

+ p)v]-

- ,,,_,-,,, _

## 1 0 [,, Oe/ r '_ Or kr I--_r}, density fluid.

where p is the density, v the velocity, rn the momentum density (e = -_pv 1 2 + P/(7 - 1)), and p the pressure of the be written

of state

where

"T is the

constant

ratio

of specific

heats.

The

spatial

coordinate

is r,

and

the

## coordinate coordinates, given the spatial

system is specified by n (n = 0, 1, or 2 for rectangular, cylindrical, respectively). The dissipation coefficient i and finite difference 2 and 4. in the are (5.25) scheme. are Fourth integrated integrated order finite and in time along difference pressure according with the form approximations gradient to the interior and terms. method derivatives equations convective

or spherical methods are are The made resulting The the using dissipative to

in Chapters

semi-discrete

of (2.31).

## boundary equations sa-me time stepping

equations, containing

## system, also in conservative coordinates, is

+
am, a_ am_

(pv=)+

(p,,,) = _

,_

+_

,_

(5.45)

0 a

0 ("'v') + _(':''")

## 0 (ham= 0 (_cgrn= _ + ap ax - ax k ax _ ) +_ k ay ]' ap

(5.46)

o, +
Oe

+
O

a [ amy1

)+

a f

amy1

)'

c5.47)
(5.48) respectively.

## 0-7+ _[(_ + p)v.]+ _[(_ + ,),_,]= _ _. a=) + _ k oH'

Where The {m_::m_)and equation of state (v,, is vv)are the momentum density and velocity vectors,

on

a'_

O (

8'_

,:

5.6.

CHARACTERISTIC

EQUATIONS

FOR

FLUID

DYNAMICS

79

5.6
The at the

Characteristic
boundary boundaries, the one conditions characteristic dimensional require so we begin

Equations
that the the fluid boundary

for
equations specification

Fluid
be put for fluid

Dynamics
in characteristic dynamics form form problems of Eq. (5.2)

## by finding In the with

form for the fluid equations. case we can write the fluid equations

in the

I I I
where

v
s

, A=

_ V _
P

, v

C=

0 0

(5.50)

0 entropy

s is a measure

of the

_=pp-_,
and c is the speed of sound c 2 = "tP/P. (The dissipative The eigenvalues terms are set are :_l=v-c, and the left eigenvectors 11 : Taking venient characteristic (-e, are p,--P) variable Therefore 12 = (0, 0, simplifies the 1), Is= (c, p, P) but p and A2=v, A3=v+c, to zero at the boundaries.)

(5.51)
(5.52)

of A

(5.53)

## s as a primitive work. equations Op

eigenvalue 8 in favor

calculation, of p and

for numerical

we eliminate

## -_ - pc_ + _-pc',r = O, Ot - pc-_+ _

Oa P ot c 2N i) p

ov (op
+_' (op
vector U has oa'(J/Ot ap oat oam oap ( _Oa P

(5.55)
(5.56)

c 2 ig P "_ or]

='

a.
where the new i)U/at primitive at the Given

Ov
variable boundaries,

or)
components from p, v, and (5.3) by p. is obtained ap oat oar

(5.57)

(5.58)

(5.59)

80

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

(

dimensions
l

the

fluid

equations

may

be written

in the

P
Vz
V

I
,A=

vz
2

p v= 0 0

0
0

0
2_ P_ _B=

vv 0
C2

0 Vv

p 0

## 0 0 ,Cz =C v---O. (5.61)

7 0 0

vz 0

0 vz

vv

The

eigenvalues

of A and

B are

_1

Vz

--

C,

_2

_3

_z,

_4

Vz

C,

(5.62)

l_1----

v v-c,

P2

Ps

v v,

P4

vu +

c.

(5.63)

The

y direction

characteristic

terms,

in the

form

of (5.35),

are

Op

avv

( Op

Ovv

= 0,

(5.64)

0_' z

C_Vz

or--7 +
Op c2 0P + #s

=o,
:0,

(5.65)

aty Op
An analogous The set holds and for the

at v 0%
x direction. time

_ ( Op

ay ] 0%

(5.66)

(5.67)
by

conservative

primitive

## derivatives Op Ot Op Ot ' ap v'-oi Op

are related

(5.68) or,

am,
,i

Ot Orn v Ot Oe 1 2 _ _, OP

+ pot' Ov_

(5.69)

-_
['

+ .-_,
Ov_ Ovv" _ + 710p lot"

(5.70)
(5.71)

## +" _"_-_- + _--_- )

5.7.

BOUNDARY

CONDITIONS

FOR

FLUID

DYNAMICS

81

5.7
In the finite ferential The of the ing the

Boundary
one dimensional solver difference equation combined boundary write interior

Conditions
case, we solve for the data and are Eqs. spatial time the at the

for

Fluid

Dynamics
in the and of the which at those interior an explicit conservative are obtained points. The using centered difvariables. by solvdetails ordinary

## (5.41)-(5.43) derivatives, derivatives points, equations

approximations requires

to integrate

algorithm

boundary

## characteristic calculations the boundary dpi dt

nonreflecting below. as

given equations

We first

at ri

= O,

(5.72)

(5.73)

## d'--t+ pic_-_ + si + --pici vi = O, ri

inward (nonrefiecting condition), outward: characteristic equations if _,k at ri is directed

(5.74) or is

## _ki is set to zero if Ak at ri is directed according to the

computed

z,,

= (,, - c,)_-Tr [p,+l- p, - p,c,(v,+l- _,)] i < o, _, - c, < o, z = (_, - c,)_ [p,- ,,_, - p,c,(_,- ,,,-1)1 i > z, v, - _, > o;
1 VIA--_ [pi+l Pi ci

(5.75) (5.7o)

Z,2_ =

## 2(p,+l i < o, v, < o, - p,)]

(5.77)

= v, 1
1 Z_, = (v,+c,)E; r[p,+l-p,+p,c,Cv,+'-v,)]

, >,, v,>0;
i<0, v,+c,<0, (5.7O)

=
Given _ the

## (vi c,)A1---r [P, - Pi-1 + pic,(vi - v,-l)]

the time dpi -d-( derivatives 1 -_(r.s, of the primitive

i > I, vi + ci > 0.
variables are

(5.80)

L values,

+ Zl,)

n 2 V p, c,",,

(5.81)

d.,,

-_ = -_(z_,dp,
= and Eqs. (5.59) and

11,),
.
+/-:2i),

(5.82)
(5.83)

1 ( dp,
_ _-_ dmi/dt and We

(5.00) provide
interior case

at the Eqs.

|

difference

spatial

an explicit

82

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

## integration x -- x,_i,, similar

method for the time derivatives. x = X,naz, y = Y,,_i,,, and y = y,,,_,. it will be sufficient by writing the fluid to look equations

## four boundaries, boundaries are boundaries. points as

defined by treated in a

fashion,

at the

We begin

i)p 0-7+

I-ffxx'

(5.84)

Om 0

## a--[+ _(m,`',) + a= ot + _(m,`',)

Om. 0
_

- _ _, a= )'

(585)

ot, - o= k o= ]'

0(0m

(586)
(5.87)
in the normal to the begin boundary, by writing

## a--/+_[(' + P)`"] at, - a= _, a=] '

where the DI_l/at, terms are the contributions to cgrd/Ot tangential in Eqs. as d`'uij -- PiJCij'-_v d`'zij dt--'-u-+ "M='i = 0, dplj dt, dPii -_v where inward below each _kii is set to zero if the + P'iciJ local -e2 dpij ,i_ d`',ij dt----_ + .M4ii = O, characteristic according velocity, q_Iii : O,

due

## to derivatives relative and

(y) direction. The x derivatives are in the and are evaluated just as in the interior. Eqs. We need to compute the OU/Ot (5.64)-(5.67) in finite difference dpij -dt, v terms form,

direction, (5.84)-(5.87),

(5.88)

(5.89)

+ _3,i

= O,

(5.90)

## (5.91) _k, is directed forms

y direction

(nonreflecting if _ is directed

condition), outward:

or is computed

to the

characteristic

j < 0, J > J,

v,ii v,ii

-eii -eii

(5.95)
(5.96)

5.8.

TEST

PROBLEMS

83

1
1

_ 2 (P_i- p_-l)]

j > J,

## = (_,,i + _,_)_-_y [p,j- ,,___ + p,_,_(_

Given the _ values, we compute dp_i dt v dv_ii dt v dv_q dry _ 3U/c3t_ 1 from

- v,,;_,)]

_(_t4,_+ _t_,i)
1 2pqc_i .M2_1, (.M.4q_uj),

(5.1oo)
(5.101)

(5.102)

dp,j
dt v Finally, their values similar

1 {dp,
c_j _, dt v + _Isij ] using (5.69)-(5.71), to Eqs. (5.84)-(5.87).

(5.103)
and A

dm_i/dt v, dm_,i/dt_, and dc_j/dt_ are calculated are used in the finite difference approximations is followed at the x boundaries.

process

5.8

Test

Problems
to see how work well the combined interior and boundary some test methods problems, on described in one a grid and

it is instructive up two to this point dimensions. As in Chapter length, of state numerical and the divided is 5/3 velocity

in practice. one

## 100 subintervals for the t.

(I = i00,

of 3, in the (solid

analytical pressure a,

lines) density

solutions

p, the

momentum

v, at a time

c_At Ar : c_ + At

is set
{_r)

where

e_ =

max(MI + e)
wave

over

grid

(and

is a single

shock has

starts

a positive must

## is determined V_, and

by the satisfy

jump

conditions

84

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

Thus we have one more free parameter, chosen post-shock flow. The Mach number is related unshocked pressures by M2 =

to be the Mach number M = v/c of the to the ratio R = p,/p, of the shocked to

2 (R1) 2 "7R "7 + 1 + ('7 - 1)R" 1)], where M,,_az = 1.3416 subsonic takes shock the form for "7 = 5/3. wave crosses

(5.105)

As R _

co,

## M 2 ---, M_a z = 2/['7('7is generated by Hedstrom when [17].

A reflection as demonstrated

## a boundary, amplitude at the is the as the

of a constant

perturbation to the post-shock speed of sound relative to the relative difference pressure. error in the pressure

solution, which travels inward from the boundary moving fluid. A convenient measure of the reflection after the shock has crossed the boundary, defined

between the numerical and analytical pressure values, divided by the analytical Table 5.1 gives the pressure ratio R and reflections as a function of the Mach shock waves modeled with the dissipation value of k results in large oscillations near out over nowhere many grid exceeding the points.) 1%. The to note jump velocity his interior At the specified by k = 0.35. (A the shock, while a larger case the is the M = 0.98

number, for subsonic significantly smaller value spreads the The reflections shock, as M not here, with increases why a likely

of 0.82%.

is such

between

presented

culprit

mismatch

## Lax-Wendroff method for the interior. to the spatial derivatives, and

0v
at for the time derivatives. The

=
time

## +' - ,,,".) + oCAt)

integration scheme methods was are used quite for different. both of (2.31) (M Thus interior

(5.106)
In conand to

two

trast, the boundary When the right, and none The t = 0 the The left Figure

## point be produced, 4.9. At

and no signals are observed. next state example consists (x < 0) has the

is the

## in section states, p = 0.125, with

time

system

of two spatially p = p = 1, while solution through the No reflections is the 4.9. out Figure scales numerical

at x = 0. The

p = 0.1. k = 0.3.

5.1 shows

t = 0.438,

rarefaction wave has passed through the right boundary. well behaved. The sion, with The next problem and has with

left boundary, and the shock wave has passed are visible on either side. The boundaries are solution the the for a spherically explosion to the velocity at step example at the relative symmetric 1000, boundary in Figure has explot = 3.069, 4.8. de-

Sedov

## 5.2 shows magnified and

of the

domain,

5.8.

TEST

PROBLEMS

85

Mach

Number M 0.50 0.60 0.70 0.80 0.90 0.92 0.94 0.95 0.96 0.97 0.98 0.99 0.995 1.00 Table

Pressure

Ratio

Relative

Error

(%)

R = po/p_, 2.504 3.096 3.891 5.000 6.635 7.058 7.524 7.775 8.040 8.319 8.614 8.926 9.089 9.257 5.1: Reflections

100 X (Pr*t,m -- Pan)/P,m 0.08 0.19 0.33 0.48 0.68 0.71 0.74 0.77 0.78 0.81 0.82 0.82 0.80 O.77 for Subsonic Shocks

0.0

D.I

MOMENTUM 0.2

0.3

0.4

D.5

0.0 &

0.2 r

DENS]T'f 0.4

0.6

0,8

1.0

' '//
o o x o oo o o o i c:3 o |

2_

oq
)=i o

=.

_Q

oOO s o o _

c3

_'_
_._ 0,0 0.2

VELOCITY
0.4 0.6

PRESSURE r
0.8 I 1,0 0,0 0.2 0.4

&

,I
&

0,6 f

0.8 f

l.O

0 0
o

I
:t
x

I
p-

:1
I
m

ro

SNOI,LIGNOD

AHVGNI'IOEt

DNI, l'.DStq,_45IHNON

"_ HSLZdVHD

98

o |

c_

60

o.

| 4

0
Z, o7, CO

0_

0_
00

c_

## o 0.0 0.0 o o 0.2 0,_ O.B 0.8 o

1.0

c;
oOOOO a o o o o o

0
o

Z U fi::l

z:c__
o

._

o.

d 8 o c_
..... 0.0 _"" 0.2 "-"" ' 0.4 ' 06 01. 8 .0

oo

0.0

o'.2

0'._
R

o.6

0'.8

1.0

Figure

5.2:

Spherical

explosion

at step

1000

88
creased from supersonic

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

(immediately

behind

the

shock)

to subsonic.

A perturbation

has developed at the boundary from the velocity curve. The is presumably contain an due inward to the fact solution of properly medium. propagating

and is propagating discrepancy between that the similarity which one, but wave,

inward, as can be seen most clearly the numerical and analytic solutions solution it is not for by the the explosion boundary to the really does conditions. explosion with the with is while
t

is suppressed

The resulting numerical problem at late times. The expansion -0.5 impossibility of a uniform velocity The

the solution

## for all problems problem, pressure but remain the region

nonreflecting

prescription

is further is linear,

## p -- p = 1. The < x < 0.5.

u = X/to,

to chosen with

to be 1. The

J i

density

and

pressure

the velocity also decreases but subsonic and directed outward The problem has a simple

## linear in x. The flow at the set of initial conditions. solution, given by

boundaries

i I

( p = p0 (1 +
p = po 1 +
X

(5.107)

(5.10s)
(5.109) does not satisfy (x = b) the representing the nonreflecting is subsonic waves

v = t + to One and can verify directed by direct outward. substitution For example, two The that at the characteristic this solution equations

_o

boundary

conditions.

right

boundary

flow

outgoing

(Eqs. (5.56) and (5.57)) hold as written, while the absence of an incoming wave is imposed by the nonrefIecting condition of Eq. (5.72) with _I -- 0, which can be written Op at The analytic solution does not satisfy condition will not produce the desired Figure 5.3 shows the expansion solutions portion. i)v pc_-( -- O. condition, t = 0.305, so the with nonreflecting k = 0. The

## the nonreflecting numerical solution. problem at step 50,

numerical and analytical match well in the middle disagree everywhere. We conditions. satisfies can use In information particular,

diverge markedly near the boundaries, The discrepancy grows with time until

## although they the two solutions

this

problem is zero

to specify everywhere,

## better and the

boundary velocity

pressure Ov

o-7+
which in place is in characteristic of the nonreflecting form and describes boundary condition,

= 0,
outflow at the boundary. three If (5.110) we have characteristic

(5.110)
is used equations

o o

_.

,,

o-

r_

*q O t_ t_

o"

n,-

Z bJ '_I-

b_1

d-

o7
o o

Ol o o

-0.s

-0'.3

-_.l

0'._

_._

0.s

Ol

-0._

-_._

-0'._

_._

0'.3

0.5

u_

,4-

C3 --]

o-

,,?

u_

,o

?-o.s

-0'._

-0'._

o'.l

0'.3

0,5

-0,5

-0'.3

-0'. 1

0'.i

0'.3

0.5:

Figure

5.3:

Homologous

expansion

at step

50

00

90

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

describing cluded

## waves. from the

(By

throwing The

out

the

pressure characteristic

term, left

we have is the

exfluid

problem.

only

velocity

velocity. The The resulting This in general nonreflecting problems be used The result

## evolution numerical is not boundary nothing

of the velocity profile solution matches the meant as an endorsement useful conditions for the cannot

then determines the rest of the analytical solution everywhere. of Eq. (5.110) to give specific as a boundary but simply the to such desired problem),

(it does

explosion be

## illustrates problems shock,

expected

which do contain incoming waves. Information to produce more useful boundary conditions. final test problem is two dimensional.

It is a planar

Newtonian

traveling

in rectangular geometry. The the upper right, at a 45 angle the shock front and the origin

## grid has _x with respect is 0.8. The

= Ay _-- 1/130. The shock is traveling toward to the x axis. The initial distance it0 between unshocked density and pressure are p = 1, of the flow behind the shock is M The dissipation used is k = 0.3. = 0.95,

## p = 1, with v_ = vy = 0. The Mach picked to roughly maximize reflection show

number errors.

Contour plots of the density, pressure, and velocity fields in Figures 5.4, 5.5, and 5.6 the time evolution of the solution. The arrows in the velocity plot show the direction flow, and have t the grid. a length values 0.197, edges The proportional is 1.01. respectively. before of the reflection it reaches shock. from Step the The to the figures Step the are magnitude at step the Small the of the initial boundary shortly inward, velocity. 100, The Step the ratio 100 can shock contour 200, shock near the 0, t -- 0; step t = 0.098;

shortly

perturbations

## 200 shows corner

solution

propagated

at its peak

to about 6% of the post-shock pressure dimensional case, perhaps because the not enough to obscure

profile. The reflection is greater than in corner is subject to reflections from two significant features of the post-shock

5.8.

TEST

PROBLEMS

91

DENSITY

ox

o o

-1.o
o

-o'.8

-o'.6

-o'.4

-o'.2

o'.o
PRESSURE

o'.2

o'.4

o.6

o'.o

l,O

to

o-

o
o

,o -_ .0

r_ o"

o o

lO X RXIS

Figure

5.4:

Angled

shock

at step

92

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

OEN51TY

oo o-

o-

i::)

-I .0

-o'.8

-o'.6

-0'.4

-&2

d.o
PRESSURE

O'2

O'4

'

08

10

id-}o X O:

o-

c_ o

o t i

-1.0

-0'. B

-0.6

-0.4

-0'. 2

## shock at step 100

5.8.

TEST

PROBLEMS

93

DEN51TY

co O-

qr o"

\
-I.0 -0'. 8 ' :O.. 6 -0 '. 4

f_ 0"

Q 0

4.2
'

o..o
PRESSURE

0'.2

0_.4

01.6

0'.8

1.0

0 U-j

X _Z

o-

r_

-I .0 R

o..o

6.2

o'.4

o'.s

o'.e

1.0

a0 o

0 0

-I .0

-o'.8

-o',6

-o'.4

-o'.2

o'.o Axis

O..2

o'.,_

_.s

O..e

1.0

Figure

5.6:

Angled

shock

at step

200

94

CHAPTER

5.

NONREFLECTING

BOUNDARY

CONDITIONS

Exercises
Derive the conservative
.

(5.50)

from

the

## Starting with Eqs. only two characteristic

(5.50), assume isentropic flow (s _-- constant), equations result. What are the characteristic 2 in the form of Eq. (5.15). invariaats in fluid dynamics.

## and show that velocities?

Express the results of problem V1 and V2 are called Riemana is constant along Riemann invariants its

## The two wave amplitudes Each Riemann invariant v 4- c) in the xt plane.

corresponding trajectory (v - c or do not exist if the flow is non-isentropic. of matrix S -1, and velocity verify A in Eq. the (5.49). Form

Find mation

the

right matrices

eigenvectors S and

the

similarity

transfor(5.11).

## transformation two dimensional

of Eq.

Derive the characteristic of EQ. (5.61). Perform M = 0.9. that the the shock wave see

components

fluid problem

calculation

## in section big is it? of Eq. right

5.8,

for

a Mach

number

Do you the

a reflection?

Verify satisfy

homologous

expansion

solution

(5.107)-(5.109) boundary.

does

not

nonreflecting

boundary

condition

at the

Appendix The
Chapter

A of Fluid
concepts of tensor calculus,

Equations
4 described the basic

Dynamics
the tensor formulation of the

## fluid dynamics equations, list of the relevant equations coordinate systems.

and artificial viscosity. This appendix provides a complete for fluid dynamics in rectangular, cylindrical, and spherical

A.1
The

Coordinate
geometry of the coordinate

Geometries
system is described

and

Metric
metric

Tensors
tensor gab. The metric

by the

tensor, defines

## functions of two closely in terms

space points, at x" = (x*, x 2, x s) and x _ + dx" = (x 1 + dx 1, x 2 + dx _, x s + dxS), of the coordinate differentials dx% This distance is given by given by

ds 2 = gabdxa dx b.

(A.1)

metric may

tensor

implies (six

that,

only

n(n

+ 1)/2

be unique

components

dimensions).

A general

be written

as a 3 3 array

ga b= I

g21 gll

g22 g12

g23 g13

'

(A.2)

gal

gs2

g_3

where

by symmetry
gab = gba.

In C_ - _,_

orthogonal

coordinate

systems,

where 95

the

96

APPENDIX

A.

THE

EQUATIONS

OF FLUID

DYNAMICS

each

other,

the

metric

tensor

is diagonal,

and may

be written

where

factors

directions

(and

## the superscript by the sub-

2 represents

number,

The covariant derivative of a tensor in coordinate script ;a. The following are useful examples: aA

direction

a is denoted

A;o = az.'

(A.5)

B.;b = az*

r_,B,.

(A.7)

ac "b

## c"b;_ = _O=o + r_o c_ + r_c _d,

aC'2b am c a d + F&C b -

(A.8)

Ca_;c =

r_cC"d,

(A.9)

(A.10) given by

F_:, used

. r_ =g"_r_,

r_0=

l(Og,a _ -0-V+

Ogdc _

(A.11)

and Note

on the itself

a tensor. ,, The

## (F_, = Fc_), due connection

of the the

metric. equation

coefficients 0

1 Og

Fb,_ -- g Ox _ -- Ox b lng,

(A.12)

where

g = y/I det(g,b)].

A.2.

THE

COORDINATE

INVARIANT

FLUID

EQUATIONS

97

A.2

The

Coordinate

Invariant
and total energy transformations. flux (pu"),

Fluid

Equations

## (p), pressure (p), under coordinate = pu,

density (e) of a fluid are scalar fields and The coordinate velocity (u"), momentum and total energy flux ([e + p]u '_) are vector tensor. coordinate is the rate of where with are as the and -'

= Pg=_ub), mass

## fields. The momentum velocity u = dxa/dt is generally not the

flux (pu=ub + psi) is a second rank is the rate of change of a fluid element as the physical velocity v=, which

same

## change of distance along the coordinate axes are diagonal elements

coordinate axis x ". In an orthogonal at right angles to each other, the a system requires The the physical

coordinate system, metric gab is diagonal, and coordinate equations momentum velocities as well density

## ga, = h2, In such

related by v= = h=u" (not summed). ClOsing the system =of equations differential vel0clty equations is one such given equation: below.

auxiliary relationship

algebraic between

## ua = gabUb = gabmb/P" Also useful is the velocity magnitude v, given by

(A.13)

_, __uou o= g,buOu_ = _ + _ + _.
The to p= In simple to 5/3 dynamics) heats. The viscosity nonzero Chapter The equations in finite only given the in this grid simply appendix resolution set here. equations, 0p include The used dissipative in the terms coefficient, The definition are for use for perfect "_ may (ff-1), =e-_pv'=e-:m,u=.2 ratio local of specific fluid state, heats, and and (such is not is a constant as relativistic the ratio equation of state connects the pressure p to the thermal 1 energy density

(A.14)
E according

## ff is the In more of the

a monatomic

complicated

problems

difference equations,

calculations.

dissipation

## _, is taken is finite. for

because

calculations

dissipatlon-free

_ = 0 throughout. with

_ is given

dissipation, ;=

Oe

(A.16)

## a-7+ [(e + p)u];= (_:e;);.,

Orn, _) o-V + (mu_ + p,5_);_ = ( ,_m ;_, in terms of covariant derivatives, 0p or 1 0 ,, 1 0 ( ,,_ 0p'_

(A.17)

(A.18)

(A.19)

98

APPENDIX

A.

THE

EQUATIONS

OF FLUID

DYNAMICS

ae

1 a

bae'_
-_xb )

## c9---[ -{- g _x a ig(e -{- p)ua]

-- g cgx _ _g_g

(A.20)

am

at

1 c9 g (3xb (gmau

## cgp 1 b) + ax---_ + _pu,ud

Og ca ax a

g 1 i)X a c gg bct

## Ox-'T -- rdbm d am.

-- r'_o

_'_ \ azb

where The

g = V/[ det(gob)[. following sections give the fluid equations explicitly forms Care in rectangular, of the equations has been taken cylindrical, given are to remove

## be noted that the above calculations.

terms which cancel each other (especially when the terms individually at singularities) and to cast the equations in a form well suited for calculations. forms leads The direct to serious translation cancellation to the

## become infinite, finite difference

of the tensor forms given above into finite difference errors. One should always eliminate cancellations greatest degree possible before resorting to numerical

## and singularities approximations.

by hand

A.3
The

Rectangular
coordinates are

Coordinates
The metric and its inverse are

x _ = (x, y, z).

gab =

/x] Is )
1 gab = 1 , 1 1 1. The (and contravariant only this) (coordinate), coordinate system: covariant, and

(A.22)

and

the

factor same

g =

physical

velocities

in this

## ,,"= (_:, _,,_), u: = (:_,_,,_), v,, = (_,_,_,)= (u', u,,,,,').

A.3.1 Connection
coefficients

(A.23)

Coefficients
are zero: rb_ = O. (A.24)

All connection

A.4.

CYLINDRICAL

COORDINATES

99

A.3.2 Set

The

Fluid

## Equations for the inviscid

with equations.

Dissipation

_ = 0 throughout Density

Op 8_"

-t-

## _._ (pu =) -I- -_y(pu a v ) + _z(pUs) 8 (A.25)

Energy
8e

o_ _

+_k

_]+_

8 +

-8t

(A.26)

x momentum 8rnffi 8t

Cm,_')+

C-%_')+

(m'_') + 8-_
(A.27)

y momentum 8rn v Ot

## (..,,,u')+ -8y 8_/

(A.28)

= 8-;\
z momentum 8ms Ot

("'"") +

(""""") +

(""'_') + 8--;

o
A.4
The

of

(A.29)

Cylindrical
coordinates are

Coordinates
and are related
f....-

x = (r, , z),

to rectangular y_,

coordinates

by

z = rcos, y = r sin ,
Z= Z_

## r = _/x2+ tan = y/x,

Z= Z

(A.30)

100

APPENDIX

A.

THE

EQUATIONS

OF

FLUID

DYNAMICS

The

metric

and

its inverse

are

gab

(1/ l1 /
r2 , g,b : r -2 , 1 1 r. The contravariant (coordinate), covariant, and

(A.31)

and

the

metric

factor

g = by

physical

velocities

are related

(A.32)

## ,,o = (_,,-_,_)= (.', r._, .').

A.4.1
The

Connection
connection coefficients

Coefficients
are
rr

(A.33)
r

All other

F_

= 0.

A.4.2

The

Fluid

Equations
for the inviscid

with
equations.

Dissipation

## Set _ = 0 throughout Density Op O-7

+ _

1 a ;_(_P_ 1 0 r Or

c3 + _(P" _ +

) (A.34)

( o, I 1o(o 1
-_z

Energy

## 0e 1 0 0 aT + ;_[,(e + p).'] + 0_ [(_+ p).*]+ _[(e + p).']

a_
r momentum

;zy_

(A.35)

Op _ r pu _2

A.&

SPHERICAL

COORDINATES

101

x a f am,_ _ a [ (am,
|_-z_ ::Yt

(A.36)

## r-_\ momentum am, at

Od_ +rm_

),
ap

4(A.37)

+_k
z momentum amz at

a_ 1+_

k a_

a_ j'

(_m,_')+

a (_,u,) + a, (_'_*) + _
(A.38)

## - , a, k""_-,) + ,-_o-7 [,'%-) + _ _, o_ j

A.5
The

Spherical
coordinates

Coordinates
and are related to rectangular coordinates by

## are z a = (r, O, _), x -

r sin 8 cos _,

r = Cz 2 + y2 + z 2, tan 0 g

y = r sin 8 sin _,

(A.39)

i
I

## z = r cos O, The metric and its inverse are

tan

_ = V/z

!
gob = and the metric velocities factor

(1)(1)
r_ , gb = r 2 sin 2 0 g = r' sin 8. The by contravariant

(A.40)

and physical

are related

## .. = (_,_,_), .. = (_,.'b,. =sin' o\$), v. = (_,rO,rsinO_)= (u',ru,rsinOu_).

|

(A.41)

! @

102

APPENDIX

A.

THE

EQUATIONS

OF

FLUID

DYNAMICS

A.5.1
The

Connection
connection coefficients

Coefficients
are

F_0 = -r,

r_ 1

= -rsin

2 O, (A.42)

r_, =

- sin 0 cos O,

## r_, = r**0 = cot 0.

A.5.2
Set

The

Fluid

Equations
for the inviscid

with
equations.

Dissipation

_ = 0 throughout Density

Op O---t +

r1 2 O r (r2 pu')

## + sin000 1 0 (sin 0 pu s) + ff-_(pu

')

--

r 20r

_r

tg_-_-r)

nu r2sin0a0

(0,)
00 sin 0 t_

r 2sin

1 0(0,)
200

(A.43)

Energy

0e o-/+

1 o
r 2 o_r
r2E

_ o [sinO(e+V)uq+_[(e+V)u*}
-_ r 2 sin0 + r 2 sin 20 0 _; ' (A.44)

r momentum
Omr

Ot

nt-

r2

1o

(r2mrU

r)

-k

1 sin0

0 (sin0rnrU a0

) +

0 -0--(rn'u

')

+_rr

-rp

+ sin20

r 20r +

r2n

+r

2sinO00

_ O0

me)]
"_

(A.45)

r 2sin 200 1
r3 ----tz_,

_k

0 1 i)m 20 0

f Omo 00

+sin

+2rm_+ct0m]'

0 momentum
Omo

Ot

-t-

r 2 Or

1 0 (r2mou_)

0 (sinOmouO) sin1 0 00

+ ff___(mou )

II

-I-

II

Q 0 0

_
_i _:_ _
0

__
-t-

_a

i,.-,

.... t=l

e-

+
-F
0 0

Bibliography
[1] Whitham, York. [2] Courant, Verlag, [3] Lax, Theory [4] Dahlquist, Inc., R., New P.D. Friedrichs, York. 1973. Hyperbolic Waves, BjSrck, Cliffs, Systems SIAM, /_., NJ. 1967. Difference New York. Methods ]'or Initial Value Problems, for Conservation Laws and the Mathematical K.O. 1948. Supersonic Flow and Shock Waves, SpringerG.B. 1974. Linear and Nonlinear Waves, John Wiley & Sons, Inc., New

of Shock G.,

Anderson,

Englewood

## [5] Richtmyer, R.D., Morton, K.W. 2nd ed., Interscience Publishers,

[6] MacCormack, R. 1971. in Proceedings Numerical Methods in Fluid Dynamics, ed., Springer-Verlag, New York.

## Conference on vol. 8, M. Holt,

[7] Jameson, A., Baker, Sixth Computational [8] Harten, A., and Applied [9] Thompson, Dissertation,

T.J. 1984. AIAA paper 83-1929, in Proceedings Fluid Dynamics Conference, AIAA. Lax, P.D., 29, 297. Keyfitz, B. 1976. Communications

of the

AIAA

## Hyman, J.M., Mathematics, K.W. 1985. Princeton

on

Pure

A Two Dimensional University. 1971. York. and 1959. Cosmology, Fluid Numerical

Model

for

Galactic

Jets,

Ph.D.

[10] Lapidus,
tions, [11] [12]

L.,

Seinfeld, Press,

J.H. New

Solution

of Ordinary

Differential

Equa-

S. 1972. L.D.,

Gravitation E.M.

John

Wiley Pergamon

Inc., Ltd.,

New

York.

Lifshitz,

Mechanics,

Elmsford

[13] [14]

J.S., S.T.

Cooper, 1979.

G. 1970. Journal

Journal

## of Computational Physics, 31,

Physics, 335.

6, 1.

of Computational 105

p_ING

PAGE

BLANK

NOT

PILldl_

106

BIBLIOGRAPHY

[15] [16]

Beam,

R.,

R.F. G.E.,

1978. Springer,

AIAA G.S.,

Journal, Rimon,

1979. 1987. in

30, 68,

## [20] [21] [22] [23]

Yee,

H.C., A.,

Journal, Physics,

of Computational

## B., Majda, B., Majda,

Mathematics Communications

of Computation, on Pure

[24] [25]

1978. K.W.

Journal 1986.

## of Computational Journal of Fluid

Physics, Mechanics,

27,

1.

Thompson,

171,365.

Report
1. Report No.

Documentation
Accession No.

Page
3. Recipient's Catalog No.

2. Government

NASA

TM-100010
5. Report Date

## August Lectures Series in Computational Fluid Dynamics

6. Performing

1987
Organization Code

7. Author(s)

8. Performing

Organization

Report

No.

Kevin

W.

Thompson

A-87291
10. Work Unit No.

151-02-60-05
9. Pedorming Organization Name and Address 11. Contract or Grant No.

## Ames Research Center Moffett Field, CA 94035

13. Type 12. Sponsoring Agency Name and Address of Report and Period Covered

Memorandum
Agency Code

National Washington,

Aeronautics DC

20546-0001

15. Supplementary

Notes

Point

of

Contact:

Center, 694-6275

16. Abstract

## These dynamics theory, the CFD

lecture

notes

cover

the

basic

principles

of

computational

fluid

(CFD). They are oriented more toward practical applications than and are intended to serve as a unified source for basic material in field as well as an introduction to more specialized topics in artifiEach chapter in the text is assovideotapes may be obtained from the

cial viscosity and boundary conditions. ciated with a videotaped lecture; the author.

Chapter I of the notes describes the basic properties of conservation laws, wave equations, and shock waves. The duality of the conservation law and wave representations is investigated, and shock waves are examed in some detail. Chapter 2 introduces finite difference techniques for the solution of wave equations and conservation laws. for finite difference approximations. description problem
17. Key Words

Chapter Chapter

## stability analysis a consistent 5 treats the

of

artificial

viscosity boundary

methods. conditions.

Chapter

of

nonreflecting
by Author(s))

(Suggested

18. Distribution

Statement

Computational fluid dynamics CFD, Boundary conditions, Finite differences, Numerical methods Artificial viscosity
19. Security Classif. (of this report) 20. Security classif.

Unclassified-Unlimited

Subject

Category
of pages

- 64
22. Price

Unclassified
NASA FORM 1626 OCT 86

Unclassified

111

A06

C-P0 788-?86/79016