You are on page 1of 88

NONLINEAR MAGNETOHYDRODYNAMICS: NUMERICAL CONCEPTS

R. Keppens
FOM Institute for Plasma Physics Rijnhuizen, Association Euratom-FOM
P.O. Box 1207, 3430 BE Nieuwegein, The Netherlands

February 27, 2008


Abstract
The ideal MagnetoHydroDynamic (MHD) equations accurately describe the macroscopic
dynamics of a perfectly conducting plasma. Adopting a continuum, single fluid description in
terms of the plasma density , velocity v, thermal pressure p and magnetic field B, the ideal
MHD system expresses conservation of mass, momentum, energy, and magnetic flux. This
nonlinear, conservative system of 8 partial differential equations enriches the Euler equations
governing the dynamics of a compressible gas with the dynamical influence through the
Lorentz force and evolution through the additional induction equation of the magnetic
field B. In multi-dimensional problems, the topological constraint expressed by the Maxwell
equation B = 0, represents an additional complication for numerical MHD. Basic concepts
of shock-capturing high-resolution schemes for computational MHD are presented, with an
emphasis on how they cope with the thight physical demands resulting from nonlinearity,
compressibility, conservation, and solenoidality.

I. LINEAR ADVECTION PROBLEM


As a preliminary to the full hydrodynamic and magnetohydrodynamic (MHD) system, it is
instructive (see e.g. [7], [6], [5]) to focus on a seemingly trivial problem at first, namely the numerical
solution to the linear advection equation in 1 spatial (x) dimension given by
t + vx = 0.

(1)

Under a constant given velocity v, an initial density pulse (x, t = 0) = 0 (x) will merely be advected
at the constant speed, such that (x, t) = 0 (x vt). Analytically, we are done.
The particular initial data where two constant states are separated by a discontinuity is known
as the Riemann problem and has

l x < 0
(2)
(x, 0) =
r x > 0.
For the linear advection problem, its solution is still trivial and is graphically shown in Figure 1.
Linear advection (v>0)
l

t=t1

x-t plane

vt 1

x= 0

l
t=0
r
x= 0

x= 0

Figure 1: Solution of the Riemann problem for the linear advection equation.
Numerically, we need to discretize the problem both spatially and temporally, and come up with
a recipe to advance the discrete solution ni on grid cells indexed by i (e.g. equidistant grid points
spaced by x) from time level tn to tn+1 . A forward Euler temporal discretization, combined with
a centered difference spatial gradient approximation, suggests as a time-stepping recipe:
n ni1
n+1
ni
i
+ v i+1
= 0.
(3)
t
2x
Unfortunately, this method leads unavoidably to a numerical instability, under all combinations of
time step t and grid size x. This can be predicted by a Von Neumann stability analysis of the
discrete formula (3), which inserts (x, tn ) = Gn o eikx and computes the amplification factor | G |
n+1
defined from n+1 = GGn n Gn . The unconditional instability of the method is found from
s
2

t
| G |= 1 + v
sin (kx) > 1
(4)
x
2

Figure 2: Numerical solution of a Riemann problem for the linear advection equation using the
upwind scheme. Shown is the initial discontinuity placed at x = 0.5 for t = 0, and the numerical
solutions for times t = 2, 4, 6, 8, 10. Note how the profile gets diffused over more and more grid
points, but does advect at the correct velocity v = 1.
for all wavenumbers k.
Luckily, there are several ways to cure the instability (at least conditionally) by slightly modifying the formula (3). One way is to replace the centered difference spatial gradient by a one-sided
gradient operator, taken in the upwinded direction. That is, if the flow goes from left to right
(v > 0), simply use the upwind scheme
n ni1
n+1
ni
i
+v i
= 0.
t
x
The Von Neumann stability analysis of this scheme finds for the amplification
s


t
t
| G |= 1 + 2v
v
1 [1 cos (kx)].
x
x

(5)

(6)

This scheme is conditionally stable, as | G |< 1 for t < x/v. At a given (fixed) grid spacing x,
this poses a limit on the discrete time step. When one numerically solves the Riemann problem for
the advection equation using this upwind scheme (5), the numerical solution will show the correct
advection behavior of the initial step function, but the discontinuity becomes smeared out over
increasingly many grid points. This is illustrated in Figure 2.
A method which mixes spatially forward and backward differences as follows

t n
i = ni v
i+1 ni
x

t
i i1

= ni v
i
x

i
n+1
= i
,
(7)
i
2
3

is known as the MacCormack method, and this can be rewritten as




t ni+1 ni1
n+1
n
i
= i v
x
2
 n

2
i+1 2ni + ni1
2 (t)
.
+v
2
(x)2

(8)

Hence, while the upwind method (5) stabilizes the scheme (3) by replacing the centered spatial
gradient with a one-sided one, the MacCormack scheme (7) in effect adds a diffusive type term.
Indeed, the last term in (8) is recognized as a finite difference approximation to a right hand side
source term
2
t + vx = xx
,
(9)
with MC = v 2 t/2. Note that for the constant coefficient linear advection problem (1) considered
here, the method (8) is also referred to as a Lax-Wendroff scheme. One can obtain this discrete
formula (8) from a truncated Taylor series expansion as
(x, t + t) (x, t) + t

(t)2 2
+
.
t
2 t2

(10)

Using the equation (1), the temporal derivatives can be replaced by spatial derivatives, directly
leading to (8). The Von Neumann analysis gives the amplification
s


(t)2 2
(t)2 2
2
| G |= 1 +
v [cos (kx) 2 cos (kx) + 1]
v 1 .
(11)
(x)2
(x)2
This demonstrates that conditional stability again requires t x/v. The result of solving a Riemann problem with l = 1 and r = 0.1 using the MacCormack method with an increasing number
of grid points is shown in Figure 3. The initial discontinuity is captured numerically by a steep negative gradient region, immediately trailed by an oscillatory part. This oscillation does not disappear
when more grid points are used, but covers roughly the same number of grid points throughout.
This so-called Gibbs phenomenon is an indication of the dispersive properties of this scheme, where
numerical wave signals of different wavelengths (or wavenumbers k) travel at different speeds. Note
that the Riemann problem has an initially monotone (although discontinuous) variation with x, i.e.
there is no internal extremum of (x, t = 0). The MacCormack method introduces internal extrema
seen in Figure 3 from this monotone data, and is therefore non-monotonicity preserving.
Despite its tendency to introduce spurious oscillations at discontinuities, the MacCormack
scheme is superior to the upwind method for smooth solutions. To determine the order of accuracy of a discrete approximation to a partial differential equation, the Local Truncation Error can
be quantified by inserting the exact solution in the discretization formula. For the upwind method
n ni1
n+1
ni
i
+v i
= 0,
t
x

(12)

the local truncation error is found from


LUP
t =

1
v
[(x, t + t) (x, t)] +
[(x, t) (x x, t)] .
t
x
4

(13)

Figure 3: Numerical solution of a Riemann problem for the linear advection equation using the
MacCormack scheme for increasing number of grid points N. We used xi = (1/2 + i)/N with
i = 1, N on x [0, 1] and left state l = 1 and right state r = 0.1. The initial discontinuity
was at x = 0.5, and the solutions correspond to time t = 0.4: the exact solution should jump
discontinuously at x = 0.9
By using Taylor expansions (hence assuming smooth solutions), and using the fact that the solution
obeys t + vx = 0 we find



t
x
UP
Lt =
xx + O t2 , x2 .
(14)
v v
2
t

Since this goes to zero linearly with t for t 0, the upwind scheme is first order accurate. A
similar determination of the order of accuracy for the MacCormack method leads to

 2

x
t2
2
MC
(15)
v
v xxx + O t3 , x3 .
Lt =
2
6
t
Hence, the MacCormack method is second order accurate.
A third option to stabilize the scheme (3) is to replace the ni in the temporal gradient approximation by a centered average, namely
t n
1
( ni1 ).
n+1
= (ni+1 + ni1 ) v
i
2
2x i+1

(16)

This scheme is known as the Lax-Friedrichs discretization. Performing a Von Neumann stability
analysis gives | G |=| cos(kx)i vt
sin(kx) | 1 if t x/v. Furthermore, this discretization
x
is first order accurate since



x2
t
2
2
2
LF
v

+
O
t
,
x
.
(17)
Lt =
xx
2
t2
5

First Order Upwind

Second order MacCormack

Time

First order Lax-Friedrichs

Space
Figure 4: Space-time stencils for the different schemes discussed in the text.
We can rearrange the terms in (16) to write it as
n+1
i



t ni+1 ni1
=
v
x
2
 n

2
i+1 2ni + ni1
(x)
.
+
2
(x)2
ni

(18)

We conclude from this formula that in analogy with the MacCormack method (8), a diffusive term
is added with coefficient LF = (x)2 /2t. Note that due to the condition t x/v, we find
that MC < LF .
Some general considerations and nomenclature can now be introduced. For more extensive discussions of these concepts, we refer to LeVeque [6], Chapter 8.
A method where the Local Truncation Error (LTE) goes to zero when t 0 is said to be
consistent.
When a method is stable and smooth solutions are sought, the LTE and the global error
between the numerical and exact overall solution can be demonstrated to be of the same
order.
The Lax equivalence theorem states that for a consistent method, stability of the scheme is a
necessary and sufficient condition for convergence.
The stencil of a method can be drawn schematically by linking the discrete space-time points
involved in the discrete formula. Stencils are shown in Figure 4 for all three schemes mentioned
thus far.

Figure 5: Error versus number of grid points for periodic advection of a smooth bell profile. Upwind
method (solid) versus MacCormack method (dashed). Representative solutions are at right.
We found that conditional stability was expressed by t x/v for all three usable schemes (5,7,16).
For a chosen grid size x, this condition on the time step will apply generally to any explicit time
stepping scheme where future n+1
values are directly computable from presumed known values ni
i
at time level tn .
To demonstrate that the convergence to the correct solution is in accord with the order of
accuracy, we first simulate the periodic advection of a smooth Gaussian bell profile. The initial
data is shown at left in Fig. 6. Since the side boundaries x = 0 and x = 1 are treated periodically,
after one complete cycle the error can be computed from the difference with the initial t = 0 pulse
(i.e. the analytical solution). This is done after one full advection cycle of the Gaussian profile
for both the upwind and the MacCormack scheme for resolutions [50, 100, 200, 400], as shown in
Fig. 5. Representative solutions are depicted as well. For this smooth initial data, the MacCormack
scheme renders second order accuracy, while the upwind scheme is only first order accurate, as
evident in the slope of the curve for the error versus number of grid points N. Obviously, the first
order upwind scheme suffers from rather large numerical diffusion as the bell profile widens and its
maximum lowers accordingly (conserving the total area underneath the curve).
We now repeat this exercise for two formally second order methods, the MacCormack scheme (7)
and a second order TVDLF scheme, to be introduced later. However, we now contrast the periodic advection of a smooth Gaussian bell profile with the advection of a square pulse, essentially
consisting of two discontinuous jumps. Both initial profiles are shown in Figure 6. The convergence for both methods on both problems is shown in Figure 7 (left panel). Note that the smooth
7

Figure 6: Initial data for periodic advection problems: Gaussian bell and square pulse profile.
profile yields the expected second order convergence, but only first order convergence is found for
the square pulse. Contrasting the numerical solutions at 50 versus 400 grid points (right panels),
one can notice the diffusive properties of this TVDLF scheme, and again the dispersive nature of
the MacCormack scheme. As the initial pulse is fairly narrow, the spurious oscillations from the
latter are dominating the visual appearance of the numerical solution, and are clearly undesirable.
On a single discontinuity, the TVDLF scheme diffuses the jump over a number of grid points, and
the equivalent of Figure 3 for the TVDLF scheme is Figure 8. We will see later that the TVDLF
scheme is monotonicity preserving (monotone initial data remains monotone), which is confirmed
by the observation that for the Riemann problem from Figure 8, no oscillations appear.
These numerical experiments for the linear advection equation are indicative for simulations
of more physical systems. Sophisticated discretization formulae that handle e.g. shocks in gas
dynamics computations will generally balance a wish for high order accuracy on smooth data,
as well as a desire to avoid the introduction of spurious oscillations in numerically representing
discontinuous profiles. As we will see, this combination will call for nonlinearity in the discretization
methods employed.

Figure 7: Error after one cyclic advection of a Gaussian Bell, as well as a square pulse, for increasing
resolutions for MacCormack and TVDLF schemes. At right, solutions are shown for the square pulse
profile advected once over [0, 1].

Figure 8: Numerical solution of a Riemann problem for the linear advection equation using the
TVDLF scheme for increasing number of grid points N. Compare to Figure 3.
9

II. LINEAR HYPERBOLIC SYSTEMS


A generalization from the linear advection equation considers the constant coefficient linear
system given by
~qt + A~qx = 0.
(19)
We now have to solve for m unknown spatio-temporal functions ~q(x, t) m for a given constant
matrix A mm . This linear system is said to be hyperbolic when A is diagonalizable with real
eigenvalues. When all eigenvalues are always distinct, the system is strictly hyperbolic. In that case,
we can determine m real eigenvalues p (with p 6= q for p 6= q) from solving
| A I |= 0.

(20)

The corresponding right eigenvectors obey by definition


A~rp = p~rp with p : 1, . . . , m.

(21)

We can write this in matrix form where the column vectors ~rp are arranged in a square matrix R as

2
.
(22)
[A] [~r1 | ~r2 | . . . | ~rm ] = [~r1 | ~r2 | . . . | ~rm ]

...
m

Calling the diagonal matrix , this is A R = R .


In the strict hyperbolic case where all eigenvectors are distinct, we can compute the inverse
matrix R1 . This matrix then obeys R1 A = R1 , so that its rows determine the left eigenvectors
of the matrix A. These can be denoted as ~lq and are clearly orthogonal to the right eigenvectors as
~lq ~rp = q (as R1 R = I).
p
The solution to the system ~qt + A~qx = 0 is then found as follows:
pre-multiply with R1 or:
redefine ~v R1 ~q to get

(R1 ~q)t + R1 (R R1 )~qx = 0,


~vt + ~vx = 0.

In the new variables ~v , the problem is now reduced to m independent constant coefficient linear
advection equations. The ~v variables are called the characteristic variables and the p are the
characteristic speeds.
Exercise: Consider the 2 2 linear system

ut + 0.5ux + wx
= 0
wt 1.25ux + 3.5wx = 0
Show that this system is strictly hyperbolic. Compute its eigenvalues and the left and right eigenvectors. Calculate the characteristic variables and verify that their evolution is governed by constant
coefficient linear advection equations.
10

Each advection equation t vp + p x vp = 0 has the trivial analytic solution


vp (x, t) = vp (x p t, 0).

(23)

Returning to the original variables using ~v R1 ~q then gives the solution to the full linear hyperbolic
system as
Xm
vp (x p t, 0)~rp .
(24)
~q(x, t) =
p=1

Note how for every point x at time t, the solution depends on the initial data at m discrete points.
In the (x, t) plane, the curves (straight lines) with slopes related to the p by x = xo + p t are called
p-characteristics.
Specifying to initial data corresponding to the Riemann problem for the linear hyperbolic system,
i.e.

~ql x < 0,
~q(x, 0) =
(25)
~qr x > 0,
we can determine the analytic solution as follows. First decompose the constant left and right states
in terms of a linear combination of the right eigenvectors as
~ql =
~qr =

m
X

p=1
m
X

p~rp ,
p~rp .

(26)

p=1

