Beruflich Dokumente
Kultur Dokumente
!
I I
t
,-
I
|
i i
i
i
(llASl-_II'l-
1000 10)
LEC'I_S
N87-29_
14
Uncla_ 00978C6
August
1987
NASA Technical
Memorandum
100010
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
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
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
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
............................. .............................. .............................. 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
More
52 53 55 59 59 62 64 69 71 71
Dimension
. . . . .
- . . . . 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
of Fluid Geometries
Dynamics and Metric Fluid Tensors ................. .................. Equations ........................ withDissipation ............................ ........................ with Dissipation ................ ................
Invariant Coordinates
............................
Connection Fluid
A.4
Coordinates Fluid
Connection Coordinates
A.5
Spherical
.............................
.,
CONTENTS
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
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
everything to construct
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
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
degree By
of basic
this
standard,
computational
INTR
OD UCTION
fluid getting
dynamics a widely
is not ad hoe
a mature methods.
field. These
been will
by
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
Science
at NASA Science to
NASA also
for supporting
in this the
appreciation
for sponsoring
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
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
conserved
quantity, equation.
at which
u flows x2,
a given satisfies
x coordinate).
integrated
points
x2 < xl,
(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
when
as the fluid
equations. context,
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
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)
(1.5) is called
the characteristic curve, or simply characteristic, equation, and may be cast in different forms.
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
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
adu" (1.7)
1.3.
CONTINUOUS
ANALYTICAL
SOLUTIONS
If a = constant,
the
problem u(x,t)
and
the
solution
characteristics
in 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
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
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
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)
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:
Diagram
for
Nonlinear of John
Waves. Wiley
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
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
x > O,
X < O.
(1.15)
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<
_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
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
differentiable. If the shock is located at x2 < x_(t) < xx at time t, we may write
for u as [1]
d fz_" . .
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 _
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
of u on 2. be also
side
right
u2 are jump
on side
is at rest;
i.e., which
original
be continuous
= fs - u2v,,
Rewriting
velocity vs = f(u2)-
u 2 -- u 1
limit
where
]usshock,
ul]
-= a(u).
weak
travels
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
hyperbolic non-interacting
gas).
equations,
in a vacuum, solutions
or a zero
The solution
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,
(1.23)
ul < x/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
continuity
equation However,
for the
a = v = velocity
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
velocity widens
a2 < al breaks states jump also u2 and condition fan. a shock u. expansion destroying must It propagate
adjoining
about the
the
breakup between
expansion Such
to ask
as a shock,
is permitted it leaves
is known
as an expansion
a state
Small
solution Stable
Compression condition
(1.26)
, ,, r_
cross
at the
the
shock
the
slope
of the
shock
in the
slopes point
of the
which
of decreasing case
t intersects
drawn Burger's
initial
at t = 0. In the satisfies
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.
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
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_,
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
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
systems an entropy
in Chapter
waves
in a fashion
(1.26).
as given
1), > _k(Ul)
1.9.
EXERCISES
11
must
the
velocities speed
are
v is the
velocity by the
> V$
c is the k = 3:
-_- el,
of sound.
-3t- C2
(1/$
>
0),
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
In either than more relative weak and travel the slowly shock
behind
shock to the
sound supersonic
waves
in front Thus
shock
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
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
be determined quantities
i.e., by working
conserved
,
meaningful,
momentum,
The
general
(1.22).
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
('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
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
nonlinear
of nonlinear each
in more systems
will be discussed of the determine suited will for artificial will a form form
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
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
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)
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
_
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
.... (2.4) as at
"
(2.6)
For a sufficiently order approximation The ary, properties available. first order where
leading error term as is Eq. (2.5). are data in most and useful are not
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-'
-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
is quadratic
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
by taking following
combinations a fourth
an exact combination
for the
error
order
n2error
df d---xiis again
(2.9)
that n
The may
leading not be
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,
over
Higher order approximations different intervals nAx, chosen above to cancel approach [4]. out The is an
then the
cients approach
leading application
to limit
Richardson
extrapolation
be used
order estimates discretization using linear higher tion Eq. obtained (2.6), Another to obtain different
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
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
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
of trapezoidal approximations linear combinations of the approximation than does derivative yields the trapezoidal
a much
approximation
second
of a function, (2.12)
+ f,-1)
+ O(Ax2). as
be approximated
- 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
of "Traditional"
Solution
Meth-
Having solve
basics
difference equation
approximations,
we will now
attempt
to
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
differential in which
an initial
problem.
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
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
"TRADITIONAL"
SOLUTION
METHODS
17
glance
these of the
may
seem to
equally be
they any
approximations 3, but
of which
guaranteed to Chapter
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
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
approximation,
determined Explicit
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
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,
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
are preferable. velocities for an explicit the associated with but be used (such state solution
contain
large
characteristic
whose
or not
as convection),
dictated case
phenomena is in steady a set of initial dependent state expensive quite Thus solution steps
as sound
a steady be
a small
carefully from
problem
while focus
now
on the
discussion
methods.
Two order
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)
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,
possess at second a
independent
Lax-Wendroff time
[5]. We start
a Taylor's term:
approximation
for U_ +1 about
t ", truncated
U: 1 = U: + At Ov Ot
(2.21)
2.2.
A BRIEF
SURVEY
OF
"TRADITIONAL"
SOLUTION
METHODS
19
may wave
be solved velocity.
-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
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
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
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
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
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
x and derivatives Pu
t, as well of uj.
as In
spatial with
derivatives,
but
derivatives approximation
in Pu
formulas,
numerical
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
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
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
the
current in the At
running
of the
of operators (given
appearing time
in (2.30)
is O(At4).
maximum
criterion
integration
an error
should integration
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
coefficient order
method
of (2.30)
method
the wave Pu
a_ At order such
<__amaz
(2.32) approximation is made, with integration.) is made then e,_z to Ou/Ox, -- 2.06. only
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
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
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
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
direction difference
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
by the while
second
order coefficient
difference not
to to
of diffusion
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 _ 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
In addition,
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
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
scheme may not achieve first order scheme! equation, are such as of functions 1).
a nonlinear
_,and
a = a(u)At/Ax
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
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)
velocities.
aUlo,I
la,I; hence
diffusion
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
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
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,
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.
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
(2.51)
;_
where
a useful
(but
not
unique}
definition
for
v,j is
(
v,y = The ness same
max _klV,+ly
(2.52)
definition definition
in both by the
dissipative transformation
terms
in Eq. properties
(2.49).
This
uniquefields, a
in the
of scalar
subject The
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)
(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.)
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
adding
the
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,
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
of these
As in Chapter
2, we consider time
initial spatial
dependent or boundary
solution in P with
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
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
operator difference
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
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
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-
to Eq. initial
(3.3), data
the
operator data
C(At) at time
advances t n = nAt
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
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
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
=
)} 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
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
-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 _
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
(3.18)
and we
(3.19)
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
[g(_)]_l, Otherwise The practice, the as the numerical following solution may examples
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)
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
stability
of the
Consider
Fourier
transform
a(1
(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)
which
we now
know
to be stable
(3.43)
The
Fourier
transform
of (3.43)
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
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
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.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
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
(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
Figure Academic
3.1:
regions
methods
of order
p. Copyright Inc.
1971
by
Reprinted
of Academic
Press,
At (3.56)
this with
point either
we have method
two (2.30)
options. or (2.31),
The
first both
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
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
We quickly if a second
= 1.3722,
hence will
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
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
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
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
(x, y) of a function
= _
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
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-
(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
_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
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
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
(3.73)
(3.74)
limit
if m = 4, a < 2.0612.
We select
O
a stable
value
for a and
compute
At
--
I_1 +
Az
Ibl"
Ay
(3.75) result
leads
to the
_
which versa: for _ as defined by Eq. (3.69)
+
puts
(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
It is reasonable whole
characteristic
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
(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
real and
A taken
to be a general
i
i
i !
Ill
the terms,
need
viscosity artificial
in finite viscosity
approximations
discontinuous
to damp
numerical
requirement dissipative
satisfy
is the intervals
consistency go to zero.
condiCon-
tion.
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
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.
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
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.
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_,
called
usually format,
names,
to generically defined
are sometimes
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').
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,
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
defined same.
above Translations
assume
that
the
origins
of the which
transformed
(transformations are coordinate of C1) and systems 2+y2+z 2 (1) rotations geometry (2). are related of a rectangular
allowed some
axis (e.g.,
a 45 rotation
x = y -- z); (2) transformations to spherical); rectangular x or (3) any and example, spherical
rsinScos,
_,
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)
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
derivatives 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
the
distances
them.
by the
is a symmetric
components Suppose
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
(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
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
not
only
because
it defines to as where
the
If a is a lower
we wish
b index
U b = gabub,
(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
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
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)
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
be generated be added
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
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
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
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
gradient define
while yield
gradients
of tensors
in general
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
= gadF dbe,
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
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-
symmetric derivative
in coordinate
a is denoted
following
are
;b=B a a
"
(4.31)
t_ab _-_ ;c
_ab _'
,c _ 7-
'_ raeCdb
--
for tensors
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
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
(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
Op O---t+ (PUS);s
= O,
(4.41)
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
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--
,, ) = 0, (4.50)
i_
0e
0 + p)ua] = 0, (4.51)
"i
a--It + Y_'" The last term in (4.52) of the geometries. Integral by the velocity
(grnaub)
Ox"
= O. arises
I
i "
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
,
] and the total mass and energy
P g dx'dx'dx
(4.53)
d---t
(4.54) is
constant.
-_
d f fvf
magdxldx'dxS=
f fvf (Op
_
q-
10ged'_ _pueud---_Xa
gdxldx'dx
3,
(_4.55)
" ,
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
set
of fluid
equations
looks three
like most
to Appendix coordinate
out
50
CHAPTER
4.
ARTIFICIAL
VISCOSITY
AND
CONSERVATION
LAWS
4.3
Dissipation
for
Tensor
Fields
or tensor) and F = F(U) be a generalized
= 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
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
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
(spread
out) form
sharp which
and
damp
oscillations; systems;
3. D is written
in a general
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
go to zero
condition). kind of flux. of order in tensor in the that grid flux be The no a to form.
as the
of some
requires
be a diffusive
derivatives appears
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
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
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
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
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
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,
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
with dissipation are given we will look at the definition 2, the choice
in Chapter
,, = a(u)
of (2.37)
,
when have k the = 1/2, but does conservation,
(4.86)
this isotropy J
its generalization to higher dimensions) invariance properties we seek? is a qualified yes. Isotropy grid point, so that dissipation
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
in multidimensional
problem
systems?
Will
two solutions agree? I do not mean agree even or so, be computed except possibly
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.
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
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
elements original
of the
(such
as diffusion viscosity.
:. %
in anisotropic
materials),
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.
(4.6s)
._ equation
"
as in Chapter 2. The
: -_+,_
semi-discrete
0:
_ k a_]'
approximation 1 is
:=/('4'
(4.69)
dtZ,
dt
|
--
Ax
-16c_)/, +
_ _ for
(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
'
2
1 a
aT + _(r
m,_ ) + ar - # _r _
u':m,./p,
ar /
1) (e -- _pu 1 ,2)
= ('_--
1 1) (e -- _m,,u
,) velocity,
(4.75) which
gas). velocity
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
+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
the
diffusion equation,
to define value
wave current
speed
a.
In in
of a single
of df/du.
problem
equations,
are three
characteristic
u', and u'+ c, where c : _-p/p is governed by the most rapidly of the greatest wave (4.79)
c, to be the magnitude
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
be made
a function has
solution
component
(p, m,
e, or some
combina-
choice
v = v(p)
so we define (4.83)
]p,+l -
L'Hopital's
ap a-; +3
(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"
p, e, r = 0.
u r are antisymmetric,
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),
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)
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
(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- _
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
gas). v, when
The
coordinate velocities at
velocity summed),
equations,
velocity
coordinate equations
is an angular where
momentum, Cj = jag?,
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)
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
ri _,jk
2A
2Ar
'
drn. dt
ijk m Ur
ri a r
az"
1
1 6C,,,)pi .k
'
(4.105)
+,,-Z_,, ["'+'"+"
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)
_,+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
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
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,
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
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
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
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.
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,
(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)
'
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 =
(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
(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
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
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
//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
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
-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
n. of normal exact
(4.131)
fluxes
leaving
The
scheme
of (4.130)
yields
numerical
A numerical
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)
+ :
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
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
(4.135)
eighth to ensure con(4.134),
properly
conservation
64
CHAPTER
4.
ARTIFICIAL
VISCOSITY
AND
CONSERVATION
LAWS
For example,
consider
the
single
equation
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)]
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
(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
(4.140) the grid (and similarly as a test for c,). for hydrody-
+ c) over
The
problem,
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
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
_"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
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
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
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
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.
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
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)
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
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
However, the correct is not attained. has the density goes origin. and going to infinity. Instead a high Note
exact
to the
numertemsound in at
ical solution
reproduce
singular center
nonzero at the
density center,
pressure
represented. largest
is therefore
is Win fact
velocity speed
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
x a = (x, y, z) be rectangular
coordinates,
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?
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%
7. Verify 8. 9. Derive If the meaning 10. Show first 11. Show and
of the
momentum have?
density
are
not
conserved,
what
"conservation choice
diffusion
coefficient
leads
to the
monotonic
scheme the
of Eq.
mid-point finite
(4.134)
and
(4.135)
the in the
standard formula
second
fourth
order
approximations
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
possible. conditions
solid
objects interface.
boundary if viscosity
at the
fluid-object boundary
at such elsewhere
a boundary, (e.g.,
is important
[15],
common
boundary,
which
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
originally
postulated been
in rectangular coordinate
geometry,
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).
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
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)
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
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
Multiplying
sU --_-+
or
As0U Oz +sc
+hili _ + liC
= 0,
......(5..12:)
(5.13) corresponding to the original
= 0,
equation
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-
be made appear
everywhere, forms
side
of (5.14). fluid
must V/to
condition holds
integrability of (5.14).
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
boundary dependent
in the
conditions
Difficulty
specification implying
generally
contains
at the
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
another something
depend involving
approximations
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
to multidimensional
problems
non-rectangular
coordinate
systems
Hedstrom's amplitudes
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
(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
(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
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 = 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
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
s0_V_ U Ot ++SC=0,
which leads to
(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)
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
-1 = A, eigenvectors is the
of eigenvalues
Then
+ T-1MT form
(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.
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-
for an a two
arbitrary dimensional
of boundary Let the necessarily grid points each Away direction corner points side from with
since coordispacrectanat be
space.
coordinate in each
points
(xi, Yi) on a rectangular direction. xy plane, The corner Interior and boundary points. in the points. or more and while
of the
of one each
surfaces (there
point
an associated
tangential at the
dimensions),
each
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
term. form as
The
y term the
is in the
normal
direction,
however, can
in characteristic
so that
appropriate
boundary
conditions
(5.26)
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
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)
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
rectangular
coordinates. cases
solutions
78
CHAPTER
5.
NONREFLECTING
BOUNDARY
CONDITIONS
be
discontinuous,
and
it is necessary
to
add
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+ _("
,.,
(5.41) (5.42)
(5.43) (m The = pv), equation e the energy can
- ,,,_,-,,, _
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
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).
equations, containing
+
am, a_ am_
(pv=)+
(p,,,) = _
,_
+_
,_
(5.45)
0 a
0 ("'v') + _(':''")
(5.46)
o, +
Oe
+
O
a [ amy1
)+
a f
amy1
)'
c5.47)
(5.48) respectively.
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)
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)
eigenvalue 8 in favor
calculation, of p and
for numerical
we eliminate
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
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
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
approximations requires
to integrate
algorithm
boundary
nonreflecting below. as
given equations
We first
= O,
(5.72)
(5.73)
(5.74) or is
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_ =
(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
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
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
defined by treated in a
fashion,
at the
We begin
i)p 0-7+
I-ffxx'
(5.84)
Om 0
Om. 0
_
- _ _, a= )'
(585)
ot, - o= k o= ]'
0(0m
(586)
(5.87)
in the normal to the begin boundary, by writing
due
(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)
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,
- 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
(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
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,
A reflection as demonstrated
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
0v
at for the time derivatives. The
=
time
(5.106)
In conand to
two
trast, the boundary When the right, and none The t = 0 the The left Figure
and no signals are observed. next state example consists (x < 0) has the
is the
time
system
of two spatially p = p = 1, while solution through the No reflections is the 4.9. out Figure scales numerical
adjoining
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
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_
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
nonreflecting
prescription
is further is linear,
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
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
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
about the
this
particular gradient Ov
problem is zero
to specify everywhere,
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
(By
throwing The
out
the
pressure characteristic
gradient
term, left
we have is the
exfluid
problem.
only
velocity
velocity. The The resulting This in general nonreflecting problems be used The result
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
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
= 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,
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
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
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
(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.
Express the results of problem V1 and V2 are called Riemana is constant along Riemann invariants its
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).
of Eq.
Derive the characteristic of EQ. (5.61). Perform M = 0.9. that the the shock wave see
components
fluid problem
calculation
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
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
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
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
(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
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
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
flux (pu=ub + psi) is a second rank is the rate of change of a fluid element as the physical velocity v=, which
same
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
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
(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
a monatomic
complicated
problems
difference equations,
calculations.
dissipation
because
calculations
dissipatlon-free
_ = 0 throughout. with
_ is given
dissipation, ;=
(A.16)
(A.17)
(A.18)
(A.19)
98
APPENDIX
A.
THE
EQUATIONS
OF FLUID
DYNAMICS
ae
1 a
bae'_
-_xb )
-- g cgx _ _g_g
(A.20)
am
at
1 c9 g (3xb (gmau
Og ca ax a
g 1 i)X a c gg bct
-- 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
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
of the tensor forms given above into finite difference errors. One should always eliminate cancellations greatest degree possible before resorting to numerical
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
(A.23)
Coefficients
are zero: rb_ = O. (A.24)
All connection
A.4.
CYLINDRICAL
COORDINATES
99
A.3.2 Set
The
Fluid
with equations.
Dissipation
_ = 0 throughout Density
Op 8_"
-t-
Energy
8e
o_ _
+_k
_]+_
8 +
-8t
(A.26)
x momentum 8rnffi 8t
Cm,_')+
C-%_')+
(m'_') + 8-_
(A.27)
y momentum 8rn v Ot
= 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_
(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)
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
+ _
1 a ;_(_P_ 1 0 r Or
c3 + _(P" _ +
) (A.34)
( o, I 1o(o 1
-_z
Energy
a_
r momentum
;zy_
(A.35)
Op _ r pu _2
A.&
SPHERICAL
COORDINATES
101
x a f am,_ _ a [ (am,
|_-z_ ::Yt
(A.36)
Od_ +rm_
),
ap
4(A.37)
+_k
z momentum amz at
a_ 1+_
k a_
a_ j'
(_m,_')+
a (_,u,) + a, (_'_*) + _
(A.38)
Spherical
coordinates
Coordinates
and are related to rectangular coordinates by
r sin 8 cos _,
r = Cz 2 + y2 + z 2, tan 0 g
y = r sin 8 sin _,
(A.39)
i
I
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
(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,
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')
')
--
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
[6] MacCormack, R. 1971. in Proceedings Numerical Methods in Fluid Dynamics, ed., Springer-Verlag, New York.
[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
on
Pure
A Two Dimensional University. 1971. York. and 1959. Cosmology, Fluid Numerical
Model
for
Galactic
Radio
Jets,
Ph.D.
[10] Lapidus,
tions, [11] [12]
L.,
Seinfeld, Press,
J.H. New
Solution
of Ordinary
Differential
Equa-
Academic
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
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,
Yee,
H.C., A.,
Journal, Physics,
of Computational
Mathematics Communications
of Computation, on Pure
[24] [25]
1978. K.W.
Journal 1986.
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
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.
Memorandum
Agency Code
National Washington,
Aeronautics DC
20546-0001
15. Supplementary
Notes
Point
of
Contact:
Center, 694-6275
16. Abstract
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
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
(of this page) 21. No.
Category
of pages
- 64
22. Price
Unclassified
NASA FORM 1626 OCT 86
Unclassified
111
A06
C-P0 788-?86/79016