In practice, these expansion coefficients can be found from ~lq ~ql = q due to the orthogonality
between left and right eigenvectors of A. The corresponding characteristic variables at t = 0 are
then obviously

p x < 0,
vp (x, 0) =
p x > 0.
Hence, the characteristic variable vp at later times, cfr. equation (23), is then

p if x p t < 0,
vp (x, t) =
p if x p t > 0.

(27)

Therefore, following the general solution (24), the solution for the Riemann problem posed by (25)
is given by
X
X
p~rp .
(28)
p~rp +
~q(x, t) =
all p where x/t>p

all p where x/t<p

In the (x, t) plane, we can graphically illustrate this solution procedure for dimension m = 3 as
shown in Figure 9. At time t = 0, the two constant states ~ql and ~qr are denoted by their coefficients
(1 , 2 , 3 ) and (1 , 2 , 3 ), respectively. Assuming distinct and ordered eigenvalues 1 < 2 < 3 ,
the three characteristic curves x = p t through the origin (the position x = 0 of the discontinuity
at t = 0) divide the halfplane t > 0 in 4 regions. In each of these four regions, the solution of the
Riemann problem is a constant state. Indeed, according to the formula (28), the coefficients used
in writing ~q(x, t) as a linear combination of the (constant) right eigenvectors ~rp can be found by
11

Linear Hyperbolic System (m=3): solution to RP


x= 1 t

x= 2 t
(1, 2, 3)

x= 3 t

(1, 2, 3)

(1, 2, 3)

x=0
Figure 9: Graphical representation in the (x, t) plane of the solution of the Riemann problem for a
linear hyperbolic 3 3 system.
drawing the three p-characteristics backwards in time from the point (x, t). Their intersection with
the initial t = 0 data determines which of the two coefficients p or p prevails. The three expansion
coefficients then change in the four regions going from left to right: from (1 , 2 , 3 ) (hence ~ql ) to
(1 , 2 , 3 ) (this case is indicated in the figure 9), to (1 , 2 , 3 ) to ~qr = (1 , 2 , 3 ).
Hence, out of one discontinuity separating two constant states for a system of m linear equations,
up to a maximum of m + 1 constant states (m 1 on top of the given left and right state) separated
by m discontinuities emerge. The discontinuities travel at the characteristic speeds given by the
eigenvalues of the coefficient matrix A, while the jumps across the m discontinuities are proportional
to the right eigenvectors of the matrix A.
More on linear hyperbolic systems can be found in Chapter 3 from [6], and Chapter 6 from [5].

12

Figure 10: Numerical solution to the Riemann problem from the exercise at t = 1.
Exercise: Consider again the 2 2 linear system

ut + 0.5ux + wx
= 0
wt 1.25ux + 3.5wx = 0
Compute the analytic solution to the Riemann problem for initial data

  
u
4
~ql =
=
w
1
for x < 0 and
~qr =

u
w

2
100

for x > 0. Figure 10 shows a numerical result for time t = 1, computed using the TVDLF discretization. Is the numerical solution correct?

13

III. NONLINEAR SCALAR EQUATION


In gas dynamics and magnetohydrodynamics, we will have to deal with systems of nonlinear
equations. Nonlinearity introduces the possibility to develop discontinuities in the solution from
initially continuous data. A general nonlinear scalar conservation law for the quantity q(x, t) is
written as
qt + (f (q))x = 0,
(29)
where the flux function f (q) depends nonlinearly on q (the linear advection equation has the linear
dependence f = v q). The inviscid Burgers equation is obtained for f (q) = q 2 /2. Assuming
differentiability, Burgers equation can be written as
qt + q qx = 0,

(30)

so that we can speak of an advection speed proportional to q. Identifying q , the local density
determines the local advection speed, with
R x2 denser regions traveling faster than more rarified regions.
Note further that the spatial integral x1 dx determining the total mass over the interval [x1 , x2 ]
will be the same for all times if the fluxes f (q) at the edges x1 and x2 vanish at all times. This is
the conservation property of equation (29). From these considerations, it is now easily understood
how wave steepening and shock formation can occur. In Figure 11, numerical results are shown for
both the MacCormack (7) [as applicable to the nonlinear scalar equation this method is written out
in equation (56)] and the TVDLF scheme [the latter still to be specified fully in equation (58)]. As
initial data, a triangular pulse is set up. The tip of the triangle experiences the fastest rightward
advection, and in conserving the total area underneath the triangle, the front edge steepens. This
continues up to the point where a true discontinuity appears: the shock front has formed. At all
later times, the solution will remain its form as shown in the right panels. Note again the Gibbs
phenomenon for the MacCormack numerical result, which is absent in the TVDLF simulation.
When we now consider the Riemann problem for the inviscid Burgers equation with q ,
we can expect two totally different outcomes depending on whether the constant left state has the
higher (l > r ) or the lower density (l < r ). In the former case, the discontinuity will remain
(the left state is advected at the higher speed l ), but the speed of the discontinuity s must be
compliant with the discrete equivalent of the conservation law across the shock. This is known as
the Rankine-Hugoniot condition for the discontinuity traveling at speed s, expressed as
f (l ) f (r ) = s (l r ) .

(31)

r
For Burgers equation, we find s = l +
. In contrast, when the left state is of lower density, we expect
2
the right state to run away from the left one, turning the initial discontinuity into a continuously
increasing profile. Note though that the Rankine-Hugoniot relation (31) is symmetric: exchanging
r
r l would still lead to a solution for s = l +
. A physically admissable shock must obey
2
another relation as well, known as the Lax entropy condition.
We can identify f (q) dd fq from (29) as the characteristic speed, like the p in the linear
hyperbolic system. For Riemann initial data with ql joined to qr at x = 0, the characteristics in the
(x, t) plane are then straight lines with slopes changing according to x = f (ql )t and x = f (qr )t. The
Lax entropy condition states that a shock with speed s satisfying the Rankine-Hugoniot relations
must additionally obey
f (ql ) > s > f (qr ).
(32)

14

Figure 11: Initial triangular pulse (left) and shocked numerical solution of Burgers equation as
obtained with MacCormack (top) and TVDLF (bottom) schemes.

15

p-shock

Ul

Ur
p-characteristics

Figure 12: An admissable p-shock will have the p-characteristics converge into the shock, as sketched
in this (x, t) diagram.
This expresses that the shock speed must lie in between the characteristic speeds of the 2 states, and
r
> qr , as expected.
is asymmetric in left versus right state. For Burgers equation, we find ql > ql +q
2
In general, a system of nonlinear equations in the variable U will have multiple characteristic speeds
p , and a jump in the p-th characteristic variable obeying Rankine-Hugoniot is allowed when
p (Ul ) > s > p (Ur ).

(33)

Schematically indicated in Figure 12, p-characteristics then enter the shock from both sides. From
every point on the shock, one can then travel along characteristics backward in time. This indicates
how information reaches the shock from the past, not from the future, as required by causality.
This time-irreversibility argument leads to the nomenclature of entropy condition for (33).
Returning to Burgers equation, we now analyse the case where l < r , and a continuously
increasing profile is expected. For continuous solutions, assuming a x/t self-similarity in the (x, t)
plane such that (x, t) = (x/t) () we find from (29) with q that
df d
d
=
,
d d
d

(34)

or we must have = dd f . For Burgers equation, this means that the solution to the Riemann
problem for which l < r is given by

x < l t
l
x/t l t < x < r t
(x, t) = (x/t) =
(35)

r
x > r t.
When the discontinuity is initially at x = 0, at all later times t the left state is found for x < l t,
and a linear profile connects this state to the constant right state in the region x > r t. This is a
so-called rarefaction wave, as the gas gets rarefied when the signal passes. The result of numerically
solving Riemann problems for Burgers equation with the TVDLF scheme is shown in Figure 13.
16

Figure 13: Riemann problems as solved with the TVDLF scheme for Burgers equation. Left panels:
initial data, right panels: solution at t = 0.5, with the analytical positions of shock wave and
rarefaction edges indicated by dotted vertical lines.

17

To stress the importance of using a discretization which is able to handle discontinuities properly,
suppose we were to apply the following first order upwind-like scheme directly discretizing the
quasi-linear form t + x = 0 as
n+1
ni +
i


t n n
i i ni1 = 0,
x

(36)

where we assumed 0. The particular initial data [1, 1, 1, 0, 0, 0] is seen [5] to remain a discrete
solution that does not change from time tn to tn+1 . However, we know the correct solution should
have the jump traveling rightward, at the shock speed s = 0.5. The reason why this discretization
fails for discontinuous solutions is that it can not be written in a conservative form. A conservative
scheme is of the form

t 
Fi+1/2 Fi1/2 ,
(37)
n+1
= ni
i
x
where the numerical fluxes Fi+1/2 are interpreted as fluxes over cell edges xi + x/2. It turns out
that both MacCormack and the TVDLF scheme are conservative in this sense, and as seen before
capture shocks traveling at their correct shock speeds. The scheme (36) would do fine for smooth
solutions. Another means of conveying the same message is to show that the conservation law given
by
2 3
(2 )t +
x = 0,
(38)
3
is non-equivalent to the inviscid Burgers equation [15], although it expresses the same for differentiable . The correct shock speed associated with a discontinuous solution to (38) is found to be
s = 2 (2r + r l + 2l ) /(3r + 3l ), in contrast with s = (r + l ) /2.
The flux f (q) appearing in the nonlinear conservation law (29) is said to be convex when the
second derivative f (q) has the same sign everywhere, expressing that the first derivative f (q)
varies monotonically. Burgers equation with flux function f (q) = q 2 /2 has this property, and we
saw how the Riemann problem gave rise to either a rarefaction solution or a shock. When we take
as nonlinear flux function f (q) q 3 , the flux is non-convex as f (q) = 6q changes sign at q = 0. In
the solution of the Riemann problem for a scalar equation with a non-convex flux function, a new
possible outcome arises. The familiar cases return as long as we stay on the monotonous side by
e.g. restricting q > 0. Then, we conclude by analogy with Burgers equation that for f (q) q 3 the
rarefaction wave will occur when 0 < ql < qr with solution

ql
x < 3 ql2 t
p
x
(39)
q(x, t) = q(x/t) =
( 3t
) 3 ql2t < x < 3 qr2 t

2
qr
x > 3 qr t.

In contrast, when 0 < qr < ql , the discontinuity is maintained and travels at the shock speed
s = ql2 + ql qr + qr2 .
When we allow for negative states q, we can find a compound solution as follows. Taking
ql > 0 > qr , we can seek an intermediate state qm < 0 which connects to ql discontinuously, hence
2
at shock speed s = ql2 + ql qm + qm
, while at the same time qm is connecting to the right state qr by
a rarefaction solution. This compound solution then has

2
2
x < s t = (ql2 + ql qm + qm
) t = 3 qm
t
ql p
x
2
2
(40)
q(x, t) = q(x/t) =
3 qm t < x < 3 qr t
( 3t )

qr
x > 3 qr2t.
18

Figure 14: Riemann problems as solved with the TVDLF scheme for a non-convex scalar equation.
The discontinuity was placed at x = 0.1 at t = 0, and the frames shown are at time t = 0.27. The
vertical dotted lines in all frames correspond to the analytic locations of shocks or rarefaction edges.
In the left panel, the dashed line indicates the exact solution for the compound wave structure.

Compound wave

Shock

Rarefaction

Figure 15: Schematic solution to Riemann problems for a non-convex nonlinear scalar conservation
law in the (x, t) plane.
For the case considered here, qm = ql /2, and thus this compound solution will only emerge when
ql > 0 > ql /2 > qr .
Example numerical solutions to Riemann problems for qt + (q 3 )x = 0 as solved with TVDLF are
shown in Figure 14, demonstrating the three distinct possibilities. Schematically in (x, t) diagrams,
the three possibilities are indicated in Figure 15.
More on nonlinear scalar problems: Chapters 11 and 16 in [6].

19

IV. FINITE VOLUME DISCRETIZATION


The Euler system for compressible gas dynamics, as well as the ideal MHD system, forms a
set of nonlinear conservation laws. For a single scalar conservation law, written in the differential
form (29), the discontinuous solutions discussed above seem to conflict mathematically with the
implicit assumption of differentiable functions. Physically though, they correctly describe solutions
to qt + (f (q))x = qxx expected in the limit of vanishing viscosity . In fact, the discontinuous solutions are perfectly allowed by the more general integral form of the conservation laws. Considering
a cell [x1 , x2 ] and a conserved quantity within this cell, the total mass in this cell changes from
times t1 to t2 only through a flux over the cell edge f () (provided that no mass sink or source
exists within this cell). This leads to the integral form
Z x2
Z x2
(x, t2 ) dx =
(x, t1 ) dx
x1
x1
Z t2
Z t2
f (x2 , t) dt.
(41)
f (x1 , t) dt
+
t1

t1

Under the assumption of smoothly differentiable functions, and since this holds for any cell [x1 , x2 ]
and time interval [t1 , t2 ], we arrive at the differential form
t + (f ())x = 0.

(42)

The Finite Volume discretization method, see [6], directly incorporates the more general integral
form as follows. Given conservation laws
Ut + F(U) = S

(43)

for the vector of conserved quantities U where possible sources or sinks are collected in S, the Finite
Volume method will solve for the time evolution of cell-averaged quantities U (any U component)
Z
1
Ui (t) =
U(x, t)dx,
(44)
Vi Vi
where Vi indicates the volume (length, area or true volume depending on dimensionality) of grid
cell i. It therefore solves the volume averaged conservation law
Z
Ui
1
1 X
Fl nl =
Sdx,
(45)
+
t
Vi l
Vi Vi
where the cell normals are nl . Since this is consistent with the integral form of the conservation laws,
this approach is ok for dealing with discontinuous solutions as well. Note that for a 1D problem
without source term, this is simply written as

Ui
1
Fi+1/2 Fi1/2 = 0,
+
t
xi

(46)

where Fi+1/2 are fluxes defined at the cell edges. Clearly, this is the conservation form discussed
earlier. Any cell average value changes only through the cell edge fluxes, and the total mass in the
20

entire discretized volume can only change through boundary losses or gains. As explained before,
it turns out to be extremely important to use a conservative discretization of the form (46) in order
to correctly treat discontinuous (weak) solutions: schemes that can not be recasted in this form can
easily produce completely erroneous shock speeds. In fact, all of the schemes (5,7,16), representing
the upwind, MacCormack and Lax-Friedrichs schemes, are conservative. E.g., the upwind flux
from (5) for the linear advection equation is given by
UP
Fi+1/2
=

1
{vi+1 + vi | v | [i+1 i ]} ,
2

while the Lax-Friedrichs flux from (16) is




x
1
LF
vi+1 + vi
[i+1 i ] .
Fi+1/2 =
2
t

(47)

(48)

However, we mentioned that the upwind and Lax-Friedrichs schemes render first order spatial
accuracy. In the Finite Volume discretization, the evaluation of fluxes at the cell edges implies that
some extrapolation within the cell i is needed from the volume averaged value Ui . Simply using a
constant extrapolation where U(x [xi1/2 , xi+1/2 ]) = Ui is of course consistent with Ui as the cell
average, but leads to first order accuracy where averaged edge fluxes Fi+1/2 = (F (Ui ) + F (Ui+1 )) /2
are used. Better, and still consistent with Ui as a volume average, is to use a linear extrapolation
within the cell with slope i , hence
U(x [xi1/2 , xi+1/2 ]) = Ui + i

x xi
.
xi

(49)

The slope is then the difference


i = Ui+1/2 Ui1/2 Ui .

(50)

This linear reconstruction can be exploited to get a Left and Right edge centered state
L
R
Ui+1/2
= Ui + Ui /2 and Ui+1/2
= Ui+1 Ui+1 /2.

(51)

The flux at the cell edge then takes the average from

L
R
Fi+1/2 = F (Ui+1/2
) + F (Ui+1/2
) /2.

(52)

This process of linear reconstruction raises the spatial order of accuracy to second order.
In practice, one must limit the slopes used in the linear reconstruction in order to avoid the
introduction of spurious oscillations. On comparing the slopes as obtained from using neighbouring
left or right cell values, one typically needs to take the least steep slope of the two, and to fall
back on constant extrapolation within a cell when these slopes conflict in sign. Schematically, this
is shown in Fig. 16. Different flavours of slope limiters exist, which ensure the Total Variation
Diminishing (TVD) concept. The numerical total variation is defined as the summed differences
X
TV
| Ui+1 Ui |,
(53)
i

and a scheme is called TVD when it ensures that this total variation diminishes with time
TVn+1 TVn .
21

(54)

Figure 16: Slope limited linear reconstruction process.


Hence, the initial data sets a bound for the total variation at all times, and it is easily appreciated
that this TVD property ensures that monotone initial data remains monotone. In other words, the
TVD property guarantees that the scheme is monotonicity preserving, and it avoids the creation of
spurious oscillations in the numerical solution to the Riemann problem. However, these statements
are strictly speaking only true for a single scalar nonlinear equation, while we will later deal with
systems of nonlinear equations.
Any explicit time marching scheme calculates all fluxes and sources from the known time level
tn . The allowed time step t will then be restricted by the chosen grid size x for numerical
stability, exactly as encountered for the linear advection equation. This Courant, Friedrichs, Lewy
condition or CFL condition on t means that the domain of dependence of the discretization must
include the domain of dependence of the governing PDEs. If the PDEs describe a system in which
the maximal physical speed is denoted by cmax (x), we have that t xi /cmax
for all dimensions
i
i. This ensures that the numerical time step is less than the crossing time of discrete cells by the
fastest wave. Schematically, this is indicated in Figure 17.
Due to this CFL restriction, raising the spatial order of accuracy for explicit time-dependent
simulations calls for a consistent higher order temporal accuracy. Employing a forward Euler onestep time marching for discretizing the time derivative in (46) would make the overall scheme O(t).
This was done in the first order upwind (5) and the Lax-Friedrichs (16) schemes. Second order can
be achieved by a two-step Predictor-Corrector or Runge-Kutta method as in
t
[ F(Un ) + S(Un )]
2 h
i
n
= U + t F(Un+1/2 ) + S(Un+1/2 ) .

Un+1/2 = Un +
Un+1

(55)

We already encountered a similar two-step strategy when introducing the MacCormack scheme (7)
for the linear advection equation. Written out for the nonlinear scalar equation (29), the MacCormack scheme is

t
n
qi = qin
f (qi+1
) f (qin )
x
n


q
+
q
t
i
i
n+1

qi
=
f (qi ) f (qi1
) .
(56)

2
2 x
22

Numerical
Domain of
Dependence

tn+1

tn

xi-1

xi

xi+1

Physical DOD
Figure 17: The CFL condition for explicit schemes, expressing that the numerical Domain Of
Dependence (DOD) must encompass the physical DOD.
Note the differences in the coefficients with the predictor-corrector scheme (55). A method which
follows the latter more closely is the second order Lax-Wendroff method. It is given by

q n + qin
t
n+ 1
n
qi+ 12 = i+1

f (qi+1
) f (qin )
2
2
2x


t
n+ 1
n+ 1
f (qi+ 12 ) f (qi 12 ) .
(57)
qin+1 = qin
2
2
x
In this method, the predictor step delivers intermediate values at half the time step, at the cell
edges xi + x/2. As indicated earlier, for the linear advection equation the MacCormack and
Lax-Wendroff schemes become identical and reduce to (8).
We are now in a position to give the detailed formulae for the second order Total Variation
Diminishing Lax-Friedrichs scheme, abbreviated earlier as TVDLF (see [14]). It uses a predictorcorrector approach where the corrector step computes time centered numerical fluxes from
)
(
L
R
i
h
U
+
U
1
1
1
i+ 2
i+ 2
n+1/2
R
max
L
L
R
(
,
(58)
fi+ 1 =
F (Ui+
) | Ui+
1 ) | c
1
1 ) + F (U
1 U
i+
i+
2
2
2
2
2
2
2
where the left and right states are

n+1/2

n+1/2 /2,
+ U
i

n+1/2

n+1/2 /2.
U
i+1

L
Ui+
= Ui
1
2

R
Ui+
1
2

= Ui+1

(59)

The overbar denotes the slope limiter, with e.g. the minmod limiter given by
i = sgn(Ui Ui1 ) max [0, min {| Ui Ui1 |, (Ui+1 Ui )sgn(Ui Ui1 )}] .
U
23

(60)

Figure 18: After one advection cycle, square pulse (initial data as dotted line) for TVDLF with
minmod (left) versus Woodward (right) slope limiter.
The stencil of this TVDLF scheme is 5 cells wide, through the slope limited linear reconstruction.
This scheme is generally applicable to any system of nonlinear conservation laws, by inserting the
appropriate maximal physical propagation speed cmax . For the linear advection equation cmax = v,
for Burgers equation cmax = . We will see later that for the Euler system, one must use cmax =| v |
+c where c denotes the (local) sound speed, and for MHD cases, c will denote the fast magnetosonic
speed.
The first order variant of TVDLF (without linear reconstruction/limiting and without the
predictor-corrector approach) reduces to the upwind scheme (5) for the linear advection equation,
while the connection with the Lax-Friedrichs scheme is through the replacement | cmax | x/t.
In Fig. 18, the periodic advection of the square pulse using the TVDLF scheme with two different
flavors of slope limiter is plotted (using 200 grid points). The various slope limiters differ in their
diffusive character, with the minmod limiter (60) being most diffusive. These can be compared
with the MacCormack results in Fig. 7. The monotonicity preserving nature of TVDLF is evident.
The nonlinearity introduced by the limiting process prevents spurious oscillations at discontinuities
(essentially rendering local first order accuracy), while yielding second order accuracy on smoothly
varying data. The fact that TVDLF depends nonlinearly on the data from time tn is an unavoidable
consequence from the Godunov theorem. This theorem states that any linear monotonicity preserving method is at most first order accurate. By introducing nonlinearity in the discrete scheme,
TVDLF manages to achieve second order accuracy (for smooth solution parts) with the ability
to preserve monotonicity. In general, methods which incorporate the TVD property will always
degenerate to 1st order accuracy at extrema.
The description of the numerical methods has thus far concentrated on 1D problems. Conceptually, multi-D simulations can be reduced to a succession of 1D problems in the various coordinate
directions. Strang type dimensional splitting for a 2D case writes
Un+1 = Lxt/2 Lyt Lxt/2 Un ,

(61)

where the operator Lxt/2 indicates an update with a timestep t/2 taking account of only the fluxes
in the x-direction. Alternatively, we can alternate coordinate directions as
Un+2 = Lxt Lyt Lyt Lxt Un .

(62)

These dimensional splitting strategies retain the second order accuracy of the individual dimensional
sweeps. As concrete examples, we show the result of several 2D advection tests, where initial profiles
24

Figure 19: Gaussian Bell profile with TVDLF at 1002 and 4002 versus exact.

Figure 20: Convergence behavior for 2D advection tests with TVDLF.

25

Figure 21: Advection of a discontinuity dominated 2D profile with TVDLF at 4002.


physical domain

11111111111111
00000000000000
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111
00000000000000
11111111111111

2 layers of
ghost cells

Computational domain

Figure 22: Boundary conditions are easily implemented by surrounding the domain with ghost
cells.
o (x, y) are advected with constant velocity vector (vx , vy ). Taking a doubly periodic domain [0, 1]2
and (vx , vy ) = (1, 1), the initial profile is advected along the diagonal and will return to its t = 0
shape at t = 1. Figure 19 shows the result of advecting a Gaussian bell profile, shown at right, using
the TVDLF scheme. Two cases for different resolutions, namely 1002 and 4002 are depicted after
one full advection. At the latter resolution, the profile is nearly indistinguishable from the initial
pulse. A quantification of the error at increasing resolution from 502 to 4002 is given in Figure 20,
and it demonstrates the expected second order convergence property. When we take instead a
discontinuity dominated profile, as the one shown in Figure 21 where the density is 2 within and
0.5 outside the contours shown at t = 0, first order convergence is found. The solution at t = 1 for
4002 resolution clearly shows the diffusion of the initial discontinuities. This behavior is identical
with its 1D counterpart.
The 2D advection tests shown used periodic boundaries. In a finite volume approach, these
and many more complex types of boundary conditions are most easily achieved by surrounding the
26

discretized physical domain with several layers of additional ghost cells, as sketched in Figure 22.
For second order schemes like TVDLF, the stencil typically becomes 5 cells wide, so 2 layers of
ghost cells on either side suffice. The implementation of the boundary condition then amounts to
providing values for the variables appearing in the equation in all ghost cells. Periodic boundaries
are easily achieved by copying the corresponding values from the 2 cell layers interior to the opposing
edge. Dirichlet conditions prescribe fixed values in the ghost cells, while zero gradient Von Neumann
conditions can be achieved by copying values from the adjacent physical cell into the ghost cells.

27

V. ISOTHERMAL HYDRODYNAMICS
Following [5], we start the discussion of nonlinear systems with the isothermal hydrodynamic
system. The governing equations then express mass and momentum conservation for a compressible
gas at a constant temperature. This is an acceptable approximation when dealing with the dynamics
of a gas whose cooling time (due to radiative processes) is very short with respect to all other
dynamical time scales. In astrophysical context, these conditions can be met in dilute environments
which are constantly fed energy from a central source (irradiation from a star). To keep the gas
at a constant temperature, one must thus relax energy conservation. Instead of explicitly handling
source and sink terms in an equation governing the energy evolution, the isothermal hydro system
avoids the solution of this equation alltogether, and assumes that the net effect is to maintain a
constant temperature.
We will first study the 1D Riemann problem for this system, where two gases of different density
and velocity make contact at t = 0. When the velocities of both gases are zero, we call this a shock
tube problem. To achieve our 1D problem in a laboratory setting, one may imagine a long, linear
tube filled with two gasses of different density. These are separated by a membrane, while to achieve
isothermality, the whole tube is immersed in a thermal bath kept at constant temperature. Under
such isothermal conditions,
the constant gas temperature Ti will directly quantify the isothermal
sound travel time ci = RTi in the gas, where R is the gas constant. The squared constant value
c2i relates pressure p with the density through p = c2i . Writing momentum m = v with velocity
v, the governing equations are

t + ( v)x
= 0
(63)
mt + (m v + p)x = 0
This writes as

Ut + (F(U))x = 0 ,
where the conserved variables are U = (, m)T and the flux vector is


m
.
F(U) =
m2
+ c2i

(64)

(65)

The flux Jacobian matrix can be used to write the system in quasi-linear form Ut + FU Ux = 0, and
is found to be


0
1
F
2
(66)
FU =
c2i m2 2m
U

In analogy with the linear hyperbolic system, we can determine right and left eigenvalue-eigenvector
pairs. The right eigenvectors (determined up to an arbitrary scale factor) obey FU ~r = ~r, and we
directly find
= v ci
1

1
~r1 =
v ci

2 = v + ci ,


1
~r2 =
v + ci

(67)
(68)

Since ci > 0, the eigenvalues are always distinct. When again introducing the right eigenvectors as
columns in a matrix R, and defining = diag(1 , 2 ), we have once more FU R = R or in full


 


0
1
1
1
1
1
v ci
0
=
(69)
c2i v 2 2v
v ci v + ci
v ci v + ci
0
v + ci
28

Equivalently, we could exploit the variables V = (, v)T and write the governing equations as
! 
 
 
v

0
+
=
(70)
c2i
v t
v x
0
v

The matrix W appearing in this system has the same eigenvalues as indicated above, due to the
relation
FU = UV W UV1 ,
(71)
where we defined the matrix UV from





d
1 0
d
= UV dV =
dU =
dv
v
dm

(72)

Also, the eigenvectors of W and FU are related, with R = UV1 R, where R is the matrix with the
~ p of W collected in columns. One can easily check that
right eigenvectors R


1 1
R=
(73)
ci ci
One can algebraically manipulate the equations to obtain yet another equivalent form for the 1D
isothermal hydro system, namely

(v ci ln )t + (v ci )(v ci ln )x = 0
(74)
(v + ci ln )t + (v + ci )(v + ci ln )x = 0
This form states that along the curves in the (x, t) plane given by dx/dt = v ci , we will have
constant values for the Riemann Invariants v ci ln . These Riemann Invariants can also be
obtained from writing out
dV1
dV2
=
~ 1 )1
~ 1 )2
(R
(R
dV2
dV1
=
~ 2 )1
~ 2 )2
(R
(R

(75)
(76)

Note that we implicitly assumed continuity of the occuring variables in manipulating the system to
these alternate forms. In analogy to the scalar conservation law case discussed earlier, the governing
conservation laws will also allow physically realizable discontinuous solutions representing shocks.
Since matter and momentum must also be conserved across a discontinuity traveling with a speed
and U

s, we arrive at the Rankine-Hugoniot conditions which must hold between the two states U
adjacent to the discontinuity


F(U)
=s U
U

F(U)
(77)
Note the symmetry in this relation, implying that on the basis of this condition alone, interchanging
the left with the right state and the right with the left state still represents an admissable shock.
However, exactly as in the case of the non-linear scalar conservation law (e.g. Burgers equation),
this will generally not be true.
29

When we use the Rankine-Hugoniot relations alone to determine which states U can be connected
= (
to a given state U
, m)
T in accord with the discrete expression of conservation, we find a system
of 2 equations for three unknowns: the shock speed s, and both state variables U = (, m)T . We

will thus find a 1-parameter family of states U, known as the Hugoniot locus for the fixed state U.
Written out in full, we get for the isothermal hydro system

mm

=
s( )
(78)
m2
m
2
2

+
c
(

)
=
s(m
m)

Straightforward manipulation leads to


Note the obvious solution where s = 0 and U = U.

m = m

c ( )

i
q

s =

(79)

Since the density is restricted to positive values only, we can parametrize = (1 + ) where
to lower density states. Using this parametrization,
[1, +[. The part with [1, 0[ connects U
can be plotted as curves in the (, m) plane. This is illustrated in
the Hugoniot locus for state U

= (1, 0)T . From the expression for m() for the Hugoniot
Figure 23 for states U = (1, 1)T and U
one can immediately verify that locally, i.e. at the state U,
the tangent
locus for fixed state U,
=
directions to the two curves coincide with the directions defined by the right eigenvectors ~rp (U)
T
(1, v ci ) for p = 1, 2:
dm
| = v ci
(80)
d

We can further analyse the Rankine-Hugoniot system given by Eq. 77 for the special case of a
stationary shock, where the shock speed s = 0. We find immediately that momentum must balance
m
= m,
and that we can write the second relation as
v +

c2i
c2
= v + i = 2ci
v
v

(81)

where the latter equality holds at the sonic point rs where v(rs ) = ci . This can be used to deduce
the Prandtl-Meyer relation, expressing c2i = vv. This expression states that a stationary shock
v/ci , we get
separates a subsonic from a supersonic state, and introducing the Mach number M
2
2
= v/
. This implies that the density (and hence the pressure) is lower in the
M
v and /
= 1/M
supersonic state than in the subsonic state. This is schematically indicated in Figure 24, introducing
the terminology of pre-shock, upstream matter of low pressure and density, which gets compressed
to high density and pressure post-shock, downstream material. To generalize these findings to a
shock moving at finite speed s, we simply perform a Galilean transformation on these relations,
which leaves the thermodynamic variables unchanged and thus yields
2 = v s =
M
v s

(82)

Upstream, pre-shock matter will see the shock arrive supersonically, and as the shock passes, it gets
compressed with a resulting raise in pressure, and a drop in velocity.
30

= (1, 1)T (left) and (1, 0)T (right), as plotted in the


Figure 23: The Hugoniot locus for states U
(, m) state plane.
So far, we did not introduce any asymmetry between the two states that can be connected by a
will have to be
shock. However, part of the Hugoniot locus which we can draw for a given state U
excluded from consideration. Graphically, the Hugoniot locus consists of 4 curve segments starting
(where the two curves corresponding to the in Eq. 79 that go through U
are separated in
from U
is a left Ul or
a part connecting to lower, and to higher density states). Depending on whether U
right Ur state in a shock configuration, we will need to discard two of these 4 segments on the basis
of physical admissability. To be admissable as a physically realizable p-shock solution, the already
encountered Lax entropy condition must again be satisfied, for the p-th characteristic field. Hence,
this states that the shock speed sp must lie in between the characteristic speed p as evaluated on
each side of the shock
p (Ul ) > sp > p (Ur )
(83)
If we evaluate the consequences of this relation for a left state Ul , we see that an admissable 1-shock
connecting Ul to a right state Ur requires that
r
r
r
l
vl ci > vl ci
= vr ci
> vr ci
(84)
| {z }
l
r | {z }
| {z } |
{z
} 1 (Ur )
1 (Ul )
s1 (Ul )
s1 (Ur )
This can be satisfied only for r > l . Hence, for a left state, we need to exclude that part of the
curve corresponding to 1-shocks which connects Ul to lower density states. Reversely, for a right
state, we need to exclude part of the 1-shock curve which connects to higher density. We also find
that the shock speed for a 1-shock is lower than the fluid velocities on either side of the shock:
s1 < vl and s1 < vr .
31

Pre-Shock

high p,

Upstream
low p,

Post-shock

Downstream

v
v>ci
ci

v<c

Figure 24: A schematic of the pressure, density, and velocity variation across a stationary shock:
upstream, supersonic material gets compressed to subsonic, post-shock material.

32

Um

Ul

x
Figure 25: A graphical solution to the Riemann problem, only exploiting the Hugoniot locus for
left state (1, 1) and right state (1, 0).
A completely analogous reasoning applies to the 2-shock curves, where the Lax entropy condition
r
r
r
l
= vr + ci
> vr + ci
(85)
vl + ci > vl + ci
| {z }
l
r | {z }
{z
} 2 (Ur )
| {z } |
2 (Ul )
s2 (Ul )
s2 (Ur )

translates in r < l . This selects the lower density part of the 2-shock curve for a left state, and
the higher density part for a right state. Now, the shock speed obeys s2 > vl and s2 > vr . Finally,
from both 1-shock and 2-shock Lax entropy relations, we find that vr < vl .
We can already attempt to solve the full Riemann problem on the basis of the knowledge obtained
thus far, where we only considered discontinuous, shock relations, and the Hugoniot locus. Consider
the situation given in Fig. 25, where we want to (graphically) solve the full Riemann problem for a
left state Ul = (1, 1)T and right state Ur = (1, 0)T . Drawn in this Fig. 25 are the complete Hugoniot
curves for both states (as already shown in Fig. 23), momentarily disregarding their status as being
left and right states at t = 0. These Hugoniot loci intersect at two intermediate states, but we
know from the speed ordering 1 < 2 that we only must look at the intersection indicated as Um
such that Ul is connected via a 1-shock to intermediate state Um , which in turn connects via a
2-shock to right state Ur . For the particular case shown in the Figure, this represents also a fully
admissable configuration, since Ul connects to Um via an increasing density 1-shock, while Um
connects to Ur via a decreasing density 2-shock curve. In such case, we can actually compute the
intermediate state Um fully: we have 4 defining equations represented by the Rankine-Hugoniot
relations between Ul and Um , as well as between Um and Ur . These 4 relations determine fully

33

the four unknowns Um = (m , mm )T with the two shock speeds s1 and s2 . This works out to give
s
"
#2

l r
1 vl vr
1 (vl vr )2
l r

m =
+ 4 l r
(86)

2 ci
l + r 2
c2i
( l + r )2


r

l r
vr + vl ci ( l r )
(87)
+
vm =
m +

2
2
l r
m
If we however switch the roles of states (1, 1)T and (1, 0)T in the example above, we arrive at the
situation shown in Fig. 26, which represents an all-shock solution to the Riemann problem with left
state Ul = (1, 0)T which can not be realized in practice: we see that we now selected parts of the
Hugoniot locus which do not obey the Lax entropy condition. In particular, Ul is connected via a
1-shock to lower density state Um , which we excluded on the basis of Eq. 84.
Just as for the nonlinear scalar conservation law, our restriction to purely discontinuity based
solutions to the Riemann problem needs revision, and continuous, self-similar solution parts will
need to be accounted for as well. Noting that the system 63 remains identical when scaling x a x
and t a t, the essential dependence is in a form U(x, t) = U(x/t) U(). We can seek solutions
U() which are continuous in and also yield single-valued U() within a certain range. In
correspondence with the Rankine-Hugoniot relation 77, we now look for a rarefaction type solution
of this kind which connects t = 0 left state Ul to t = 0 right state Ur such that

x 1 t
Ul
w()
1 t < x < 2 t
U(x, t) = U() =
(88)

Ur
2 t x
Within the range 1 < x/t < 2 , we find Ut = w(x/t)t = tx2 w , where w dw
. Also, Ux = 1t w ,
d
so the quasi-linear form of the conservation law Ut + FU Ux = 0 is now written as
FU (w())w () = w ()

(89)

This relation indicates that w () must be (proportional to) an eigenvector of the Jacobian FU (w())
and that must be the eigenvalue. We already computed the possible eigenvalue-eigenvector pairs
for FU and indicated them with ~rp . In the same notation, we must have
w () = ()~rp (w())

(90)

= p (w())

(91)

and furthermore
When we differentiate the latter relation to , we find

p
(w())
1 = p (w()) w () =

p
(w())
m



w1
w2

(92)

where the latter is for the particular case of the 1D isothermal system at hand. Substituting the
proportionality relation 90, this relation gives us () and thereby
w () =

~rp (w())
p (w()) ~rp (w())
34

(93)

Figure 26: A Riemann problem and its solution exploiting the Hugoniot locus for left state (1, 0)
and right state (1, 1), which will not be realizable in practice, as both shocks connecting to Um do
not obey the Lax entropy condition.

35

For the 1D isothermal hydro system, the dividing factor p (w()) ~rp (w()) = ci / (where the
is for p = 1) is always non-zero, for both eigenvalue-eigenvector pairs obtained for p = 1, 2.
Hence, we can always construct the self-similar solution 88 provided that increases monotonically
between 1 < < 2 . From the fact that obeys Eq. 91, we ask a monotonically increasing variation
of p between p (Ul ) < p (Ur ). Note that we here obtain exactly the opposite ordering from the
Lax entropy relation which holds for shocks. In our 1D isothermal system, this implies vl < vr , as
a necessary condition for the possibility of a pure rarefaction wave construction connecting the left
state Ul with the right state Ur .
= (
In direct analogy with the Hugoniot locus for a fixed state U
, m)
T , we can define the
integral curves in the (, m) state plane which graphically represent all states that can be connected
via a rarefaction wave. From the above, we need to solve the defining equation 93, under the
to U
is either the left end state (thus determining the value of 1 ), or the
boundary condition that U
right end state (setting 2 ). Writing out both components of Eq. 93 explicitly, we find the system
of ODEs given by
(
d
= ()
d
ci
m()
dm
=

+ ()
ci
( d
(94)
()
d
=
+
d
ci
m()
dm
=
+
+ ()
d
ci
The first pair of ODEs corresponds to p = 1, or 1-rarefactions, the second is for 2-rarefactions.
Concentrating on 1-rarefactions only, the first equation directly yields () = c exp(/ci ). To
is left state, we need 1 = 1 (U)
= v ci , and we arrive at
obey the boundary condition where U


1
() = exp
(95)
ci
Using this in the second equation for 1-rarefactions then determines


1
m() = ( + ci ) exp
ci

(96)

Taken together, this states how v() = +ci along 1-rarefactions, indicating at any time t, a spatially
would be right state, the same is obtained, with formally 2 1 (of
linear velocity profile. If U
course then again 2 = v ci ). We can eliminate the parameter and obtain a closed form relation
as
m() for the 1-rarefactions for given U
m() = v ci ln

(97)

The derivative evaluated at also coincides with v ci , so locally the 1-rarefaction integral curve
is similar to the 1-shocks from the Hugoniot locus. The 2-rarefactions can be found to yield the
integral curves given by

(98)
m() = v + ci ln

is ~r2 (U).
We can plot both integral curves, e.g. parametrizing =
and its tangent vector at U
(1 + ) with [1, +[ as done for the Hugoniot curves before, and this is shown in Figure 27
36

= (1, 1)T .
Figure 27: Both integral curves, for the state UU

=
Figure 28: A comparison of the full Hugoniot locus, and both integral curves, for the state UU
T
(1, 1) .

37

Right State

Left State
S

2
R1

Ur

Ul
S1

R1
2

Figure 29: A schematic, local representation of the physically realizable parts of both shock and
rarefaction wave curves, for the case of a left state, and for the case of a right state.
= (1, 1)T . In Figure 28, we now plot both the Hugoniot locus, and the integral
for the state U
= (1, 1)T . Note that they deviate from each other, despite their local
curves, for the fixed state U
coincidence.
consisting of 1Strictly speaking, we now have 8 curve segments coming together in the state U,
to either
shock and 2-shock curves, as well as integral curves for 1- and 2-rarefactions, connecting U
lower, or higher density states. Of course, only four will be relevant for solving a Riemann problem
is either left or right state at t = 0. Indeed, suppose that U
is actually the left state in
where U
the discontinuous initial condition, then we already saw that the Lax entropy relation excludes the
1-shocks to lower densities, as well as the 2-shocks to higher densities. Since the requirement for
rarefactions was that of monotonically increasing p , i.e. p (Ul ) < p (Ur ) from above, which is
exactly the opposite ordering of the Lax entropy condition 83, we note that the relevant parts are
as indicated in Fig. 29 for a left state, while they are reversed to those shown in the same Fig. 29
for a right state. Indeed, for the case of a left state and a 1-rarefaction, we saw that m() is given
by Eq. 97. Since 1 (Ul ) < 1 (Ur ) tells us that vl < vr , this equation 97 evaluated at the right state
yields also that l > r . Hence, a left state can connect to lower density, increased velocity right
state by means of a 1-rarefaction. All other cases follow a similar reasoning.
We can now solve the Riemann problem for the 1D isothermal hydro case for arbitrary t = 0
left Ul and right Ur states. As should be clear from the discussion thus far, we will typically need
to find intermediate state Um which is connected via a 1-wave (either a shock or a rarefaction)
to Ul , in turn being connected via a 2-wave to Ur . This means that we can concentrate on the
1-wave curves through Ul , which as we now know connect to lower density states via 1-rarefactions,
and to higher density states via 1-shocks. Similarly, through right state Ur , we normally need only
the 2-rarefactions connecting to lower, and the 2-shocks connecting to higher density states. This
is schematically indicated in Fig. 30. This picture is also intuitively clear, as shocks must lead
to increased density, compressed states, while rarefactions indicate gas rarifications, i.e. drops in
density. Depending on the relative orientation of the left and right states in the (, m) state plane,
we will then arrive at 4 different possibilities. These are collected in Fig. 31, in a schematic fashion.
The first shown there is the 1-shock, 2-shock solution, whose middle state we also computed in
equation 87. A second possibility is where both wave types are of the continuous, rarefaction type
38

Form L-1-M-2-R

2
M
L

S2

From intersections of
R1

2-shock to increased
density states

1-shock to increased
density states

1-rarefaction to
decreased density states

2-rarefaction to
decreased density states

Figure 30: The basic parts involved typically when solving the Riemann problem for 1D isothermal
hydro: a left state with its 1-wave types connecting to higher (shock) and lower (rarefaction)
density states, and the right state with its 2-wave types similarly connecting to higher (shock) or
lower (rarefaction) density states.

39

solution (where we know that then we need vl < vr ). Using the formulae collected for rarefactions
above, one can solve for the intermediate state Um analytically too, and one finds


vl vr

m =
l r exp
(99)
2ci
vl + vr ci l
(100)
+ ln
vm =
2
2 r
Two other possibilities involve one rarefaction, and one shock component, and are shown schematically in the last two panels of Fig. 31.
For completeness though, 4 more somewhat degenerate cases must be accounted for as well, in
which case states Ul and Ur happen to be connected by a single wave type only. It can indeed
happen that Ur lies exactly on the 1-shock curve segment connecting the left state Ul to higher
density states. This case is schematically shown in Fig. 32, and is the reason why the 1-shock curve
segment to higher density states for the right state Ur needs to be included as well. Similarly, Ur
may accidentally lie on the 1-rarefaction integral curve connecting Ul to lower density. The two
final degenerate cases occur when left state Ul happens to lie exactly on the 2-wave curves through
state Ur , such that either a pure 2-shock, or a pure 2-rarefaction wave emerges as solution to the
Riemann problem. Taking these 4 special cases in consideration as well, we arrive at 8 possibilities
to be accounted for as exact solution to the Riemann problem for the 1D isothermal hydro system.
Since we were able to determine the solution to the Riemann problem for the 1D isothermal
hydro equations for any two randomly chosen left and right states, it is a very useful system
to check whether a shock-capturing numerical solution reproduces the various outcomes properly.
One could use the TVDLF method 58 for this system, where the maximal propagation speed
cmax is set equal to | v | +ci , and confront numerically produced solutions with the predicted
outcome. This is done for three different cases in Fig. 33, each time showing the numerically
obtained density profile at t = 0.15 in the panel at left, while showing the predicted solution as
graphed in the (, m) state plane in the panels at right. The first test considers Ul = (1, 0)T with
Ur = (0.125, 0)T initially separated at x = 0.5. Drawing in the physically realizable parts of the
Hugoniot locus for both states (solid red curves for Ul , and solid black curves for Ur ), together
with the realizable parts of the integral curves (dotted curves), we see that the solution must be
a 1-rarefaction connecting left state Ul to middle state Um = (0.346, 0.367)T . This Um is in turn
connected via a 2-shock to Ur . Note that the numerical solution indeed represents an accurate
approximation. The second test takes Ul = (0.445, 0.31061)T with Ur = (0.5, 0), and is such that
a 1-shock connects to Um = (0.667, 0.193)T , in turn connected via a 2-shock to Ur . This doubly
discontinuous solution is indeed numerically approximated well: few grid points are needed through
both shocks in the density panel at left. The third example considers left state Ul = (0.5, 0)T and
right state Ur = (0.445, 0.31061)T . The graphical analysis in the (, m) state plane demonstrates
that this will trigger two rarefaction waves, with the middle state Um = (0.333, 0.136)T , in accord
with eq. 100. The computed density profile indeed agrees nicely with this overall continuous solution.
Finally, the computed solutions can also be verified to obey the continuity of the Riemann invariants
associated with different (continuous) wave families. In particular for the first of our test cases which
led to a Ul 1-rarefactionUm 2-shockUr solution, we can plot both Riemann invariants at t = 0.15
as a function of position. This is shown in Fig. 34. In agreement with the discussion given earlier,
the v + ci ln invariant which stays constant on curves dx/dt = v + ci in the (x, t) plane, remains
constant through the 1-rarefaction and equal to the initial left state value, up to the location of
40

R1

S2

M
L

R
R
R2

1
2

R1

S2

R
L

S1

R
R

S2

2
M
L

R
R1

L
R2

S1

1
S2

2
M
R
L

R1
R2

L
S

Figure 31: A schematic representation of the solution to the Riemann problem, for the 4 generically
different solution types. At left is a sketch in a (x, t) diagram indicating the shocks and/or rarefactions which connect left and right state to the newly formed, middle state. At right is a schematic
representation of the relevant parts of the Hugoniot and integral curves, which depending on their
orientation in the state space (, m) determine the type of solution.
41

S
R on Hugoniot locus of L

R1

1
R

S
R1

R on integral curve of L

R
S

R1

S2

R1

S1

L on Hugoniot locus of R

R2

S2
R2

S2

2
R
L

L
R

R
S

R1
L on integral curve of R

L
S

Figure 32: A schematic representation of the special, degenerate cases as solution to the Riemann
problem, for the 4 generically different solution types.

42

Figure 33: For three different initial Riemann problem conditions, a numerical solution showing the
density at t = 0.15 at left, and the graphical solution using the state-plane representation at right.

43

Figure 34: For the first of the test cases shown in Figure 33, the Riemann invariants plotted as
function of x at time t = 0.15.
the 2-shock discontinuity. In contrast, the v ci ln Riemann invariant shows variation through
both the 1-rarefaction and the 2-shock, as it would only remain invariant through a 2-rarefaction
component.

44

VI. THE EULER EQUATIONS


The governing conservation laws for the 1D dynamics of a compressible gas are the Euler equations, written as

= 0
t + ( v)x
mt + (m v + p)x = 0
(101)

et + (e v + p v)x = 0.

They express mass, momentum, and total energy conservation. The vector of conserved quantities

U= m
(102)
e
contains the density , momentum density m = v, and total energy density computed from
v 2
e=
+
2
|{z}
kinetic

p
1
| {z }

(103)

thermal energy

with the gas pressure denoted by p, and the ratio of specific heats = cp /cv entering as a parameter.
The specific heats cp and cv are generally defined as follows. We first express the thermal energy
in terms of a specific (i.e. per unit mass) internal energy esi such that esi = e = p/( 1). For an
ideal gas, a temperature can be computed from p = RT with gas constant R. Also, an ideal gas
has its specific internal energy depending on temperature only esi (T ). The specific heat at constant
volume is by definition
d esi
cv =
.
(104)
dT
Hence, esi = cv T for the ideal gas case. For defining the specific heat at constant pressure, the
specific enthalpy
e+p
(105)
hs = esi + p/ =

is introduced. Then
d hs
cp =
.
(106)
dT
, where n is an integer
For an ideal gas, we find cp cv = R. Generally, their ratio = cp /cv = n+2
n
quantifying the total number of degrees of freedom over which internal energy can be distributed.
Molecules composing the gas can have translational, rotational, or vibrational degrees of freedom.
For a monoatomic gas, only the three (in 3D) translational degrees of freedom exist and = 5/3.
Another state variable is the entropy S = p (actually, the entropy is cv ln S + const but we
will refer to S as entropy). From the Euler system (which neglects viscosity, thermal conduction,
and heat addition - considering adiabatic processes only), one can deduce
S
S
+v
= 0,
t
x

(107)

so that the flow is isentropic: the entropy of a gas parcel is merely advected with the flow velocity.
Note that (107) is NOT in conservation form since generally v(x, t). It does express that in the
45

(x, t) plane, the entropy is constant along curves dx


= v. Using equation (107), along these curves
dt
dx
=
v
we
can
deduce
the
so-called
characteristic
equation
dt
dp c2 d = 0,

(108)

where dp = pt dt + px dx and c2 = p/. The velocity


s
p
c=
|S

(109)

is the sound speed (the partial derivative is taken at constant entropy). The flow speed v will be
shown to correspond to one of the characteristic speeds for the Euler system, and equation (107)
= v.
identifies S as a Riemann invariant along the characteristic curves dx
dt
The components of the vector

,
v
V=
(110)
p
are referred to as the primitive variables. The Euler system written in terms of these variables is
not in conservation form, and is given by


v 0

v + 0 v 1 v = 0.
(111)
p x
p t
0 p v

From this system, one can deduce

vt + (v c) vx
Using c =

1
(pt + (v c)px ) = 0.
p

(112)

and under constant entropy S = p , we find




2c
v
1



2c
+ (v c) v
= 0.
1 x
t

(113)

2c
= v c, we have the Riemann invariant v 1
. For curves dx
= v + c, the invariant
Along curves dx
dt
dt
2c
is v + 1 . In analogy with the characteristic equation (108), the Euler system can be reformulated
in three characteristic equations, namely

dp c dv = 0 along
dp c2 d = 0 along
dp + c dv = 0 along

dx
dt
dx
dt
dx
dt

= vc
=v
= v + c.

(114)

The Euler system exploiting the conservative variables U can be written as Ut + (F(U))x = 0
where we introduce the flux vector

m
m2 3

F(U) = 2 + ( 1)e .
(115)
1 m3
em
2 2

46

When we use the flux Jacobian matrix

FU =
U

em
2

0
m2 3
2 2

+ (

3
1) m
3

we can write the system in quasilinear form as

1
0
m
(3 )
1

m
3 m2
+ (1 ) 2 2

Ut + FU Ux = 0.

(116)

(117)

In analogy with the linear hyperbolic system, we compute the eigenvalues and the right eigenvectors
of the flux Jacobian to find
q
m
= v c with right eigenvector
eigenvalue 1 = p

~r1 =
eigenvalue 2 =

v2
2

1
1
= v c ,
vc
c2
+ 1 vc
hs vc

= v with right eigenvector

1
~r2 = v ,

eigenvalue 3 =

(118)

v2
2

(119)

= v + c with right eigenvector

~r3 =

v2
2

1
1
= v + c .
v+c
c2
+ 1 + vc
hs + vc

(120)

Because c > 0, the three eigenvalues are distinct and the Euler system is strictly hyperbolic. We
can anticipate that, similar to a 3 3 linear hyperbolic system, up to 3 characteristic waves will
emerge from the initial Riemann problem data when two constant states are joined discontinuously.
As before, we can introduce the matrix R = (~r1 | ~r2 | ~r3 ). The left eigenvectors ~lq , normalized to be
orthonormal to ~rp , are then given by the rows of the matrix



1
+ 4vc 2 + ( 1) vc 21c 1 + ( 1) vc
2 c2
v2
(121)
R1 =
( 1) cv2
1) c12 .
1 1
2 c2

 (1
v
v
1
v
4 c 2 ( 1) c + 2 c 1 ( 1) c
2 c2

The eigenvalues p can also be deduced directly from the Euler system (111) written in terms
of the primitive variables V. Start by writing (111) as
Vt + W Vx = 0,
47

(122)

and (117) as Ut + FU Ux = 0. Introducing the matrix R whose columns consist of the right
eigenvectors ~rp of FU and the diagonal matrix from the eigenvalues p , we have by construction
FU R = R, as in the linear hyperbolic case. Defining the matrix UV from dU = UV dV we conclude
that
FU = UV W UV1 .
(123)
It follows directly that W and FU have the same eigenvalues, and their right eigenvectors are related
~ p of W as its columns. Similarly,
by R = UV1 R, where R is the matrix with the right eigenvectors R
~ q of W correspond to the rows of the matrix R1 = R1 UV . These matrices are
left eigenvectors L
given by

1 0
0
1 1 1
0 2c 2c12
0 . (124)
R = c 0 c and R1 = 1 0 c12 and UV = v

1
v2
1
2
2
v 1
0 + 2 c 2c2
c 0 c
2

There are direct relationships between the Riemann invariants, the characteristic equations, and
the left eigenvectors from either conservative R1 or primitive R1 formulations. Introducing the
vector collecting the Riemann invariants

2c
v 1
,
S
(125)
R=
2c
v + 1
the defining equations for the Riemann invariants (107,113) can be written as
Rt + Rx = 0.

(126)

This is equivalent to the characteristic equations (114) stating that


h
i
h
i
p
~lp dU
~
= L dV
= 0.
dx=p dt

We can note further that

dx=p dt

Rt R1 Ut = R1 Vt ,
Rx R1 Ux = R1 Vx .

Exercise: Consider the 1.5 dimensional isentropic hydrodynamic system, given by

t + (m1)x

 = 0

m21
= 0
(m1 )t + + p()
x



(m2 )t + m1 m2
= 0.

(127)

(128)

(129)

In the isentropic case, the pressure is given by p = S0 with constant entropy S0 and polytropic index
. The 1.5 dimensionality reflects the fact that while we consider 2 velocity components (vx , vy )
(v1 , v2 ) (m1 /, m2 /), translational invariance y = 0 is assumed in the y direction so that the
problem remains essentially one-dimensional. Compute the flux Jacobian, its eigenvalues, and its
left and right eigenvectors. Derive the governing equation for the primitive variables V = ( v1 v2 )T .
Verify that the eigenvalues of the matrix W appearing in this primitive formulation are identical
48

~ p and left eigenvectors


to the eigenvalues of the flux Jacobian. Compute the right eigenvectors R
~ q for the W matrix. Check the relations between matrices R, FU , W , R. Compute the Riemann
L
invariants and find that for this system (as long as 6= 1)

2c
v1 1
,
v2
R=
(130)
2c
v1 + 1
with c =

dp
.
d

For the isothermal case for which = 1, what are the Riemann invariants then?

49

VII. EULER SYSTEM AND RANKINE-HUGONIOT


The Euler system allows for discontinuous solutions where a constant left state Ul = (l ml el )T is
separated from a constant right state Ur = (r mr er )T by specific jumps in the conserved quantities
at a location which travels at a shock speed s. Such a traveling discontinuity must still obey the
discrete equivalent of the conservation laws, expressed by the Rankine-Hugoniot relations F(Ul )
F(Ur ) = s (Ul Ur ), hence

ml mir = s(l r )

i h 2
h m2 3
mr 3
l
+ ( 1)el r 2 + ( 1)er = s(ml mr )
(131)
l 2
i
h
i h

3
3

m
m
1
1
e
m
e
m
l
r
l l

= s(el er ).
r r
2
2
l

Note that for a given right state, this constitutes a system of 3 equations for 4 unknowns, namely s
and Ul . In particular, a contact discontinuity which travels at the fluid velocity s = v (corresponding
to the characteristic speed 2 ) and only carries an arbitrary jump in density l 6= r , while having
constant velocity vl = vr = v and constant pressure pl = pr = p, is a viable solution to the RankineHugoniot relations. This contact discontinuity is seen to have an entropy/temperature/density
jump, advected with the local fluid velocity. Hence, the numerical treatment of these contact
discontinuities in gas dynamic simulations already calls for a scheme which appropriately deals with
advection problems of discontinuous profiles.
Apart from the contact discontinuities, genuine shock solutions are also obtained from the relations (131). Analyzing these relations for the case of a stationary shock where s = 0, we find
ml = mr and
vl2
c2
v2
c2
+1 2
+ l = r + r =
c.
(132)
2
1
2
1
2( 1)
The last equality is for the sonic point where v = c . The Prandtl Meyer relation follows then as
c2 = vl vr , expressing that a stationary shock separates a super- from a subsonic state (w.r.t. c ).
If we introduce the Mach number Ml = vcll , we find relations between the left and right primitive
variables depending on Ml (and ) only. Indeed, we get
( + 1)Ml2
vl
,
=
vr
( 1)Ml2 + 2
l
( 1)Ml2 + 2
=
,
r
( + 1)Ml2
pl
+1
=
.
pr
1 + 2Ml2

(133)

The maximal compression ratio r /l for a very strong shock Ml is then seen to reach
( + 1)/( 1) = 4 for = 5/3.
For a moving shock, we use a Galilean transformation of the above relations, which leaves all
+1
and P = pprl , the two parameters for
thermodynamic quantities unchanged. Introducing = 1
a moving shock are P and the shock speed s (together with and hence ). The relations for
the primitive variables across the moving shock (assuming vr s 6= 0 thus excluding the contact
discontinuity) are then
+P
r
vl s
(134)
=
= ,
vr s
P + 1
l
50

(s vl ) =

c2l




+ 1 pr
1 .
1+
2
pl

(135)

Note in particular that when the pressure ratio pr /pl is close to unity (weak shock), we find that
the shock speed will be s = vl cl , in correspondence with the characteristic speeds 1 , 3 . See
further discussions in [15] and [11].
VIII. THE RIEMANN PROBLEM FOR EULER
As already encountered in the case of the scalar Burgers equation, not all shock solutions obeying
the Rankine-Hugoniot relations (131) are physically admissable. We can analyze the possibility for
continuously varying rarefaction wave solutions where U(x, t) = U(x/t) U() as follows. From
the quasilinear form (117), we deduce that for such self-similar solutions,

d
d
dm
d
de
d

We write this in shorthand notation as

d
d
dm
d
de
d

FU U = U .

(136)

(137)

This expression means that must be an eigenvalue p of the flux Jacobian FU , and that U (with
the prime indicating the derivative with respect to ) must be proportional to the corresponding
right eigenvector ~rp . Hence
= p (U()) and U = ()~rp (U()).

(138)

Differentiating the first expression with respect to we find


1=


p d p d m p d e
+
+
= U p U
d
m d
e d

(139)

Using the correspondence between U and ~rp , the proportionality constant () is found from
() =

1

.
U p ~rp

(140)

We determined the possible values p for the Euler system to be v c and v, and their right
eigenvectors in (118,119,120). One can verify that the construction to determine () fails for
2 = v, since

U 2 ~r2 = 0.
(141)

This indicates that the second characteristic wave family is linearly degenerate, and only has
the discontinuous contact discontinuity solution. For the first and third wave family, rarefaction
solutions are possible.
Exercise: Consider again the 1.5 dimensional isentropic hydrodynamic system. Verify that
a shear wave representing an arbitrary jump in the tangential velocity component v2 , but without
51

1-rarefaction

CD
2-shock

Uml

3-shock

Umr

Ul

Ur
x

Figure 35: Schematic solution to the Riemann problem for the Euler system.
change in density and normal velocity v1 is a valid solution to the Rankine-Hugoniot relations for
this system with shock speed s = v1 . Demonstrate further that the second characteristic wave family
related to this shear wave is linearly degenerate.
We now have all ingredients to appreciate the general solution to the Riemann problem for the
Euler system. Out of the contact point of the initial two constant states Ul and Ur , normally 3 wave
signals will emerge separating 4 constant states. The two emergent intermediate states Uml and Umr
will be connected by a contact discontinuity traveling at the speed v which is identical for these two
states, as is the intermediate pressure p . The remaining Rankine-Hugoniot relations connecting
the left state Ul with Uml via a 1-wave and Ur with Umr via a 3-wave then mathematically
constitute a system with 6 equations for the six unknowns, namely (s1 , ml , v , p , s3 , mr ) with the
shock speeds s1 and s3 . Physically though, not all shock solutions are allowed. An admissable shock
will have the fluid increase its entropy as the shock passes. Therefore, either one of the 1-wave
or 3-wave signals can be a rarefaction wave instead. In case the 1-wave is a rarefaction fan, we
know from the discussion of the Riemann invariants that the entropy S as well as the quantity
v + 2c/( 1) will remain constant through the rarefaction, and identical for Ul and Uml . When
the 3-wave is a rarefaction, we conclude that the entropy S and v 2c/( 1) will be the same
for Ur and Umr . Schematically, the Riemann problem for the Euler system leads to the generic
solution as sketched in Fig. 35. This figure assumes the particular (but rather typical) case where
the solution consists of a rarefaction wave, a contact discontinuity and a genuine shock.

52

Exercise: The exact solution to the Riemann problem for 1D hydro can be numerically computed as follows (see also Toro [11], chapter 4). The pressure in the intermediate region p can be
found as the zero of the function
f (p, Ul , Ur ) = fl (p, Ul ) + fr (p, Ur ) + vr vl .
In this expression, we have

fk (p, Uk ) =


 12
2

(+1)k

(p pk )
(1)p

p+ +1 k

2ck
1

  1
2
p
pk

if p > pk (shock)

if p pk (raref action)

The velocity in the middle region is then


v =

vl + vr fr (p ) fl (p )
+
.
2
2

This zero can be computed using a Newton-Raphson scheme on the function f (p), with start value
e.g. p0 = 0.5(pr + pl ) (better start values may exist, and may need to be used to avoid the generation
of negative pressure values!). Another way to find the zero is to note that with pmin = min(pl , pr )
and pmax = max(pl , pr ) the signs of f (pmin) and f (pmax ) will determine which bracket to use for the
zero p : it lies in [0, pmin ] when f (pmin) > 0 and f (pmax ) > 0; it is [pmin , pmax ] when their signs
differ; and p is in [pmax , +] when f (pmin) < 0 and f (pmax ) < 0. These statements can be made
since f (p) can be shown to be a monotonous function of p. There is a caveat: pressure positivity
requires f (0) < 0 leading to
2cl
2cr
+
> vr vl .
1 1

If this condition is not fulfilled, vacuum will be created (and this case needs special treatment). Once
the initial bracket for the zero is identified, a simple bisection algorithm can be employed as well to
zoom in on the root of f (p). As always, a root for a nonlinear function is computed numerically
to within a certain accuracy, hence the quotation marks for denoting this as an exact solution.
As seen from the above formula, whether we have a left shock or rarefaction ultimately depends on
p > pl or p < pl , respectively. Similarly, the character of the right nonlinear wave is determined
by which pressure is dominant: p or pr .
With knowledge of Ul , Ur , p and v as well as the nature of the left and right nonlinear wave, we
can then fully compute the solution as function of x at any time t (it will be a self-similar solution,
essentially depending on x/t if the initial discontinuity is placed at x = 0). For a shock, we need
to determine its shock speed (s1 or s3 ), and the density across the shock. These follow both from
Rankine Hugoniot, and in essence use Eqns. 134-135. If we know the signal is a rarefaction, we can
use the knowledge of the generalized Riemann invariants across these continuous waves to deduce
the density (since entropy is constant) in the middle (left or right) state. The rarefaction
p wave itself
will have a tail and head position which are given by vk ck and v c where c = p / . The
variation through the rarefaction is then also found in function of x/t from the knowledge of the
53

Riemann invariants on the rays x/t = v c. In particular, for a left rarefaction one then finds:


2
1 
= l
vl
+
+ 1 ( + 1)cl


1
x
2
cl +
,
vl +
v =
+1
2
t

2
1 
p = pl
vl
+
+ 1 ( + 1)cl

x
t

2
 1

(142)
(143)

 2
x  1
.
t

(144)

Deduce these expressions, find the corresponding expressions for the variation through a right rarefaction, and consecutively write a little plotting program which shows the variation of , v, p and
the 3 Riemann Invariants R at any point x in a (finite) domain [xmin , xmax ] at any time t, for a
Riemann problem with given left and right state Ul and Ur seperated at the middle of the interval
for t = 0. An extra input parameter is the ratio of specific heats , and the number of points used
in between [xmin , xmax ] to produce the plots.

54

IX. SHOCK-CAPTURING SCHEMES FOR EULER


We can now present the basic concepts exploited in modern high resolution (i.e. second order
accurate in smooth regions), shock-capturing schemes for the Euler equations. They involve some
reconstruction procedure (e.g. the linear reconstruction ensuring the TVD property and second
order spatial accuracy) to obtain cell edge values for conservative/primitive variables, to be used in
the flux computations. For obeying the conservation properties on the discrete numerical level, we
always use a conservative scheme of the form

dUi
1
Fi+1/2 Fi1/2 = 0,
+
dt
x

(145)

with the time stepping done in a predictor-corrector approach. As usual, cell values Ui change
through fluxes across cell edges, with the edge-centered numerical flux having a certain stencil
Fi+1/2 (Uip , Uip+1 , . . . , Ui+q ). Different choices for this numerical flux are indicated in what follows.
A. TVDLF for the Euler system
The simple but robust second order TVDLF scheme from equation (58) for the Euler system
uses as maximal physical propagation speed cmax =| v | +c in the flux expression, written out per
component of F(U) as
(
)
h
i
ULi+ 1 + UR
1
i+ 21
L
R
max
R
L
2
F (Ui+ 1 ) + F (Ui+ 1 ) | c (
) | Ui+ 1 Ui+ 1
.
(146)
Fi+ 1 =
2
2
2
2
2
2
2
Minor variations of this formula can be found easily. One can use instead of the maximal physical
propagation speed of the arithmetic average (UL + UR )/2, the maximum of each state separately,
i.e.
max (| cmax (UL ) |, | cmax (UR ) |) .
(147)
The TVDLF method is also referred to as Local Lax-Friedrichs method, since it uses a local value
for the maximal propagation speed. In fact, the first order variant was exploited as early as in 1961
by Rusanov [9], to numerically solve several shock-dominated 2D gas dynamic problems. In the
second order variant, slight improvements may occur when performing the linear reconstruction on
the primitive variables V instead of the conservative variables U.
To demonstrate the typical outcome, we perform a series of Riemann problem calculations for
1D Euler flows using the 2nd order accurate, conservative, TVDLF discretization. We use 200
grid points on x [0, 1], typically place the t = 0 discontinuity at x = 0.5, and set the ratio of
specific heats = 1.4 (representing a diatomic gas like O2 in air, where three translational and
two rotational degrees of freedom are taken into account). Boundary conditions represent open
boundaries x = 0, by continuous extrapolation of the solution into the two ghost cells (on each
side). Various tests that follow are taken as in Wesseling [15], Chapter 10.
The classical Sod problem is a shock tube problem: the sudden removal of a diaphragm
separating 2 gases at rest. This Riemann problem takes
Vl = (l , vl , pl )T = (1, 0, 1)T and Vr = (0.125, 0, 0.1)T
55

(148)

Figure 36: TVDLF solution for the Sod problem (148) at t = 0.15. Top panels show density ,
velocity v, and pressure p. Note how velocity and pressure remain constant through the contact
discontinuity. The bottom panels plot the Riemann invariants from equation (125). Note how the
second and third Riemann invariant stay constant through the leftward going rarefaction wave.

56

Figure 36 shows the numerical solution at t = 0.15. [See [15], Fig. 10.2 for exact solution, where
ENTROPY indicates ln S]. We clearly identify a leftward traveling rarefaction wave, a rightward
traveling contact discontinuity, and a rightward traveling shock. Note how through the rarefaction
wave the two Riemann invariants S and v + 2c/( 1) remain constant, while v and p are constant
across the contact discontinuity. The shock is resolved over a few discrete cells, but the contact
discontinuity is spread over (too) many cells. Slight under/overshoot errors can be detected in some
variables, which are influenced by the precise choice of the limiters (minmod here).
Similar conclusions can be drawn from a test case from Lax, where two states in relative motion are considered. Taking an initial rightwardly moving left state, with Vl = (l , vl , pl )T =
(0.445, 0.698, 3.528)T and Vr = (0.5, 0, 0.571)T , the solution at t = 0.15 is given in Figure 37.
[See [15], Fig. 10.3 for exact solution, where ENTROPY indicates ln S].
Both the Sod and Lax test cases remain subsonic as M = v/c < 1. Supersonic flows are
considered in a Mach 3 test from Arora and Roe, with
Vl = (l , vl , pl )T = (3.857, 0.92, 10.333)T and Vr = (1, 3.55, 1)T .

(149)

The obtained solution at t = 0.09 in Figure 38 shows how the contact discontinuity is rather poorly
resolved, with pronounced overshoots in the Riemann invariants. Note also that the most rightward
signal is a shock which is spread over many grid points. [See [15], Fig. 10.4 for exact solution, where
ENTROPY indicates ln S].
A somewhat better behavior is found for a supersonic shock tube problem taking Vl = (l , vl , pl )T =
(8, 0, 8)T and Vr = (0.2, 0, 0.2)T . The solution at t = 0.1562 depicted in Figure 39 also contains a
strong transonic rarefaction wave, and suffers from much less spurious overshoots. [See [15], Fig.
10.8 for exact solution].
In all but the Mach 3 test, the shock was rather well captured numerically: only few cells are
needed to resolve that discontinuity (in contrast to the contact discontinuity). The TVDLF scheme
may behave rather diffusive for slowly moving weak shocks as well. The solution at time t = 0.175
of a problem taking
Vl = (l , vl , pl )T = (1, 1, 1)T and Vr = (0.9275, 1.0781, 0.9)T

(150)

is given in Figure 40. Note how (too) many cells are needed to represent the slowly rightward
moving weak shock (at right). [See [15], Fig. 10.15 for exact solution].
The diffusion of a contact discontinuity by the TVDLF scheme is most obvious when a stationary
contact discontinuity, i.e. an exact solution to the Euler system, is solved numerically. Setting
Vl = (l , vl , pl )T = (1, 0, 0.5)T and Vr = (0.6, 0, 0.5)T , the TVDLF result at times t = 0.1 and
t = 1 is compared to the exact t = 0 solution in Figure 41. As time progresses, increasingly (too)
many cells are needed to represent the contact discontinuity.
On the positive side, the TVDLF scheme does well for more continuous (transonic) flows, and
recognizes rarefaction waves. Indeed, when we start with two states with the same entropy, as Vl =
(l , vl , pl )T = (1, 3, 10)T and Vr = (0.87469, 2.46537, 8)T , where = 5/3, a single rarefaction
wave emerges. This problem is taken from Falle [3]. The solution shown in Figure 42 took 800
cells from [0, 800] and shows the velocity v at times t = 0 and t = 40 and t = 80. The leftward
rarefaction wave is nicely recovered numerically.
The outcome of a 1D Euler Riemann problem can occasionally contain two rarefactions, or two
shocks for both the 1-wave and the 3-wave signal. A rather severe numerical test that leads to
57

Figure 37: TVDLF solution for the Lax problem at t = 0.15. Top panels show density , velocity v,
and pressure p. Note how velocity and pressure remain constant through the contact discontinuity.
The bottom panels plot the Riemann invariants from equation (125). Note how the second and
third Riemann invariant stay constant through the leftward going rarefaction wave.

58

Figure 38: TVDLF solution for the Mach 3 problem (149) at t = 0.09. Top panels show density
, velocity v, and pressure p. Note that velocity and pressure should remain constant through the
contact discontinuity. The bottom panels plot the local Mach number M = v/c, and the second and
third Riemann invariants from equation (125). Note how the second and third Riemann invariant
stay constant through the leftward going rarefaction wave, but clearly show overshoots at the contact
discontinuity.

59

Figure 39: TVDLF solution for the supersonic shock tube problem at t = 0.1562. Top panels show
density , velocity v, and pressure p. Note that velocity and pressure remain constant through the
contact discontinuity. The bottom panels plot the local Mach number M = v/c, and the second and
third Riemann invariants from equation (125). Note how the second and third Riemann invariant
stay constant through the leftward going rarefaction wave.

60

Figure 40: TVDLF solution for the slowly moving weak shock problem (150) at t = 0.175. Top
panels show density , velocity v, and pressure p. The rightmost signal (at x 0.5) is a shock,
which is particularly smeared over many grid cells. The bottom panels plot the local Mach number
M = v/c, and the second and third Riemann invariants from equation (125).

61

Figure 41: TVDLF solution for a stationary contact discontinuity, at t = 0 (left) and t = 0.1 and
t = 1 (right). The exact solution should maintain the discontinuous density profile from t = 0 at
left.

62

Figure 42: TVDLF solution for a rarefaction wave, seen in the velocity v at t = 0 and t = 40 and
t = 80.

63

two strong rarefaction fans is set up by creating a central evacuation as follows


Vl = (l , vl , pl )T = (1, 2, 0.4)T and Vr = (1, 2, 0.4)T .

(151)

By taking the same left and right thermodynamic conditions, and artificially reversing the velocity
discontinuously, this test will lead to two rarefactions separated by a zero velocity, near vacuum
state. [This is Test 2 in Toro [11], Chapter 10, p.329]. In fact, when the initial separating velocities
would be raised even higher, eventually a true vacuum state would be formed. The rarefactions
resulting from (151) go transonic, and the numerical result for TVDLF is shown in Figure 43 at
t = 0.15. Note that the entropy quantifies the numerical error directly: it should remain constant
throughout but instead shows O(1) variation! Also, the other Riemann invariants clearly show
erroneous variations. The middle constant state should have zero velocity, and the largest errors
seem correlated with the position of the sonic point (where v = c) in both rarefactions.
A Riemann problem that leads to the creation of two shocks is given by
Vl = (l , vl , pl )T = (5.99924, 19.5975, 460.894)T and Vr = (5.99242, 6.19633, 46.0950)T . (152)
[This is Test 4 in Toro [11], Chapter 10, p.329]. The TVDLF result at t = 0.035 is given in Figure 44.
Both shocks are well captured, the left shock needing more grid points due to its slow movement.
The contact discontinuity is significantly smeared out.
Its diffusive nature makes the TVDLF scheme not optimally suited to study pure linear wave
dynamics. To illustrate this statement, we simulate linear sound waves by implementing a time
dependent driver v = A sin (2t/P ) at x = 0 in the ghost cells. When we start from (t = 0) = 1,
v(t = 0) = 0, p(t = 0) = 0.6 with = 5/3, taking A = 0.02 with P = 1 generates sound waves (of
amplitude 0.01) which travel a unit distance in unit time. Figure 45 compares TVDLF results at
t = 4 for 100 versus 400 grid points on [0, 5]. Obviously, the wave damping is purely numerical,
and we conclude that a high resolution (already in 1D) is needed to battle the numerical diffusion.
This must be kept in mind when detailed linear wave interactions are of interest. On the other
hand, repeating the simulation with an amplitude A = 0.2, the nonlinear sound wave steepening
and shock formation is well captured, as seen in Figure 46. Note how 10 % variations already imply
significant nonlinear effects, such that the ability of shock-capturing schemes are really desirable.
In summary, besides some clear shortcomings, the TVDLF method is rather reliable and can be
used succesfully on many shock-dominated 1D and multi-dimensional problems.
B. Riemann solver based methods
The TVDLF method uses only the maximal eigenvalue of the flux Jacobian, and essentially no
knowledge of the generic solution as sketched in Figure 35 to the Riemann problem for the Euler
equations. At the other extreme, a method originally proposed by Godunov was to consider the cell
averaged values Uni for time t = tn as piecewise constant data throughout the cells, and then use the
exact nonlinear solution of the Riemann problems at the cell interfaces in the numerical flux. The
x
discrete but time-variable time step is restricted to obey tn+1 < 2 max|
n | , with the maximum taken
p
over all eigenvalues of the flux Jacobian FU . This restriction ensures that no wave interaction occurs
in one cell within tn+1 , so that the solution to the Riemann problem remains
self-similar in x/t.

xx
i+1/2

Denoting the exact Riemann problem solution for state Uni and Uni+1 as U
, Uni , Uni+1 , the
t
64

Figure 43: TVDLF solution at t = 0.15 for a Riemann problem given by (151) leading to two
rarefaction waves. Top panels show density, velocity and pressure, bottom panels the three Riemann
invariants from (125). Note the error in the entropy - which should remain constant throughout and in both other Riemann invariants. The central region should remain at rest (v = 0) and contain
a near-vacuum state.

65

Figure 44: TVDLF solution at t = 0.035 for a Riemann problem given by (152) leading to two
shock waves separated by a contact discontinuity. Top panels show density, velocity and pressure,
bottom panels the three Riemann invariants from (125).

66

Figure 45: TVDLF solution for linear sound waves at 100 versus 400 grid points.

67

Figure 46: TVDLF solution for nonlinear sound wave driving at 400 grid points.

68

Godunov scheme then uses as numerical flux



0, Un , Un ).
Fi+1/2 (Ui , Ui+1 ) = F(U
i
i+1

(153)

Ut + AUx = 0, A R33 ,

(154)

Due to its piecewise constant representation of cell values, this original Godunov scheme is
at best 1st order accurate. In any case, it requires an exact solution to the nonlinear Riemann
problem, which is a rather complicated process involving an iterative solution procedure to handle
the nonlinearities. It was soon realized that one might just as well solve the Riemann problem in
an approximate fashion. Approximate Riemann solver based schemes then use some linearization
of the nonlinear problem, and capitalize on the fact that the exact analytic solution for a linear
hyperbolic system is known.
In what follows, we describe the widely used Roe solver for 1D hydrodynamic simulations. See
also Chapter 10 from Wesseling [15]. As a general procedure to numerically solve the 3 3 system
Ut + (F(U))x = 0, one considers again the local Riemann problem obtained from a left and right
cell interface value Ul and Ur . Instead of using the exact nonlinear solution, Roe suggested to solve
a linear Riemann problem instead, namely

where the constant matrix A = A (Ul , Ur ) must satisfy the conditions


F(Ul ) F(Ur ) = A(Ul , Ur ) (Ul Ur ),
A(Ul , Ur ) FU (Ur ) as Ul Ur ,
A(Ul , Ur ) has only real eigenvalues,
A(Ul , Ur ) has a complete system of eigenvectors.
These conditions ensure that the exact Riemann problem solution is obtained when the initial
states obey the Rankine-Hugoniot relations, i.e. are separated by a single shock transition or
contact discontinuity. Indeed, when (Ul , Ur ) are such that F(Ul ) F(Ur ) = s (Ul Ur ), the first
condition ensures that Ul Ur is an eigenvector of A with eigenvalue equal to the shock speed s.
The solution of the linear Riemann problem merely maintains this jump at the physically correct
shock speed. The second condition ensures consistency with the original nonlinear equations. The
last two conditions guarantee solvability of the linear Riemann problem.
Provided such a Roe matrix A can be found [if there is one satisfying all Roe conditions, it can
be shown to be unique], the Roe scheme uses the numerical Roe flux expression at the interface
between cells i, i + 1 given by
(0, Ui , Ui+1 ) .
Fi+1/2 (Ui , Ui+1 ) = Ai+1/2 (Ui , Ui+1 )U

(155)

indicates the exact solution of the linear Riemann problem.


In the above expression (155), U
Let us write the eigenvalues p and right eigenvectors ~rp of the local Roe matrix Ai+1/2 (Ui , Ui+1 ),
hence
Ai+1/2~rp = p~rp .
(156)
More explicit expressions for the Roe flux can then be obtained as follows. As encountered in the
discussion of the linear hyperbolic system, one decomposes both states in terms of the eigenvectors
69

X
X
~rp , writing Ui =
p~rp and Ui+1 =
p~rp . The same decomposition of the difference Ui+1 Ui
then introduces coefficients p from
X
X
Ui+1 Ui =
(p p ) ~rp
p~rp .
(157)
As found from the analytic solution (28) for the Riemann problem for the linear hyperbolic system
[note the change in notation p p and p p ], the solution along the (x, t) ray (xxi+ 1 )/t = 0
2
is thus
X
X
=
p~rp .
(158)
p~rp +
U
0>p

0<p

Alternative expressions are

=
U

p~rp +
X
= Ui +

or similarly

p <0

p <0

(p p )~rp

(159)

p~rp ,

X
p~rp +
(p p )~rp
X p >0
= Ui+1
p~rp .

=
U

This is then combined to

(160)

p >0

= Ui + Ui+1 + 1
U
2
2

p <0

p~rp .

(161)

p >0

The Roe flux (155) then becomes

= 1 Ai+1/2 (Ui + Ui+1 ) + 1


Fi+1/2 = Ai+1/2 U
2
2

p <0

p Ai+1/2~rp .

(162)

p >0

As a result of the first Roe condition imposed on the matrix A, and due to the fact that for the
hydrodynamic system we find the (purely) mathematical equality F(U) = F(U), the Roe flux
is written as
1
1X
Fi+1/2 = (F(Ui ) + F(Ui+1 ))
| p | p~rp .
(163)
2
2
The solver is then completely determined once the matrix Ai+1/2 that satisfies the Roe conditions
is constructed. For the Euler system, this starts by noting that in terms of the components of the
vector

v ,
Z=
(164)
s
h
, all components of the vector of conserved quantities U and of
using the specific enthalpy hs = e+p

the flux vector F(U) can be written as quadratic functions alone. One can verify easily that when
writing Z = (z1 , z2 , z3 )T , we find

z1 z2
z1 z1
and F = +1 z2 z2 + 1 z1 z3 .
z1 z2
U=
2

1
z z + 1
zz
z2 z3
1 3
2 2 2
70

It is then possible to compute matrices B and C which have elements linear in z = 21 (zi + zi+1 )
such that Ui+1 Ui = B (Zi+1 Zi ) and Fi+1 Fi = C (Zi+1 Zi ). The matrix Ai+1/2 C B 1
then satisfies Ai+1/2 (Ui+1 Ui ) = Fi+1 Fi , which is recognized as the first Roe condition.
This procedure leads to the introduction of the so-called Roe-averages for the velocity and
specific enthalpy as

i vi + i+1 vi+1
(165)
v

i + i+1
s
i hi + i+1 hsi+1
s

h
(166)

i + i+1
In terms of these averages, the matrix Ai+1/2 is found to be

0
1
0
3 2
Ai+1/2 =
v
(3 )
v
1
2
1 3
s
s
2
h
( 1)
v vh
v

v
2

(167)

from (116), i.e. the flux Jacobian


By mere inspection, this matrix is seen to be identical to FU (U)
 s
 T
+ ( 1)
= (
evaluated at the Roe average state U
, m,
e)T , v, h
v 2 /2 / . The Roe
average density is defined to be = i i+1 . Since we know that the flux Jacobian of the Euler
system has real eigenvalues and a complete system of eigenvectors, this matrix clearly satisfies all
other Roe conditions as well.
All ingredients appearing in the Roe flux (163) are now known. From a given left and right
state, we compute the Roe average. The eigenvalues p in terms of the Roe-average state are then
known to be 1 = v c, 2 = v, 3 = v + c, where the sound speed for the Roe average state follows
s v2 . The right eigenvectors are explicitly given by
from c2 = ( 1) h
2

1
1
1
~r1 = v c ~r2 = v ~r3 = v + c .
v2
s vc
s + vc
h
h
2

(168)

The wave strength coefficients p quantify the jumps in the conserved variables and could be
computed from the left eigenvectors ~lq of the Roe matrix as p = ~lp (Ui+1 Ui ). Alternatively, and
~ p of the primitive variable
for practical implementation purposes, one can use the left eigenvectors L
formulation to express the p directly in terms of jumps in the primitive variables Vi+1 Vi as
~ p (Vi+1 Vi ). Writing i+1 i we then find
p = ~lp (Ui+1 Ui ) = L
1
(p cv)
2
c2
1
= 2 p
c
1
=
(p + cv) .
2
c2

1 =
2
3

(169)

Note the direct correspondence with the characteristic equations (114).


As a final note on approximate Riemann solver based schemes, to ensure spatial second order
accuracy, the linear reconstruction and limiting procedures discussed earlier could be applied directly
71

Figure 47: TVDLF (top) versus Roe based (bottom) solution for the Sod shock tube.

72

Figure 48: TVDLF (top) versus Roe based (bottom) solution for the Mach 3 test.
on the jumps in the characteristic wave fields. This is a frequently used alternative to reconstructing
and limiting the conservative or primitive variables.
We now directly compare numerical results for several of the 1D Riemann problems introduced
earlier. We contrast the endresults for the 2nd order TVDLF scheme with those obtained with a
one-step, second order accurate scheme employing a Roe solver. Starting with the classical Sod
shock tube problem given by (148), Figure 47 shows density, velocity and pressure at time t = 0.15
for TVDLF (top panels) versus the Roe-based scheme (bottom). It is seen that the Roe solver
shows a slight improvement in the resolution of the contact discontinuity. At the 200 grid points
used in the calculation, other differences are quite marginal.
The Mach 3 test case defined by (149) shows a rather striking result for the Roe based method:
Figure 48 shows how in contrast to the TVDLF scheme, the Roe method erroneously recognizes the
initial discontinuity as a stationary solution! This error is due to the presence of a transonic mach
M = 1 point. [See also the discussion in Wesseling [15], Chapter 10]. For the initial states (149),

73

we saw that the TVDLF method produced the physically correct transonic rarefaction associated
with the 1 wave family. The states are such that the eigenvalue computed in the Roe scheme as
1 = v c is (essentially) zero, and the wave strengths p associated with the 2nd and third wave
family also (nearly) vanish 2 = 3 = 0. The Roe flux then reduces to a central discretization as
Fi+1/2 =

1
(F(Ui ) + F(Ui+1 ))
2

such that discontinuities are insufficiently smeared out. An entropy-violating (wrong!) solution
may then occur. The remedy to avoid this problem is known as a sonic entropy fix, and it merely
replaces the eigenvalues 1 and 3 in case they approach zero. Introducing a small fixed parameter
, a sonic fix for the Roe scheme then writes if | 1 |< or | 3 |<


1 2p
p
+ .
2
This is thus only effective when transonic solutions | v | c occur. Repeating the Mach 3 test case
with a sonic entropy fix, Figure 49 shows noticable improvements for the Roe solver as compared to
the TVDLF scheme. This is particularly true for the contact discontinuity and rightward traveling
shock part of the solution. In the transonic rarefaction, the Roe result still shows a small sonic
glitch. In fact, even with the mentioned entropy fix, the Roe-based method failed to produce results
for the severe double transonic rarefaction test given by (151).
A clear improvement of the numerical solution from a Roe-solver based scheme over the TVDLF
results is found for the case of the slowly moving very weak shock given by (150). The diffusive
TVDLF scheme smeared out the rightward moving shock over a large number of grid points. In
Figure 50, the (bottom) Roe result is seen to capture the shock with an acceptable low number of
grid points. Finally, another clear advantage of the Roe method is its capacity to recognize and
maintain a static contact discontinuity as exact solution of the Euler system. The stationary contact
discontinuity depicted at t = 0, t = 0.1 and t = 1 in Figure 51 is not diffused at all with the Roe
scheme, showing a radical improvement from the TVDLF result.
In summary, it is clear that the Roe solver is mathematically more involved than the TVDLF
method, but by design incorporates more of the governing physics in its flux computations. It needs
an artificial entropy fix for transonic expansion fans, but overall represents a contact discontinuity
better, especially stationary ones which are recognized as steady solutions. It is doing fine on
slowly traveling weak shocks as well. These conclusions are true for the 2nd order variants of the
TVDLF and the Roe-based TVD type schemes, both of which are heavily used in multi-dimensional
hydrodynamic simulations.

74

Figure 49: TVDLF (top) versus Roe based (bottom) solution with entropy fix for the Mach 3 test.

75

Figure 50: TVDLF (top) versus Roe based (bottom) solution for the slowly moving weak shock
test.

76

Figure 51: TVDLF (top) versus Roe based (bottom) solution for a stationary contact discontinuity.
X. 1D MHD SIMULATIONS
Turning now to ideal MHD simulations, we start in a 1D configuration where all variables are
function of the first (x) coordinate only, but vector quantities can have components perpendicular
to this direction. Since we assume no variation in these other directions, the B = 0 constraint is
1 . Together with the
trivially enforced by keeping a constant x-component of the magnetic field B
1 ). In a 1.5D approach where only 1
ratio of specific heats , there are then two parameters (, B
orthogonal component is considered, the system to solve Ut + (F(U))x = 0 becomes a nonlinear,
5-component PDE system for the conserved quantities U = (, v1 m1 , v2 m2 , e, B2 )T . Its
flux vector F(U) has the entries

m1
m21

2 + ( 1)(e m2 ) + (2 ) B2
B

2
2

m1 m2
1 B2

B
.
F(U) =
(170)




2
2
m1 e ( 1) m + (2 ) B B
m1
m2

1 (B1 + B2 )

2
2
m
m1
1 2
B2 B

The total energy density now reads

e=

p
v 2 B 2
+
+
,
1
2
2

(171)

2 + B 2 ).
consisting of internal, kinetic and magnetic contributions (where v 2 = v12 + v22 and B 2 = B
1
2
Note that we have adopted magnetic units where vacuum permeability is unity.
The eigenvalues of the flux Jacobian FU are now v1 , v1 cs , and v1 cf , where the (squared)
77

v-c s
v-c a

v+cs

v-c f

v+ca
v+cf

x
Figure 52: The schematic (x, t) diagram denoting the solution of the Riemann problem in 1.75D
for the MHD system: backward and forward traveling fast, Alfven, and slow waves are separated
by a contact discontinuity traveling at the plasma velocity v. Fast and slow signals can be shocks,
rarefactions, or compound in type.
slow cs and fast cf magnetosonic speeds are

s
2
2
2
2

p B1
1 p + B
p + B
.

4
c2f,s =
2

(172)

1 /, while the other turns into


In the limit of zero B2 , one of them becomes the Alfven speed ca = B
the sound speed c. In general, the following ordering applies cs ca cf . Including third vector
components and the corresponding two additional equations for m3 and B3 , this 1.75D system for
U = (, m1 , m2 , m3 , e, B2 , B3 ) has the full 7 characteristic speeds v1 , v1 cs , v1 ca , and v1 cf .
This makes the solution of the simple Riemann problem in 1D MHD quite involved. Indeed, up to 5
signals separating 6 constant states can emerge out of two constant states in contact for 1.5D MHD,
while up to 8 states can form spontaneously in 1.75D Riemann problems. The latter is sketched
schematically in an (x, t) diagram in Figure 52. The middle wave associated with the flow speed v1 is
again a contact discontinuity: one can verify that an arbitrary density (hence temperature/entropy)
jump leaving all other variables (velocity, pressure, magnetic field components) constant is again a
viable solution to the Rankine-Hugoniot relations for the 1.5D or 1.75D MHD system. It can be
shown that this wave is again linearly degenerate. The Alfven signals correspond to non-compressive
disturbances in the orthogonal components v2 and B2 , while both slow and fast magnetoacoustic
signals are compressive.
For the MHD system, it is again possible to show that the governing equation for the entropy
S = p is given by (107). The entropy S is then again found to be a Riemann invariant, and will
remain constant through fast/slow rarefaction waves.
It is possible to design a Roe-type approximate Riemann solver, by following the same procedure
as outlined for the 1D Euler system. This was done by Brio and Wu [2], and the same authors pointed
out a number of peculiarities in applying this procedure to the MHD system. It is clear from the
expressions of the characteristic speeds (172) that situations exist where eigenvalues coincide. The
1.5D or 1.75D MHD system is thus not strictly hyperbolic, contrary to the 1D Euler system (101).
78

The points where strict hyperbolicity fails are termed umbilic points. For the 1.75D case, when
1 = 0, both the Alfven speed ca and the slow speed cs vanish, so that v1 is an umbilic point
B
of multiplicity 5. In case the orthogonal magnetic field components vanish B2 = 0 = B3 , the
2
B
eigenvalues v1 ca are at least of multiplicity 2, and even of multiplicity 3 when also 1 = p
. The

latter case represents the so-called triple umbilic point for the 1.75D MHD system. Related to
these degeneracies of the eigenvalues, the right eigenvectors of the Jacobian matrix FU can contain
indeterminate factors (divisions by zero when components contain factors like 1/(c2s c2a )). As
the eigenvectors are determined up to an arbitrary scaling factor, it turns out that most of these
indeterminacies can be avoided by mere renormalization. Still, limiting cases must be handled
properly. Moreover, it turns out that for general ratio of specific heats , there is no equivalent for
the MHD system of the Roe-average state from the 1D Euler system. Hence, one typically works
with the Jacobian matrix evaluated at a mere arithmetic average of the left/right states. Note that
in contrast to the Roe-type solvers which have to deal with all these complications explicitly, the
simple TVDLF scheme only exploits as maximal physical propagation speed cmax =| v1 | +cf .
As representative numerical tests for the 1D MHD system, a few Riemann problems and a test
case focused on Alfven wave propagation are presented. Starting with a 1.5D Riemann problem
1 = 0.7 separating states
with = 5/3 and B
(, v1 , v2 , p, B2 )L = (1, 4.6985, 1.085146, 0.2327, 1.9680)
(, v1 , v2 , p, B2 )R = (0.727, 4.0577, 0.8349, 0.13677916, 1.355),

(173)

the velocity component v1 at times t = 0, t = 50 and t = 100 is shown in Figure 53. This test is
taken from Falle [3]. The initial states are such that they have the same entropy S = p , and they
can be connected by a single fast magnetosonic rarefaction wave. The numerical solution shows that
this rarefaction indeed emerges, but also shows a (small) error (at position x 600 at t = 100) that
is reminiscent of the initial discontinuity. The latter start-up error also plagues many numerical
schemes for the 1D hydro system.
Another example of a Riemann problem where a single stationary fast shock connects two states
1 = 0.1 and states given by
is obtained with = 5/3 and B
(, v1 , v2 , p, B2 )L = (1, 1.5, 0, 106, 1)
(, v1 , v2 , p, B2 )R = (1.6111, 0.9310409, 0.04103, 0.04847, 1.6156).

(174)

This test is taken from Falle [3]. For this stationary shock, the Rankine-Hugoniot relations are
obeyed with s = 0, hence e.g. m1,L = m1,R . That it is a fast shock can be recognized from plotting
the fast Mach number v/cf and noting that it crosses Mfast = 1. Since B2 increases from left to right
(from upstream where Mfast > 1 to downstream where Mfast < 1 and the density and pressure
are increased), the magnetic field line bends away from the shock normal: another indication of the
fast shock character. The numerical solution shown in Figure 54 clearly maintains this stationary
solution.
1 = 2 separating states
Another 1.5D Riemann problem from [3] takes = 5/3 and B
(, v1 , v2 , p, B2 )L = (0.5, 0, 2, 10, 2.5)
(, v1 , v2 , p, B2)R = (0.1, 10, 0, 0.1, 2).

(175)

The result, shown at t = 30 in Figure 55 contains a leftward traveling fast rarefaction, a leftward
going slow rarefaction, a contact discontinuity, and a rightward going slow shock and fast shock.
79

Figure 53: Velocity evolution in a 1.5D Riemann problem leading to a fast rarefaction only.
This is a typical outcome for a MHD Riemann problem. Note that the contact discontinuity as seen
in the density and entropy is rather smeared out, but keeps the velocity constant across it. The
leftward fast and slow rarefactions have no entropy variation associated with them.
A test case which was discussed in the original Brio-Wu paper [2] has become a standard benchmark test for numerical 1.5D MHD. It is a shocktube problem (both left and right states are at
rest initially), and takes (, p, B2 )L = (1, 1, 1) and right state (0.125, 0.1, 1). Furthermore, the
1 = 0.75. Out of the initial discontinuity 5 signals emerge, namely a
parameters are = 2 and B
leftward moving fast rarefaction wave (with no entropy variation), a slow compound wave, a contact discontinuity, a rightward moving slow shock, and a rightward fast rarefaction. The numerical
TVDLF solution is shown at t = 0.1 in Figure 56 and used 800 grid points with the discontinuity
initially midway the domain [0, 1]. The slow compound wave is a slow shock with a rarefaction
wave attached to it, and is a possibility novel to 1D compressible MHD flow: in hydrodynamics
only shocks or rarefaction waves can emerge. It is related to the non-convexity of the governing

80

Figure 54: Pressure, momentum, entropy and fast Mach number for a stationary fast shock: the
exact solution is maintained numerically.
equations, and was in fact first discovered numerically!
To show that the 1.5D system also can describe pure Alfven waves, one can perturb a straight
field line with a perpendicular velocity pulse alone. This test is taken as in [14], following Stone
1 = 1 and uniform = 1 and p = 109 , a square velocity pulse
and Norman [10]. Taking = 1.4, B
is set up by setting v2 = 0.001 for x [1, 2]. When we solve the time evolution of this initial state
on x [0, 3], the velocity pulse is seen to split in two orthogonally polarized (perturbations in B2
and v2 , (nearly) non-compressive (constant ) Alfven pulses traveling at the Alfven speed along the
straight field line. This is shown in Figure 57.
1 = 1.
Finally, Figure 58 is from a 1.75D MHD simulation with parameter values = 5/3 and B
The initial data separates
(, v1 , v2 , v3 , p, B2 , B3 )L = (0.5, 0, 1, 0.1, 1, 2.5, 0),
(, v1 , v2 , v3 , p, B2 , B3 )R = (0.1, 0, 0, 0, 0.1, 2, 0),
81

Figure 55: Density, velocity and entropy at t = 30 for a 1.5D MHD Riemann problem.
with the transition at x = 350. We use 1000 grid cells of unit size. Shown is the density and
the velocity component v3 at time t = 80, and from left to right one encounters the following
features: fast rarefaction wave, Alfven signal, slow rarefaction, contact discontinuity, slow shock,
Alfven signal, fast shock.
It should be clear from the above examples that the 1D MHD system already leads to an
enormous variety of possible outcomes of the simple Riemann problem: both fast and slow signals
can be of rarefaction, shock or compound type in general, and typically occur together with Alfven
wave signals and contact discontinuities. Designing a scheme exploiting the exact solution of the
MHD Riemann problem, in the spirit of the original Godunov method, is therefore particularly
challenging, and usually avoided.

82

Figure 56: The Brio-Wu coplanar shocktube test as seen in density (top) and entropy (bottom) at
time t = 0.1.
XI. MULTI-D MHD AND B = 0
For multi-D MHD simulations, we also need to handle the non-trivial B = 0 constraint.
This is because even if it is satisfied exactly at t = 0, one can numerically generate B 6= 0 due
to the non-linearities of the various shock-capturing methods. Besides the fact that this is clearly
undesirable physically, it can even cause fatal numerical instabilities. However, exact solenoidal
fields may not be needed in numerical simulations, as one always faces discretization and machine
precision errors. In practice, it turns out to be very difficult (although possible [13]), to insist on
(1) a conservative form which is needed for correctly handling shocks, (2) ensure solenoidal B in
some discrete sense, and (3) have the discretized Lorentz force orthogonal to the magnetic field in
the cell centers. The conservative form of the MHD equations uses the divergence of the Maxwell

83

Figure 57: Generation of Alfven waves as seen at times t = 0, t = 0.4, t = 0.8 in perpendicular
velocity and magnetic field components.
stress tensor, which is equal to the Lorentz force provided B = 0 since


B2
I
BB = ( B) B B ( B) .
2
Many strategies to cope with the solenoidal constraint have been developed. A thorough comparison of 7 different strategies on a series of 9 2D MHD tests can be found in [12]. Here, we only
mention the projection scheme strategy, which controls the numerical value of B in a particular
discretization to a given accuracy. The basic idea [1] is to correct the B computed by a scheme
with B 6= 0, by projecting it on the subspace of zero divergence solutions. Hence, we modify
B by subtracting the gradient of a scalar field , to be computed from
2 = B .
84

(176)

Figure 58: Density and v3 velocity component at t = 80 for a 1.75D MHD Riemann problem.
By construction, this yields a solenoidal B = B which is then used in the next timestep. This
process can be repeated after each time step. It is important to note that the accuracy up to which
the Poisson problem (176) is solved need not be machine precision, and that this approach keeps
the order of accuracy of the base scheme, while not violating its conservation properties. Note also
that the projection does not change the current density J = B either.
With a strategy for handling the divergence of B in place, we can now turn to multi-D simulations
of the conservative ideal MHD equations:
t + (v)
(v)t + (vv BB) + ptot
et + (ve + vptot BB v)
Bt + (vB Bv)

=
=
=
=

0
0
0
0,

(177)

where we used the total pressure ptot p + B 2 /2.


As an instructive example from [4], we perform a 2.5D MHD simulation designed to reveal the
extreme anisotropy of linear MHD waves. On a domain (x, y) [0.5, 0.5]2 , we locally perturb a
homogeneous magnetized plasma at rest. Taking = 5/3, = 1, p = 0.6 and a uniform horizontal
B = 0.9
ex (making the sound speed c = 1, Alfven speed ca = 0.9), we perturb 4 cells at the origin
with a 10 % pressure and density increase, and trigger a small orthogonal velocity pulse vz . We
used a non-uniform 3002 grid, and show in Fig. 59 the resulting entropy, total pressure, and Bz
field. Overplotted in all frames is the theoretical Friedrichs group diagram which should emerge out
of a -function perturbation. The fast magnetosonic waves propagate non-spherically outwards in
all directions, traveling faster in the direction perpendicular to B. The slow magnetosonic signals
are the extremely anisotropic cusp-like features, mainly traveling along the field lines. The entropy
signal of the initial perturbation remains stationary at the origin. Note that for linear MHD waves,
there is no entropy variation associated with the fast and slow wavefronts. The linear Alfven waves
are only seen to travel as pointlike pulses along the perturbed horizontal field lines, and do so at the
Alfven speed. They are only detected in the Bz (right panel from Figure 59) and vz components.
A representative 2D nonlinear MHD simulation where a shock-dominated transition to MHD
85

Figure 59: The entropy (left), total pressure (middle), and orthogonal Bz component in a locally
perturbed homogeneous plasma shows all linear MHD waves: fast and slow wavefronts (middle),
entropy signal (left), and Alfven pulses (right).
turbulence occurs can be taken from [8]. A doubly periodic domain [0, 2]2 is initialized with a
uniform = 25/9, p = 5/3 while = 5/3. A velocity vortex given by v = ( sin y, sin x) then
corresponds to a Mach 1 rotation cell, and magnetic islands of half the horizontal wavelength of
the velocity roll are superimposed as B = ( sin y, sin 2x). The initial vortical movement and the
magnetic islands are shown in Figure 60. The Mach 1 rotation leads to the formation of narrow,
localized current sheets and strong shocks. The evolution typifies the shock-dominated transition
to compressible, supersonic MHD turbulence. Shown in Fig. 61 is the temperature T = p/ at time
t = 3.14 which clearly shows how the ensueing dynamics is an intricate interplay of shock formations
and collisions.
REFERENCES
1. J. U. Brackbill and D. C. Barnes, The effect of non-zero B on the numerical solution of the
magnetohydrodynamic equations, J. Comp. Physics 35 (1980), 426 430.
2. M. Brio and C. C. Wu, An upwind differencing scheme for the equations of ideal magnetohydrodynamics, J. Comp. Physics 75 (1988), 400422.
3. S. A. E. G. Falle, Rarefaction shocks, shock errors and low order of accuracy in ZEUS, Astrophys.
J. 577 (2002), L123L126.
4. R. Keppens, Dynamics controlled by magnetic fields: parallel astrophysical computations, in Parallel Computational Fluid Dynamics Trends and Applications, eds. C. B. Jenssen et al. (Amsterdam,
Elsevier Science B.V., 2001), pp. 3142.
5. R. J. LeVeque, Numerical Methods for Conservation Laws (Berlin, Birkhauser Verlag, 1990).
6. R. J. LeVeque, Finite Volume Methods for Hyperbolic Problems (Cambridge, Cambridge University
Press, 2002).
7. R. J. LeVeque, D. Mihalas, E. A. Dorfi and E. M
uller, Computational Methods for Astrophysical
Fluid Flow (Berlin, Springer Verlag, 1998).
8. J. M. Picone and R. B. Dahlburg, Evolution of the Orszag-Tang vortex system in a compressible
medium. II. Supersonic flow, Phys. Fluids B3 (1991), 2944.

86

Figure 60: Initial velocity field (left) and magnetic topology (right) for the MHD vortex simulation.
9. V. V. Rusanov, The calculation of the interaction of non-stationary shock waves and obstacles,
USSR Computational Mathematics and Mathematical Physics 1 (1961), 304320 (Translated from
Zh. vych. mat. 1 (1961), 267279).
10. J. M. Stone and M. L. Norman, ZEUS-2D: A radiation magnetohydrodynamics code for astrophysical
flows in two space dimensions. II. The magnetohydrodynamic algorithms and tests, Astrophys. J.
Suppl. Ser. 80 (1992), 791818.
11. E. F. Toro, Riemann Solvers and Numerical Methods for Fluid dynamics. A practical Introduction
(2nd Edition) (Berlin, Springer-Verlag, 1999).
12. G. Toth, The B = 0 constraint in shock-capturing magnetohydrodynamics codes, J. Comp.
Physics 161 (2000), 605652.
13. G. Toth, Conservative and orthogonal discretization for the Lorentz force, J. Comp. Physics 182
(2002), 346354.
14. G. Toth and D. Odstrcil, Comparison of some flux corrected transport and total variation diminishing numerical schemes for hydrodynamic and magnetohydrodynamic problems, J. Comp. Physics
128 (1996), 82100.
15. P. Wesseling, Principles of Computational Fluid dynamics (Berlin, Springer-Verlag, 2001).

87

Figure 61: Temperature at t = 3.14 in a shock-dominated transition to compressible MHD turbulence.

88

You might also like