This page intentionally left blank
Finite Volume Methods for Hyperbolic Problems
This book contains an introduction to hyperbolic partial differential equations and a pow
erful class of numerical methods for approximating their solution, including both linear
problems and nonlinear conservation laws. These equations describe a wide range of wave
propagation and transport phenomena arising in nearly every scientiﬁc and engineering
discipline. Several applications are described in a selfcontained manner, along with much
of the mathematical theory of hyperbolic problems. Highresolution versions of Godunov’s
method are developed, in which Riemann problems are solved to determine the local wave
structure and limiters are then applied to eliminate numerical oscillations. These meth
ods were originally designed to capture shock waves accurately, but are also useful tools
for studying linear wavepropagation problems, particularly in heterogenous material. The
methods studied are implemented in the CLAWPACK software package. Source code for all
the examples presented can be found on the web, along with animations of many time
dependent solutions. This provides an excellent learning environment for understanding
wavepropagation phenomena and ﬁnite volume methods.
Randall LeVeque is the Boeing Professor of Applied Mathematics at the University of
Washington.
Cambridge Texts in Applied Mathematics
Maximum and Minimum Principles
M.J. SEWELL
Solitons
P.G. DRAZIN AND R.S. JOHNSON
The Kinematics of Mixing
J.M. OTTINO
Introduction to Numerical Linear Algebra and Optimisation
PHILIPPE G. CIARLET
Integral Equations
DAVID PORTER AND DAVID S.G. STIRLING
Perturbation Methods
E.J. HINCH
The Thermomechanics of Plasticity and Fracture
GERARD A. MAUGIN
Boundary Integral and Singularity Methods for Linearized Viscous Flow
C. POZRIKIDIS
Nonlinear Wave Processes in Acoustics
K. NAUGOLNYKH AND L. OSTROVSKY
Nonlinear Systems
P.G. DRAZIN
Stability, Instability and Chaos
PAUL GLENDINNING
Applied Analysis of the Navier–Stokes Equations
C.R. DOERING AND J.D. GIBBON
Viscous Flow
H. OCKENDON AND J.R. OCKENDON
Scaling, SelfSimilarity and Intermediate Asymptotics
G.I. BARENBLATT
A First Course in the Numerical Analysis of Differential Equations
ARIEH ISERLES
Complex Variables: Introduction and Applications
MARK J. ABLOWITZ AND ATHANASSIOS S. FOKAS
Mathematical Models in the Applied Sciences
A.C. FOWLER
Thinking About Ordinary Differential Equations
ROBERT E. O’MALLEY
A Modern Introduction to the Mathematical Theory of Water Waves
R.S. JOHNSON
Rareﬁed Gas Dynamics
CARLO CERCIGNANI
Symmetry Methods for Differential Equations
PETER E. HYDON
High Speed Flow
C.J. CHAPMAN
Wave Motion
J. BILLINGHAM AND A.C. KING
An Introduction to Magnetohydrodynamics
P.A. DAVIDSON
Linear Elastic Waves
JOHN G. HARRIS
An Introduction to Symmetry Analysis
BRIAN J. CANTWELL
Introduction to Hydrodynamic Stability
P.G. DRAZIN
Finite Volume Methods for Hyperbolic Problems
RANDALL J. LEVEQUE
Finite Volume Methods for Hyperbolic Problems
RANDALL J. LEVEQUE
University of Washington
iuniisuio ny rui iiiss syxoicari oi rui uxiviisiry oi caxniioci
The Pitt Building, Trumpington Street, Cambridge, United Kingdom
caxniioci uxiviisiry iiiss
The Edinburgh Building, Cambridge CB2 2RU, UK
40 West 20th Street, New York, NY 100114211, USA
477 Williamstown Road, Port Melbourne, VIC 3207, Australia
Ruiz de Alarcón 13, 28014 Madrid, Spain
Dock House, The Waterfront, Cape Town 8001, South Africa
http://www.cambridge.org
First published in printed format
ISBN 0521810876 hardback
ISBN 0521009243 paperback
ISBN 0511042191 eBook
Randall J. LeVeque 2004
2002
(netLibrary)
©
To Loyce and Benjamin
Contents
Preface page xvii
1 Introduction 1
1.1 Conservation Laws 3
1.2 Finite Volume Methods 5
1.3 Multidimensional Problems 6
1.4 Linear Waves and Discontinuous Media 7
1.5 CLAWPACK Software 8
1.6 References 9
1.7 Notation 10
Part I Linear Equations
2 Conservation Laws and Differential Equations 15
2.1 The Advection Equation 17
2.2 Diffusion and the Advection–Diffusion Equation 20
2.3 The Heat Equation 21
2.4 Capacity Functions 22
2.5 Source Terms 22
2.6 Nonlinear Equations in Fluid Dynamics 23
2.7 Linear Acoustics 26
2.8 Sound Waves 29
2.9 Hyperbolicity of Linear Systems 31
2.10 VariableCoefﬁcient Hyperbolic Systems 33
2.11 Hyperbolicity of Quasilinear and Nonlinear Systems 34
2.12 Solid Mechanics and Elastic Waves 35
2.13 Lagrangian Gas Dynamics and the pSystem 41
2.14 Electromagnetic Waves 43
Exercises 46
3 Characteristics and Riemann Problems for Linear
Hyperbolic Equations 47
3.1 Solution to the Cauchy Problem 47
ix
x Contents
3.2 Superposition of Waves and Characteristic Variables 48
3.3 Left Eigenvectors 49
3.4 Simple Waves 49
3.5 Acoustics 49
3.6 Domain of Dependence and Range of Inﬂuence 50
3.7 Discontinuous Solutions 52
3.8 The Riemann Problem for a Linear System 52
3.9 The Phase Plane for Systems of Two Equations 55
3.10 Coupled Acoustics and Advection 57
3.11 Initial–BoundaryValue Problems 59
Exercises 62
4 Finite Volume Methods 64
4.1 General Formulation for Conservation Laws 64
4.2 A Numerical Flux for the Diffusion Equation 66
4.3 Necessary Components for Convergence 67
4.4 The CFL Condition 68
4.5 An Unstable Flux 71
4.6 The Lax–Friedrichs Method 71
4.7 The Richtmyer TwoStep Lax–Wendroff Method 72
4.8 Upwind Methods 72
4.9 The Upwind Method for Advection 73
4.10 Godunov’s Method for Linear Systems 76
4.11 The Numerical Flux Function for Godunov’s Method 78
4.12 The WavePropagation Form of Godunov’s Method 78
4.13 FluxDifference vs. FluxVector Splitting 83
4.14 Roe’s Method 84
Exercises 85
5 Introduction to the CLAWPACK Software 87
5.1 Basic Framework 87
5.2 Obtaining CLAWPACK 89
5.3 Getting Started 89
5.4 Using CLAWPACK – a Guide through example1 91
5.5 Other UserSupplied Routines and Files 98
5.6 Auxiliary Arrays and setaux.f 98
5.7 An Acoustics Example 99
Exercises 99
6 HighResolution Methods 100
6.1 The Lax–Wendroff Method 100
6.2 The Beam–Warming Method 102
6.3 Preview of Limiters 103
6.4 The REA Algorithm with Piecewise Linear Reconstruction 106
Contents xi
6.5 Choice of Slopes 107
6.6 Oscillations 108
6.7 Total Variation 109
6.8 TVD Methods Based on the REA Algorithm 110
6.9 SlopeLimiter Methods 111
6.10 Flux Formulation with Piecewise Linear Reconstruction 112
6.11 Flux Limiters 114
6.12 TVD Limiters 115
6.13 HighResolution Methods for Systems 118
6.14 Implementation 120
6.15 Extension to Nonlinear Systems 121
6.16 CapacityForm Differencing 122
6.17 Nonuniform Grids 123
Exercises 127
7 Boundary Conditions and Ghost Cells 129
7.1 Periodic Boundary Conditions 130
7.2 Advection 130
7.3 Acoustics 133
Exercises 138
8 Convergence, Accuracy, and Stability 139
8.1 Convergence 139
8.2 OneStep and Local Truncation Errors 141
8.3 Stability Theory 143
8.4 Accuracy at Extrema 149
8.5 Order of Accuracy Isn’t Everything 150
8.6 Modiﬁed Equations 151
8.7 Accuracy Near Discontinuities 155
Exercises 156
9 VariableCoefﬁcient Linear Equations 158
9.1 Advection in a Pipe 159
9.2 Finite Volume Methods 161
9.3 The Color Equation 162
9.4 The Conservative Advection Equation 164
9.5 Edge Velocities 169
9.6 VariableCoefﬁcient Acoustics Equations 171
9.7 ConstantImpedance Media 172
9.8 Variable Impedance 173
9.9 Solving the Riemann Problem for Acoustics 177
9.10 Transmission and Reﬂection Coefﬁcients 178
9.11 Godunov’s Method 179
9.12 HighResolution Methods 181
xii Contents
9.13 Wave Limiters 181
9.14 Homogenization of Rapidly Varying Coefﬁcients 183
Exercises 187
10 Other Approaches to High Resolution 188
10.1 CenteredinTime Fluxes 188
10.2 HigherOrder HighResolution Methods 190
10.3 Limitations of the Lax–Wendroff (Taylor Series) Approach 191
10.4 Semidiscrete Methods plus Time Stepping 191
10.5 Staggered Grids and Central Schemes 198
Exercises 200
Part II Nonlinear Equations
11 Nonlinear Scalar Conservation Laws 203
11.1 Trafﬁc Flow 203
11.2 Quasilinear Form and Characteristics 206
11.3 Burgers’ Equation 208
11.4 Rarefaction Waves 209
11.5 Compression Waves 210
11.6 Vanishing Viscosity 210
11.7 EqualArea Rule 211
11.8 Shock Speed 212
11.9 The Rankine–Hugoniot Conditions for Systems 213
11.10 Similarity Solutions and Centered Rarefactions 214
11.11 Weak Solutions 215
11.12 Manipulating Conservation Laws 216
11.13 Nonuniqueness, Admissibility, and Entropy Conditions 216
11.14 Entropy Functions 219
11.15 LongTime Behavior and NWave Decay 222
Exercises 224
12 Finite Volume Methods for Nonlinear Scalar
Conservation Laws 227
12.1 Godunov’s Method 227
12.2 Fluctuations, Waves, and Speeds 229
12.3 Transonic Rarefactions and an Entropy Fix 230
12.4 Numerical Viscosity 232
12.5 The Lax–Friedrichs and Local Lax–Friedrichs Methods 232
12.6 The Engquist–Osher Method 234
12.7 Eschemes 235
12.8 HighResolution TVD Methods 235
12.9 The Importance of Conservation Form 237
12.10 The Lax–Wendroff Theorem 239
Contents xiii
12.11 The Entropy Condition 243
12.12 Nonlinear Stability 244
Exercises 252
13 Nonlinear Systems of Conservation Laws 253
13.1 The Shallow Water Equations 254
13.2 DamBreak and Riemann Problems 259
13.3 Characteristic Structure 260
13.4 A TwoShock Riemann Solution 262
13.5 Weak Waves and the Linearized Problem 263
13.6 Strategy for Solving the Riemann Problem 263
13.7 Shock Waves and Hugoniot Loci 264
13.8 Simple Waves and Rarefactions 269
13.9 Solving the DamBreak Problem 279
13.10 The General Riemann Solver for Shallow Water Equations 281
13.11 Shock Collision Problems 282
13.12 Linear Degeneracy and Contact Discontinuities 283
Exercises 287
14 Gas Dynamics and the Euler Equations 291
14.1 Pressure 291
14.2 Energy 292
14.3 The Euler Equations 293
14.4 Polytropic Ideal Gas 293
14.5 Entropy 295
14.6 Isothermal Flow 298
14.7 The Euler Equations in Primitive Variables 298
14.8 The Riemann Problem for the Euler Equations 300
14.9 Contact Discontinuities 301
14.10 Riemann Invariants 302
14.11 Solution to the Riemann Problem 302
14.12 The Structure of Rarefaction Waves 305
14.13 Shock Tubes and Riemann Problems 306
14.14 Multiﬂuid Problems 308
14.15 Other Equations of State and Incompressible Flow 309
15 Finite Volume Methods for Nonlinear Systems 311
15.1 Godunov’s Method 311
15.2 Convergence of Godunov’s Method 313
15.3 Approximate Riemann Solvers 314
15.4 HighResolution Methods for Nonlinear Systems 329
15.5 An Alternative WavePropagation Implementation of Approximate
Riemann Solvers 333
15.6 SecondOrder Accuracy 335
xiv Contents
15.7 FluxVector Splitting 338
15.8 Total Variation for Systems of Equations 340
Exercises 348
16 Some Nonclassical Hyperbolic Problems 350
16.1 Nonconvex Flux Functions 350
16.2 Nonstrictly Hyperbolic Problems 358
16.3 Loss of Hyperbolicity 362
16.4 Spatially Varying Flux Functions 368
16.5 Nonconservative Nonlinear Hyperbolic Equations 371
16.6 Nonconservative Transport Equations 372
Exercises 374
17 Source Terms and Balance Laws 375
17.1 FractionalStep Methods 377
17.2 An Advection–Reaction Equation 378
17.3 General Formulation of FractionalStep Methods for Linear Problems 384
17.4 Strang Splitting 387
17.5 Accuracy of Godunov and Strang Splittings 388
17.6 Choice of ODE Solver 389
17.7 Implicit Methods, Viscous Terms, and HigherOrder Derivatives 390
17.8 SteadyState Solutions 391
17.9 Boundary Conditions for FractionalStep Methods 393
17.10 Stiff and Singular Source Terms 396
17.11 Linear Trafﬁc Flow with OnRamps or Exits 396
17.12 Rankine–Hugoniot Jump Conditions at a Singular Source 397
17.13 Nonlinear Trafﬁc Flow with OnRamps or Exits 398
17.14 Accurate Solution of Quasisteady Problems 399
17.15 Burgers Equation with a Stiff Source Term 401
17.16 Numerical Difﬁculties with Stiff Source Terms 404
17.17 Relaxation Systems 410
17.18 Relaxation Schemes 415
Exercises 416
Part III Multidimensional Problems
18 Multidimensional Hyperbolic Problems 421
18.1 Derivation of Conservation Laws 421
18.2 Advection 423
18.3 Compressible Flow 424
18.4 Acoustics 425
18.5 Hyperbolicity 425
18.6 ThreeDimensional Systems 428
18.7 Shallow Water Equations 429
Contents xv
18.8 Euler Equations 431
18.9 Symmetry and Reduction of Dimension 433
Exercises 434
19 Multidimensional Numerical Methods 436
19.1 Finite Difference Methods 436
19.2 Finite Volume Methods and Approaches to Discretization 438
19.3 Fully Discrete FluxDifferencing Methods 439
19.4 Semidiscrete Methods with Runge–Kutta Time Stepping 443
19.5 Dimensional Splitting 444
Exercise 446
20 Multidimensional Scalar Equations 447
20.1 The DonorCell Upwind Method for Advection 447
20.2 The CornerTransport Upwind Method for Advection 449
20.3 WavePropagation Implementation of the CTU Method 450
20.4 von Neumann Stability Analysis 452
20.5 The CTU Method for VariableCoefﬁcient Advection 453
20.6 HighResolution Correction Terms 456
20.7 Relation to the Lax–Wendroff Method 456
20.8 DivergenceFree Velocity Fields 457
20.9 Nonlinear Scalar Conservation Laws 460
20.10 Convergence 464
Exercises 467
21 Multidimensional Systems 469
21.1 ConstantCoefﬁcient Linear Systems 469
21.2 The WavePropagation Approach to Accumulating Fluxes 471
21.3 CLAWPACK Implementation 473
21.4 Acoustics 474
21.5 Acoustics in Heterogeneous Media 476
21.6 Transverse Riemann Solvers for Nonlinear Systems 480
21.7 Shallow Water Equations 480
21.8 Boundary Conditions 485
22 Elastic Waves 491
22.1 Derivation of the Elasticity Equations 492
22.2 The PlaneStrain Equations of TwoDimensional Elasticity 499
22.3 OneDimensional Slices 502
22.4 Boundary Conditions 502
22.5 The PlaneStress Equations and TwoDimensional Plates 504
22.6 A OneDimensional Rod 509
22.7 TwoDimensional Elasticity in Heterogeneous Media 509
xvi Contents
23 Finite Volume Methods on Quadrilateral Grids 514
23.1 Cell Averages and Interface Fluxes 515
23.2 Logically Rectangular Grids 517
23.3 Godunov’s Method 518
23.4 Fluctuation Form 519
23.5 Advection Equations 520
23.6 Acoustics 525
23.7 Shallow Water and Euler Equations 530
23.8 Using CLAWPACK on Quadrilateral Grids 531
23.9 Boundary Conditions 534
Bibliography 535
Index 553
Preface
Hyperbolic partial differential equations arise in a broad spectrum of disciplines where
wave motion or advective transport is important: gas dynamics, acoustics, elastodynamics,
optics, geophysics, and biomechanics, to name but a few. This book is intended to serve
as an introduction to both the theory and the practical use of highresolution ﬁnite volume
methods for hyperbolic problems. These methods have proved to be extremely useful in
modeling a broad set of phenomena, and I believe that there is need for a book introducing
them in a general framework that is accessible to students and researchers in many different
disciplines.
Historically, many of the fundamental ideas were ﬁrst developed for the special case
of compressible gas dynamics (the Euler equations), for applications in aerodynamics,
astrophysics, detonation waves, and related ﬁelds where shock waves arise. The study of
simpler equations such as the advection equation, Burgers’ equation, and the shallow water
equations has playedanimportant role inthe development of these methods, but oftenonlyas
model problems, the ultimate goal being application to the Euler equations. This orientation
is still reﬂected in many of the texts on these methods. Of course the Euler equations remain
an extremely important application, and are presented and studied in this book, but there
are also many other applications where challenging problems can be successfully tackled
by understanding the basic ideas of highresolution ﬁnite volume methods. Often it is not
necessary to understand the Euler equations in order to do so, and the complexity and
peculiarities of this particular system may obscure the more basic ideas.
In particular, the Euler equations are nonlinear. This nonlinearity, and the consequent
shock formation seen in solutions, leads to many of the computational challenges that moti
vated the development of these methods. The mathematical theory of nonlinear hyperbolic
problems is also quite beautiful, and the development and analysis of ﬁnite volume methods
requires a rich interplay between this mathematical theory, physical modeling, and numer
ical analysis. As a result it is a challenging and satisfying ﬁeld of study, and much of this
book focuses on nonlinear problems.
However, all of Part I and much of Part III (on multidimensional problems) deals en
tirely with linear hyperbolic systems. This is partly because many of the concepts can
be introduced and understood most easily in the linear case. A thorough understanding
of linear hyperbolic theory, and the development of highresolution methods in the linear
case, is extremely useful in fully understanding the nonlinear case. In addition, I believe
there are many linear wavepropagation problems (e.g., in acoustics, elastodynamics, or
xvii
xviii Preface
electromagnetics) where these methods have a great deal of potential that has not been fully
exploited, particularly for problems in heterogeneous media. I hope to encourage students
to explore some of these areas, and researchers in these areas to learn about ﬁnite vol
ume methods. I have tried to make it possible to do so without delving into the additional
complications of the nonlinear theory.
Studying these methods in the context of a broader set of applications has other pedagog
ical advantages as well. Identifying the common features of various problems (as uniﬁed
by the hyperbolic theory) often leads to a better understanding of this theory and greater
ability to apply these techniques later to new problems. The ﬁnite volume approach can
itself lead to greater insight into the physical phenomena and mathematical techniques. The
derivation of most conservation laws gives ﬁrst an integral formulation that is then converted
to a differential equation. A ﬁnite volume method is based on the integral formulation, and
hence is often closer to the physics than is the partial differential equation.
Mastering a set of numerical methods in conjunction with learning the related mathemat
ics and physics has a further advantage: it is possible to apply the methods immediately in
order to observe the behavior of solutions to the equations, and thereby gain intuition for
how these solutions behave. To facilitate this handson approach to learning, virtually every
example in the book (and many examples not in the book) can be solved by the reader using
programs and data that are easy to download from the web. The basis for most of these pro
grams is the CLAWPACK software package, which stands for “conservationlawpackage.”
This package was originally developed for my own use in teaching and so is intimately
linked with the methods studied in this book. By having access to the source code used
to generate each ﬁgure, it is possible for the interested reader to delve more deeply into
implementation details that aren’t presented in the text. Animations of many of the ﬁgures
are also available on the webpages, making it easier to visualize the timedependent nature
of these solutions. By downloading and modifying the code, it is also possible to experiment
with different initial or boundary conditions, with different mesh sizes or other parameters,
or with different methods on the same problem.
CLAWPACK has been freely available for several years and is now extensively used for
research as well as teaching purposes. Another function of this book is to serve as a reference
to users of the software who desire a better understanding of the methods employed and the
ways in which these methods can be adapted to new applications. The book is not, however,
designed to be a user’s manual for the package, and it is not necessary to do any computing
in order to follow the presentation.
There are many different approaches to developing and implementing highresolution
ﬁnite volume methods for hyperbolic equations. In this book I concentrate primarily on one
particular approach, the wavepropagation algorithm that is implemented in CLAWPACK,
but numerous other methods and the relation between them are discussed at least brieﬂy.
It would be impossible to survey all such methods in any detail, and instead my aim is
to provide enough understanding of the underlying ideas that the reader will have a good
basis for learning about other methods from the literature. With minor modiﬁcations of the
CLAWPACK code it is possible to implement many different methods and easily compare
them on the same set of problems.
This book is the result of an evolving set of lecture notes that I have used in teaching
this material over the past 15 years. An early version was published in 1989 after giving
Preface xix
the course at ETH in Z¨ urich [281]. That version has proved popular among instructors and
students, perhaps primarily because it is short and concise. Unfortunately, the same claim
cannot be made for the present book. I have tried, however, to write the book in such a
way that selfcontained subsets can be extracted for teaching (and learning) this material.
The latter part of many chapters gets into more esoteric material that may be useful to have
available for reference but is not required reading. In addition, many whole chapters can be
omitted without loss of continuity in a course that stresses certain aspects of the material. In
particular, to focus on linear hyperbolic problems and heterogeneous media, a suggested set
of chapters might be 1–9 and 18–21, omitting the sections in the multidimensional chapters
that deal with nonlinearity. Other chapters may also be of interest, but can be omitted
without loss of continuity. To focus on nonlinear conservation laws, the basic theory can
be found in Chapters 1–8, 11–15, and 18–21. Again, other topics can also be covered if
time permits, or the course can be shortened further by concentrating on scalar equations
or onedimensional problems, for example.
This book may also be useful in a course on hyperbolic problems where the focus is not
on numerical methods at all. The mathematical theory in the context of physical applications
is developed primarily in Chapters 1–3, 9, 11, 13, 14, 16, 18, and 22, chapters that contain
little discussion of numerical issues. It may still be advantageous to use CLAWPACK to
further explore these problems and develop physical intuition, but this can be done without
a detailed study of the numerical methods employed.
Many topics in this book are closely connected to my own research. Repeatedly teach
ing this material, writing course notes, and providing students with sample programs has
motivated me to search for more general formulations that are easier to explain and more
broadly applicable. This work has been funded for many years by the National Science
Foundation, the Department of Energy, and the University of Washington. Without their
support the present form of this book would not have been possible.
I am indebted to the many students and colleagues who have taught me so much about
hyperbolic problems and numerical methods over the years. I cannot begin to thank everyone
by name, and so will just mention a few people who had a particular impact on what is
presented in this book. Luigi Quartapelle deserves high honors for carefully reading every
word of several drafts, ﬁnding countless errors, and making numerous suggestions for
substantial improvement. Special thanks are also due to Mike Epton, Christiane Helzel, Jan
Olav Langseth, Sorin Mitran, and George Turkiyyah. Along with many others, they helped
me to avoid a number of blunders and present a more polished manuscript. The remaining
errors are, of course, my own responsibility.
I would also like to thank Cambridge University Press for publishing this book at a
reasonable price, especially since it is intended to be used as a textbook. Many books are
priced exorbitantly these days, and I believe it is the responsibility of authors to seek out
and support publishers that serve the community well.
Most importantly, I would like to thank my family for their constant encouragement and
support, particularly my wife and son. They have sacriﬁced many evenings and weekends
of family time for a project that, from my nineyear old’s perspective at least, has lasted a
lifetime.
Seattle, Washington, August, 2001
1
Introduction
Hyperbolic systems of partial differential equations can be used to model a wide variety of
phenomena that involve wave motion or the advective transport of substances. This chapter
contains a brief introduction to some of the fundamental concepts and an overview of the
primary issues discussed in this book.
The problems we consider are generally timedependent, so that the solution depends
on time as well as one or more spatial variables. In one space dimension, a homogeneous
ﬁrstorder system of partial differential equations in x and t has the form
q
t
(x, t ) + Aq
x
(x, t ) = 0 (1.1)
in the simplest constantcoefﬁcient linear case. Here q : R × R → R
m
is a vector with
m components representing the unknown functions (pressure, velocity, etc.) we wish to
determine, and A is a constant m ×m real matrix. In order for this problemto be hyperbolic,
the matrix must satisfy certain properties discussed below. Note that subscripts are used to
denote partial derivatives with respect to t and x.
The simplest case is the constantcoefﬁcient scalar problem, in which m =1 and the
matrix A reduces to a scalar value. This problem is hyperbolic provided the scalar A is
real. Already this simple equation can model either advective transport or wave motion,
depending on the context.
Advective transport refers to a substance being carried along with ﬂuid motion. For ex
ample, consider a contaminant being advected downstreamwith some ﬂuid ﬂowing through
a onedimensional pipe at constant velocity ¯ u. Then the concentration or density q(x, t ) of
the contaminant satisﬁes a scalar advection equation of the form
q
t
(x, t ) + ¯ uq
x
(x, t ) = 0, (1.2)
as derived in Chapter 2. It is easy to verify that this equation admits solutions of the form
q(x, t ) = ˜ q(x − ¯ ut ) (1.3)
for any function ˜ q(ξ). The concentration proﬁle (or waveform) speciﬁed by ˜ q simply prop
agates with constant speed ¯ u and unchanged shape. In this context the equation (1.2) is
generally called the advection equation.
The phenomenon of wave motion is observed in its most basic form if we model a sound
wave traveling down a tube of gas or through an elastic solid. In this case the molecules of
1
2 1 Introduction
the gas or solid barely move, and yet a distinct wave can propagate through the material
with its shape essentially unchanged over long distances, and at a speed c (the speed of
sound in the material) that is much larger than the velocity of material particles. We will see
in Chapter 2 that a sound wave propagating in one direction (to the right with speed c > 0)
can be modeled by the equation
w
t
(x, t ) +cw
x
(x, t ) = 0, (1.4)
where w(x, t ) is an appropriate combination of the pressure and particle velocity. This again
has the form of a scalar ﬁrstorder hyperbolic equation. In this context the equation (1.4) is
sometimes called the oneway wave equation because it models waves propagating in one
particular direction.
Mathematically the advection equation (1.2) and the oneway wave equation (1.4) are
identical, which suggests that advective transport and wave phenomena can be handled by
similar mathematical and numerical techniques.
Tomodel acoustic waves propagatinginbothdirections alonga onedimensional medium,
we must consider the full acoustic equations derived in Chapter 2,
p
t
(x, t ) + Ku
x
(x, t ) = 0,
u
t
(x, t ) +(1/ρ) p
x
(x, t ) = 0,
(1.5)
where p(x, t ) is the pressure (or more properly the perturbation from some background
constant pressure), and u(x, t ) is the particle velocity. These are the unknown functions to
be determined. The material is described by the constants K (the bulk modulus of com
pressibility) and ρ (the density). The system (1.5) can be written as the ﬁrstorder system
q
t
+ Aq
x
= 0, where
q =
p
u
, A =
0 K
1/ρ 0
. (1.6)
To connect this with the oneway wave equation (1.4), let
w
1
(x, t ) = p(x, t ) +ρcu(x, t ),
where c =
√
K/ρ. Then it is easy to check that w
1
(x, t ) satisﬁes the equation
w
1
t
+cw
1
x
= 0
and so we see that c can be identiﬁed as the speed of sound. On the other hand, the function
w
2
(x, t ) = p(x, t ) −ρcu(x, t )
satisﬁes the equation
w
2
t
−cw
2
x
= 0.
This is also a oneway wave equation, but with propagation speed −c. This equation has
solutions of the form q
2
(x, t ) = ˜ q(x + ct ) and models acoustic waves propagating to the
left at the speed of sound, rather than to the right.
1.1 Conservation Laws 3
The system (1.5) of two equations can thus be decomposed into two scalar equations
modeling the two distinct acoustic waves moving in different directions. This is a funda
mental theme of hyperbolic equations and crucial to the methods developed in this book.
We will see that this type of decomposition is possible more generally for hyperbolic sys
tems, and in fact the deﬁnition of “hyperbolic” is directly connected to this. We say that
the constantcoefﬁcient system (1.1) is hyperbolic if the matrix A has real eigenvalues and
a corresponding set of m linearly independent eigenvectors. This means that any vector in
R
m
can be uniquely decomposed as a linear combination of these eigenvectors. As we will
see in Chapter 3, this provides the decomposition into distinct waves. The corresponding
eigenvalues of A give the wave speeds at which each wave propagates. For example, the
acoustics matrix A of (1.6) has eigenvalues −c and +c, the speeds at which acoustic waves
can travel in this onedimensional medium.
For simple acoustic waves, some readers may be more familiar with the secondorder
wave equation
p
t t
= c
2
p
xx
. (1.7)
This equation for the pressure can be obtained from the system (1.5) by differentiating the
ﬁrst equation with respect to t and the second with respect to x, and then eliminating the
u
xt
terms. The equation (1.7) is also called a hyperbolic equation according to the stan
dard classiﬁcation of secondorder linear equations into hyperbolic, parabolic, and elliptic
equations (see [234], for example). In this book we only consider ﬁrstorder hyperbolic
systems as described above. This form is more fundamental physically than the derived
secondorder equation, and is more amenable to the development of highresolution ﬁnite
volume methods.
In practical problems there is often a coupling of advective transport and wave motion.
For example, we will see that the speed of sound in a gas generally depends on the density
and pressure of the gas. If these properties of the gas vary in space and the gas is ﬂowing, then
these variations will be advected with the ﬂow. This will have an effect on any sound waves
propagating through the gas. Moreover, these variations will typically cause acceleration
of the gas and have a direct effect on the ﬂuid motion itself, which can also be modeled as
wavepropagation phenomena. This coupling leads to nonlinearity in the equations.
1.1 Conservation Laws
Much of this book is concerned with an important class of homogeneous hyperbolic equa
tions called conservation laws. The simplest example of a onedimensional conservation
law is the partial differential equation (PDE)
q
t
(x, t ) + f (q(x, t ))
x
= 0, (1.8)
where f (q) is the ﬂux function. Rewriting this in the quasilinear form
q
t
+ f
(q)q
x
= 0 (1.9)
suggests that the equation is hyperbolic if the ﬂux Jacobian matrix f
(q) satisﬁes the con
ditions previously given for the matrix A. In fact the linear problem (1.1) is a conservation
4 1 Introduction
law with the linear ﬂux function f (q) = Aq. Many physical problems give rise to nonli
near conservation laws in which f (q) is a nonlinear function of q, a vector of conserved
quantities.
1.1.1 Integral Form
Conservation laws typically arise most naturally from physical laws in an integral form as
developed in Chapter 2, stating that for any two points x
1
and x
2
,
d
dt
x
2
x
1
q(x, t ) dx = f (q(x
1
, t )) − f (q(x
2
, t )). (1.10)
Each component of q measures the density of some conserved quantity, and the equation
(1.10) simply states that the “total mass” of this quantity between any two points can change
only due to the ﬂux past the endpoints. Such conservation laws naturally hold for many
fundamental physical quantities. For example, the advection equation (1.2) for the density
of a contaminant is derived from the fact that the total mass of the contaminant is conserved
as it ﬂows down the pipe and the ﬂux function is f (q) = ¯ uq. If the total mass of contaminant
is not conserved, because of chemical reactions taking place, for example, then the con
servation law must also contain source terms as described in Section 2.5, Chapter 17, and
elsewhere.
The constantcoefﬁcient linear acoustics equations (1.5) can be viewed as conservation
laws for pressure and velocity. Physically, however, these are not conserved quantities
except approximately in the case of very small amplitude disturbances in uniform media. In
Section 2.7 the acoustics equations are derived from the Euler equations of gas dynamics,
the nonlinear conservation laws that model more general disturbances in a compressible gas.
These equations model the conservation of mass, momentum, and energy, and the laws of
physics determine the ﬂux functions. See Section 2.6 and Chapter 14 for these derivations.
These equations have been intensively studied and used in countless computations because
of their importance in aerodynamics and elsewhere.
There are many other systems of conservation laws that are important in various appli
cations, and several are used in this book as examples. However, the Euler equations play a
special role in the historical development of the techniques discussed in this book. Much of
the mathematical theory of nonlinear conservation laws was developed with these equations
in mind, and many numerical methods were developed speciﬁcally for this system. So, al
though the theory and methods are applicable much more widely, a good knowledge of the
Euler equations is required in order to read much of the available literature and beneﬁt from
these developments. A brief introduction is given in Chapter 14. It is a good idea to become
familiar with these equations even if your primary interest is far from gas dynamics.
1.1.2 Discontinuous Solutions
The differential equation (1.8) can be derived from the integral equation (1.10) by simple
manipulations (see Chapter 2) provided that q and f (q) are sufﬁciently smooth. This proviso
is important because in practice many interesting solutions are not smooth, but contain
discontinuities such as shock waves. A fundamental feature of nonlinear conservation laws
1.2 Finite Volume Methods 5
is that these discontinuities can easily develop spontaneously even fromsmooth initial data,
and so they must be dealt with both mathematically and computationally.
At a discontinuity in q, the partial differential equation (1.8) does not hold in the classical
sense and it is important to remember that the integral conservation law (1.10) is the more
fundamental equation which does continue to hold. A rich mathematical theory of shock
wave solutions to conservation laws has been developed. This theory is introduced starting
in Chapter 11.
1.2 Finite Volume Methods
Discontinuities lead to computational difﬁculties and the main subject of this book is the
accurate approximation of such solutions. Classical ﬁnite difference methods, in which
derivatives are approximated by ﬁnite differences, can be expected to break down near
discontinuities in the solution where the differential equation does not hold. This book
concerns ﬁnite volume methods, which are based on the integral form (1.10) instead of
the differential equation. Rather than pointwise approximations at grid points, we break
the domain into grid cells and approximate the total integral of q over each grid cell, or
actually the cell average of q, which is this integral divided by the volume of the cell. These
values are modiﬁed in each time step by the ﬂux through the edges of the grid cells, and the
primary problemis to determine good numerical ﬂux functions that approximate the correct
ﬂuxes reasonably well, based on the approximate cell averages, the only data available. We
will concentrate primarily on one class of highresolution ﬁnite volume methods that have
proved to be very effective for computing discontinuous solutions. See Section 6.3 for an
introduction to the properties of these methods.
Other classes of methods have also been applied to hyperbolic equations, such as ﬁnite
element methods and spectral methods. These are not discussed directly in this book,
although much of the material presented here is good background for understanding high
resolution versions.
1.2.1 Riemann Problems
A fundamental tool in the development of ﬁnite volume methods is the Riemann problem,
which is simply the hyperbolic equation together with special initial data. The data is
piecewise constant with a single jump discontinuity at some point, say x = 0,
q(x, 0) =
q
l
if x < 0,
q
r
if x > 0.
(1.11)
If Q
i −1
and Q
i
are the cell averages in two neighboring grid cells on a ﬁnite volume grid, then
by solving the Riemann problem with q
l
= Q
i −1
and q
r
= Q
i
, we can obtain information
that can be used to compute a numerical ﬂux and update the cell averages over a time
step. For hyperbolic problems the solution to the Riemann problem is typically a similarity
solution, a function of x/t alone, and consists of a ﬁnite set of waves that propagate away
from the origin with constant wave speeds. For linear hyperbolic systems the Riemann
problem is easily solved in terms of the eigenvalues and eigenvectors of the matrix A, as
6 1 Introduction
developed in Chapter 3. This simple structure also holds for nonlinear systems of equations
and the exact solution (or arbitrarily good approximations) to the Riemann problem can be
constructed even for nonlinear systems such as the Euler equations. The theory of nonlinear
Riemann solutions for scalar problems is developed in Chapter 11 and extended to systems
in Chapter 13.
Computationally, the exact Riemann solution is often too expensive to compute for non
linear problems and approximate Riemann solvers are used in implementing numerical
methods. These techniques are developed in Section 15.3.
1.2.2 Shock Capturing vs. Tracking
Since the PDEs continue to hold away from discontinuities, one possible approach is to
combine a standard ﬁnite difference or ﬁnite volume method in smooth regions with some
explicit procedure for tracking the location of discontinuities. This is the numerical analogue
of the mathematical approach in which the PDEs are supplemented by jump conditions
across discontinuities. This approach is often called shock tracking or front tracking. In more
than one space dimension, discontinuities typically lie along curves (in two dimensions) or
surfaces (in three dimensions), and such algorithms typically become quite complicated.
Moreover, in realistic problems there may be many such surfaces that interact in complicated
ways as time evolves. This approach will not be discussed further in this book. For some
examples and discussion, see [41], [66], [103], [153], [154], [171], [207], [289], [290],
[321], [322], [371], [372].
Instead we concentrate here on shockcapturing methods, where the goal is to capture
discontinuities in the solution automatically, without explicitly tracking them. Discontinu
ities must then be smeared over one or more grid cells. Success requires that the method
implicitly incorporate the correct jump conditions, reduce smearing to a minimum, and not
introduce nonphysical oscillations near the discontinuities. Highresolution ﬁnite volume
methods based on Riemann solutions often performwell and are much simpler to implement
than shocktracking methods.
1.3 Multidimensional Problems
The Riemann problem is inherently onedimensional, but is extensively used also in the
solution of multidimensional hyperbolic problems. A twodimensional ﬁnite volume grid
typically consists of polygonal grid cells; quadrilaterals or triangles are most commonly
used. ARiemann problemnormal to each edge of the cell can be solved in order to determine
the ﬂux across that edge. In three dimensions each face of a ﬁnite volume cell can be
approximated by a plane, and a Riemann problem normal to this plane solved in order
to compute the ﬂux. Multidimensional problems are discussed in the Part III of the book,
starting with an introduction to the mathematical theory in Chapter 18.
If the ﬁnite volume grid is rectangular, or at least logically rectangular, then the simplest
way to extend onedimensional highresolution methods to more dimensions is to use di
mensional splitting, a fractionalstep approach in which onedimensional problems along
each coordinate direction are solved in turn. This approach, which is often surprisingly ef
fective in practice, is discussed in Section 19.5. In some cases a more fully multidimensional
1.4 Linear Waves and Discontinuous Media 7
method is required, and one approach is developed starting in Chapter 20, which again relies
heavily on our ability to solve onedimensional Riemann problems.
1.4 Linear Waves and Discontinuous Media
Highresolution methods were originally developed for nonlinear problems in order to ac
curately capture discontinuous solutions such as shock waves. Linear hyperbolic equations
often arise from studying smallamplitude waves, where the physical nonlinearities of the
true equations can be safely ignored. Such waves are often smooth, since shock waves can
only appear fromnonlinear phenomena. The acoustic waves we are most familiar with arise
from oscillations of materials at the molecular level and are typically well approximated
by linear combinations of sinusoidal waves at various frequencies. Similarly, most familiar
electromagnetic waves, such as visible light, are governed by the linear Maxwell equations
(another hyperbolic system) and again consist of smooth sinusoidal oscillations.
For many problems in acoustics or optics the primary computational difﬁculty arises from
the fact that the domain of interest is many orders of magnitude larger than the wavelengths
of interest, and so it is important to use a method that can resolve smooth solutions with a
very high order of accuracy in order to keep the number of grid points required manageable.
For problems of this type, the methods developed in this book may not be appropriate. These
ﬁnite volume highresolution methods are typically at best secondorder accurate, resulting
in the need for many points per wavelength for good accuracy. Moreover they have a
high cost per grid cell relative to simpler ﬁnite difference methods, because of the need to
solve Riemann problems for each pair of grid cells every time step. The combination can
be disastrous if we need to compute over a domain that spans thousands of wavelengths.
Instead methods with a higher order of accuracy are typically used, e.g., fourthorder ﬁnite
difference methods or spectral methods. For some problems it is hopeless to try to resolve
individual wavelengths, and instead raytracing methods such as geometrical optics are
used to determine how rays travel without discretizing the hyperbolic equations directly.
However, there are some situations in which highresolution methods based on Riemann
solutions may have distinct advantages even for linear problems. In many applications wave
propagation problems must be solved in materials that are not homogeneous and isotropic.
The heterogeneity may be smoothly varying (e.g., acoustics in the ocean, where the sound
speed varies with density, which may vary smoothly with changes in salinity, for example).
In this case highorder methods may still be applicable. In many cases, however, there are
sharp interfaces between different materials. If we wish to solve for acoustic or seismic
waves in the earth, for example, the material parameters typically have jump discontinuities
where soil meets rock or at the boundaries between different types of rock. Ultrasound waves
in the human body also pass through many interfaces, between different organs or tissue and
bone. Even in ocean acoustics there may be distinct layers of water with different salinity,
and hence jump discontinuities in the sound speed, as well as the interface at the ocean ﬂoor
where waves pass between water and earth. With wavetracing methods it may be possible
to use reﬂection and transmission coefﬁcients and Snell’s law to trace rays and reﬂected
rays at interfaces, but for problems with many interfaces this can be unwieldy. If we wish
to model the wave motion directly by solving the hyperbolic equations, many highorder
methods can have difﬁculties near interfaces, where the solution is typically not smooth.
8 1 Introduction
For these problems, highresolution ﬁnite volume methods based on solving Riemann
problems can be an attractive alternative. Finite volume methods are a natural choice for
heterogeneous media, since each grid cell can be assigned different material properties via
an appropriate averaging of the material parameters over the volume enclosed by the cell.
The idea of a Riemann problem is easily extended to the case where there is a discontinuity
in the medium at x =0 as well as a discontinuity in the initial data. Solving the Riemann
problemat the interface between two cells then gives a decomposition of the data into waves
moving into each cell, including the effects of reﬂection and transmission as waves move
between different materials. Indeed, the classical reﬂection and transmission coefﬁcients
for various problems are easily derived and understood in terms of particular Riemann
solutions. Variablecoefﬁcient linear problems are discussed in Chapter 9 and Section 21.5.
Hyperbolic equations with variable coefﬁcients may not be in conservation form, and
so the methods are developed here in a form that applies more generally. These wave
propagation methods are based directly on the waves arising from the solution of the
Riemann problem rather than on numerical ﬂuxes at cell interfaces. When applied to con
servation laws, there is a natural connection between these methods and more standard
ﬂuxdifferencing methods, which will be elucidated as we go along. But many of the
shockcapturing ideas that have been developed in the context of conservation laws are
valuable more broadly, and one of my goals in writing this book is to present these meth
ods in a more general framework than is available elsewhere, and with more attention to
applications where they have not traditionally been applied in the past.
This book is organized in such a way that all of the ideas required to apply the methods
on linear problems are introduced ﬁrst, before discussing the more complicated nonlinear
theory. Readers whose primary interest is in linear waves should be able to skip the nonlinear
parts entirely by ﬁrst studying Chapters 2 through 9 (on linear problems in one dimension)
and then the preliminary parts of Chapters 18 through 23 (on multidimensional problems).
For readers whose primary interest is in nonlinear problems, I believe that this orga
nization is still sensible, since many of the fundamental ideas (both mathematical and
algorithmic) arise already with linear problems and are most easily understood in this con
text. Additional issues arise in the nonlinear case, but these are most easily understood if
one already has a ﬁrm foundation in the linear theory.
1.5 CLAWPACK Software
The CLAWPACK software (“conservationlaws package”) implements the various wave
propagation methods discussed in this book (in Fortran). This software was originally
developed as a teaching tool and is intended to be used in conjunction with this book.
The use of this software is brieﬂy described in Chapter 5, and additional documentation is
available online, from the webpage
http://www.amath.washington.edu/~claw
Virtually all of the computational examples presented in the book were created using
CLAWPACK, and the source code used is generally available via the website
http://www.amath.washington.edu/~claw/book.html
1.6 References 9
A parenthetical remark in the text or ﬁgure captions of the form
[claw/book/chapN/examplename]
is an indication that accompanying material is available at
http://www.amath.washington.edu/~claw/book/chapN/examplename/www
often including an animation of timedependent solutions. Fromthis webpage it is generally
possible to download a CLAWPACK directory of the source code for the example. Down
loading the tarﬁle and unpacking it in your claw directory results in a subdirectory called
claw/book/chapN/examplename. (You must ﬁrst obtain the basic CLAWPACK routines as
described in Chapter 5.)
You are encouraged to use this software actively, both to develop an intuition for the
behavior of solutions to hyperbolic equations and also to develop direct experience with
these numerical methods. It should be easy to modify the examples to experiment with
different parameters or initial conditions, or with the use of different methods on the same
problem.
These examples can also serve as templates for developing codes for other problems.
In addition, many problems not discussed in this book have already been solved using
CLAWPACK and are often available online. Some pointers can be found on the webpages for
the book, and others are collected within the CLAWPACK software in the applications
subdirectory; see
http://www.amath.washington.edu/~claw/apps.html
1.6 References
Some references for particular applications and methods are given in the text. There are
thousands of papers on these topics, and I have not attempted to give an exhaustive survey
of the literature by any means. The references cited have been chosen because they are
particularly relevant to the discussion here or provide a good entrance point to the broader
literature. Listed below are a few books that may be of general interest in understanding
this material, again only a small subset of those available.
An earlier version of this book appeared as a set of lecture notes [281]. This contains
a different presentation of some of the same material and may still be of interest. My
contribution to [287] also has some overlap with this book, but is directed speciﬁcally
towards astrophysical ﬂows and also contains some description of hyperbolic problems
arising in magnetohydrodynamics and relativistic ﬂow, which are not discussed here.
The basic theory of hyperbolic equations can be found in many texts, for example John
[229], Kevorkian [234]. The basic theory of nonlinear conservation laws is neatly presented
in the monograph of Lax [263]. Introductions to this material can also be found in many
other books, such as Liu [311], Whitham [486], or Chorin & Marsden [68]. The book of
Courant & Friedrichs [92] deals almost entirely with gas dynamics and the Euler equations,
but includes much of the general theory of conservation laws in this context and is very
useful. The books by Bressan [46], Dafermos [98], Majda [319], Serre [402], Smoller
[420], and Zhang & Hsiao [499] present many more details on the mathematical theory of
nonlinear conservation laws.
10 1 Introduction
For general background on numerical methods for PDEs, the books of Iserles [211],
Morton & Mayers [333], Strikwerda [427], or Tveito & Winther [461] are recommended.
The book of Gustafsson, Kreiss &Oliger [174] is aimed particularly at hyperbolic problems
and contains more advanced material on wellposedness and stability of both initial and
initial–boundaryvalue problems. The classic book of Richtmyer &Morton [369] contains a
good description of many of the mathematical techniques used to study numerical methods,
particularly for linear equations. It also includes a large section on methods for nonlinear
applications including ﬂuid dynamics, but is out of date by now and does not discuss many
of the methods we will study.
A number of books have appeared recently on numerical methods for conservation laws
that cover some of the same techniques discussed here, e.g., Godlewski & Raviart [156],
Kr¨ oner [245], and Toro [450]. Several other books on computational ﬂuid dynamics are also
useful supplements, including Durran [117], Fletcher [137], Hirsch [198], Laney [256],
Oran & Boris [348], Peyret & Taylor [359], and Tannehill, Anderson & Pletcher [445].
These books discuss the ﬂuid dynamics in more detail, generally with emphasis on speciﬁc
applications.
For an excellent collection of photographs illustrating a wide variety of interesting ﬂuid
dynamics, including shock waves, Van Dyke’s Album of Fluid Motion [463] is highly re
commended.
Many more references on these topics can easily be found these days by searching on the
web. In addition to using standard web search engines, there are preprint servers that contain
collections of preprints on various topics. In the ﬁeld of conservation laws, the Norwegian
preprint server at
http://www.math.ntnu.no/conservation/
is of particular note. Online citation indices and bibliographic databases are extremely useful
in searching the literature, and students should be encouraged to learn to use them. Some
useful links can be found on the webpage [claw/book/chap1/].
1.7 Notation
Some nonstandard notation is used in this book that may require explanation. In general I
use q to denote the solution to the partial differential equation under study. In the literature
the symbol u is commonly used, so that a general onedimensional conservation law has
the form u
t
+ f (u)
x
=0, for example. However, most of the speciﬁc problems we will
study involve a velocity (as in the acoustics equations (1.5)), and it is very convenient
to use u for this quantity (or as the xcomponent of the velocity vector u =(u, v) in two
dimensions).
The symbol Q
n
i
(in one dimension) or Q
n
i j
(in two dimensions) is used to denote the
numerical approximation to the solution q. Subscripts on Q denote spatial locations (e.g.,
the i th grid cell), and superscript n denotes time level t
n
. Often the temporal index is
suppressed, since we primarily consider onestep methods where the solution at time t
n+1
is
determined entirely by data at time t
n
. When Q or other numerical quantities lack a temporal
superscript it is generally clear that the current time level t
n
is intended.
1.7 Notation 11
For a system of m equations, q and Q are mvectors, and superscripts are also used to
denote the components of these vectors, e.g., q
p
for p =1, 2, . . . , m. It is more convenient
to use superscripts than subscripts for this purpose to avoid conﬂicts with spatial indices.
Superscripts are also used to enumerate the eigenvalues λ
p
and eigenvectors r
p
of an m×m
matrix. Luckily we generally do not need to refer to speciﬁc components of the eigenvectors.
Of course superscripts must also be used for exponents at times, and this will usually be
clear from context. Initial data is denoted by a circle above the variable, e.g., q
◦
(x), rather
than by a subscript or superscript, in order to avoid further confusion.
Several symbols play multiple roles in different contexts, since there are not enough
letters and familiar symbols to go around. For example, ψ is used in different places for the
entropy ﬂux, for source terms, and for stream functions. For the most part these different
uses are well separated and should be clear from context, but some care is needed to
avoid confusion. In particular, the index p is generally used for indexing eigenvalues and
eigenvectors, as mentioned above, but is also used for the pressure in acoustics and gas
dynamics applications, often in close proximity. Since the pressure is never a superscript, I
hope this will be clear.
One new symbol I have introduced is q
∨

(q
l
, q
r
) (pronounced perhaps “q Riemann”) to
denote the value that arises in the similarity solution to a Riemann problem along the ray
x/t =0, when the data q
l
and q
r
is speciﬁed (see Section 1.2.1). This value is often used in
deﬁning numerical ﬂuxes in ﬁnite volume methods, and it is convenient to have a general
symbol for the function that yields it. This symbol is meant to suggest the spreading of
waves from the Riemann problem, as will be explored starting in Chapter 3. Some notation
speciﬁc to multidimensional problems is introduced in Section 18.1.
Part one
Linear Equations
2
Conservation Laws and Differential Equations
To see how conservation laws arise from physical principles, we will begin by considering
the simplest possible ﬂuid dynamics problem, in which a gas or liquid is ﬂowing through a
onedimensional pipe with some known velocity u(x, t ), which is assumed to vary only with
x, the distance along the pipe, and time t . Typically in ﬂuid dynamics problems we must
determine the motion of the ﬂuid, i.e., the velocity function u(x, t ), as part of the solution,
but let’s assume this is already known and we wish to simply model the concentration or
density of some chemical present in this ﬂuid (in very small quantities that do not affect
the ﬂuid dynamics). Let q(x, t ) be the density of this chemical tracer, the function that we
wish to determine.
In general the density should be measured in units of mass per unit volume, e.g., grams
per cubic meter, but in studying the onedimensional pipe with variations only in x, it is
more natural to assume that q is measured in units of mass per unit length, e.g., grams per
meter. This density (which is what is denoted by q here) can be obtained by multiplying the
threedimensional density function by the crosssectional area of the pipe (which has units
of square meters). Then
x
2
x
1
q(x, t ) dx (2.1)
represents the total mass of the tracer in the section of pipe between x
1
and x
2
at the particular
time t , and has the units of mass. In problems where chemical kinetics is involved, it is
often necessary to measure the “mass” in terms of moles rather than grams, and the density
in moles per meter or moles per cubic meter, since the important consideration is not the
mass of the chemical but the number of molecules present. For simplicity we will speak in
terms of mass, but the conservation laws still hold in these other units.
Now consider a section of the pipe x
1
<x <x
2
and the manner in which the integral
(2.1) changes with time. If we are studying a substance that is neither created nor destroyed
within this section, then the total mass within this section can change only due to the ﬂux
or ﬂow of particles through the endpoints of the section at x
1
and x
2
. Let F
i
(t ) be the rate
at which the tracer ﬂows past the ﬁxed point x
i
for i =1, 2 (measured in grams per second,
say). We use the convention that F
i
(t ) >0 corresponds to ﬂow to the right, while F
i
(t ) <0
means a leftward ﬂux, of F
i
(t ) grams per second. Since the total mass in the section [x
1
, x
2
]
15
16 2 Conservation Laws and Differential Equations
changes only due to ﬂuxes at the endpoints, we have
d
dt
x
2
x
1
q(x, t ) dx = F
1
(t ) − F
2
(t ). (2.2)
Note that +F
1
(t ) and −F
2
(t ) both represent ﬂuxes into this section.
The equation (2.2) is the basic integral form of a conservation law, and equations of this
type form the basis for much of what we will study. The rate of change of the total mass
is due only to ﬂuxes through the endpoints – this is the basis of conservation. To proceed
further, we need to determine how the ﬂux functions F
j
(t ) are related to q(x, t ), so that we
can obtain an equation that might be solvable for q. In the case of ﬂuid ﬂow as described
above, the ﬂux at any point x at time t is simply given by the product of the density q(x, t )
and the velocity u(x, t ):
ﬂux at (x, t ) = u(x, t )q(x, t ). (2.3)
The velocity tells how rapidly particles are moving past the point x (in meters per second,
say), and the density q tells how many grams of chemical a meter of ﬂuid contains, so the
product, measured in grams per second, is indeed the rate at which chemical is passing this
point.
Since u(x, t ) is a known function, we can write this ﬂux function as
ﬂux = f (q, x, t ) = u(x, t )q. (2.4)
In particular, if the velocity is independent of x and t , so u(x, t ) = ¯ u is some constant, then
we can write
ﬂux = f (q) = ¯ uq. (2.5)
In this case the ﬂux at any point and time can be determined directly from the value of
the conserved quantity at that point, and does not depend at all on the location of the point
in space–time. In this case the equation is called autonomous. Autonomous equations will
occupy much of our attention because they arise in many applications and are simpler to
deal with than nonautonomous or variablecoefﬁcient equations, though the latter will also
be studied.
For a general autonomous ﬂux f (q) that depends only on the value of q, we can rewrite
the conservation law (2.2) as
d
dt
x
2
x
1
q(x, t ) dx = f (q(x
1
, t )) − f (q(x
2
, t )). (2.6)
The righthand side of this equation can be rewritten using standard notation from calculus:
d
dt
x
2
x
1
q(x, t ) dx = −f (q(x, t ))
x
2
x
1
. (2.7)
This shorthand will be useful in cases where the ﬂux has a complicated form, and also
suggests the manipulations performed below, leading to the differential equation for q.
2.1 The Advection Equation 17
Once the ﬂux function f (q) is speciﬁed, e.g., by (2.5) for the simplest case considered
above, we have an equation for q that we might hope to solve. This equation should hold
over every interval [x
1
, x
2
] for arbitrary values of x
1
and x
2
. It is not clear how to go about
ﬁnding a function q(x, t ) that satisﬁes such a condition. Instead of attacking this problem
directly, we generally transform it into a partial differential equation that can be handled
by standard techniques. To do so, we must assume that the functions q(x, t ) and f (q) are
sufﬁciently smooth that the manipulations below are valid. This is very important to keep
in mind when we begin to discuss nonsmooth solutions to these equations.
If we assume that q and f are smooth functions, then this equation can be rewritten as
d
dt
x
2
x
1
q(x, t ) dx = −
x
2
x
1
∂
∂x
f (q(x, t )) dx, (2.8)
or, with some further modiﬁcation, as
x
2
x
1
∂
∂t
q(x, t ) +
∂
∂x
f (q(x, t ))
dx = 0. (2.9)
Since this integral must be zero for all values of x
1
and x
2
, it follows that the integrand must
be identically zero. This gives, ﬁnally, the differential equation
∂
∂t
q(x, t ) +
∂
∂x
f (q(x, t )) = 0. (2.10)
This is called the differential form of the conservation laws. Partial differential equations
(PDEs) of this type will be our main focus. Partial derivatives will usually be denoted by
subscripts, so this will be written as
q
t
(x, t ) + f (q(x, t ))
x
= 0. (2.11)
2.1 The Advection Equation
For the ﬂux function (2.5), the conservation law (2.10) becomes
q
t
+ ¯ uq
x
= 0. (2.12)
This is called the advection equation, since it models the advection of a tracer along with
the ﬂuid. By a tracer we mean a substance that is present in very small concentrations
within the ﬂuid, so that the magnitude of the concentration has essentially no effect on the
ﬂuid dynamics. For this onedimensional problem the concentration (or density) q can be
measured in units such as grams per meter along the length of the pipe, so that
x
2
x
1
q(x, t ) dx
measures the total mass (in grams) within this section of pipe. In Section 9.1 we will
consider more carefully the manner in which this is measured and the form of the resulting
advection equation in more complicated cases where the diameter of the pipe and the ﬂuid
velocity need not be constant.
Equation (2.12) is a scalar, linear, constantcoefﬁcient PDE of hyperbolic type. The
general solution of this equation is very easy to determine. Any smooth function of the
18 2 Conservation Laws and Differential Equations
form
q(x, t ) = ˜ q(x − ¯ ut ) (2.13)
satisﬁes the differential equation (2.12), as is easily veriﬁed, and in fact any solution to
(2.12) is of this form for some ˜ q. Note that q(x, t ) is constant along any ray in space–time
for which x − ¯ ut = constant. For example, all along the ray X(t ) = x
0
+ ¯ ut the value of
q(X(t ), t ) is equal to ˜ q(x
0
). Values of q simply advect (i.e., translate) with constant velocity
¯ u, as we would expect physically, since the ﬂuid in the pipe (and hence the density of
tracer moving with the ﬂuid) is simply advecting with constant speed. These rays X(t ) are
called the characteristics of the equation. More generally, characteristic curves for a PDE
are curves along which the equation simpliﬁes in some particular manner. For the equation
(2.12), we see that along X(t ) the time derivative of q(X(t ), t ) is
d
dt
q(X(t ), t ) = q
t
(X(t ), t ) + X
(t )q
x
(X(t ), t )
= q
t
+ ¯ uq
x
= 0. (2.14)
and the equation (2.12) reduces to a trivial ordinary differential equation
d
dt
Q = 0, where
Q(t ) = q(X(t ), t ). This again leads to the conclusion that q is constant along the charac
teristic.
To ﬁnd the particular solution to (2.12) of interest in a practical problem, we need more
information in order to determine the particular function ¯ q in (2.13): initial conditions and
perhaps boundary conditions for the equation. First consider the case of an inﬁnitely long
pipe with no boundaries, so that (2.12) holds for −∞< x < ∞. Then to determine q(x, t )
uniquely for all times t > t
0
we need to know the initial condition at time t
0
, i.e., the initial
density distribution at this particular time. Suppose we know
q(x, t
0
) = q
◦
(x), (2.15)
where q
◦
(x) is a given function. Then since the value of q must be constant on each charac
teristic, we can conclude that
q(x, t ) = q
◦
(x − ¯ u(t −t
0
))
for t ≥ t
0
. The initial proﬁle q
◦
simply translates with speed ¯ u.
If the pipe has ﬁnite length, a < x < b, then we must also specify the density of tracer
entering the pipe as a function of time, at the inﬂow end. For example, if ¯ u >0 then we
must specify a boundary condition at x = a, say
q(a, t ) = g
0
(t ) for t ≥ t
0
in addition to the initial condition
q(x, t ) = q
◦
(x) for a < x < b.
2.1 The Advection Equation 19
(a)
t
a b (b)
t
a b
Fig. 2.1. The solution to the advection equation is constant along characteristics. When solving this
equation on the interval [a, b], we need boundary conditions at x = a if ¯ u > 0 as shown in (a), or at
x = b if ¯ u < 0 as shown in (b).
The solution is then
q(x, t ) =
g
0
(t −(x −a)/¯ u) if a < x < a + ¯ u(t −t
0
),
q
◦
(x − ¯ u(t −t
0
)) if a + ¯ u(t −t
0
) < x < b.
Note that we do not need to specify a boundary condition at the outﬂow boundary x = b
(and in fact cannot, since the density there is entirely determined by the data given already).
If on the other hand ¯ u <0, then ﬂow is to the left and we would need a boundary
condition at x = b rather than at x = a. Figure 2.1 indicates the ﬂow of information along
characteristics for the two different cases. The proper speciﬁcation of boundary conditions
is always an important part of the setup of a problem.
From now on, we will generally take the initial time to be t = 0 to simplify notation, but
everything extends easily to general t
0
.
2.1.1 Variable Coefﬁcients
If the ﬂuid velocity u varies with x, then the ﬂux (2.4) leads to the conservation law
q
t
+(u(x)q)
x
= 0. (2.16)
In this case the characteristic curves X(t ) are solutions to the ordinary differential equations
X
(t ) = u(X(t )). (2.17)
Starting from an arbitrary initial point x
0
, we can solve the equation (2.17) with initial
condition X(0) = x
0
to obtain a particular characteristic curve X(t ). Note that these curves
track the motion of particular material particles carried along by the ﬂuid, since their velocity
at any time matches the ﬂuid velocity. Along a characteristic curve we ﬁnd that the advection
20 2 Conservation Laws and Differential Equations
equation (2.16) simpliﬁes:
d
dt
q(X(t ), t ) = q
t
(X(t ), t ) + X
(t )q
x
(X(t ), t )
= q
t
+u(X(t ))q
x
= q
t
+(u(X(t ))q)
x
−u
(X(t ))q
= −u
(X(t ))q(X(t ), t ). (2.18)
Note that when u is not constant, the curves are no longer straight lines and the solution q
is no longer constant along the curves, but still the original partial differential equation has
been reduced to solving sets of ordinary differential equations.
The operator ∂
t
+u∂
x
is often called the material derivative, since it represents differen
tiation along the characteristic curve, and hence computes the rate of change observed by a
material particle moving with the ﬂuid.
The equation (2.16) is an advection equation in conservation form. In some applications
it is more natural to derive a nonconservative advection equation of the form
q
t
+u(x)q
x
= 0. (2.19)
Again the characteristic curves satisfy (2.17) and track the motion of material points. For
this equation the second line of the righthand side of (2.18) reduces to zero, so that q is
now constant along characteristic curves. Which form (2.16) or (2.19) arises often depends
simply on what units are used to measure physical quantities, e.g., whether we measure
concentration in grams per meter as was assumed above (giving (2.16)), or whether we use
grams per cubic meter, as might seem to be a more reasonable deﬁnition of concentration
in a physical ﬂuid. The latter choice leads to (2.19), as is discussed in detail in Chapter 9,
and further treatment of variablecoefﬁcient problems is deferred until that point.
2.2 Diffusion and the Advection–Diffusion Equation
Now suppose that the ﬂuid in the pipe is not ﬂowing, and has zero velocity. Then according
to the advection equation, q
t
= 0 and the initial proﬁle q
◦
(x) does not change with time.
However, if q
◦
is not constant in space, then in fact it should still tend to slowly change
due to molecular diffusion. The velocity ¯ u should really be thought of as a mean velocity,
the average velocity that the roughly 10
23
molecules in a given drop of water have. But
individual molecules are bouncing around in different directions, and so molecules of the
substance we are tracking will tend to get spread around in the water, as a drop of ink spreads.
There will tend to be a net motion from regions where the density is large to regions where
it is smaller. Fick’s law of diffusion states that the net ﬂux is proportional to the gradient
of q, which in one space dimension is simply the derivative q
x
. The ﬂux at a point x now
depends on the value of q
x
at this point, rather than on the value of q, so we write
ﬂux of q = f (q
x
) = −βq
x
, (2.20)
where β is the diffusion coefﬁcient. Using this ﬂux in (2.10) gives
q
t
= βq
xx
, (2.21)
which is known as the diffusion equation.
2.3 The Heat Equation 21
In some problems the diffusion coefﬁcient may vary with x. Then f = −β(x)q
x
and the
equation becomes
q
t
= (β(x)q
x
)
x
. (2.22)
Returning to the example of ﬂuid ﬂow, more generally there would be both advection
and diffusion occurring simultaneously. Then the ﬂux is f (q, q
x
) = ¯ uq −βq
x
, giving the
advection–diffusion equation
q
t
+ ¯ uq
x
= βq
xx
. (2.23)
The diffusion and advection–diffusion equations are examples of the general class of
PDEs called parabolic.
2.3 The Heat Equation
The equation (2.21) (or more generally (2.22)) is often called the heat equation, for heat
diffuses in much the same way as a chemical concentration. In the case of heat, there may
be no net motion of the material, but thermal vibration of molecules causes neighboring
molecules to vibrate and this internal energy diffuses through the material. Let q(x, t ) now
be the temperature of the material at point x (e.g., a metal rod, since we are in one space
dimension). The density of internal energy at point x is then given by
E(x, t ) = κ(x)q(x, t ),
where κ(x) is the heat capacity of the material at this point. It is this energy that is conserved,
and hence varies in a test section [x
1
, x
2
] only due to the ﬂux of energy past the endpoints.
The heat ﬂux is given by Fourier’s law of heat conduction,
ﬂux = −βq
x
,
where β is the coefﬁcient of thermal conductivity. This looks identical to Fick’s law for
diffusion, but note that Fourier’s law says that the energy ﬂux is proportional to the temper
ature gradient. If the heat capacity is identically constant, say κ ≡ 1, then this is identical
to Fick’s law, but there is a fundamental difference if κ varies. Equation (2.22) is the heat
equation when κ ≡ 1. More generally the heat equation is derived fromthe conservation law
d
dt
x
2
x
1
κ(x)q(x, t ) dx = −β(x)q
x
(x, t )
x
2
x
1
, (2.24)
and has the differential form
(κq)
t
= (βq
x
)
x
. (2.25)
Typically κ does not vary with time and so this can be written as
κq
t
= (βq
x
)
x
. (2.26)
22 2 Conservation Laws and Differential Equations
2.4 Capacity Functions
In the previous section we saw how the heat capacity comes into the conservation law for
heat conduction. There are also other situations where a “capacity” function naturally arises
in the derivation of a conservation law, where again the ﬂux of a quantity is naturally deﬁned
in terms of one variable q, whereas it is a different quantity κq that is conserved. If the ﬂux
function is f (q), then the obvious generalization of (2.24) yields the conservation law
κq
t
+ f (q)
x
= 0. (2.27)
While it may be possible to incorporate κ into the deﬁnition of f (q), it is often preferable
numerically to work directly with the form (2.27). This is discussed in Section 6.16 and is
useful in many applications. In ﬂuid ﬂow problems, κ might represent the capacity of the
medium to hold ﬂuid. For ﬂow through a pipe with a varying diameter, κ(x) might be the
crosssectional area, for example (see Section 9.1). For ﬂow in porous media, κ would be
the porosity, the fraction of the medium available to ﬂuid. On a nonuniform grid a capacity
κ appears in the numerical method that is related to the size of a physical grid cell; see
Section 6.17 and Chapter 23.
2.5 Source Terms
In some situations
x
2
x
1
q(x, t ) dx changes due to effects other than ﬂux through the endpoints
of the section, if there is some source or sink of the substance within the section. Denote
the density function for such a source by ψ(q, x, t ). (Negative values of ψ correspond to a
sink rather than a source.) Then the equation becomes
d
dt
x
2
x
1
q(x, t ) dx =
x
2
x
1
∂
∂x
f (q(x, t )) dx +
x
2
x
1
ψ(q(x, t ), x, t ) dx.
This leads to the PDE
q
t
(x, t ) + f (q(x, t ))
x
= ψ(q(x, t ), x, t ). (2.28)
In this section we mention only a few effects that lead to source terms. Conservation laws
with source terms are more fully discussed in Chapter 17.
2.5.1 External Heat Sources
As one example, consider heat conduction in a rod as in Section 2.3, with κ ≡ 1 and β ≡
constant, but now suppose there is also an external energy source distributed along the rod
with density ψ. Then we obtain the equation
q
t
(x, t ) = βq
xx
(x, t ) +ψ(x, t ).
This assumes the heat source is independent of the current temperature. In some cases
the strength of the source may depend on the value of q. For example, if the rod is immersed
in a liquid that is held at constant temperature q
0
, then the ﬂux of heat into the rod at the
2.6 Nonlinear Equations in Fluid Dynamics 23
point (x, t ) is proportional to q
0
−q(x, t ) and the equation becomes
q
t
(x, t ) = βq
xx
(x, t ) + D(q
0
−q(x, t )),
where D is the conductivity coefﬁcient between the rod and the bath.
2.5.2 Reacting Flow
As another example, consider a ﬂuid ﬂowing through a pipe at constant velocity as in
Section 2.1, but now suppose there are several different chemical species being advected
in this ﬂow (in minute quantities compared to the bulk ﬂuid). If these chemicals react with
one another, then the mass of each species individually will not be conserved, since it is
used up or produced by the chemical reactions. We will have an advection equation for each
species, but these will include source terms arising from the chemical kinetics.
As an extremely simple example, consider the advection of a radioactive isotope with
concentration measured by q
1
, which decays spontaneously at some rate α into a different
isotope with concentration q
2
. If this decay is taking place in a ﬂuid moving with velocity
¯ u, then we have a system of two advection equations with source terms:
q
1
t
+ ¯ uq
1
x
= −αq
1
,
q
2
t
+ ¯ uq
2
x
= +αq
1
.
(2.29)
This has the form q
t
+ Aq
x
= ψ(q), in which the coefﬁcient matrix A is diagonal with both
diagonal elements equal to ¯ u. This is a hyperbolic system, with a source term. More generally
we might have m species with various chemical reactions occurring simultaneously between
them. Then we would have a system of m advection equations (with diagonal coefﬁcient
matrix A = ¯ uI ) and source terms given by the standard kinetics equations of mass action.
If there are spatial variations in concentrations, then these equations may be augmented
with diffusion terms for each species. This would lead to a system of reaction–advection–
diffusion equations of the form
q
t
+ Aq
x
= βq
xx
+ψ(q). (2.30)
The diffusion coefﬁcient could be different for each species, in which case β would be a
diagonal matrix instead of a scalar.
Other types of source terms arise from external forces such as gravity or from geometric
transformations used to simplify the equations. See Chapter 17 for some other examples.
2.6 Nonlinear Equations in Fluid Dynamics
In the pipeﬂowmodel discussed above, the function q(x, t ) represented the density of some
tracer that was carried along with the ﬂuid but was present in such small quantities that
the distribution of q has no effect on the ﬂuid velocity. Now let’s consider the density of
the ﬂuid itself, again in grams per meter, say, for this onedimensional problem. We will
denote the ﬂuid density by the standard symbol ρ(x, t ). If the ﬂuid is incompressible (as
most liquids can be assumed to be for most purposes), then ρ(x, t ) is constant and this
24 2 Conservation Laws and Differential Equations
onedimensional problem is not very interesting. If we consider a gas, however, then the
molecules are far enough apart that compression or expansion is possible and the density
may vary from point to point.
If we again assume that the velocity ¯ u is constant, then the density ρ will satisfy the same
advection equation as before (since the ﬂux is simply ¯ uρ and ¯ u is constant),
ρ
t
+ ¯ uρ
x
= 0, (2.31)
and any initial variation in density will simply translate at speed ¯ u. However, this is not
what we would expect to happen physically. If the gas is compressed in some region (i.e.,
the density is higher here than nearby) then we would expect that the gas would tend to
push into the neighboring gas, spreading out, and lowering the density in this region while
raising the density nearby. (This does in fact happen provided that the pressure is also higher
in this region; see below.) In order for the gas to spread out it must move relative to the
neighboring gas, and hence we expect the velocity to change as a result of the variation in
density.
While previously we assumed the tracer density q had no effect on the velocity, this
is no longer the case. Instead we must view the velocity u(x, t ) as another unknown to
be determined along with ρ(x, t ). The density ﬂux still takes the form (2.3), and so the
conservation law for ρ has the form
ρ
t
+(ρu)
x
= 0, (2.32)
which agrees with (2.31) only if u is constant. This equation is generally called the continuity
equation in ﬂuid dynamics, and models the conservation of mass.
In addition to this equation we now need a second equation for the velocity. The velocity
itself is not a conserved quantity, but the momentum is. The product ρ(x, t )u(x, t ) gives
the density of momentum, in the sense that the integral of ρu between any two points x
1
and x
2
yields the total momentum in this interval, and this can change only due to the ﬂux
of momentum through the endpoints of the interval. The momentum ﬂux past any point x
consists of two parts. First there is momentum carried past this point along with the moving
ﬂuid. For any density function q this ﬂux has the form qu, as we have already seen at the
beginning of this chapter, and so for the momentum q = ρu this contribution to the ﬂux is
(ρu)u = ρu
2
. This is essentially an advective ﬂux, although in the case where the quantity
being advected is the velocity or momentum of the ﬂuid itself, the phenomenon is often
referred to as convection rather than advection.
In addition to this macroscopic convective ﬂux, there is also a microscopic momentum
ﬂux due to the pressure of the ﬂuid, as described in Section 14.1. This enters into the
momentum ﬂux, which now becomes
momentum ﬂux = ρu
2
+ p.
The integral form of the conservation law (2.7) is then
d
dt
x
2
x
1
ρ(x, t )u(x, t ) dx = −[ρu
2
+ p]
x
2
x
1
. (2.33)
2.6 Nonlinear Equations in Fluid Dynamics 25
Note that it is only a difference in pressure between the two ends of the interval that will
cause a change in the net momentum, as we would expect. We can think of this pressure
difference as a net force that causes an acceleration of the ﬂuid, though this isn’t strictly
correct and a better interpretation is given in Section 14.1.
If we assume that ρ, u, and p are all smooth, then we obtain the differential equation
(ρu)
t
+(ρu
2
+ p)
x
= 0, (2.34)
modeling conservation of momentum. Combining this with the continuity equation (2.32),
we have a system of two conservation laws for the conservation of mass and momentum.
These are coupled equations, since ρ and ρu appear in both. They are also clearly nonlinear,
since products of the unknowns appear.
In developing the conservation law for ρu we have introduced a new unknown, the
pressure p(x, t ). It appears that we need a third differential equation for this. Pressure is not
a conserved quantity, however, and so instead we introduce a fourth variable, the energy,
and an additional equation for the conservation of energy. The density of energy will be
denoted by E(x, t ). This still does not determine the pressure, and to close the system we
must add an equation of state, an algebraic equation that determines the pressure at any
point in terms of the mass, momentum, and energy at the point. The energy equation and
equations of state will be discussed in detail in Chapter 14, where we will derive the full
system of three conservation laws.
For the time being we consider special types of ﬂowwhere we can drop the conservation
ofenergy equation and use a simpler equation of state that determines p from ρ alone. For
example, if no shock waves are present, then it is often correct to assume that the entropy of
the gas is constant. Such a ﬂow is called isentropic. This is discussed further in Chapter 14.
This assumption is reasonable in particular if we wish to derive the equations of linear
acoustics, which we will do in the next section. In this case we look at very smallamplitude
motions (sound waves) and the ﬂow remains isentropic. In the isentropic case the equation
of state is simply
p = ˆ κρ
γ
≡ P(ρ), (2.35)
where ˆ κ and γ are two constants (with γ ≈1.4 for air).
More generally we could assume an equation of state of the form
p = P(ρ), (2.36)
where P(ρ) is a given function specifying the pressure in terms of density. To be physically
realistic we can generally assume that
P
(ρ) > 0 for ρ > 0. (2.37)
This matches our intuition (already used above) that increasing the density of the gas will
cause a corresponding increase in pressure. Note that the isentropic equation of state (2.35)
has this property. We will see below that the assumption (2.37) is necessary in order to
obtain a hyperbolic system.
26 2 Conservation Laws and Differential Equations
Using the equation of state (2.36) in (2.34), together with the continuity equation (2.32),
gives a closed system of two equations:
ρ
t
+(ρu)
x
= 0,
(ρu)
t
+(ρu
2
+ P(ρ))
x
= 0.
(2.38)
This is a coupled system of two nonlinear conservation laws, which we can write in the
form
q
t
+ f (q)
x
= 0 (2.39)
if we deﬁne
q =
ρ
ρu
=
q
1
q
2
, f (q) =
ρu
ρu
2
+ P(ρ)
=
q
2
(q
2
)
2
/q
1
+ P(q
1
)
. (2.40)
More generally, a system of m conservation laws takes the form (2.39) with q ∈ R
m
and
f : R
m
→R
m
. The components of f are the ﬂuxes of the respective components of q, and
in general each ﬂux may depend on the values of any or all of the conserved quantities at
that point.
Again it should be stressed that this differential form of the conservation law is derived
under the assumption that q is smooth, from the more fundamental integral form. Note that
when q is smooth, we can also rewrite (2.39) as
q
t
+ f
(q)q
x
= 0, (2.41)
where f
(q) is the Jacobian matrix with (i, j ) entry given by ∂ f
i
/∂q
j
. The form (2.41) is
called the quasilinear form of the equation, because it resembles the linear system
q
t
+ Aq
x
= 0, (2.42)
where A is a given m×m matrix. In the linear case this matrix does not depend on q, while
in the quasilinear equation (2.41) it does. Athorough understanding of linear systems of the
form (2.42) is required before tackling nonlinear systems, and the ﬁrst 10 chapters concern
only linear problems. There is a close connection between these theories, and the Jacobian
matrix f
(q) plays an important role in the nonlinear theory.
2.7 Linear Acoustics
In general one can always obtain a linear system from a nonlinear problem by linearizing
about some state. This amounts to deﬁning A = f
(q
0
) for some ﬁxed state q
0
in the linear
system(2.42), and gives a mathematically simpler problemthat is useful in some situations,
particularly when the interest is in studying small perturbations about some constant state.
To see how this comes about, suppose we wish to model the propagation of sound waves
in a onedimensional tube of gas. An acoustic wave is a very small pressure disturbance that
propagates through the compressible gas, causing inﬁnitesimal changes in the density and
pressure of the gas via small motions of the gas with inﬁnitesimal values of the velocity u.
2.7 Linear Acoustics 27
Our eardrums are extremely sensitive to small changes in pressure and translate small
oscillations in the pressure into nerve impulses that we interpret as sound. Consequently,
most sound waves are essentially linear phenomena: the magnitudes of disturbances from
the background state are so small that products or powers of the perturbation amplitude
can be ignored. As linear phenomena, they also do not involve shock waves, and so a
linearization of the isentropic equations introduced above is suitable. (An exception is the
“sonic boom” caused by supersonic aircraft – this is a nonlinear shock wave, or at least
originates as such.)
To perform the linearization of (2.40), let
q(x, t ) = q
0
+ ˜ q(x, t ), (2.43)
where q
0
= (ρ
0
, ρ
0
u
0
) is the background state we are linearizing about and ˜ q is the pertur
bation we wish to determine. Typically u
0
= 0, but it can be nonzero if we wish to study
the propagation of sound in a constantstrength wind, for example. Using (2.43) in (2.11)
and discarding any terms that involve powers or products of the ˜ q variables, we obtain the
linearized equations
˜ q
t
+ f
(q
0
) ˜ q
x
= 0 (2.44)
This is a constantcoefﬁcient linear system modeling the evolution of small disturbances.
To obtain the acoustics equations, we compute the Jacobian matrix for the simpliﬁed
system of gas dynamics (2.38). Differentiating the ﬂux function from (2.40) gives
f
(q) =
∂ f
1
/∂q
1
∂ f
1
/∂q
2
∂ f
2
/∂q
1
∂ f
2
/∂q
2
=
0 1
−(q
2
)
2
/(q
1
)
2
+ P
(q
1
) 2q
2
/q
1
=
0 1
−u
2
+ P
(ρ) 2u
. (2.45)
The equations of linear acoustics thus take the form of a constantcoefﬁcient linear system
(2.44) with
A = f
(q
0
) =
0 1
−u
2
0
+ P
(ρ
0
) 2u
0
. (2.46)
Note that the vector ˜ q in the system (2.44) has components ˜ ρ and ρu, the perturbation of
density and momentum. When written out in terms of its components, the system is
˜ ρ
t
+( ρu)
x
= 0
( ρu)
t
+
−u
2
0
+ P
(ρ
0
)
˜ ρ
x
+2u
0
( ρu)
x
= 0.
(2.47)
Physically it is often more natural to model perturbations ˜ u and ˜ p in velocity and pressure,
since these can often be measured directly. To obtain such equations, ﬁrst note that pressure
perturbations can be related to density perturbations through the equation of state,
p
0
+ ˜ p = P(ρ
0
+ ˜ ρ) = P(ρ
0
) + P
(ρ
0
) ˜ ρ +· · · ,
28 2 Conservation Laws and Differential Equations
and since p
0
= P(ρ
0
), we obtain
˜ p ≈ P
(ρ
0
) ˜ ρ.
Also we have
ρu = (ρ
0
+ ˜ ρ)(u
0
+ ˜ u) = ρ
0
u
0
+ ˜ ρu
0
+ρ
0
˜ u + ˜ ρ ˜ u,
and so
ρu ≈ u
0
˜ ρ +ρ
0
˜ u.
Using these expressions in the equations (2.47) and performing some manipulations
(Exercise 2.1) leads to the alternative form of the linear acoustics equations
˜ p
t
+u
0
˜ p
x
+ K
0
˜ u
x
= 0,
ρ
0
˜ u
t
+ ˜ p
x
+ρ
0
u
0
˜ u
x
= 0,
(2.48)
where
K
0
= ρ
0
P
(ρ
0
). (2.49)
The equations (2.48) can be written as a linear system
p
u
t
+
u
0
K
0
1/ρ
0
u
0
p
u
x
= 0. (2.50)
Here and from now on we will generally drop the tilde on p and u and use
q(x, t ) =
p(x, t )
u(x, t )
to denote the pressure and velocity perturbations in acoustics.
The system (2.50) can also be derived by ﬁrst rewriting the conservation laws (2.38) as
a nonconservative set of equations for u and p, which is valid only for smooth solutions,
and then linearizing this system; see Exercise 2.2.
An important special case of these equations is obtained by setting u
0
= 0, so that we
are linearizing about the motionless state. In this case the coefﬁcient matrix A appearing in
the system (2.50) is
A =
0 K
0
1/ρ
0
0
(2.51)
and the equations reduce to
p
t
+ K
0
u
x
= 0,
ρ
0
u
t
+ p
x
= 0.
(2.52)
In Section 2.12 we will see that essentially the same set of equations can be derived for
onedimensional acoustics in an elastic solid. The parameter K
0
is called the bulk modulus
of compressibility of the material; see Section 22.1.2 for more about this parameter.
2.8 Sound Waves 29
2.8 Sound Waves
If we solve the equations just obtained for linear acoustics in a stationary gas, we expect the
solution to consist of sound waves propagating to the left and right. Since the equations are
linear, we should expect that the general solution consists of a linear superposition of waves
moving in each direction, and that each wave propagates at constant speed (the speed of
sound) with its shape unchanged. This suggests looking for solutions to the system (2.52)
of the form
q(x, t ) = ¯ q(x −st )
for some speed s, where ¯ q(ξ) is some function of one variable. With this Ansatz we compute
that
q
t
(x, t ) = −s ¯ q
(x −st ), q
x
(x, t ) = ¯ q
(x −st ),
and so the equation q
t
+ Aq
x
= 0 reduces to
A¯ q
(x −st ) = s ¯ q
(x −st ). (2.53)
Since s is a scalar while A is a matrix, this is only possible if s is an eigenvalue of the matrix
A, and ¯ q
(ξ) must also be a corresponding eigenvector of A for each value of ξ. Make sure
you understand why this is so, as this is a key concept in understanding the structure of
hyperbolic systems.
For the matrix A in (2.51) we easily compute that the eigenvalues are
λ
1
= −c
0
and λ
2
= +c
0
, (2.54)
where
c
0
=
K
0
/ρ
0
, (2.55)
which must be the speed of sound in the gas. As expected, waves can propagate in either
direction with this speed. Recalling (2.49), we see that
c
0
=
P
(ρ
0
). (2.56)
The intuitively obvious assumption (2.37) (that pressure increases with density so that
P
(ρ) > 0) turns out to be important mathematically in order for the speed of sound c
0
to
be a real number.
For the more general coefﬁcient matrix A of (2.50) with u
0
= 0, the eigenvalues are
found to be
λ
1
= u
0
−c
0
and λ
2
= u
0
+c
0
. (2.57)
When the ﬂuid is moving with velocity u
0
, sound waves still propagate at speed ±c
0
relative
to the ﬂuid, and at velocities λ
1
and λ
2
relative to a ﬁxed observer. (See Figure 3.7.)
30 2 Conservation Laws and Differential Equations
Regardless of the value of u
0
, the eigenvectors of the coefﬁcient matrix are
r
1
=
−ρ
0
c
0
1
, r
2
=
ρ
0
c
0
1
. (2.58)
Any scalar multiple of each vector would still be an eigenvector. We choose the particular
normalization of (2.58) because the quantity
Z
0
≡ ρ
0
c
0
(2.59)
is an important parameter in acoustics, called the impedance of the medium.
A sound wave propagating to the left with velocity −c
0
must have the general form
q(x, t ) = ¯ w
1
(x +c
0
t )r
1
(2.60)
for some scalar function ¯ w
1
(ξ), so that
q(x, t ) = ¯ w
1
(x +c
0
t )r
1
≡ ¯ q(x +c
0
t )
and hence ¯ q
(ξ) is a scalar multiple of r
1
as required by (2.53) for s = −c
0
. In terms of the
components of q this means that
p(x, t ) = −Z
0
¯ w
1
(x +c
0
t ),
u(x, t ) = ¯ w
1
(x +c
0
t ).
(2.61)
We see that in a leftgoing sound wave the pressure and velocity perturbations are always
related by p = −Z
0
u. Analogously, in a rightgoing sound wave p = +Z
0
u everywhere
and q(x, t ) = ¯ w
2
(x −c
0
t )r
2
for some scalar function ¯ w
2
(ξ). (See Figure 3.1.)
The general solution to the acoustic equations consists of a superposition of leftgoing
and rightgoing waves, and has
q(x, t ) = ¯ w
1
(x +c
0
t )r
1
+ ¯ w
2
(x −c
0
t )r
2
(2.62)
for some scalar functions ¯ w
1
(ξ) and ¯ w
2
(ξ). Exactly what these functions are will depend
on the initial data given for the problem. Let
q(x, 0) = q
◦
(x) =
p
◦
(x)
u
◦
(x)
be the pressure and velocity perturbation at time t = 0. To compute the resulting solution
q(x, t ) we need to determine the scalar functions ¯ w
1
and ¯ w
2
in (2.62). To do so we can
evaluate (2.62) at time t = 0 and set this equal to the given data q
◦
, obtaining
¯ w
1
(x)r
1
+ ¯ w
2
(x)r
2
= q
◦
(x).
At each point x this gives a 2 ×2 linear system of equations to solve for ¯ w
1
(x) and ¯ w
2
(x)
at this particular point (since the vectors r
1
, r
2
, and q
◦
(x) are all known). Let
R = [r
1
r
2
] (2.63)
2.9 Hyperbolicity of Linear Systems 31
be the 2×2 matrix with columns r
1
and r
2
. Then this system of equations can be written as
R ¯ w(x) = q
◦
(x), (2.64)
where ¯ w(x) is the vector with components ¯ w
1
(x) and ¯ w
2
(x). For acoustics the matrix R is
R =
−Z
0
Z
0
1 1
, (2.65)
which is a nonsingular matrix provided Z
0
> 0 as it will be in practice. The solution to
(2.64) can be found in terms of the inverse matrix
R
−1
=
1
2Z
0
−1 Z
0
1 Z
0
. (2.66)
We ﬁnd that
¯ w
1
(x) =
1
2Z
0
[−p
◦
(x) + Z
0
u
◦
(x)],
¯ w
2
(x) =
1
2Z
0
[ p
◦
(x) + Z
0
u
◦
(x)].
(2.67)
The solution (2.62) then becomes
p(x, t ) =
1
2
[ p
◦
(x +c
0
t ) + p
◦
(x −c
0
t )] −
Z
0
2
[u
◦
(x +c
0
t ) −u
◦
(x −c
0
t )],
u(x, t ) = −
1
2Z
0
[ p
◦
(x +c
0
t ) − p
◦
(x −c
0
t )] +
1
2
[u
◦
(x +c
0
t ) +u
◦
(x −c
0
t )].
(2.68)
2.9 Hyperbolicity of Linear Systems
The process we have just gone through to solve the acoustics equations motivates the
deﬁnition of a ﬁrstorder hyperbolic system of partial differential equations. This process
generalizes to solve any linear constantcoefﬁcient hyperbolic system.
Deﬁnition 2.1. A linear system of the form
q
t
+ Aq
x
= 0 (2.69)
is called hyperbolic if the m ×m matrix A is diagonalizable with real eigenvalues.
We denote the eigenvalues by
λ
1
≤ λ
2
≤ · · · ≤ λ
m
.
The matrix is diagonalizable if there is a complete set of eigenvectors, i.e., if there are
nonzero vectors r
1
, r
2
, . . . , r
m
∈ R
m
such that
Ar
p
= λ
p
r
p
for p = 1, 2, . . . , m, (2.70)
32 2 Conservation Laws and Differential Equations
and these vectors are linearly independent. In this case the matrix
R = [r
1
r
2
 · · · r
m
], (2.71)
formed by collecting the vectors r
1
, r
2
, . . . , r
m
together, is nonsingular and has an inverse
R
−1
. We then have
R
−1
AR = and A = RR
−1
, (2.72)
where
=
λ
1
λ
2
.
.
.
λ
m
≡ diag(λ
1
, λ
2
, . . . , λ
m
).
Hence we can bring A to diagonal form by a similarity transformation, as displayed in
(2.72). The importance of this from the standpoint of the PDE is that we can then rewrite
the linear system (2.69) as
R
−1
q
t
+ R
−1
ARR
−1
q
x
= 0. (2.73)
If we deﬁne w(x, t ) ≡ R
−1
q(x, t ), then this takes the form
w
t
+w
x
= 0. (2.74)
Since is diagonal, this system decouples into m independent advection equations for the
components w
p
of w:
w
p
t
+λ
p
w
p
x
= 0 for p = 1, 2, . . . , m. (2.75)
Since each λ
p
is real, these advection equations make sense physically and can be used to
solve the original systemof equations (2.69). Complete details are given in the next chapter,
but clearly the solution will consist of a linear combination of m “waves” traveling at the
characteristic speeds λ
1
, λ
2
, . . . , λ
m
. (Recall that eigenvalues are also sometimes called
“characteristic values.”) These values deﬁne the characteristic curves X(t ) = x
0
+ λ
p
t
along which information propagates in the decoupled advection equations. The functions
w
p
(x, t ) are called the characteristic variables; see Section 3.2.
There are some special classes of matrices A for which the systemis certainly hyperbolic.
If A is a symmetric matrix (A = A
T
), then A is always diagonalizable with real eigenvalues
and the system is said to be symmetric hyperbolic. Also, if A has distinct real eigenvalues
λ
1
< λ
2
< · · · < λ
m
, then the eigenvectors must be linearly independent and the system is
hyperbolic. Such a systemis called strictly hyperbolic. The equations of linear acoustics are
strictly hyperbolic, for example. The homogeneous part of the system (2.29) (i.e., setting
α = 0) is symmetric hyperbolic but not strictly hyperbolic. Difﬁculties can arise in studying
certain nonstrictly hyperbolic equations, as discussed brieﬂy in Section 16.2. If A has real
eigenvalues but is not diagonalizable, then the systemis weakly hyperbolic; see Section 16.3.
2.10 VariableCoefﬁcient Hyperbolic Systems 33
2.9.1 SecondOrder Wave Equations
From the acoustics equations (2.52) we can eliminate the velocity u and obtain a second
order equation for the pressure. Differentiating the pressure equation with respect to t and
the velocity equation with respect to x and then combining the results gives
p
t t
= −K
0
u
xt
= −K
0
u
t x
= K
0
1
ρ
0
p
x
x
= c
2
0
p
xx
.
This yields the secondorder wave equation of the classical form
p
t t
= c
2
0
p
xx
(c
0
≡ constant). (2.76)
This is also a hyperbolic equation according to the standard classiﬁcation of secondorder
differential equations. In this book, however, we concentrate almost entirely on ﬁrstorder
hyperbolic systems as deﬁned at the start of Section 2.9. There is a certain equivalence
as suggested by the above transformation for acoustics. Conversely, given a secondorder
equation of the type (2.76), we can derive a ﬁrstorder hyperbolic system by deﬁning new
variables
q
1
= p
t
, q
2
= −p
x
,
so that (2.76) becomes q
1
t
+c
2
0
q
2
x
= 0, while the equality of mixed partial derivatives gives
q
2
t
+ q
1
x
= 0. These two equations taken together give a system q
t
+
˜
A
qx
= 0, with the
coefﬁcient matrix
˜
A =
0 c
2
0
1 0
. (2.77)
This matrix is similar to the matrix A of (2.51), meaning that there is a similarity transfor
mation
˜
A = SAS
−1
relating the two matrices. The matrix S relates the two sets of variables
and leads to a corresponding change in the eigenvector matrix, while the eigenvalues of the
two matrices are the same, ±c
0
.
Many books take the viewpoint that the equation (2.76) is the fundamental wave equation
and a ﬁrstorder system can be derived from it by introducing “artiﬁcial” variables such
as p
t
and p
x
. In fact, however, it is the ﬁrstorder system that follows directly from the
physics, as we have seen. Since effective numerical methods are more easily derived for
the ﬁrstorder system than for the secondorder scalar equation, there is no need for us to
consider the secondorder equation further.
2.10 VariableCoefﬁcient Hyperbolic Systems
A variablecoefﬁcient linear system of PDEs might take the form
q
t
+ A(x)q
x
= 0. (2.78)
This systemis hyperbolic at any point x where the coefﬁcient matrix satisﬁes the conditions
laid out in Section 2.9. In Section 9.6, for example, we will see that the equations of acoustics
in a heterogeneous medium(where the density and bulk modulus vary with x) can be written
34 2 Conservation Laws and Differential Equations
as such a system which is hyperbolic everywhere, with eigenvalues given by ±c(x), where
the sound speed c(x) varies with position depending on the material parameters.
In some cases we might have a conservative system of linear equations of the form
q
t
+(A(x)q)
x
= 0, (2.79)
in which the ﬂux function f (q, x) = A(x)q depends explicitly on x. This system could be
rewritten as
q
t
+ A(x)q
x
= −A
(x)q (2.80)
as a system of the form (2.78) with the addition of a source term. Again the problem is
hyperbolic at any point where A(x) is diagonalizable with real eigenvalues. Such problems
are discussed further in Chapter 9.
2.11 Hyperbolicity of Quasilinear and Nonlinear Systems
A quasilinear system
q
t
+ A(q, x, t )q
x
= 0 (2.81)
is said to be hyperbolic at a point (q, x, t ) if the matrix A(q, x, t ) satisﬁes the hyperbolicity
condition (diagonalizable with real eigenvalues) at this point.
The nonlinear conservation law (2.11) is hyperbolic if the Jacobian matrix f
(q) appear
ing in the quasilinear form (2.41) satisﬁes the hyperbolicity condition for each physically
relevant value of q.
Example 2.1. The nonlinear equations of isentropic gas dynamics (2.38) have the Jacobian
matrix (2.45). The eigenvalues are
λ
1
= u −c, λ
2
= u +c,
where the velocity u may now vary from point to point, as does the sound speed
c =
P
(ρ). (2.82)
However, since P
(ρ) > 0 at all points in the gas, this nonlinear systemis strictly hyperbolic.
(Provided we stay away fromthe “vacuumstate” where ρ and p go to zero. For the equation
of state (2.35), c →0 as well in this case, and the nonstrict hyperbolicity at this point causes
additional difﬁculties in the nonlinear analysis.)
Solutions to nonlinear hyperbolic systems also involve wave propagation, and for a
system of m equations we will often be able to ﬁnd m independent waves at each point.
However, since the wave speeds depend on the value of the solution q, wave shapes will typ
ically deform, and the solution procedure is greatly complicated by this nonlinear structure.
Nonlinear conservation laws are discussed starting in Chapter 11.
In the remainder of this chapter some other hyperbolic systems are introduced. These
sections can be skipped at this point without loss of continuity.
2.12 Solid Mechanics and Elastic Waves 35
2.12 Solid Mechanics and Elastic Waves
The equations of linear acoustics were derived in Section 2.8 by linearizing the equations
of isentropic gas dynamics. Essentially the same system of equations can be derived from
elasticity theory to obtain the equations modeling a onedimensional acoustic wave in a
solid, which again is a smallamplitude compressional disturbance in which the material
moves back and forth in the same direction as the wave propagates, leading to smallscale
changes in density and pressure. Unlike a gas or liquid, however, a solid also supports a
second distinct type of smallamplitude waves called shear waves, in which the motion of
the material is orthogonal to the direction of wave propagation. These two types of waves
travel at distinct speeds, as illustrated in Figure 2.2. In general these two types of waves are
coupled together and the equations of linear elasticity are a single set of hyperbolic equations
that must be solved for all motions of the solid, which are coupled together. However, if
we restrict our attention to onedimensional plane waves, in which all quantities vary only
in one direction, then these equations decouple into two independent hyperbolic systems
of two equations each. Mathematically these linear systems are not very interesting, since
each has the same structure as the acoustics equations we have already studied in detail.
Because of this, however, some of the basic concepts of wave propagation in solids can be
most easily introduced in this context, and this foundation will be useful when we develop
the multidimensional equations.
Figure 2.2 shows the two distinct types of planewave motion in an elastic solid. Other
types of waves can also be observed in solids, such as surface waves at a free surface or
interface between different solids, but these have a truly multidimensional structure. The
strips shown in Figure 2.2 should be viewed as taken froman inﬁnite threedimensional solid
in which all quantities vary only with x, so the motion shown extends inﬁnitely far in the
c
p
t c
s
t
(a) (b)
Fig. 2.2. Illustration of (a) Pwaves and (b) Swaves in elastic solids. Time advances going upwards.
36 2 Conservation Laws and Differential Equations
y (upward) direction and in z (normal to the page). Related onedimensional equations can
also be used to study elastic motion in a ﬁnite elastic bar, but then additional complications
arise in that a compression in the xdirection will typically result in some spreading in the
y and zdirections, whereas in the inﬁnite planewave case there is no opportunity for such
spreading; see Chapter 22.
In Figure 2.2(a) the material is compressed at the left edge by a motion in the xdirection
conﬁned to a small region in x. This compressional wave moves in the xdirection at some
speed c
p
and is analogous to an acoustic wave in a gas. Compressing the material leads to
an increase in stress and hence to acceleration in the xdirection. These changes in stress
and velocity are coupled together to result in wave motion.
Figure 2.2(b) shows a different type of wave, a shear wave in which the material is
displaced in the ydirection over a small region in x. In a gas or liquid, a shear displacement
of this type would not result in any restoring force or wave motion. There is no compression
or expansion of the material, and hence no stress results. Molecules of a gas or liquid may
be freely rearranged as long as there is no change in the pressure and there will be no
restoring force. Of course frictional (viscous) forces will arise during a rearrangement as
the molecules move past one another, but once rearranged they are not pulled back towards
their original locations. A solid is fundamentally different in that the constituent molecules
are attached to one another by chemical bonds that resist any deformations. The bonds will
stretch slightly to allowsmall elastic deformations, but like tiny springs they exert a restoring
force that typically grows with the magnitude of any deformation. This operates like pressure
in the case of compressional waves, but these bonds also resist shear deformations, and the
restoring forces result in shear waves as illustrated in Figure 2.2(b). These waves move at
a speed c
s
that we will see is always smaller then the speed c
p
of compressional waves.
The two types of waves are often called Pwaves and Swaves, with “P” and “S” having
two possible interpretations: “pressure” and “shear” waves, or alternatively “primary” and
“secondary” waves in view of the fact that c
p
> c
s
and so the Pwave arising from some
disturbance always arrives at a distant observer before the Swave.
The theory of linear elasticity results from assuming that the deformations are small
enough that the restoring force is linearly related to an appropriate measure of the defor
mation of the solid. For larger deformations the response may be nonlinear. The material
is still elastic if the deformation is sufﬁciently small that the material can be expected to
eventually return to its original conﬁguration if all external forces are removed. If the defor
mation is too extreme, however, the material may simply fail (fracture or break), if enough
bonds are irreparably broken, or it may undergo a plastic deformation, in which bonds are
broken and reformed in a newconﬁguration so that the resulting solid has a different resting
conﬁguration from that of the original solid. The theory of plasticity then applies.
2.12.1 Elastic Deformations
The mathematical notation of solid mechanics is somewhat different from that of ﬂuid
dynamics. For an elastic body we are typically concerned with small displacements about
some reference conﬁguration, the location of the body at rest, for example, and so it makes
sense to consider the actual location of material points at some time as a function of their
reference location. For example, in two space dimensions we can let (X(x, y), Y(x, y))
2.12 Solid Mechanics and Elastic Waves 37
represent the location at time t of the material whose reference location is (x, y). The
displacement vector
δ is then deﬁned to be
δ(x, y, t ) =
δ
1
(x, y, t )
δ
2
(x, y, t )
=
X(x, y, t )
Y(x, y, t )
−
x
y
. (2.83)
The symbol u is often used for the displacement vector, but we reserve this for the velocity
vector, which is the time derivative of the displacement,
u(x, y, t ) =
u(x, y, t )
v(x, y, t )
=
δ
1
t
(x, y, t )
δ
2
t
(x, y, t )
. (2.84)
Displacements of the body often lead to strains within the body. Astrain is a deformation
that results in changes of length or shape within the body. These strains in turn lead to
stress, the interior forces due to the stretching or compression of atomic bonds. These
forces result in acceleration of the material, affecting the motion and hence the evolution of
the strains. The equations of elasticity consist of Newton’s lawrelating force to acceleration
together with stress–strain relations describing the force that results from a given strain.
This constitutive relation depends on the particular material (similarly to the equation of
state for a gas). For sufﬁciently small strains the stress may be assumed to vary linearly
with strain, resulting in the equations of linear elasticity.
2.12.2 Strain
Not all deformations result in a strain. Rigidbody motions (translations and rotations) in
which the body is simply moved as a rigid entity do not lead to any internal strain or stress.
Rigid translations correspond to a displacement vector
δ(x, y, t ) that varies only with t and
is independent of spatial position. Clearly there will be a strain in the material only if
δ
varies in space, so that some points are displaced relative to other points in the body. Hence
the strain depends only on the displacement gradient
∇
δ =
δ
1
x
δ
1
y
δ
2
x
δ
2
y
=
X
x
−1 X
y
Y
x
Y
y
−1
, (2.85)
where the subscripts denote partial derivatives. Note that for a rigid translation ∇
δ = 0.
We still need to eliminate solidbody rotations, which can be done by splitting ∇
δ into
the sum of a symmetric and a skewsymmetric matrix,
∇
δ = +, (2.86)
with
=
1
2
[∇
δ +(∇
δ)
T
] =
δ
1
x
1
2
δ
1
y
+δ
2
x
1
2
δ
1
y
+δ
2
x
δ
2
y
(2.87)
and
=
1
2
[∇
δ −(∇
δ)
T
] =
0
1
2
δ
1
y
−δ
2
x
−
1
2
δ
1
y
−δ
2
x
0
. (2.88)
38 2 Conservation Laws and Differential Equations
The rotation matrix measures rigid rotations, whereas the symmetric matrix is the
desired strain matrix, which will also be written as
=
11
12
21
22
.
The diagonal elements
11
and
22
measure extensional strains in the x and ydirections,
whereas
12
=
21
is the shear strain.
Example 2.2. The Pwave shown in Figure 2.2 has a displacement of the form
δ(x, y, t ) =
w(x −c
p
t )
0
for some wave form w, and hence
=
w
(x −c
p
t ) 0
0 0
with only
11
nonzero.
The Swave shown in Figure 2.2 has a displacement of the form
δ(x, y, t ) =
0
w(x −c
s
t )
for some waveform w, and hence
=
0
1
2
w
(x −c
s
t )
1
2
w
(x −c
s
t ) 0
with only the shear strain nonzero.
To study onedimensional elastic waves of the sort shown in Figure 2.2, we need only
consider the components
11
and
12
of the strain and must assume that these are functions
of (x, t ) alone, independent of y and z. For twodimensional elasticity we must consider
22
as well, with all three variables being functions of (x, y, t ). For full threedimensional
elasticity the displacement vector and strain matrix must be extended to three dimensions.
The formula (2.87) still holds, and is now a 3 ×3 symmetric matrix with six independent
elements, three extensional strains on the diagonal, and three shear strains off the diagonal.
See Chapter 22 for more discussion of these equations and their proper relation to three
dimensional elasticity.
2.12.3 Stress
A strain in an elastic body typically results in a restoring force called the stress. For one
dimensional elasticity as described above, we need only be concerned with two components
of the stress: σ
11
(x, t ), the force in the xdirection (the normal stress), and σ
12
(x, t ), the
force in the ydirection (the shear stress).
2.12 Solid Mechanics and Elastic Waves 39
In onedimensional linear elasticity there is a complete decoupling of compressional and
shear effects. The normal stress σ
11
depends only on the strain
11
, while the shear stress
σ
12
depends only on the shear strain
12
, and these constitutive relations are linear:
σ
11
= (λ +2µ)
11
with λ +2µ > 0, (2.89)
σ
12
= 2µ
12
with µ > 0. (2.90)
Here λ and µ are the Lam´ e parameters characterizing the material. The parameter µ is also
called the shear modulus. The parameter λ does not have a simple physical meaning, but is
related to other properties of the material in Section 22.1. It is unfortunate that the symbol
λ is standard for this parameter, which should not be confused with an eigenvalue.
2.12.4 The Equations of Motion
We are nowready to write down the equations of motion for onedimensional elastic waves.
Pwaves are governed by the system of equations
11
t
−u
x
= 0,
ρu
t
−σ
11
x
= 0,
(2.91)
where ρ >0 is the density of the material. The ﬁrst equation follows from the equality
X
xt
= X
t x
, since
11
(x, t ) = X
x
(x, t ) −1 =⇒
11
t
= X
xt
,
u(x, t ) = X
t
(x, t ) =⇒u
x
= X
t x
.
(2.92)
The second equation of (2.91) is Newton’s second law since u
t
is the acceleration.
The system (2.91) involves both
11
and σ
11
, and one of these must be eliminated using
the constitutive relation (2.89). If we eliminate σ
11
, we obtain
11
u
t
+
0 −1
−(λ +2µ)/ρ 0
11
u
x
= 0. (2.93)
This is a hyperbolic system, since the matrix has eigenvalues λ = ±c
p
with
c
p
=
(λ +2µ)/ρ. (2.94)
If we instead eliminate
11
we obtain
σ
11
u
t
+
0 −(λ +2µ)
−1/ρ 0
σ
11
u
x
= 0. (2.95)
Again the coefﬁcient matrix has eigenvalues ±c
p
. Note that this form is essentially equiv
alent to the acoustic equations derived in Section 2.8 if we identify
p(x, t ) = −σ
11
(x, t ). (2.96)
Since
11
measures the extensional stress (positive when the material is stretched, negative
when compressed), a positive pressure corresponds to a negative value of σ
11
. Note that
40 2 Conservation Laws and Differential Equations
(a)
σ
(b)
p
V
Fig. 2.3. (a) A typical stress–strain relation σ = σ() for the nonlinear elasticity equation (2.97).
(b) The equation of state p = p(V) for isentropic gas dynamics in a Lagrangian frame using the
psystem (2.108).
the stress σ
11
can have either sign, depending on whether the material is compressed or
stretched, while the pressure in a gas can only be positive. A gas that is “stretched” by
allowing it to expand to a larger volume will not attempt to contract back to its original
volume the way a solid will. This is another consequence of the fact that there are no
intermolecular bonds between the gas molecules.
Onedimensional nonlinear Pwaves can be modeled by the more general form of (2.91)
given by
t
−u
x
= 0,
ρu
t
−σ()
x
= 0,
(2.97)
where is the extensional strain
11
and σ
11
= σ() is a more general nonlinear constitutive
relation between stress and strain. Atypical stress–strain relation might look something like
what is shown in Figure 2.3(a). In the case shown the derivative of the stress with respect
to strain decreases as the magnitude of the strain is increased. This is shown for small
values of , in particular for − 1, since = −1 corresponds to a state of complete
compression, X
x
= 0. Elasticity theory typically breaks down long before this. For very
small deformations , this nonlinear function can generally be replaced by a linearization
σ = (λ+2µ), where (λ+2µ) ≡ σ
(0). This is the relation (2.90) used in linear elasticity.
The equations for a linear Swave are essentially identical to (2.91) but involve the shear
strain, shear stress, and vertical velocity:
12
t
−
1
2
v
x
= 0,
ρv
t
−σ
12
x
= 0.
(2.98)
The relationship (2.90) is now used to eliminate either
12
or σ
12
, resulting in a closed
system of two equations, either
12
v
t
+
0 −1/2
−2µ/ρ 0
12
v
x
= 0 (2.99)
2.13 Lagrangian Gas Dynamics and the pSystem 41
if
12
is used, or
σ
12
v
t
+
0 −µ
−1/ρ 0
σ
12
v
x
= 0 (2.100)
if σ
12
is used. In either case, the eigenvalues of the coefﬁcient matrix are λ = ±c
s
, with the
wave speed
c
s
=
µ/ρ. (2.101)
In general, µ < λ +2µ and so c
s
< c
p
.
We have assumed that shearwave motion is in the ydirection. In a threedimensional
body one could also observe a plane shear wave propagating in the xdirection for which
the shear motion is in the zdirection. These are governed by a set of equations identical to
(2.100) but involving
13
and σ
13
in place of
12
and σ
12
, and the zcomponent of velocity
w in place of v. Shear motion need not be aligned with either the y or the zaxis, but
can occur in any direction perpendicular to x. Motion in any other direction is simply a
linear combination of these two, however, so that there are really two decoupled systems of
equations for Swaves, along with the systemof equations of Pwaves, needed to describe all
plane waves in x. Note that the systems (2.95) and (2.100) both have the same mathematical
structure as the acoustics equations studied previously.
For a general two or threedimensional motion of an elastic solid it is not possible
to decompose the resulting equations into independent sets of equations for Pwaves and
Swaves. Instead one obtains a single coupled hyperbolic system. For motions that are
fully twodimensional (but independent of the third direction), one obtains a system of ﬁve
equations for the velocities u, v and the components of the stress tensor σ
11
, σ
12
, and σ
22
(or alternatively the three components of the strain tensor). Only in the case of purely one
dimensional motions do these equations decouple into independent sets. These decoupled
systems are related to the full threedimensional equations in Chapter 22.
2.13 Lagrangian Gas Dynamics and the pSystem
The ﬂuid dynamics equations derived in Section 2.6 are in Eulerian form, meaning that x
represents a ﬁxed location in space, and quantities such as the velocity u(x, t ) refer to the
velocity of whatever ﬂuid particle happens to be at the point x at time t . Alternatively, the
equations can be written in Lagrangian form, where ﬁxing the coordinate ξ corresponds to
tracking a particular ﬂuid particle. The Lagrangian velocity U(ξ, t ) then gives the velocity
of this particle at time t . We must then determine the mapping X(ξ, t ) that gives the physical
location of the particle labeled ξ at time t . This is more like the approach used in elasticity,
as described in Section 2.12, and in one dimension a system of equations very similar to
(2.97) results. (The term ﬂuid particle refers to an inﬁnitesimally small volume of ﬂuid, but
one that still contains a huge number of molecules so that the smallscale random variations
in velocity can be ignored.)
42 2 Conservation Laws and Differential Equations
To set up the labeling of points initially, we take an arbitrary physical location x
0
(say
x
0
= 0) and then at each point x assign the label
ξ =
x
x
0
ρ
◦
(s) ds (2.102)
to the particle initially located at x, where ρ
◦
is the initial data for the density. If the density
is positive everywhere, then this gives a one–one map. Note that ξ has units of mass and
the label ξ gives the total mass between x
0
and X(ξ, t ). Moreover ξ
2
−ξ
1
is the total mass
of all particles between those labeled ξ
1
and ξ
2
(at any time t , since particles cannot cross
in this onedimensional model).
The Lagrangian velocity is related to the Eulerian velocity by
U(ξ, t ) = u(X(ξ, t ), t ).
Since X(ξ, t ) tracks the location of this particle, we must have
X
t
(ξ, t ) = U(ξ, t ).
We could deﬁne a Lagrangian density function similarly, but the conservation of mass
equation in the Lagrangian framework is more naturally written in terms of the speciﬁc
volume
V(ξ, t ) =
1
ρ(X(ξ, t ), t )
.
This has units of volume/mass (which is just length/mass in one dimension), so it makes
sense to integrate this over ξ. Since integrating the speciﬁc volume over a ﬁxed set of
particles gives the volume occupied by these particles at time t , we must have
ξ
2
ξ
1
V(ξ, t ) dξ = X(ξ
2
, t ) − X(ξ
1
, t ). (2.103)
Differentiating this with respect to t gives
d
dt
ξ
2
ξ
1
V(ξ, t ) dξ = U(ξ
2
, t ) −U(ξ
1
, t )
=
ξ
2
ξ
1
∂
∂ξ
U(ξ, t ) dξ. (2.104)
Rearranging this and using the fact that it must hold for all choices of ξ
1
and ξ
2
gives the
differential form of the conservation law,
V
t
−U
ξ
= 0. (2.105)
Now consider the conservation of momentum. In Eulerian form ρu is the density of
momentumin units of momentum/volume. In Lagrangian formwe instead consider U(ξ, t ),
which can be interpreted as the momentum per unit mass, with
ξ
2
ξ
1
U(ξ, t ) dξ
2.14 Electromagnetic Waves 43
being the total momentumof all particles between ξ
1
and ξ
2
. By conservation of momentum,
this integral changes only due to ﬂux at the endpoints. Since in the Lagrangian framework
the endpoints are moving with the ﬂuid, there is no “advective ﬂux” and the only change in
momentum comes from the pressure difference between the two endpoints, so
d
dt
ξ
2
ξ
1
U(ξ, t ) dξ = p(ξ
1
, t ) − p(ξ
2
, t ),
which leads to the conservation law
U
t
+ p
ξ
= 0. (2.106)
If we consider isentropic or isothermal ﬂow, then we have only these two conservation
laws and the equation of state gives p in terms of V alone. Then (2.105) and (2.106) give
the system of conservation laws known as the psystem,
V
t
−U
ξ
= 0,
U
t
+ p(V)
ξ
= 0.
(2.107)
This is another simple system of two equations that is useful in understanding conservation
laws. It is slightly simpler than the corresponding Eulerian equations (2.38) in that the
only nonlinearity is in the function p(V). This system if hyperbolic if p
(V) <0 (see
Exercise 2.7). Note that for isentropic ﬂow we have p(V) = ˆ κV
−γ
, corresponding to
the equation of state (2.35), with the shape shown in Figure 2.3(b).
Frequently the psystem is written using lowercase symbols as
v
t
−u
x
= 0,
u
t
+ p(v)
x
= 0,
(2.108)
and we will generally use this notation when the psystem is used as a generic example of a
hyperbolic system. To relate this system to the Eulerian gas dynamics equations, however,
it is important to use distinct notation as derived above.
The psystem (2.108) has a very similar structure to the nonlinear elasticity equation
(2.97) if we equate p with the negative stress −σ as discussed in Section 2.12. Note,
however, that in the gas dynamics case we must have V >0 and p >0, whereas in elasticity
the stress and strain can each be either positive or negative, corresponding to extension and
compression respectively (recall Figure 2.3(a)).
2.14 Electromagnetic Waves
Electromagnetic waves are governed by Maxwell’s equations. In the simplest case this is
a hyperbolic system of equations, though in materials where waves are attenuated due to
induced electric currents these are modiﬁed by additional source terms. If we assume there
is no net electric charge or current in the material through which the wave is propagating,
44 2 Conservation Laws and Differential Equations
then Maxwell’s equations reduce to
D
t
−∇ ×
H = 0, (2.109)
B
t
+∇ ×
E = 0, (2.110)
∇ ·
D = 0, (2.111)
∇ ·
B = 0. (2.112)
Here
E,
D,
B, and
H are all vectors with three spatial components. The electric ﬁeld
E and
the magnetic ﬁeld
B are related to the two other ﬁelds
D and
H via constitutive relations
that characterize the medium in which the wave is propagating. These are similar to the
stress–strain relations needed in elasticity theory. In general they take the form
D =
E, (2.113)
B = µ
H, (2.114)
where is the permittivity and µ is the magnetic permeability of the medium. In a homo
geneous isotropic material these are both scalar constants. More generally they could be
3 ×3 matrices and also vary in space.
If the initial data satisﬁes the divergencefree conditions (2.111) and (2.112), then it can
be shown that these will hold for all time, and so equations (2.109) and (2.110) for
D
t
and
B
t
can be taken as the time evolution equations for electromagnetic waves.
If and µ are scalar constants, then we can eliminate
D and
H and rewrite the wave
propagation equations as
E
t
−
1
µ
∇ ×
B = 0,
B
t
+∇ ×
E = 0.
(2.115)
This is a linear hyperbolic system of equations in three dimensions.
In this chapter we consider only the simplest case of a plane wave propagating in the
xdirection. The B and Eﬁelds then oscillate in the y–z plane, so that electromagnetic
waves are somewhat like shear waves, with the oscillations orthogonal to the direction of
propagation. However, there are now two ﬁelds, and there is an additional relationship that
the Bﬁeld oscillations for a given wave are orthogonal to the Eﬁeld oscillations. Figure 2.4
illustrates a wave in which the Eﬁeld oscillates in y while the Bﬁeld oscillates in z. In
this case only the ycomponent of
E and the zcomponent of
B are nonzero, and both vary
only with x and t . Then
E and
B have the form
E =
0
E
2
(x, t )
0
,
B =
0
0
B
3
(x, t )
. (2.116)
2.14 Electromagnetic Waves 45
B
E
x
y
z
↑
↑
Fig. 2.4. The
E and
B ﬁelds for an electromagnetic plane wave propagating in the xdirection.
Maxwell’s equations (2.115) then reduce to
E
2
t
+
1
µ
B
3
x
= 0,
B
3
t
+ E
2
x
= 0.
(2.117)
This has exactly the same structure as the onedimensional linear acoustics and elasticity
equations considered previously, with the coefﬁcient matrix
A =
0 1/µ
1 0
. (2.118)
The eigenvalues are λ
1,2
= ±c, where
c =
1
√
µ
(2.119)
is the speed of light in the medium. In a vacuum the parameters and µ take particular
constant values
0
and µ
0
known as the permittivity and permeability of free space, and
c
0
=
1
√
0
µ
0
(2.120)
is the speed of light in a vacuum. For any other medium we have c < c
0
.
In a heterogeneous medium that consists of onedimensional layers of isotropic material,
and µ would be scalar but vary with x and we would obtain the variablecoefﬁcient
hyperbolic system
(x)E
2
t
(x, t ) +
1
µ(x)
B
3
(x, t )
x
= 0,
B
3
t
(x, t ) + E
2
x
(x, t ) = 0.
(2.121)
46 2 Conservation Laws and Differential Equations
The methods discussed in Section 9.6 for variablecoefﬁcient acoustics could also be applied
to this system.
In some media and/or µ may depend on the strength of the electric or magnetic ﬁeld,
and hence will vary as a wave passes through. In this case the constitutive relations become
nonlinear, and Maxwell’s equations yield a nonlinear hyperbolic system of equations. Ac
tually, in most materials and µ do vary with the ﬁeld strength, but normally the ﬁelds
associated with electromagnetic waves are so weak that the linearized theory is perfectly
adequate. However, in some problems with very strong ﬁelds or special materials it is nec
essary to consider nonlinear effects. The ﬁeld of nonlinear optics is important, for example,
in the design and study of ﬁberoptic cables used to transmit pulses of light over thousands
of kilometers in the telecommunications industry.
Exercises
2.1. Derive the equations (2.48) of linear acoustics from the linearized system (2.47).
2.2. (a) Show that for smooth solutions the conservation laws (2.38) can be manipulated
into the following set of nonconservative nonlinear equations for the pressure
and velocity:
p
t
+up
x
+ρP
(ρ)u
x
= 0,
u
t
+(1/ρ) p
x
+uu
x
= 0,
(2.122)
where we assume that the equationof state canbe invertedtodeﬁne ρ as a function
of p to complete this system. Note that linearizing this nonlinear system about
some state (ρ
0
, u
0
, p
0
= P(ρ
0
)) again gives the acoustics system (2.47).
(b) Show that the nonlinear system (2.122) is hyperbolic provided P
(ρ) > 0, and
has the same characteristic speeds as the conservative version (2.38).
2.3. Determine the eigenvalues and eigenvectors the matrix
˜
A in (2.77) and also the simi
larity transformation relating this to A from (2.51) when u
0
= 0.
2.4. Determine the eigenvalues and eigenvectors the matrix A from (2.46), and show that
these agree with (2.57). Determine the similarity transformation relating this matrix
to A from (2.51).
2.5. Determine the condition on the function σ() that is required in order for the nonlinear
elasticity equation (2.91) to be hyperbolic.
2.6. Showthat X
ξ
(ξ, t ) =V(ξ, t ) and hence (2.105) is simply the statement that X
ξt
= X
t ξ
.
2.7. Show that the psystem (2.108) is hyperbolic provided the function p(V) satisﬁes
p
(V) < 0 for all V.
2.8. Isothermal ﬂowis modeled by the system(2.38) with P(ρ) = a
2
ρ, where a is constant;
see Section 14.6.
(a) Determine the wave speeds of the linearized equations (2.50) in this case.
(b) The Lagrangian form of the isothermal equations have p(V) = a
2
/V. Linearize
the psystem (2.107) in this case about V
0
, U
0
, and compute the wave speeds
for Lagrangian acoustics. Verify that these are what you expect in relation to the
Eulerian acoustic wave speeds.
3
Characteristics and Riemann Problems for Linear
Hyperbolic Equations
In this chapter we will further explore the characteristic structure of linear hyperbolic sys
tems of equations. In particular, we will study solutions to the Riemann problem, which is
simply the given equation together with very special initial data consisting of a piecewise
constant function with a single jump discontinuity. This problem and its solution are dis
cussed starting in Section 3.8, after laying some more groundwork. This simple problem
plays a very important role in understanding the structure of more general solutions. It is
also a fundamental building block for the ﬁnite volume methods discussed in this book.
Linear hyperbolic systems of the form
q
t
+ Aq
x
= 0 (3.1)
were introduced in the last chapter. Recall that the problem is hyperbolic if A ∈ R
m×m
is
diagonalizable with real eigenvalues, so that we can write
A = RR
−1
, (3.2)
where R is the matrix of right eigenvectors. Then introducing the new variables
w = R
−1
q
allows us to reduce the system (3.1) to
w
t
+w
x
= 0, (3.3)
which is a set of m decoupled advection equations. Note that this assumes A is constant.
If A varies with x and/or t , then the problem is still linear, but R and will typically
depend on x and t as well and the manipulations used to obtain (3.3) are no longer valid.
See Chapter 9 for discussion of variablecoefﬁcient problems.
3.1 Solution to the Cauchy Problem
Consider the Cauchy problem for the constantcoefﬁcient system (3.1), in which we are
given data
q(x, 0) = q
◦
(x) for −∞< x < ∞.
47
48 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
From this data we can compute data
w
◦
(x) ≡ R
−1
q
◦
(x)
for the system (3.3). The pth equation of (3.3) is the advection equation
w
p
t
+λ
p
w
p
x
= 0 (3.4)
with solution
w
p
(x, t ) = w
p
(x −λ
p
t, 0) = w
◦
p
(x −λ
p
t ).
Having computed all components w
p
(x, t ) we can combine these into the vector w(x, t ),
and then
q(x, t ) = Rw(x, t ) (3.5)
gives the solution to the original problem. This is exactly the process we used to obtain the
solution (2.68) to the acoustics equations in the previous chapter.
3.2 Superposition of Waves and Characteristic Variables
Note that we can write (3.5) as
q(x, t ) =
m
p=1
w
p
(x, t ) r
p
, (3.6)
so that we can view the vector q(x, t ) as being some linear combination of the right eigen
vectors r
1
, . . . , r
m
at each point in space–time, and hence as a superposition of waves
propagating at different velocities λ
p
. The scalar values w
p
(x, t ) for p = 1, . . . , m give
the coefﬁcients of these eigenvectors at each point, and hence the strength of each wave.
The requirements of hyperbolicity insure that these m vectors are linearly independent and
hence every vector q has a unique representation in this form. The manipulations resulting
in (3.4) show that the eigencoefﬁcient w
◦
p
(x) = w
p
(x, 0) is simply advected at constant
speed λ
p
as time evolves, i.e., w
p
(x, t ) ≡ w
◦
p
(x
0
) all along the curve X(t ) = x
0
+λ
p
t . These
curves are called characteristics of the pth family, or simply pcharacteristics. These are
straight lines in the case of a constantcoefﬁcient system. Note that for a strictly hyperbolic
system, m distinct characteristic curves pass through each point in the x–t plane.
The coefﬁcient w
p
(x, t ) of the eigenvector r
p
in the eigenvector expansion (3.6) of q(x, t )
is constant along any pcharacteristic. The functions w
p
(x, t ) are called the characteristic
variables.
As an example, for the acoustics equations with Agiven by (2.51), we found in Section 2.8
that the characteristic variables are −p +Z
0
u and p +Z
0
u (or any scalar multiples of these
functions), where Z
0
is the impedance; see (2.67).
3.5 Acoustics 49
3.3 Left Eigenvectors
Let L = R
−1
, and denote the rows of the matrix L by
1
,
2
, . . . ,
m
. These row vectors
are the left eigenvectors of the matrix A,
p
A = λ
p
p
,
whereas the r
p
are the right eigenvectors. For example, the left eigenvectors for acoustics
are given by the rows of the matrix R
−1
in (2.66).
We canwrite the characteristic variable w
p
(x, t ), whichis the pthcomponent of R
−1
q(x, t )
= Lq(x, t ), simply as
w
p
(x, t ) =
p
q(x, t ). (3.7)
We can then rewrite the solution q(x, t ) from (3.6) succinctly in terms of the initial data q
◦
as
q(x, t ) =
m
p=1
[
p
q
◦
(x −λ
p
t )]r
p
. (3.8)
3.4 Simple Waves
We can view the solution q(x, t ) as being the superposition of m waves, each of which is
advected independently with no change in shape. The pth wave has shape w
◦
p
(x)r
p
and
propagates with speed λ
p
. This solution has a particularly simple formif w
p
(x, 0) is constant
in x for all but one value of p, say w
◦
p
(x) ≡ ¯ w
p
for p = i . Then the solution has the form
q(x, t ) = w
◦
i
(x −λ
i
t )r
i
+
p=i
¯ w
p
r
p
(3.9)
= q
◦
(x −λ
i
t )
and the initial data simply propagates with speed λ
i
. Since m − 1 of the characteristic
variables are constant, the equation essentially reduces to q
t
+ λ
i
q
x
= 0, which governs
the behavior of the i th family. Nonlinear equations have analogous solutions, called simple
waves, in which variations occur only in one characteristic family; see Section 13.8.
3.5 Acoustics
Anarbitrarysolutiontothe acoustics equations, as derivedinSection2.8, canbe decomposed
as in (3.6),
p(x, t )
u(x, t )
= w
1
(x, t )
−Z
0
1
+w
2
(x, t )
Z
0
1
, (3.10)
where w
1
= [−p + Z
0
u]/2Z
0
is the strength of the leftgoing 1wave, and w
2
= [ p +
Z
0
u]/2Z
0
is the strength of the rightgoing 2wave. The functions w
1
(x, t ) and w
2
(x, t )
50 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
satisfy scalar advection equations,
w
1
t
−c
0
w
1
x
= 0 and w
2
t
+c
0
w
2
x
= 0, (3.11)
so from arbitrary initial data we can compute
w
1
(x, t ) = w
1
(x +c
0
t, 0) = w
◦
1
(x +c
0
t ),
w
2
(x, t ) = w
2
(x −c
0
t, 0) = w
◦
2
(x −c
0
t ),
(3.12)
where w
◦
(x) = R
−1
q
◦
(x) is the initial data for w, and (3.6) agrees with (2.68).
The advection equations (3.11) are often called the oneway wave equations, since each
one models the strength of an acoustic wave going in only one direction.
If one of the characteristic variables w
1
or w
2
is identically constant, then the solution
(3.10) is a simple wave as deﬁned in Section 3.4. Suppose, for example, that w
1
≡ ¯ w
1
=
constant, in which case
q(x, t ) = ¯ w
1
r
1
+ w
◦
2
(x −c
0
t ) r
2
.
In this case it is also easy to check that the full solution q satisﬁes the oneway wave equation
q
t
+c
0
q
x
= 0.
Simple waves often arise in physical problems. Suppose for example that we take initial
data inwhich p =u =0everywhere except insome small regionnear the origin. If we choose
p and u as arbitrary functions in this region, unrelated to one another, then the solution will
typically involve a superposition of a leftgoing and a rightgoing wave. Figure 3.1 shows
the time evolution in a case where
p(x, 0) =
1
2
exp(−80x
2
) + S(x),
u(x, 0) = 0,
(3.13)
with
S(x) =
1 if −0.3 < x < −0.1,
0 otherwise.
For small time the solution changes in a seemingly haphazard way as the leftgoing and
rightgoing waves superpose. But observe that eventually the two waves separate and for
larger t their individual forms are easy to distinguish. Once they have separated, each wave
is a simple wave that propagates at constant velocity with its shape unchanged. In this
example ρ
0
= 1 and K
0
= 0.25, so that c
0
= Z
0
= 1/2. Notice that the leftgoing wave
has p = −u/2 while the rightgoing wave has p = u/2, as expected from the form of the
eigenvectors.
3.6 Domain of Dependence and Range of Inﬂuence
Let (X, T) be some ﬁxed point in space–time. We see from (3.8) that the solution q(X, T)
depends only on the data q
◦
at m particular points X − λ
p
T for p = 1, 2, . . . , m. This set
3.6 Domain of Dependence and Range of Inﬂuence 51
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 0
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 0
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 0.1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 0.1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 0.5
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 0.5
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 1
Fig. 3.1. Evolution of an initial pressure perturbation, concentrated near the origin, into distinct
simple waves propagating with velocities −c
0
and c
0
. The left column shows the pressure pertur
bation q
1
= p, and the right column shows the velocity q
2
=u. (Time increases going downwards.)
[claw/book/chap3/acousimple]
of points,
D(X, T) = {X − λ
p
T: p = 1, 2, . . . , m}, (3.14)
is called the domain of dependence of the point (X, T). See Figure 3.2(a). The value of the
initial data at other points has no inﬂuence on the value of q at (X, T).
For hyperbolic equations more generally, the domain of dependence is always a bounded
set, though for nonlinear equations the solution may depend on data over a whole interval
rather than at only a ﬁnite number of distinct points. The bounded domain of dependence
results from the fact that information propagates at ﬁnite speed in a hyperbolic equation, as
we expect from wave motion or advection. This has important consequences in the design
of numerical methods, and means that explicit methods can often be efﬁciently used.
By contrast, for the heat equation q
t
= βq
xx
, the domain of dependence of any point
(X, T) is the entire real line. Changing the data anywhere would in principle change the
value of the solution at (X, T), though the contribution dies away exponentially fast, so
data at points far away may have little effect. Nonetheless, this means that implicit numer
ical methods are often needed in solving parabolic equations. This is discussed further in
Section 4.4 in relation to the CFL condition.
52 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
(a)
(X, T)
X −λ
1
T
X −λ
2
T X −λ
3
T
(b) x
0
x
0
+λ
1
t x
0
+λ
2
t x
0
+λ
3
t
Fig. 3.2. For a typical hyperbolic system of three equations with λ
1
< 0 < λ
2
< λ
3
, (a) shows the
domain of dependence of the point (X, T), and (b) shows the range of inﬂuence of the point x
0
.
Rather than looking at which initial data affects the solution at (X, T), we can turn things
around and focus on a single point x
0
at time t = 0, and ask what inﬂuence the data q
◦
(x
0
)
has on the solution q(x, t ). Clearly the choice of data at this point will only affect the
solution along the characteristic rays x
0
+ λ
p
t for p = 1, 2, . . . , m. This set of points
is called the range of inﬂuence of the point x
0
. The range of inﬂuence is illustrated in
Figure 3.2(b).
3.7 Discontinuous Solutions
While classical solutions of differential equations must be smooth (sufﬁciently differen
tiable) functions, the formula (3.6) can be used even if the initial data q
◦
(x) is not smooth, or
is even discontinuous, at some points. If the data has a singularity (a discontinuity in some
derivative) at some point x
0
, then one or more of the characteristic variables w
p
(x, 0) will
also have a singularity at this point. Such singularities in the initial data can then propagate
along the characteristics and lead to singularities in the solution q(x, t ) at some or all of the
points x
0
+λ
p
t .
Conversely, if the initial data is smooth in a neighborhood of all the points ¯ x −λ
p
¯
t , then
the solution q(x, t ) must be smooth in a neighborhood of the point ( ¯ x,
¯
t ). This means that
singularities can only propagate along characteristics for a linear system.
3.8 The Riemann Problem for a Linear System
The Riemann problem consists of the hyperbolic equation together with special initial data
that is piecewise constant with a single jump discontinuity,
q
◦
(x) =
q
l
if x < 0,
q
r
if x > 0.
By the remarks in Section 3.7, we expect this discontinuity to propagate along the charac
teristic curves.
For the scalar advection equation q
t
+ ¯ uq
x
= 0, the coefﬁcient “matrix” is the 1×1 scalar
value ¯ u. The single eigenvalue is λ
1
= ¯ u, and we can choose the eigenvector to be r
1
= 1.
The solution to the Riemann problem consists of the discontinuity q
r
− q
l
propagating at
speed ¯ u, along the characteristic, and the solution is q(x, t ) = q
◦
(x − ¯ ut ).
3.8 The Riemann Problem for a Linear System 53
For a general m × m linear system we can solve the Riemann problem explicitly using
the information we have obtained above. It is very important to understand the structure
of this solution, since we will see later that Riemann solutions for nonlinear conservation
laws have a similar structure. Moreover, many of the numerical methods we will discuss
(beginning in Chapter 4) are based on using solutions to the Riemann problem to construct
approximate solutions with more general data.
For the Riemann problem we can simplify the notation if we decompose q
l
and q
r
as
q
l
=
m
p=1
w
p
l
r
p
and q
r
=
m
p=1
w
p
r
r
p
. (3.15)
Then the pth advection equation (3.4) has Riemann data
w
◦
p
(x) =
w
p
l
if x < 0,
w
p
r
if x > 0,
(3.16)
and this discontinuity simply propagates with speed λ
p
, so
w
p
(x, t ) =
w
p
l
if x −λ
p
t < 0,
w
p
r
if x −λ
p
t > 0.
(3.17)
If we let P(x, t ) be the maximum value of p for which x −λ
p
t > 0, then
q(x, t ) =
P(x,t )
p=1
w
p
r
r
p
+
m
p=P(x,t )+1
w
p
l
r
p
, (3.18)
which we will write more concisely as
q(x, t ) =
p:λ
p
<x/t
w
p
r
r
p
+
p:λ
p
>x/t
w
p
l
r
p
. (3.19)
The determination of q(x, t ) at a given point (X, T) is illustrated in Figure 3.3. In the case
shown, w
1
= w
1
r
while w
2
= w
2
l
and w
3
= w
3
l
. The solution at the point illustrated is thus
q(X, T) = w
1
r
r
1
+w
2
l
r
2
+w
3
l
r
3
. (3.20)
Note that the solution is the same at any point in the wedge between the x = λ
1
t and x = λ
2
t
characteristics. As we cross the pth characteristic, the value of x − λ
p
t passes through 0
and the corresponding w
p
jumps from w
p
l
to w
p
r
. The other coefﬁcients w
i
(i = p) remain
constant.
The solution is constant in each of the wedges as shown in Figure 3.3. Across the pth
characteristic the solution jumps with the jump in q given by
w
p
r
−w
p
l
r
p
≡ α
p
r
p
. (3.21)
Note that this jump in q is an eigenvector of the matrix A (being a scalar multiple of r
p
).
This is an extremely important fact, and a generalization of this statement is what will
allow us to solve the Riemann problem for nonlinear systems of equations. This condition,
54 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
x = λ
1
t x = λ
2
t x = λ
3
t
X −λ
3
T
X −λ
2
T
X −λ
1
T
(X, T)
0
q
l
q
∗
l
q
∗
r
q
r
Fig. 3.3. Construction of the solution to the Riemann problem at (X, T). We trace back along the pth
characteristic to determine the value of w
p
from the initial data. The value of q is constant in each
wedge of the x–t plane: q
l
=w
1
l
r
1
+w
2
l
r
2
+w
3
l
r
3
q
∗
l
=w
1
r
r
1
+w
2
l
r
2
+w
3
l
r
3
q
∗
r
=w
1
r
r
1
+w
2
r
r
2
+w
3
l
r
3
q
r
=w
1
r
r
1
+w
2
r
r
2
+w
3
r
r
3
. Note that the jump across each discontinuity in the solution is an eigenvector
of A.
called the Rankine–Hugoniot jump condition, will be derived from the integral form of the
conservation law and seen to hold across any propagating discontinuity; see Section 11.8.
Typically the given data (q
l
, q
r
) will not satisfy this condition, and the process of solving
the Riemann problem can be viewed as an attempt to split up the jump q
r
−q
l
into a series
of jumps, deﬁning the different waves, each of which does satisfy this condition.
For the case of a linear system, solving the Riemann problemconsists of taking the initial
data (q
l
, q
r
) and decomposing the jump q
r
−q
l
into eigenvectors of A:
q
r
−q
l
= α
1
r
1
+· · · +α
m
r
m
. (3.22)
This requires solving the linear system of equations
Rα = q
r
−q
l
(3.23)
for the vector α, and so α = R
−1
(q
r
−q
l
). The vector α has components α
p
=
p
(q
r
−q
l
),
where
p
is the left eigenvector deﬁned in Section 3.3, and α
p
= w
p
r
−w
p
l
. Since α
p
r
p
is
the jump in q across the pth wave in the solution to the Riemann problem, we introduce
the notation
W
p
= α
p
r
p
(3.24)
for these waves.
The solution q(x, t ) from (3.8) can be written in terms of the waves in two different
forms:
q(x, t ) = q
l
+
p:λ
p
<x/t
W
p
(3.25)
= q
r
−
p:λ
p
≥x/t
W
p
. (3.26)
3.9 The Phase Plane for Systems of Two Equations 55
This can also be written as
q(x, t ) = q
l
+
m
p=1
H(x −λ
p
t )W
p
, (3.27)
where H(x) is the Heaviside function
H(x) =
0 if x < 0,
1 if x > 0.
(3.28)
3.9 The Phase Plane for Systems of Two Equations
It is illuminating to view the splitting of q
r
−q
l
in state space, often called the phase plane
for systems of two equations. This is simply the q
1
–q
2
plane, where q = (q
1
, q
2
). Each
vector q(x, t ) is represented by a point in this plane. In particular, q
l
and q
r
are points in
this plane, and a discontinuity with left and right states q
l
and q
r
can propagate as a single
discontinuity only if q
r
−q
l
is an eigenvector of A, which means that the line segment from
q
l
to q
r
must be parallel to the eigenvector r
1
or r
2
. Figure 3.4 shows an example. For the
state q
l
illustrated there, the jump from q
l
to q
r
can propagate as a single discontinuity if
and only if q
r
lies on one of the two lines drawn through q
l
in the directions r
1
and r
2
. These
lines give the locus of all points that can be connected to q
l
by a 1wave or a 2wave. This
set of states is called the Hugoniot locus. We will see that there is a direct generalization of
this to nonlinear systems in Chapter 13.
Similarly, there is a Hugoniot locus through any point q
r
that gives the set of all points
q
l
that can be connected to q
r
by an elementary pwave. These curves are again in the
directions r
1
and r
2
.
For a general Riemann problem with arbitrary q
l
and q
r
, the solution consists of two
discontinuities traveling with speeds λ
1
and λ
2
, with a new constant state in between that
we will call q
m
. By the discussion above,
q
m
= w
1
r
r
1
+w
2
l
r
2
, (3.29)
so that q
m
−q
l
= (w
1
r
−w
1
l
)r
1
and q
r
−q
m
= (w
2
r
−w
2
l
)r
2
. The location of q
m
in the phase
(a)
q
l
q
1
q
2
r
1
r
2
(b)
q
l
q
m
q
r
0
x = λ
1
t x = λ
2
t
Fig. 3.4. (a) The Hugoniot locus of the state q
l
consists of all states that differ from q
l
by a scalar
multiple of r
1
or r
2
. (b) Solution to the Riemann problem in the x–t plane.
56 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
(a)
q
l
q
m
q
r
r
1
r
2
(b)
q
l
q
m
q
r
r
1
r
2
Fig. 3.5. The new state q
m
arising in the solution to the Riemann problem for two different choices of
q
l
and q
r
. In each case the jump from q
l
to q
m
lies in the direction of the eigenvector r
1
corresponding
to the lower speed, while the jump from q
m
to q
r
lies in the direction of the eigenvector r
2
.
plane must be where the 1wave locus through q
l
intersects the 2wave locus through q
r
.
This is illustrated in Figure 3.5(a).
Note that if we interchange q
r
and q
l
in this picture, the location of q
m
changes as
illustrated in Figure 3.5(b). In each case we travel from q
l
to q
r
by ﬁrst going in the
direction r
1
and then in the direction r
2
. This is required by the fact that λ
1
<λ
2
, since
clearly the jump between q
l
and q
m
must travel slower than the jump between q
m
and q
r
(see Figure 3.4(b)) if we are to obtain a singlevalued solution.
For systems with more than two equations, the same interpretation is possible but becomes
harder to draw, since the state space is now mdimensional. Since the m eigenvectors r
p
are linearly independent, we can decompose any jump q
r
− q
l
into the sum of jumps in
these directions via (3.22), obtaining a piecewise linear path fromq
l
to q
r
in mdimensional
space.
3.9.1 Acoustics
As a speciﬁc example, consider the acoustics equations discussed in Sections 2.7–2.8 with
u
0
= 0,
p
u
t
+
0 K
0
1/ρ
0
0
p
u
x
= 0. (3.30)
The eigenvalues and eigenvectors of A are given by (2.54) and (2.58). The phase plane is the
p–u plane, and the eigenvectors are symmetric about the uaxis as indicated in Figure 3.6(a).
Solving the general Riemann problem gives α = R
−1
(q
r
−q
l
) with components
α
1
=
1
(q
r
−q
l
) =
−( p
r
− p
l
) + Z
0
(u
r
−u
l
)
2Z
0
,
α
2
=
2
(q
r
−q
l
) =
( p
r
− p
l
) + Z
0
(u
r
−u
l
)
2Z
0
,
(3.31)
3.10 Coupled Acoustics and Advection 57
(a)
−Z
0
Z
0
u
p
1
r
1
r
2
(b)
u
p
p
r
p
l p
m
q
m
Fig. 3.6. (a) Eigenvectors for the acoustics equations in the p–u phase plane, where Z
0
is the
impedance. (b) Solution to a Riemann problem in which u
l
= u
r
= 0 and p
r
< p
l
.
and the waves are W
1
= α
1
r
1
and W
2
= α
2
r
2
. The intermediate state is
q
m
= q
l
+α
1
r
1
=
1
2
( p
l
+ p
r
) − Z
0
(u
r
−u
l
)
(u
l
+u
r
) −( p
r
− p
l
)/Z
0
. (3.32)
Example 3.1. Consider a Riemann problem in which u
l
= u
r
= 0 and there is only a jump
in pressure with p
r
< p
l
. The phaseplane solution to the Riemann problem is sketched in
Figure 3.6(b), and we compute that
α
1
=
p
l
− p
r
2Z
0
, α
2
=
p
r
− p
l
2Z
0
,
so that the intermediate state is
q
m
= q
l
+α
1
r
1
= q
r
−α
2
r
2
=
1
2
p
l
+ p
r
−( p
r
− p
l
)/Z
0
.
(Recall that p represents the perturbation of pressure from the constant state p
0
, so it is ﬁne
for it to be negative.)
3.10 Coupled Acoustics and Advection
Nowconsider acoustics in a ﬂuid moving at constant speed u
0
> 0, and to make the problem
more interesting suppose that there is also a passive tracer being advected in this ﬂuid, with
density denoted by φ(x, t ). Then we can solve the acoustics and advection equation together
as a system of three equations,
p
u
φ
t
+
u
0
K
0
0
1/ρ
0
u
0
0
0 0 u
0
p
u
φ
x
. (3.33)
Of course the acoustics and advection could be decoupled into two separate problems, but
it is illuminating to solve the Riemann problem for this full system, since its structure is
58 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
closely related to what is seen in the nonlinear Euler equations of gas dynamics studied
later, and is also important in solving twodimensional acoustics (Section 18.4).
The coefﬁcient matrix in (3.33) has eigenvalues
λ
1
= u
0
−c
0
, λ
2
= u
0
, λ
3
= u
0
+c
0
, (3.34)
and corresponding eigenvectors
r
1
=
−Z
0
1
0
, r
2
=
0
0
1
, r
1
=
Z
0
1
0
. (3.35)
The solution to the Riemann problem is easily determined:
p
r
− p
l
u
r
−u
l
φ
r
−φ
l
= α
1
−Z
0
1
0
+α
2
0
0
1
+α
3
Z
0
1
0
,
where
α
1
=
1
2Z
0
[−( p
r
− p
l
) + Z
0
(u
r
−u
l
)],
α
2
= φ
r
−φ
l
,
α
3
=
1
2Z
0
[( p
r
− p
l
) + Z
0
(u
r
−u
l
)].
(3.36)
Note that the 1wave and 3wave are standard acoustic waves independent of φ, while the
2wave gives the advection of φ.
Suppose φ measures the concentration of a dye in the ﬂuid and that φ
r
> φ
l
, so that
at time t = 0 the ﬂuid to the left is dark while the ﬂuid to the right is light. Then the
2wave marks the interface between the dark and light ﬂuids as time evolves, as indicated
in Figure 3.7. The two ﬂuids remain in contact across this discontinuity in φ, which has
no dynamic effect, since this tracer does not affect the ﬂuid dynamics and the pressure and
velocity are both constant across the 2wave. This wave is called a contact discontinuity.
Within each of the two ﬂuids there is an acoustic wave moving at speed c
0
(relative to the
ﬂuid) away from the origin. The jump in pressure and/or velocity in the original Riemann
data creates a “noise,” that moves through the ﬂuids at the speed of sound.
(a)
u
0
−c
0
u
0
u
0
+ c
0
0
(b)
u
0
−c
0
u
0
u
0
+ c
0
0
Fig. 3.7. Solution to the Riemann problem for the coupled acoustics and advection problem. The
interface between dark and light ﬂuid advects at the ﬂuid velocity u
0
, and acoustic waves move at
speed c
0
relative to the ﬂuid. The speed of each wave is indicated. (a) Asubsonic case. (b) Asupersonic
case.
3.11 Initial–BoundaryValue Problems 59
Figure 3.7 shows two different situations. In Figure 3.7(a) the ﬂuid velocity u
0
is positive
but subsonic (u
0
<c
0
), and so the leftgoing acoustic wave (the 1wave) has a negative
velocity u
0
−c
0
<0 relative to a ﬁxed observer. Figure 3.7(b) illustrates a supersonic ﬂow,
where u
0
>c
0
and so u
0
−c
0
>0. In this case all three waves propagate to the right and no
information can propagate upstreamfromthe observer. This distinction is not very important
in this linear example. In nonlinear gas dynamics the distinction can be very important. The
ratio M = u
0
/c
0
is called the Mach number of the ﬂow.
3.11 Initial–BoundaryValue Problems
Now consider a hyperbolic system on a bounded interval a ≤ x ≤ b. This is called the
initial–boundaryvalue problem, or IBVP for short, since it is a timedependent problem
for which we need both initial data and boundary data. For a system of m equations we
need a total of m boundary conditions. Typically some conditions must be prescribed at
the left boundary x = a and some at the right boundary x = b. How many are required at
each boundary depends on the number of eigenvalues of A that are positive and negative,
respectively.
We considered the IBVP for the advection equation in Section 2.1 and sawthat we need a
boundary condition only at x = a if ¯ u > 0 and only at x = b if ¯ u < 0. So if we diagonalize
a general linear system to obtain a decoupled set of advection equations
w
p
t
+λ
p
w
p
x
= 0,
then we need to specify boundary data on w
p
(x, t ) at x = a if λ
p
> 0 and at x = b if λ
p
<0.
(For now assume all eigenvalues are nonzero, i.e., that the boundary is noncharacteristic.)
So if the system of m equations has n ≤ m negative eigenvalues and m − n positive
eigenvalues, i.e.,
λ
1
≤ λ
2
≤ · · · ≤ λ
n
< 0 < λ
n+1
≤ · · · ≤ λ
m
,
then we need to specify m −n boundary conditions at x = a and n boundary conditions at
x = b. What sort of boundary data should we impose? Partition the vector w as
w =
w
I
w
II
, (3.37)
where w
I
∈ R
n
and w
II
∈ R
m−n
. Then at the left boundary x = a, for example, we must
specify the components of w
II
, while w
I
are outﬂow variables. It is valid to specify w
II
in
terms of w
I
. For example, we might use a linear boundary condition of the form
w
II
(a, t ) = B
1
w
I
(a, t ) + g
1
(t ), (3.38)
where B
1
∈ R
(m−n)×n
and g
1
∈ R
m−n
. If B
1
= 0, then we are simply specifying given
values for the inﬂow variables. But at a physical boundary there is often some reﬂection of
outgoing waves, and this requires a nonzero B
1
.
Boundary conditions should be speciﬁed as part of the problemand are determined by the
physical setup – generally not in terms of the characteristic variables, unfortunately. It is not
60 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
always easy to see what the correct conditions are to impose on the mathematical equation.
We may have several pieces of information about what is happening at the boundary. Which
are the correct ones to specify at the boundary? If we specify too fewor too many conditions,
or inappropriate conditions (such as trying to specify the value of an outﬂow characteristic
variable), then the mathematical problem is ill posed and will have no solution, or perhaps
many solutions. It often helps greatly to know what the characteristic structure is, which
reveals howmany boundary conditions we need and allows us to check that we are imposing
appropriate conditions for a wellposed problem. In Chapter 7 boundary conditions are
discussed further, and we will see how to impose such boundary conditions numerically.
Example 3.2. Consider the acoustics problem (2.50) in a closed tube of gas, a ≤ x ≤ b.
We expect an acoustic wave hitting either closed end to be reﬂected. Since the system has
eigenvalues −c
0
and +c
0
, we need to specify one condition at each end (n = m − n = 1
and w
I
= w
1
, w
II
= w
2
). We do not have any information on values of the pressure at the
boundary a priori, but we do know that the velocity must be zero at each end at all times,
since the gas cannot ﬂow through the solid walls (and shouldn’t ﬂow away from the walls
or a vacuum would appear). This suggests that we should set
u(a, t ) = u(b, t ) = 0 (3.39)
as our two boundary conditions, and this is correct. Note that we are specifying the same
thing at each end, although the ingoing characteristic variable is different at the two ends.
From Section 2.8 we know that the characteristic variables are
w
1
= −p + Z
0
u, w
2
= p + Z
0
u. (3.40)
We cancombine w
1
andw
2
tosee that specifyingu = 0amounts torequiringthat w
1
+w
2
=
0 at each end. At x = a we can write this as
w
2
(a, t ) = −w
1
(a, t ),
which has the form(3.38) with B
1
=1 and g
1
=0. The outgoing wave is completely reﬂected
and feeds back into the incoming wave. Conversely, at x = b we can interpret the boundary
condition u = 0 as
w
1
(b, t ) = −w
2
(b, t ),
which sets the incoming variable at this boundary, again by complete reﬂection of the
outgoing variable.
Example 3.3. Suppose we set B
1
=0 and g
1
=0 in (3.38), so that this becomes w
II
(a, t ) =0.
Then there is nothing ﬂowing into the domain at the left boundary, and any leftgoing
waves will simply leave the domain with no reﬂection. These are called outﬂow boundary
conditions.
Figure 3.8 shows a continuation of the example shown in Figure 3.1 to later times, with
a solid wall at the left and outﬂow boundary conditions imposed at the right, which amount
to setting w
1
(b, t ) = 0 and hence p(b, t ) = Z
0
u(b, t ).
3.11 Initial–BoundaryValue Problems 61
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 1
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 1.5
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 1.5
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 2
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 2
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 2.5
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 2.5
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Pressure at time t = 3
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
Velocity at time t = 3
Fig. 3.8. Continuation of the example shown in Figure 3.1 with a solid wall at the left and outﬂow
boundary conditions imposed at the right. Note that the wave that strikes the left boundary is a
1wave with p =−u/2, while the reﬂected wave is a 2wave with p =u/2. [claw/book/chap3/
acousimple]
Example 3.4. A set of boundary conditions that is often useful mathematically is the
periodic boundary conditions
q(a, t ) = q(b, t ). (3.41)
This set of boundary conditions couples information at the two boundaries, and the idea is
that waves going out one end should reenter at the other end. Solving the IBVP with periodic
boundary conditions is equivalent to solving a Cauchy problem with periodic initial data,
where the data given in a ≤ x ≤ b is periodically extended to the whole real line.
We are specifying m coupled boundary conditions rather than m −n at one end and n at
the other, but we can reinterpret (3.41) in terms of the characteristic variables as
w
II
(a, t ) = w
II
(b, t ),
w
I
(b, t ) = w
I
(a, t ).
(3.42)
62 3 Characteristics and Riemann Problems for Linear Hyperbolic Equations
The m −n incoming values w
II
at x = a are speciﬁed using the outgoing values at x = b,
while the n incoming values w
I
at x = b are speciﬁed using the outgoing values at x = a.
Exercises
3.1. For each of the Riemann problems below, sketch the solution in the phase plane, and
sketch q
1
(x, t ) and q
2
(x, t ) as functions of x at some ﬁxed time t :
(a) A =
0 4
1 0
, q
l
=
0
1
, q
r
=
1
1
,
(b) A =
0 4
1 0
, q
l
=
1
1
, q
r
=
0
1
.
(c) A =
0 9
1 0
, q
l
=
1
0
, q
r
=
4
0
.
(d) A =
1 1
1 1
, q
l
=
1
0
, q
r
=
2
0
.
(e) A =
2 0
0 2
, q
l
=
0
1
, q
r
=
1
0
.
(f) A =
2 1
10
−4
2
, q
l
=
0
1
, q
r
=
1
0
.
3.2. Write a script in Matlab or other convenient language that, given any 2 × 2 matrix
A and states q
l
and q
r
, solves the Riemann problem and produces the plots required
for Exercise 3.1. Test it out on the problems of Exercise 3.1 and others.
3.3. Solve each of the Riemann problems below. In each case sketch a ﬁgure in the x–t
plane similar to Figure 3.3, indicating the solution in each wedge.
(a) A =
0 0 4
0 1 0
1 0 0
, q
l
=
1
2
0
, q
r
=
1
5
1
.
(b) A =
1 0 2
0 2 0
0 0 3
, q
l
=
1
1
1
, q
r
=
3
3
3
.
3.4. Consider the acoustics equations (3.30) with
A =
0 K
0
1/ρ
0
0
, p
◦
(x) =
1 if 1 ≤ x ≤ 2,
0 otherwise,
u
◦
(x) ≡ 0.
Find the solution for t > 0. This might model a popping balloon, for example (in
one dimension).
3.5. Solve the IBVP for the acoustics equations from Exercise 3.4 on the ﬁnite domain
0 ≤ x ≤ 4 with boundary conditions u(0, t ) = u(4, t ) = 0 (solid walls). Sketch the
solution (u and p as functions of x) at times t = 0, 0.5, 1, 1.5, 2, 3.
Exercises 63
3.6. In the problem of Exercise 3.5, what is the domain of dependence of the point
X = 1, T = 10? In this case the domain of dependence should be deﬁned to include
not only the set of points x where the initial data affects the solution, but also the set
of times on each boundary where the boundary conditions can affect the solution at
the point (X, T).
3.7. Suppose a tube of gas is bounded by a piston at x = 0 and a solid wall at x = 1,
and that the piston is very slowly pushed into the tube with constant speed c,
where c is the speed of sound. Then we might expect the gas in the tube to be
simply compressed slowly with the pressure essentially uniform through the tube
and increasing in time like p = p
0
+ t K
0
, where K
0
is the bulk modulus. The
velocity should be roughly linear in x, varying from u = at the piston to u = 0 at
the solid wall. For very small we can model this using linear acoustics on the ﬁxed
interval 0 ≤ x ≤ 1 with initial data
u
◦
(x) = 0, p
◦
(x) = p
0
,
and boundary conditions
u(0, t ) = , u(1, t ) = 0.
The solution consists of a single acoustic wave bouncing back and forth between
the piston and solid wall (very rapidly relative to the wall motion), with p and u
piecewise constant. Determine this solution, andshowthat byappropriatelyaveraging
this rapidly varying solution one observes the expected behavior described above.
This illustrates the fact that slowscale motion is sometimes mediated by highspeed
waves.
3.8. Consider a general hyperbolic system q
t
+ Aq
x
= 0 in which λ = 0 is a simple or
multiple eigenvalue. How many boundary conditions do we need to impose at each
boundary in this case? As a speciﬁc example consider the system (3.33) in the case
u
0
= 0.
4
Finite Volume Methods
In this chapter we begin to study ﬁnite volume methods for the solution of conservation
laws and hyperbolic systems. The fundamental concepts will be introduced, and then we
will focus on ﬁrstorder accurate methods for linear equations, in particular the upwind
method for advection and for hyperbolic systems. This is the linear version of Godunov’s
method, whichis the fundamental startingpoint for methods for nonlinear conservationlaws,
discussed beginning in Chapter 15. These methods are based on the solution to Riemann
problems as discussed in the previous chapter for linear systems.
Finite volume methods are closely related to ﬁnite difference methods, and a ﬁnite vol
ume method can often be interpreted directly as a ﬁnite difference approximation to the
differential equation. However, ﬁnite volume methods are derived on the basis of the integral
form of the conservation law, a starting point that turns out to have many advantages.
4.1 General Formulation for Conservation Laws
In one space dimension, a ﬁnite volume method is based on subdividing the spatial domain
into intervals (the “ﬁnite volumes,” also called grid cells) and keeping track of an approx
imation to the integral of q over each of these volumes. In each time step we update these
values using approximations to the ﬂux through the endpoints of the intervals.
Denote the i th grid cell by
C
i
=
x
i −1/2
, x
i +1/2
,
as shown in Figure 4.1. The value Q
n
i
will approximate the average value over the i th
interval at time t
n
:
Q
n
i
≈
1
x
x
i +1/2
x
i −1/2
q(x, t
n
) dx ≡
1
x
C
i
q(x, t
n
) dx, (4.1)
where x = x
i +1/2
−x
i −1/2
is the length of the cell. For simplicity we will generally assume
a uniform grid, but this is not required. (Nonuniform grids are discussed in Section 6.17.)
If q(x, t ) is a smooth function, then the integral in (4.1) agrees with the value of q
at the midpoint of the interval to O(x
2
). By working with cell averages, however, it is
easier to use important properties of the conservation lawin deriving numerical methods. In
particular, we can insure that the numerical method is conservative in a way that mimics the
64
4.1 General Formulation for Conservation Laws 65
Q
n
i−1
Q
n
i
Q
n+1
i
Q
n
i+1
F
n
i−1/2
F
n
i+1/2
t
n
t
n+1
Fig. 4.1. Illustration of a ﬁnite volume method for updating the cell average Q
n
i
by ﬂuxes at the cell
edges. Shown in x–t space.
true solution, and this is extremely important in accurately calculating shock waves, as we
will see in Section 12.9. This is because
N
i =1
Q
n
i
x approximates the integral of q over
the entire interval [a, b], and if we use a method that is in conservation form (as described
below), then this discrete sum will change only due to ﬂuxes at the boundaries x = a and
x = b. The total mass within the computational domain will be preserved, or at least will
vary correctly provided the boundary conditions are properly imposed.
The integral form of the conservation law (2.2) gives
d
dt
C
i
q(x, t ) dx = f
q
x
i −1/2
, t
− f
q
x
i +1/2
, t
. (4.2)
We can use this expression to develop an explicit timemarching algorithm. Given Q
n
i
,
the cell averages at time t
n
, we want to approximate Q
n+1
i
, the cell averages at the next time
t
n+1
after a time step of length t = t
n+1
− t
n
. Integrating (4.2) in time from t
n
to t
n+1
yields
C
i
q(x, t
n+1
) dx −
C
i
q(x, t
n
) dx =
t
n+1
t
n
f
q
x
i −1/2
, t
dt −
t
n+1
t
n
f
q
x
i +1/2
, t
dt.
Rearranging this and dividing by x gives
1
x
C
i
q(x, t
n+1
) dx =
1
x
C
i
q(x, t
n
) dx
−
1
x
t
n+1
t
n
f
q
x
i +1/2
, t
dt −
t
n+1
t
n
f
q
x
i −1/2
, t
dt
.
(4.3)
This tells us exactly how the cell average of q from (4.1) should be updated in one time
step. In general, however, we cannot evaluate the time integrals on the righthand side of
(4.3) exactly, since q(x
i ±1/2
, t ) varies with time along each edge of the cell, and we don’t
have the exact solution to work with. But this does suggest that we should study numerical
methods of the form
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
, (4.4)
66 4 Finite Volume Methods
where F
n
i −1/2
is some approximation to the average ﬂux along x = x
i −1/2
:
F
n
i −1/2
≈
1
t
t
n+1
t
n
f
q
x
i −1/2
, t
dt. (4.5)
If we can approximate this average ﬂux based on the values Q
n
, then we will have a fully
discrete method. See Figure 4.1 for a schematic of this process.
For a hyperbolic problem information propagates with ﬁnite speed, so it is reasonable
to ﬁrst suppose that we can obtain F
n
i −1/2
based only on the values Q
n
i −1
and Q
n
i
, the cell
averages on either side of this interface (see Section 4.4 for some discussion of this). Then
we might use a formula of the form
F
n
i −1/2
= F
Q
n
i −1
, Q
n
i
(4.6)
where F is some numerical ﬂux function. The method (4.4) then becomes
Q
n+1
i
= Q
n
i
−
t
x
F
Q
n
i
, Q
n
i +1
−F
Q
n
i −1
, Q
n
i
. (4.7)
The speciﬁc method obtained depends on how we choose the formula F, but in general
any method of this type is an explicit method with a threepoint stencil, meaning that the
value Q
n+1
i
will depend on the three values Q
n
i −1
, Q
n
i
, and Q
n
i +1
at the previous time level.
Moreover, it is said to be in conservation form, since it mimics the property (4.3) of the
exact solution. Note that if we sum x Q
n+1
i
from (4.4) over any set of cells, we obtain
x
J
i =I
Q
n+1
i
= x
J
i =I
Q
n
i
−
t
x
F
n
J+1/2
− F
n
I −1/2
. (4.8)
The sum of the ﬂux differences cancels out except for the ﬂuxes at the extreme edges. Over
the full domain we have exact conservation except for ﬂuxes at the boundaries. (Numerical
boundary conditions are discussed later.)
The method (4.7) can be viewed as a direct ﬁnite difference approximation to the con
servation law q
t
+ f (q)
x
= 0, since rearranging it gives
Q
n+1
i
− Q
n
i
t
+
F
n
i +1/2
− F
n
i −1/2
x
= 0. (4.9)
Many methods can be equally well viewed as ﬁnite difference approximations to this equa
tion or as ﬁnite volume methods.
4.2 A Numerical Flux for the Diffusion Equation
The above derivation was presented for a conservation law in which the ﬂux f (q) depends
only on the state q. The same derivation works more generally, however, for example if the
ﬂux depends explicitly on x or if it depends on derivatives of the solution such as q
x
. As an
example consider the diffusion equation (2.22), where the ﬂux (2.20) is
f (q
x
, x) = −β(x)q
x
.
4.3 Necessary Components for Convergence 67
Given two cell averages Q
i −1
and Q
i
, the numerical ﬂux F(Q
i −1
, Q
i
) at the cell interface
between can very naturally be deﬁned as
F(Q
i −1
, Q
i
) = −β
i −1/2
Q
i
− Q
i −1
x
, (4.10)
where β
i −1/2
≈β(x
i −1/2
). This numerical ﬂux has the natural physical interpretation that
the conserved quantity measured by q ﬂows from one grid cell to its neighbor at a rate
proportional to the difference in Qvalues in the two cells, with β
i −1/2
measuring the
conductivity of the interface between these cells. This is a macroscopic version of Fick’s
law or Fourier’s law (or Newton’s law of cooling).
Using (4.10) in (4.7) gives a standard ﬁnite difference discretization of the diffusion
equation,
Q
n+1
i
= Q
n
i
+
t
x
2
β
i +1/2
Q
n
i +1
− Q
n
i
−β
i −1/2
Q
n
i
− Q
n
i −1
. (4.11)
If β ≡ constant, then this takes the simpler form
Q
n+1
i
= Q
n
i
+
t
x
2
β
Q
n
i −1
−2Q
n
i
+ Q
n
i +1
(4.12)
and we recognize the centered approximation to q
xx
.
For parabolic equations, explicit methods of this type are generally not used, since they are
only stable if t =O(x
2
). Instead an implicit method is preferable, such as the standard
Crank–Nicolson method,
Q
n+1
i
= Q
n
i
+
t
2 x
2
β
i +1/2
Q
n
i +1
− Q
n
i
−β
i −1/2
Q
n
i
− Q
n
i −1
+β
i +1/2
Q
n+1
i +1
− Q
n+1
i
−β
i −1/2
Q
n+1
i
− Q
n+1
i −1
. (4.13)
This can also be viewed as a ﬁnite volume method, with the ﬂux
F
n
i −1/2
= −
1
2 x
β
i −1/2
Q
n
i
− Q
n
i −1
+β
i −1/2
Q
n+1
i
− Q
n+1
i −1
.
This is a natural approximation to the timeaveraged ﬂux (4.5), and in fact has the advantage
of being a secondorder accurate approximation (since it is centered in both space and time)
as well as giving an unconditionally stable method.
The stability difﬁculty with explicit methods for the diffusion equation arises fromthe fact
that the ﬂux (4.10) contains x in the denominator, leading to stability restrictions involving
t /(x)
2
after multiplying by t /x in (4.4). For ﬁrstorder hyperbolic equations the
ﬂux function involves only q and not q
x
, and explicit methods are generally more efﬁcient.
However, some care must be taken to obtain stable methods in the hyperbolic case as well.
4.3 Necessary Components for Convergence
Later in this chapter we will introduce various ways to deﬁne the numerical ﬂux function
of (4.6) for hyperbolic equations, leading to various different ﬁnite volume methods. There
68 4 Finite Volume Methods
are several considerations that go into judging how good a particular ﬂux function is for
numerical computation. One essential requirement is that the resulting method should be
convergent, i.e., the numerical solution should converge to the true solution of the differential
equation as the grid is reﬁned (as x, t →0). This generally requires two conditions:
•
The method must be consistent with the differential equation, meaning that it approxi
mates it well locally.
•
The method must be stable in some appropriate sense, meaning that the small errors made
in each time step do not grow too fast in later time steps.
Stability and convergence theory are discussed in more detail in Chapter 8. At this stage we
simply introduce some essential ideas that are useful in discussing the basic methods.
4.3.1 Consistency
The numerical ﬂux should approximate the integral in (4.5). In particular, if the function
q(x, t ) ≡ ¯ q is constant in x, then q will not change with time and the integral in (4.5) simply
reduces to f ( ¯ q). As a result, if Q
n
i −1
= Q
n
i
= ¯ q, then we expect the numerical ﬂux function
F of (4.6) to reduce to f ( ¯ q), so we require
F( ¯ q, ¯ q) = f ( ¯ q) (4.14)
for any value ¯ q. This is part of the basic consistency condition. We generally also ex
pect continuity in this function as Q
i −1
and Q
i
vary, so that F(Q
i −1
, Q
i
) → f ( ¯ q) as
Q
i −1
, Q
i
→ ¯ q. Typically some requirement of Lipschitz continuity is made, e.g., there
exists a constant L so that
F(Q
i −1
, Q
i
) − f ( ¯ q) ≤ L max(Q
i
− ¯ q, Q
i −1
− ¯ q). (4.15)
4.4 The CFL Condition
Stability analysis is considered in detail in Chapter 8. Here we mention only the CFL
condition, which is a necessary condition that must be satisﬁed by any ﬁnite volume or
ﬁnite difference method if we expect it to be stable and converge to the solution of the
differential equation as the grid is reﬁned. It simply states that the method must be used in
such a way that information has a chance to propagate at the correct physical speeds, as
determined by the eigenvalues of the ﬂux Jacobian f
(q).
With the explicit method (4.7) the value Q
n+1
i
depends only on three values Q
n
i −1
, Q
n
i
,
and Q
n
i +1
at the previous time step. Suppose we apply such a method to the advection
equation q
t
+ ¯ uq
x
= 0 with ¯ u > 0 so that the exact solution simply translates at speed ¯ u
and propagates a distance ¯ u t over one time step. Figure 4.2(a) shows a situation where
¯ u t < x, so that information propagates less than one grid cell in a single time step.
In this case it makes sense to deﬁne the ﬂux at x
i −1/2
in terms of Q
n
i −1
and Q
n
i
alone. In
Figure 4.2(b), on the other hand, a larger time step is used with ¯ u t > x. In this case the
true ﬂux at x
i −1/2
clearly depends on the value of Q
n
i −2
, and so should the new cell average
Q
n+1
i
. The method (4.7) would certainly be unstable when applied with such a large time
4.4 The CFL Condition 69
(a) x
i−1/2
Q
n
i
Q
n
i−1
t
n
t
n+1
(b) x
i−1/2
Q
n
i
Q
n
i−1
Q
n
i−2
t
n
t
n+1
Fig. 4.2. Characteristics for the advection equation, showing the information that ﬂows into cell C
i
during a single time step. (a) For a small enough time step, the ﬂux at x
i −1/2
depends only on the
values in the neighboring cells – only on Q
n
i −1
in this case where ¯ u > 0. (b) For a larger time step,
the ﬂux should depend on values farther away.
step, no matter how the ﬂux (4.6) was speciﬁed, if this numerical ﬂux depended only on
Q
n
i −1
and Q
n
i
.
This is a consequence of the CFL condition, named after Courant, Friedrichs, and Lewy.
They wrote one of the ﬁrst papers on ﬁnite difference methods for partial differential
equations [93] in 1928. (There is an English translation in [94].) They used ﬁnite difference
methods as an analytic tool for proving the existence of solutions of certain PDEs. The
idea is to deﬁne a sequence of approximate solutions (via ﬁnite difference equations), prove
that they converge as the grid is reﬁned, and then show that the limit function must satisfy
the PDE, giving the existence of a solution. In the course of proving convergence of this
sequence (which is precisely what we are interested in numerically), they recognized the
following necessary stability condition for any numerical method:
CFL Condition: A numerical method can be convergent only if its numerical domain
of dependence contains the true domain of dependence of the PDE, at least in the limit
as t and x go to zero.
It is very important to note that the CFL condition is only a necessary condition for
stability (and hence convergence). It is not always sufﬁcient to guarantee stability. In the
next section we will see a numerical ﬂux function yielding a method that is unstable even
when the CFL condition is satisﬁed.
The domain of dependence D(X, T) for a PDE has been deﬁned in Section 3.6. The
numerical domain of dependence of a method can be deﬁned in a similar manner as the
set of points where the initial data can possibly affect the numerical solution at the point
(X, T). This is easiest to illustrate for a ﬁnite difference method where pointwise values
of Q are used, as shown in Figure 4.3 for a threepoint method. In Figure 4.3(a) we see
that Q
2
i
depends on Q
1
i −1
, Q
1
i
, Q
1
i +1
and hence on Q
0
i −2
, . . . ,Q
0
i +2
. Only initial data in the
interval X −2 x
a
≤ x ≤ X +2 x
a
can affect the numerical solution at (X, T) = (x
i
, t
2
).
If we now reﬁne the grid by a factor of 2 in both space and time (x
b
=x
a
/2), but
continue to focus on the same physical point (X, T), then we see in Figure 4.3(b) that
the numerical approximation at this point now depends on initial data at more points in
the interval X − 4 x
b
≤ x ≤ X + 4 x
b
. But this is the same interval as before. If we
continue to reﬁne the grid with the ratio t /x ≡ r ﬁxed, then the numerical domain of
dependence of a general point (X, T) is X − T/r ≤ x ≤ X + T/r.
70 4 Finite Volume Methods
(a) X
t
0
T = t
2
(b) X
t
0
T = t
4
Fig. 4.3. (a) Numerical domain of dependence of a grid point when using a threepoint explicit ﬁnite
difference method, with mesh spacing x
a
. (b) On a ﬁner grid with mesh spacing x
b
=
1
2
x
a
.
Similar ﬁgures can be drawn for ﬁnite volume methods.
In order for the CFL condition to be satisﬁed, the domain of dependence of the true
solution must lie within this interval. For the advection equation q
t
+ ¯ uq
x
= 0, for example,
D(X, T) is the single point X − ¯ uT, since q(X, T) = q
◦
(X − ¯ uT). The CFL condition then
requires
X − T/r ≤ X − ¯ uT ≤ X + T/r
and hence
ν ≡
¯ u t
x
≤ 1. (4.16)
If this condition is not satisﬁed, then a change in the initial data q
◦
at X − ¯ uT would change
the true solution at (X, T) but could have no effect on the numerical solution at this point.
Clearly the method cannot converge to the proper solution for all choices of initial data
under these circumstances.
The ratio ν in (4.16) is sometimes called the CFLnumber, or more frequently the Courant
number. Returning to the ﬁnite volume method illustrated in Figure 4.2, note that the Courant
number measures the fraction of a grid cell that information propagates through in one time
step. For a hyperbolic system of equations there are generally a set of m wave speeds
λ
1
, . . . , λ
m
as described in Chapter 3, and the true domain of dependence is given by (3.14).
In this case we deﬁne the Courant number by
ν =
t
x
max
p
λ
p
. (4.17)
For a threepoint method the CFL condition again leads to a necessary condition ν ≤ 1.
Note that if the method has a wider stencil, then the CFL condition will lead to a more
lenient condition on the time step. For a centered ﬁvepoint stencil in which Q
n+1
i
depends
also on Q
n
i −2
and Q
n
i +2
, the CFL condition gives ν ≤ 2. Again this will only be a necessary
condition, and a more detailed analysis of stability would be required to determine the actual
stability constraint needed to guarantee convergence.
For hyperbolic equations we typically use explicit methods and grids for which the
Courant number is somewhat smaller than 1. This allows keeping t /x ﬁxed as the grid
is reﬁned, which is sensible in that generally we wish to add more resolution at the same
rate in both space and in time in order to improve the solution.
4.6 The Lax–Friedrichs Method 71
For a parabolic equation such as the diffusion equation, on the other hand, the CFL
condition places more severe constraints on an explicit method. The domain of dependence
of any point (X, T) for T >0 is now the whole real line, D(X, T) =(−∞, ∞), and data at
every point can affect the solution everywhere. Because of this inﬁnite propagation speed,
the CFL condition requires that the numerical domain of dependence must include the
whole real line, at least in the limit as t, x →0. For an explicit method this can be
accomplished by letting t approach zero more rapidly than x as we reﬁne the grid, e.g.,
by taking t = O(x
2
) as required for the method (4.11). A better way to satisfy the CFL
condition in this case is to use an implicit method. In this case the numerical domain of
dependence is the entire domain, since all grid points are coupled together.
4.5 An Unstable Flux
We nowreturntothe general ﬁnite volume method(4.4) for a hyperbolic systemandconsider
various ways in which the numerical ﬂux might be deﬁned. In particular we consider ﬂux
functions F as in (4.6). We wish to deﬁne the average ﬂux at x
i −1/2
based on the data Q
n
i −1
and Q
n
i
to the left and right of this point. A ﬁrst attempt might be the simple arithmetic
average
F
n
i −1/2
= F
Q
n
i −1
, Q
n
i
=
1
2
f
Q
n
i −1
+ f
Q
n
i
. (4.18)
Using this in (4.4) would give
Q
n+1
i
= Q
n
i
−
t
2 x
f
Q
n
i +1
− f
Q
n
i −1
. (4.19)
Unfortunately, this methodis generallyunstable for hyperbolic problems andcannot be used,
even if the time step is small enough that the CFL condition is satisﬁed. (See Exercise 8.1.)
4.6 The Lax–Friedrichs Method
The classical Lax–Friedrichs (LxF) method has the form
Q
n+1
i
=
1
2
Q
n
i −1
+ Q
n
i +1
−
t
2 x
f
Q
n
i +1
− f
Q
n
i −1
. (4.20)
This is very similar to the unstable method (4.19), but the value Q
n
i
is replaced by the
average
1
2
(Q
n
i −1
+ Q
n
i +1
). For a linear hyperbolic equation this method is stable provided
ν ≤ 1, where the Courant number ν is deﬁned in (4.17).
At ﬁrst glance the method (4.20) does not appear to be of the form (4.4). However, it can
be put into this form by deﬁning the numerical ﬂux as
F
Q
n
i −1
, Q
n
i
=
1
2
f
Q
n
i −1
+ f
Q
n
i
−
x
2 t
Q
n
i
− Q
n
i −1
. (4.21)
Note that this ﬂux looks like the unstable centered ﬂux (4.18) with the addition of another
term similar to the ﬂux (4.10) of the diffusion equation. By using this ﬂux we appear to be
modeling the advection–diffusion equation q
t
+ f (q)
x
= βq
xx
with β =
1
2
(x)
2
/t . But
72 4 Finite Volume Methods
if we ﬁx t /x, then we see that this coefﬁcient vanishes as the grid is reﬁned, so in the
limit the method is still consistent with the original hyperbolic equation. This additional
term can be interpreted as numerical diffusion that damps the instabilities arising in (4.19)
and gives a method that can be shown to be stable for Courant number up to 1 (which is also
the CFL limit for this threepoint method). However, the Lax–Friedrichs method introduces
much more diffusion than is actually required, and gives numerical results that are typically
badly smeared unless a very ﬁne grid is used.
4.7 The Richtmyer TwoStep Lax–Wendroff Method
The Lax–Friedrichs method is only ﬁrstorder accurate. Secondorder accuracy can be
achieved by using a better approximation to the integral in (4.5). One approach is to ﬁrst
approximate q at the midpoint in time, t
n+1/2
= t
n
+
1
2
t , and evaluate the ﬂux at this point.
The Richtmyer method is of this form with
F
n
i −1/2
= f
Q
n+1/2
i −1/2
, (4.22)
where
Q
n+1/2
i −1/2
=
1
2
Q
n
i −1
+ Q
n
i
−
t
2 x
f
Q
n
i
− f
Q
n
i −1
. (4.23)
Note that Q
n+1/2
i −1/2
is obtained by applying the Lax–Friedrichs method at the cell interface
with x and t replaced by
1
2
x and
1
2
t respectively.
For a linear system of equations, f (q) = Aq, the Richtmyer method reduces to the stan
dard Lax–Wendroff method, discussed further in Section 6.1. As we will see, these methods
often lead to spurious oscillations in solutions, particularly when solving problems with dis
continuous solutions. Additional numerical diffusion (or artiﬁcial viscosity) can be added
to eliminate these oscillations, as ﬁrst proposed by von Neumann and Richtmyer [477]. In
Chapter 6 we will study a different approach to obtaining better accuracy that allows us to
avoid these oscillations more effectively.
4.8 Upwind Methods
The methods considered above have all been centered methods, symmetric about the point
where we are updating the solution. For hyperbolic problems, however, we expect infor
mation to propagate as waves moving along characteristics. For a system of equations we
have several waves propagating at different speeds and perhaps in different directions. It
makes sense to try to use our knowledge of the structure of the solution to determine better
numerical ﬂux functions. This idea gives rise to upwind methods in which the information
for each characteristic variable is obtained by looking in the direction from which this
information should be coming.
For the scalar advection equation there is only one speed, which is either positive or neg
ative, and so an upwind method is typically also a onesided method, with Q
n+1
i
determined
based on values only to the left or only to the right. This is discussed in the next section.
4.9 The Upwind Method for Advection 73
For a system of equations there may be waves traveling in both directions, so an up
wind method must still use information from both sides, but typically uses characteristic
decomposition (often via the solution of Riemann problems) to select which information to
use from each side. Upwind methods for systems of equations are discussed beginning in
Section 4.10.
4.9 The Upwind Method for Advection
For the constantcoefﬁcient advection equation q
t
+ ¯ uq
x
= 0, Figure 4.2(a) indicates that
the ﬂux through the left edge of the cell is entirely determined by the value Q
n
i −1
in the cell
to the left of this cell. This suggests deﬁning the numerical ﬂux as
F
n
i −1/2
= ¯ uQ
n
i −1
. (4.24)
This leads to the standard ﬁrstorder upwind method for the advection equation,
Q
n+1
i
= Q
n
i
−
¯ u t
x
Q
n
i
− Q
n
i −1
. (4.25)
Note that this can be rewritten as
Q
n+1
i
− Q
n
i
t
+ ¯ u
Q
n
i
− Q
n
i −1
x
= 0,
whereas the unstable centered method (4.19) applied to the advection equation is
Q
n+1
i
− Q
n
i
t
+ ¯ u
Q
n
i +1
− Q
n
i −1
2 x
= 0.
The upwind method uses a onesided approximation to the derivative q
x
in place of the
centered approximation.
Another interpretation of the upwind method is suggested by Figure 4.4(a). If we think
of the Q
n
i
as being values at grid points, Q
n
i
≈ q(x
i
, t
n
), as is standard in a ﬁnite difference
method, then since q(x, t ) is constant along characteristics we expect
Q
n+1
i
≈ q(x
i
, t
n+1
) = q(x
i
− ¯ u t, t
n
).
(a) x
i
− ¯ u ∆t
Q
n
i
Q
n
i−1
Q
n+1
i
t
n
t
n+1
(b)
x
i−1/2
Q
n
i
Q
n
i−1
t
n
t
n+1
Fig. 4.4. Two interpretations of the upwind method for advection. (a) If Q
n
i
represents the value at
a grid point, then we can trace the characteristic back and interpolate. (b) If Q
n
i
represents the cell
average, then the ﬂux at the interface is determined by the cell value on the upwind side.
74 4 Finite Volume Methods
If we approximate the value on the right by a linear interpolation between the grid values
Q
n
i −1
and Q
n
i
, we obtain the method
Q
n+1
i
=
¯ u t
x
Q
n
i −1
+
1 −
¯ u t
x
Q
n
i
. (4.26)
This is simply the upwind method, since a rearrangement gives (4.25).
Note that we must have
0 ≤
¯ u t
x
≤ 1 (4.27)
in order for the characteristic to fall between the neighboring points so that this interpolation
is sensible. In fact, (4.27) must be satisﬁed in order for the upwind method to be stable, and
also follows from the CFL condition. Note that if (4.27) is satisﬁed then (4.26) expresses
Q
n+1
i
as a convex combination of Q
n
i
and Q
n
i −1
(i.e., the weights are both nonnegative and
sum to 1). This is a key fact in proving stability of the method. (See Section 8.3.4.)
We are primarily interested in ﬁnite volume methods, and so other interpretations of the
upwind method will be more valuable. Figure 4.4(b) and Figure 4.5 show the ﬁnite volume
viewpoint, in which the value Q
n
i
is now seen as a cell average of q over the i th grid cell C
i
.
We think of mixing up the tracer within this cell so that it has this average value at every
point in the cell, at time t
n
. This deﬁnes a piecewise constant function at time t
n
with the
(a)
x
i−1/2
x
i+1/2
Q
n
i
Q
n
i−1
Q
n
i+1
t
n
t
n+1
W
i−1/2
(b)
x
i−1/2
x
i+1/2
Q
n
i
Q
n
i−1
Q
n
i+1
t
n
t
n+1
W
i−1/2
Fig. 4.5. Wavepropagation interpretation of the upwind method for advection. The bottom pair of
graphs shows data at time t
n
, represented as a piecewise constant function. Over time t this function
shifts by a distance ¯ u t as indicated in the middle pair of graphs. We view the discontinuity that
originates at x
i −1/2
as a wave W
i −1/2
. The top pair shows the piecewise constant function at the end of
the time step after advecting. The newcell averages Q
n+1
i
in each cell are then computed by averaging
this function over each cell. (a) shows a case with ¯ u > 0, while (b) shows ¯ u < 0.
4.9 The Upwind Method for Advection 75
value Q
n
i
in cell C
i
. As time evolves, this piecewise constant function advects to the right
with velocity ¯ u, and the jump between states Q
n
i −1
and Q
n
i
shifts a distance ¯ u t into cell
C
i
. At the end of the time step we can compute a new cell average Q
n+1
i
in order to repeat
this process. To compute Q
n+1
i
we must average the piecewise constant function shown
in the top of Figure 4.5 over the cell. Computing this average results in the same convex
combination (4.26) as was motivated by the characteristicbased approach of Figure 4.4(a),
as the reader should verify.
We can also take a wavepropagation viewpoint, which will prove useful in extending
and implementing the upwind method. The jump W
i −1/2
≡ Q
n
i
− Q
n
i −1
can be viewed as a
wave that is moving into cell C
i
at velocity ¯ u. This wave modiﬁes the value of q by −W
i −1/2
at each point it passes. Over the time step it moves a distance ¯ u t and passes through a
fraction ¯ u t /x of the grid cell, and hence the cell average is modiﬁed by this fraction of
−W
i −1/2
:
Q
n+1
i
= Q
n
i
+
¯ u t
x
−W
i −1/2
. (4.28)
This again results in the upwind method (4.25).
In the above discussion we have assumed that ¯ u > 0. On the other hand if ¯ u < 0 then
the upwind direction is to the right and so the numerical ﬂux at x
i −1/2
is
F
n
i −1/2
= ¯ uQ
n
i
. (4.29)
The upwind method then has the form
Q
n+1
i
= Q
n
i
−
¯ u t
x
Q
n
i +1
− Q
n
i
. (4.30)
This can also be written in wavepropagation form as
Q
n+1
i
= Q
n
i
−
¯ u t
x
W
i +1/2
, (4.31)
with W
i +1/2
= Q
n
i +1
− Q
n
i
. All the interpretations presented above carry over to this case
¯ u < 0, with the direction of ﬂow reversed. The method (4.31) is stable provided that
−1 ≤
¯ u t
x
≤ 0. (4.32)
The two formulas (4.24) and (4.29) can be combined into a single upwind formula that
is valid for ¯ u of either sign,
F
n
i −1/2
= ¯ u
−
Q
n
i
+ ¯ u
+
Q
n
i −1
, (4.33)
where
¯ u
+
= max( ¯ u, 0), ¯ u
−
= min( ¯ u, 0). (4.34)
76 4 Finite Volume Methods
The wavepropagation versions of the upwind method in (4.28) and (4.31) can also be
combined to give the more general formula
Q
n+1
i
= Q
n
i
−
t
x
¯ u
+
W
i −1/2
+ ¯ u
−
W
i +1/2
. (4.35)
This formulation will be useful in extending this method to more general hyperbolic
problems. Not all hyperbolic equations are in conservation form; consider for example the
variablecoefﬁcient linear equation (2.78) or the quasilinear system (2.81) with suitable
coefﬁcient matrix. Such equations do not have a ﬂux function, and so numerical methods
of the form (4.7) cannot be applied. However, these hyperbolic problems can still be solved
using ﬁnite volume methods that result from a simple generalization of the highresolution
methods developed for hyperbolic conservation laws. The unifying feature of all hyperbolic
equations is that they model waves that travel at ﬁnite speeds. In particular, the solution to a
Riemann problem with piecewise constant initial data (as discussed in Chapter 3) consists
of waves traveling at constant speeds away from the location of the jump discontinuity in
the initial data.
In Section 4.12 we will generalize (4.35) to obtain an approach to solving hyperbolic
systems that is more general than the ﬂuxdifferencing form (4.4). First, however, we see
how the upwind method can be extended to systems of equations.
4.10 Godunov’s Method for Linear Systems
The upwind method for the advection equation can be derived as a special case of the
following approach, which can also be applied to systems of equations. This will be referred
to as the REA algorithm, for reconstruct–evolve–average. These are oneword summaries
of the three steps involved.
Algorithm 4.1 (REA).
1. Reconstruct a piecewise polynomial function ˜ q
n
(x, t
n
) deﬁned for all x, from the cell
averages Q
n
i
. In the simplest case this is a piecewise constant function that takes the
value Q
n
i
in the i th grid cell, i.e.,
˜ q
n
(x, t
n
) = Q
n
i
for all x ∈ C
i
.
2. Evolve the hyperbolic equation exactly (or approximately) with this initial data to obtain
˜ q
n
(x, t
n+1
) a time t later.
3. Average this function over each grid cell to obtain new cell averages
Q
n+1
i
=
1
x
C
i
˜ q
n
(x, t
n+1
) dx.
This whole process is then repeated in the next time step.
In order to implement this procedure, we must be able to solve the hyperbolic equation
in step 2. Because we are starting with piecewise constant data, this can be done using the
4.10 Godunov’s Method for Linear Systems 77
theory of Riemann problems as introduced for linear problems in Chapter 3. When applied
to the advection equation, this leads to the upwind algorithm, as illustrated in Figure 4.5.
The general approach of Algorithm 4.1 was originally proposed by Godunov [157] as
a method for solving the nonlinear Euler equations of gas dynamics. Application in that
context hinges on the fact that, even for this nonlinear system, the Riemann problem with
piecewise constant initial data can be solved and the solution consists of a ﬁnite set of
waves traveling at constant speeds, as we will see in Chapter 13.
Godunov’s method for gas dynamics revolutionized the ﬁeld of computational ﬂuid dy
namics, by overcoming many of the difﬁculties that had plagued earlier numerical methods
for compressible ﬂow. Using the wave structure determined by the Riemann solution allows
shock waves to be handled in a properly “upwinded” manner even for systems of equations
where information propagates in both directions. We will explore this for linear systems in
the remainder of this chapter.
In step 1 we reconstruct a function ˜ q
n
(x, t
n
) fromthe discrete cell averages. In Godunov’s
original approach this reconstruction is a simple piecewise constant function, and for nowwe
concentrate on this form of reconstruction. This leads most naturally to Riemann problems,
but gives only a ﬁrstorder accurate method, as we will see. To obtain better accuracy one
might consider using a better reconstruction, for example a piecewise linear function that
is allowed to have a nonzero slope σ
n
i
in the i th grid cell. This idea forms the basis for the
highresolution methods that are considered starting in Chapter 6.
Clearly the exact solution at time t
n+1
can be constructed by piecing together the Riemann
solutions, provided that the time step t is short enough that the waves from two adjacent
Riemann problems have not yet started to interact. Figure 4.6 shows a schematic diagram
of this process for the equations of linear acoustics with constant sound speed c, in which
case this requires that
c t ≤
1
2
x,
so that each wave goes at most halfway through the grid cell. Rearranging gives
c t
x
≤
1
2
. (4.36)
t
n
t
n+1
Q
n
i
Q
n+1
i
Fig. 4.6. An illustration of the process of Algorithm 4.1 for the case of linear acoustics. The Riemann
problem is solved at each cell interface, and the wave structure is used to determine the exact solution
time t later. This solution is averaged over the grid cell to determine Q
n+1
i
.
78 4 Finite Volume Methods
The quantity c t /x is simply the Courant number, so it appears that we are limited in
(4.36) to a Courant number less than 1/2. But we will see below that this method is easily
extended to Courant numbers up to 1.
4.11 The Numerical Flux Function for Godunov’s Method
We now develop a ﬁnite volume method based on Algorithm 4.1 that can be easily imple
mented in practice. As presented, the algorithmseems cumbersome to implement. The exact
solution ˜ q
n
(x, t
n+1
) will typically contain several discontinuities and we must compute its
integral over each grid cell in order to determine the new cell averages Q
n+1
i
. However,
it turns out to be easy to determine the numerical ﬂux function F that corresponds to
Godunov’s method.
Recall the formula (4.5), which states that the numerical ﬂux F
n
i −1/2
should approximate
the time average of the ﬂux at x
i −1/2
over the time step,
F
n
i −1/2
≈
1
t
t
n+1
t
n
f (q(x
i −1
, t )) dt.
In general the function q(x
i −1/2
, t ) varies with t , and we certainly don’t know this variation
of the exact solution. However, we can compute this integral exactly if we replace q(x, t )
by the function ˜ q
n
(x, t ) deﬁned in Algorithm 4.1 using Godunov’s piecewise constant
reconstruction. The structure of this function is shown in Figure 3.3, for example, and so
clearly ˜ q
n
(x
i −1/2
, t ) is constant over the time interval t
n
< t < t
n+1
. The Riemann problem
centered at x
i −1/2
has a similarity solution that is constant along rays (x −x
i −1/2
)/(t −t
n
) =
constant, and looking at the value along (x −x
i −1/2
)/t = 0 gives the value of ˜ q
n
(x
i −1/2
, t ).
Denote this value by Q
∨

i −1/2
= q
∨

(Q
n
i −1
, Q
n
i
). This suggests deﬁning the numerical ﬂux
F
n
i −1/2
by
F
n
i −1/2
=
1
t
t
n+1
t
n
f
q
∨

Q
n
i −1
, Q
n
i
dt
= f
q
∨

Q
n
i −1
, Q
n
i
. (4.37)
This gives a simple way to implement Godunov’s method for a general system of conser
vation laws:
•
Solve the Riemann problem at x
i −1/2
to obtain q
∨

(Q
n
i −1
, Q
n
i
).
•
Deﬁne the ﬂux F
n
i −1/2
= F(Q
n
i −1
, Q
n
i
) by (4.37).
•
Apply the ﬂuxdifferencing formula (4.4).
Godunov’s method is often presented in this form.
4.12 The WavePropagation Form of Godunov’s Method
By taking a slightly different viewpoint, we can also develop simple formulas for Godunov’s
method on linear systems of equations that are analogous to the form (4.35) for the upwind
4.12 The WavePropagation Form of Godunov’s Method 79
λ
2
∆t
W
1
i−1/2
W
1
i+1/2
W
2
i−1/2
W
3
i−1/2
Fig. 4.7. An illustration of the process of Algorithm 4.1 for the case of a linear system of three
equations. The Riemann problem is solved at each cell interface, and the wave structure is used to
determine the exact solution time t later. The wave W
2
i −1/2
, for example, has moved a distance λ
2
t
into the cell.
method on the advection equation. This viewpoint is particularly useful in extending
Godunov’s method to hyperbolic systems that are not in conservation form.
Figure 4.7 shows a more complicated version of Figure 4.6, in which a linear system of
three equations is solved assuming λ
1
<0 <λ
2
<λ
3
. The function ˜ q
n
(x, t
n+1
) will typically
have three discontinuities in the grid cell C
i
, at the points x
i −1/2
+ λ
2
t , x
i −1/2
+ λ
3
t ,
and x
i +1/2
+λ
1
t .
Instead of trying to work with this function directly to compute the new cell average,
recall from Section 3.8 that for a linear system the solution to the Riemann problem can be
expressed as a set of waves,
Q
i
− Q
i −1
=
m
p=1
α
p
i −1/2
r
p
≡
m
p=1
W
p
i −1/2
. (4.38)
Let’s investigate what effect each wave has on the cell average. Consider the wave denoted
by W
2
i −1/2
in Figure 4.7, for example. It consists of a jump in q given by
W
2
i −1/2
= α
2
i −1/2
r
2
,
propagating at speed λ
2
, and hence after time t it has moved a distance λ
2
t . This wave
modiﬁes the value of q over a fraction of the grid cell given by λ
2
t /x. It follows that
the effect of this wave on the cell average of q is to change the average value by the amount
−
λ
2
t
x
W
2
i −1/2
.
The minus sign arises because the value W
2
i −1/2
measures the jump from right to left, and
is analogous to the minus sign in (4.28).
Each of the waves entering the grid cell has an analogous effect on the cell average, and
the new cell average can be found by simply adding up these independent effects. For the
80 4 Finite Volume Methods
case shown in Figure 4.7, we thus ﬁnd that
Q
n+1
i
= Q
n
i
−
λ
2
t
x
W
2
i −1/2
−
λ
3
t
x
W
3
i −1/2
−
λ
1
t
x
W
1
i +1/2
= Q
n
i
−
t
x
λ
2
W
2
i −1/2
+λ
3
W
3
i −1/2
+λ
1
W
1
i +1/2
. (4.39)
Note that we use the 2 and the 3wave originating from x
i −1/2
and the 1wave originat
ing from x
i +1/2
, based on the presumed wave speeds. This can be written in a form that
generalizes easily to arbitrary hyperbolic systems of m equations. Let
λ
+
= max(λ, 0), λ
−
= min(λ, 0), (4.40)
and suppose the solution of the Riemann problem consists of m waves W
p
traveling at
speeds λ
p
, each of which may be positive or negative. Then the cell average is updated by
Q
n+1
i
= Q
n
i
−
t
x
m
p=1
(λ
p
)
+
W
p
i −1/2
+
m
p=1
(λ
p
)
−
W
p
i +1/2
. (4.41)
The cell average is affected by all rightgoing waves from x
i −1/2
and by all leftgoing waves
from x
i +1/2
. This is a generalization of (4.35). Understanding this formulation of Godunov’s
method is crucial to understanding many of the other algorithms presented in this book.
As a shorthand notation, we will also introduce the following symbols:
A
−
Q
i −1/2
=
m
p=1
(λ
p
)
−
W
p
i −1/2
,
A
+
Q
i −1/2
=
m
p=1
(λ
p
)
+
W
p
i −1/2
,
(4.42)
so that (4.41) can be rewritten as
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
. (4.43)
The symbol A
+
Q
i −1/2
should be interpreted as a single entity that measures the net
effect of all rightgoing waves from x
i −1/2
, while A
−
Q
i −1/2
measures the net effect of all
leftgoing waves from this same interface. These net effects will also sometimes be called
ﬂuctuations. Note that within cell C
i
, it is the rightgoing ﬂuctuation from the left edge,
A
+
Q
i −1/2
, and the leftgoing ﬂuctuation from the right edge, A
−
Q
i +1/2
, that affect the
cell average.
The notation introduced in (4.42) is motivated by the following observation. For the
constantcoefﬁcient linear system q
t
+ Aq
x
= 0, we have
W
p
i −1/2
= α
p
i −1/2
r
p
,
where r
p
is the pth eigenvector of A, and the propagation speed is the corresponding
4.12 The WavePropagation Form of Godunov’s Method 81
eigenvalue λ
p
. Deﬁne the matrices
+
=
(λ
1
)
+
(λ
2
)
+
.
.
.
(λ
m
)
+
,
−
=
(λ
1
)
−
(λ
2
)
−
.
.
.
(λ
m
)
−
.
(4.44)
Thus
+
has only the positive eigenvalues on the diagonal, with negative ones replaced by
zero, and conversely for
−
. Now deﬁne
A
+
= R
+
R
−1
and A
−
= R
−
R
−1
, (4.45)
and note that
A
+
+ A
−
= R(
+
+
−
)R
−1
= RR
−1
= A. (4.46)
This gives a useful splitting of the coefﬁcient matrix A into pieces essential for rightgoing
and leftgoing propagation. Now if we let Q
i −1/2
= Q
i
− Q
i −1
and multiply this vector
by A
+
, we obtain
A
+
Q
i −1/2
= R
+
R
−1
(Q
i
− Q
i −1
)
= R
+
α
i −1/2
=
m
p=1
(λ
p
)
+
α
p
i −1/2
r
p
= A
+
Q
i −1/2
. (4.47)
Similarly, we compute that
A
−
Q
i −1/2
=
m
p=1
(λ
p
)
−
α
p
i −1/2
r
p
= A
−
Q
i −1/2
. (4.48)
So in the linear constantcoefﬁcient case, each of the ﬂuctuations A
+
Q
i −1/2
and
A
−
Q
i −1/2
can be computed by simply multiplying the matrix A
+
or A
−
by the jump
in Q. For variablecoefﬁcient or nonlinear problems the situation is not quite so simple, and
hence we introduce the more general notation (4.42) for the ﬂuctuations, which can still be
computed by solving Riemann problems and combining the appropriate waves. We will see
that the form (4.43) of Godunov’s method can still be used.
For the constantcoefﬁcient linear problem, the wavepropagation form (4.43) of
Godunov’s method can be related directly to the numerical ﬂux function (4.37). Note
that the value of q in the Riemann solution along x = x
i −1/2
is
Q
∨

i −1/2
= q
∨

(Q
i −1
, Q
i
) = Q
i −1
+
p:λ
p
<0
W
p
i −1/2
,
using the summation notation introduced in (3.19).
82 4 Finite Volume Methods
In the linear case f (Q
∨

i −1/2
) = AQ
∨

i −1/2
and so (4.37) gives
F
n
i −1/2
= AQ
i −1
+
p:λ
p
<0
AW
p
i −1/2
.
Since W
p
i −1/2
is an eigenvector of A with eigenvalue λ
p
, this can be rewritten as
F
n
i −1/2
= AQ
i −1
+
m
p=1
(λ
p
)
−
W
p
i −1/2
. (4.49)
Alternatively, we could start with the formula
Q
∨

i −1/2
= Q
i
−
p:λ
p
>0
W
p
i −1/2
and obtain
F
n
i −1/2
= AQ
i
−
m
p=1
(λ
p
)
+
W
p
i −1/2
. (4.50)
Similarly, there are two ways to express F
n
i +1/2
. Choosing the form
F
n
i +1/2
= AQ
i
+
m
p=1
(λ
p
)
−
W
p
i +1/2
and combining this with (4.50) in the ﬂuxdifferencing formula (4.4) gives
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
= Q
n
i
−
t
x
m
p=1
(λ
p
)
−
W
p
i +1/2
+
m
p=1
(λ
p
)
+
W
p
i −1/2
, (4.51)
since the AQ
i
terms cancel out. This is exactly the same expression obtained in (4.41).
For a more general conservation law q
t
+ f (q)
x
= 0, we can deﬁne
F
n
i −1/2
= f (Q
i −1
) +
m
p=1
(λ
p
)
−
W
p
i −1/2
≡ f (Q
i −1
) +A
−
Q
i −1/2
(4.52)
or
F
n
i −1/2
= f (Q
i
) −
m
p=1
(λ
p
)
+
W
p
i −1/2
≡ f (Q
i
) −A
+
Q
i −1/2
, (4.53)
corresponding to (4.49) and (4.50) respectively, where the speeds λ
p
and waves W
p
come
out of the solution to the Riemann problem.
4.13 FluxDifference vs. FluxVector Splitting 83
4.13 FluxDifference vs. FluxVector Splitting
Note that if we subtract (4.52) from (4.53) and rearrange, we obtain
f (Q
i
) − f (Q
i −1
) = A
−
Q
i −1/2
+A
+
Q
i −1/2
. (4.54)
This indicates that the terms on the righthand side correspond to a socalled ﬂuxdifference
splitting. The difference between the ﬂuxes computed based on each of the cell averages
Q
i −1
and Q
i
is split into a leftgoing ﬂuctuation that updates Q
i −1
and a rightgoing
ﬂuctuation that updates Q
i
.
We can deﬁne a more general class of ﬂuxdifference splitting methods containing any
method based on some splitting of the ﬂux difference as in (4.54), followed by application
of the formula (4.43). Such a method is guaranteed to be conservative, and corresponds to
a ﬂuxdifferencing method with numerical ﬂuxes
F
n
i −1/2
= f (Q
i
) −A
+
Q
i −1/2
= f (Q
i −1
) +A
−
Q
i −1/2
. (4.55)
For a linear system, there are other ways to rewrite the numerical ﬂux F
n
i −1/2
that give
additional insight. Using (4.47) in (4.49), we obtain
F
n
i −1/2
= (A
+
+ A
−
)Q
i −1
+ A
−
(Q
i
− Q
i −1
)
= A
+
Q
i −1
+ A
−
Q
i
. (4.56)
Since A
+
+ A
−
= A, the formula (4.56) gives a ﬂux that is consistent with the correct
ﬂux in the sense of (4.14): If Q
i −1
= Q
i
= ¯ q, then (4.56) reduces to F
i −1/2
= A ¯ q = f (q).
This has a very natural interpretation as a ﬂuxvector splitting. The ﬂux function is f (q) =
Aq, and so AQ
i −1
and AQ
i
give two possible approximations to the ﬂux at x
i −1/2
. In
Section 4.5 we considered the possibility of simply averaging these to obtain F
n
i −1/2
and
rejected this because it gives an unstable method. The formula (4.56) suggests instead a
more sophisticated average in which we take the part of AQ
i −1
corresponding to rightgoing
waves and combine it with the part of AQ
i
corresponding to leftgoing waves in order to
obtain the ﬂux in between. This is the proper generalization to systems of equations of the
upwind ﬂux for the scalar advection equation given in (4.33).
This is philosophically a different approach from the ﬂuxdifference splitting discussed
in relation to (4.54). What we have observed is that for a constantcoefﬁcient linear system,
the two viewpoints lead to exactly the same method. This is not typically the case for
nonlinear problems, and in this book we concentrate primarily on methods that correspond
to ﬂuxdifference splittings. However, note that given any ﬂuxvector splitting, one can
deﬁne a corresponding splitting of the ﬂux difference in the form (4.54). If we have split
f (Q
i −1
) = f
(−)
i −1
+ f
(+)
i −1
and f (Q
i
) = f
(−)
i
+ f
(+)
i
,
and wish to deﬁne the numerical ﬂux as
F
n
i −1/2
= f
(+)
i −1
+ f
(−)
i
, (4.57)
84 4 Finite Volume Methods
then we can deﬁne the corresponding ﬂuctuations as
A
−
Q
i −1/2
= f
(−)
i
− f
(−)
i −1
,
A
+
Q
i −1/2
= f
(+)
i
− f
(+)
i −1
,
(4.58)
to obtain a ﬂuxdifference splitting that satisﬁes (4.54) and again yields F
n
i −1/2
via the
formula (4.55). Fluxvector splittings for nonlinear problems are discussed in Section 15.7.
4.14 Roe’s Method
For a constantcoefﬁcient linear problem there is yet another way to rewrite the ﬂux F
n
i −1/2
appearing in (4.49), (4.50), and (4.56), which relates it directly to the unstable naive av
eraging of AQ
i −1
and AQ
i
given in (4.18). Averaging the expressions (4.49) and (4.50)
gives
F
n
i −1/2
=
1
2
(AQ
i −1
+ AQ
i
) −
m
p=1
[(λ
p
)
+
−(λ
p
)
−
]W
p
i −1/2
. (4.59)
Notice that λ
+
−λ
−
= λ. Deﬁne the matrix  A by
 A = RR
−1
, where  = diag(λ
p
). (4.60)
Then (4.59) becomes
F
n
i −1/2
=
1
2
(AQ
i −1
+ AQ
i
) −
1
2
 A(Q
i
− Q
i −1
)
=
1
2
[ f (Q
i −1
) + f (Q
i
)] −
1
2
 A(Q
i
− Q
i −1
). (4.61)
This can be viewed as the arithmetic average plus a correction term that stabilizes the
method.
For the constantcoefﬁcient linear problem this is simply another way to rewrite the
Godunov or upwind ﬂux, but this form is often seen in extensions to nonlinear problems
based on approximate Riemann solvers, as discussed in Section 15.3. This form of the ﬂux
is often called Roe’s method in this connection. This formulation is also useful in studying
the numerical dissipation of the upwind method.
Using the ﬂux (4.61) in the ﬂuxdifferencing formula (4.4) gives the following updating
formula for Roe’s method on a linear system:
Q
n+1
i
= Q
n
i
−
1
2
t
x
A
Q
n
i +1
− Q
n
i −1
−
1
2
t
x
m
p=1
λ
p
W
p
i +1/2
−λ
p
W
p
i −1/2
. (4.62)
Exercises 85
This can also be derived directly from (4.41) by noting that another way to express (4.40) is
λ
+
=
1
2
(λ +λ), λ
−
=
1
2
(λ −λ). (4.63)
We will see in Section 12.3 that for nonlinear problems it is sometimes useful to modify
these deﬁnitions of λ
±
.
Exercises
4.1. (a) Determine the matrices A
+
and A
−
as deﬁned in (4.45) for the acoustics equa
tions (2.50).
(b) Determine the waves W
1
i −1/2
and W
2
i −1/2
that result from arbitrary data Q
i −1
and Q
i
for this system.
4.2. If we apply the upwind method (4.25) to the advection equation q
t
+ ¯ uq
x
= 0 with
¯ u > 0, and choose the time step so that ¯ u t = x, then the method reduces to
Q
n+1
i
= Q
n
i −1
.
The initial data simply shifts one grid cell each time step and the exact solution is
obtained, up to the accuracy of the initial data. (If the data Q
0
i
is the exact cell average
of q
◦
(x), then the numerical solution will be the exact cell average for every step.)
This is a nice property for a numerical method to have and is sometimes called the
unit CFL condition.
(a) Sketch ﬁgures analogous to Figure 4.5(a) for this case to illustrate the wave
propagation interpretation of this result.
(b) Does the Lax–Friedrichs method (4.20) satisfy the unit CFL condition? Does
the twostep Lax–Wendroff method of Section 4.7?
(c) Show that the exact solution (in the same sense as above) is also obtained for
the constantcoefﬁcient acoustics equations (2.50) with u
0
= 0 if we choose
the time step so that c t = x and apply Godunov’s method. Determine the
formulas for p
n+1
i
and u
n+1
i
that result in this case, and show how they are
related to the solution obtained from characteristic theory.
(d) Is it possible to obtain a similar exact result by a suitable choice of t in the
case where u
0
= 0 in acoustics?
4.3. Consider the following method for the advection equation with ¯ u > 0:
Q
n+1
i
= Q
n
i
−
Q
n
i
− Q
n
i −1
−
¯ u t −x
x
Q
n
i −1
− Q
n
i −2
= Q
n
i −1
−
¯ u t
x
−1
Q
n
i −1
− Q
n
i −2
. (4.64)
(a) Show that this method results from a wavepropagation algorithm of the sort
illustrated in Figure 4.5(a) in the case where x ≤ ¯ u t ≤ 2 x, so that each
wave propagates all the way through the adjacent cell and part way through the
next.
86 4 Finite Volume Methods
(b) Give an interpretation of this method based on linear interpolation, similar to
what is illustrated in Figure 4.4(a).
(c) Show that this method is exact if ¯ u t /x = 1 or ¯ u t /x = 2.
(d) For what range of Courant numbers is the CFL condition satisﬁed for this
method? (See also Exercise 8.6.)
(e) Determine a method of this same type that works if each wave propagates
through more than two cells but less than three, i.e., if 2 x ≤ ¯ u t ≤ 3 x.
Largetimestep methods of this type can also be applied, with limited success, to
nonlinear problems, e.g., [42], [181], [274], [275], [279], [316].
5
Introduction to the CLAWPACK Software
The basic class of ﬁnite volume methods developed in this book has been implemented in
the software package CLAWPACK. This allows these algorithms to be applied to a wide va
riety of hyperbolic systems simply by providing the appropriate Riemann solver, along
with initial data and boundary conditions. The highresolution methods introduced in
Chapter 6 are implemented, but the simple ﬁrstorder Godunov method of Chapter 4 is
obtained as a special case by setting the input parameters appropriately. (Speciﬁcally, set
method(2)=1 as described below.) In this chapter an overview of the software is given
along with examples of its application to simple problems of advection and acoustics.
The software includes more advancedfeatures that will be introducedlater inthe book, and
can solve linear and nonlinear problems in one, two, and three space dimensions, as well as
allowing the speciﬁcation of capacity functions introduced in Section 2.4 (see Section 6.16)
and source terms (see Chapter 17). CLAWPACK is used throughout the book to illustrate
the implementation and behavior of various algorithms and their application on different
physical systems. Nearly all the computational results presented have been obtained using
CLAWPACK with programs that can be downloaded to reproduce these results or investigate
the problems further. These samples also provide templates that can be adapted to solve
other problems. See Section 1.5 for details on how to access webpages for each example.
Only the onedimensional software is introduced here. More extensive documentation,
including discussion of the multidimensional software and adaptive mesh reﬁnement capa
bilities, can be downloaded from the webpage
http://www.amath.washington.edu/~claw/
See also the papers [283], [257] for more details about the multidimensional algorithms,
and [32] for a discussion of some features of the adaptive mesh reﬁnement code.
5.1 Basic Framework
In one space dimension, the CLAWPACK routine claw1 (or the simpliﬁed version claw1ez)
can be used to solve a system of equations of the form
κ(x)q
t
+ f (q)
x
= ψ(q, x, t ), (5.1)
87
88 5 Introduction to the CLAWPACK Software
where q =q(x, t ) ∈ R
m
. The standard case of a homogeneous conservation law has κ ≡ 1
and ψ ≡ 0,
q
t
+ f (q)
x
= 0. (5.2)
The ﬂux function f (q) can also depend explicitly on x and t as well as on q. Hyperbolic
systems that are not in conservation form, e.g.,
q
t
+ A(x, t )q
x
= 0, (5.3)
can also be solved.
The basic requirement on the homogeneous system is that it be hyperbolic in the sense
that a Riemann solver can be speciﬁed that, for any two states Q
i −1
and Q
i
, returns a set of
M
w
waves W
p
i −1/2
and speeds s
p
i −1/2
satisfying
M
w
p=1
W
p
i −1/2
= Q
i
− Q
i −1
≡ Q
i −1/2
.
The Riemann solver must also return a leftgoing ﬂuctuation A
−
Q
i −1/2
and a rightgoing
ﬂuctuation A
+
Q
i −1/2
. In the standard conservative case (5.2) these should satisfy
A
−
Q
i −1/2
+A
+
Q
i −1/2
= f (Q
i
) − f (Q
i −1
) (5.4)
and the ﬂuctuations then deﬁne a ﬂuxdifference splitting as described in Section 4.13.
Typically
A
−
Q
i −1/2
=
p
s
p
i −1/2
−
W
p
i −1/2
, A
+
Q
i −1/2
=
p
s
p
i −1/2
+
W
p
i −1/2
, (5.5)
where s
−
= min(s, 0) and s
+
= max(s, 0). In the nonconservative case (5.3), there is no
ﬂux function f (q), and the constraint (5.4) need not be satisﬁed.
Only the ﬂuctuations are used for the ﬁrstorder Godunov method, which is implemented
in the form introduced in Section 4.12,
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
, (5.6)
assuming κ ≡ 1.
The Riemann solver must be supplied by the user in the form of a subroutine rp1, as
described below. Typically the Riemann solver ﬁrst computes waves and speeds and then
uses these to compute A
+
Q
i −1/2
and A
−
Q
i −1/2
internally in the Riemann solver. The
waves and speeds must also be returned by the Riemann solver in order to use the high
resolution methods described in Chapter 6. These methods take the form
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
, (5.7)
where
˜
F
i −1/2
=
1
2
m
p=1
s
p
i −1/2
1 −
t
x
s
p
i −1/2
W
p
i −1/2
. (5.8)
5.3 Getting Started 89
Here
W
p
i −1/2
represents a limited version of the wave W
p
i −1/2
, obtained by comparing W
p
i −1/2
to W
p
i −3/2
if s
p
> 0 or to W
p
i +1/2
if s
p
<0.
When a capacity function κ(x) is present, the Godunov method becomes
Q
n+1
i
= Q
n
i
−
t
κ
i
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
, (5.9)
See Section 6.16 for discussion of this algorithm and its extension to the highresolution
method.
If the equation has a source term, a routine src1 must also be supplied that solves the
sourceterm equation q
t
=ψ(q, κ) over a time step. A fractionalstep method is used to
couple this with the homogeneous solution, as described in Chapter 17. Boundary condi
tions are imposed by setting values in ghost cells each time step, as described in Chapter 7.
A few standard boundary conditions are implemented in a library routine, but this can be
modiﬁed to impose other conditions; see Section 5.4.4.
5.2 Obtaining CLAWPACK
The latest version of CLAWPACK can be downloaded from the web, at
http://www.amath.washington.edu/~claw/
Go to “download software” and select the portion you wish to obtain. At a minimum, you
will need
claw/clawpack
If you plan to use Matlab to plot results, some useful scripts are in
claw/matlab
Other plotting packages can also be used, but you will have to ﬁgure out how to properly
read in the solution produced by CLAWPACK.
The basic CLAWPACK directories 1d, 2d, and 3d each contain one or two examples in
directories such as
claw/1d/example1
that illustrate the basic use of CLAWPACK. The directory
claw/book
contains drivers and data for all the examples presented in this book. You can download this
entire directory or selectively download speciﬁc examples as you need them. Some other
applications of CLAWPACK can be found in
claw/applications
5.3 Getting Started
The discussion here assumes you are using the Unix (or Linux) operating system. The Unix
prompt is denoted by unix>.
90 5 Introduction to the CLAWPACK Software
5.3.1 Creating the Directories
The ﬁles you download will be gzipped tar ﬁles. Before installing any of CLAWPACK, you
should create a directory named <path>/claw where the pathname <path> depends on
where you want these ﬁles to reside and the local naming conventions on your computer.
You should download any CLAWPACK or claw/book ﬁles to this directory. After down
loading any ﬁle of the form name.tar.gz, execute the following commands:
unix> gunzip name.tar.gz
unix> tar xvf name.tar
This will create the appropriate subdirectories within <path>/claw.
5.3.2 Environment variables for the path
You should now set the environment variable CLAW in Unix so that the proper ﬁles can be
found:
unix> setenv CLAW <path>/claw
You might want to put this line in your .cshrc ﬁle so it will automatically be executed
when you log in or create a new window. Now you can refer to $CLAW/clawpack/1d, for
example, and reach the correct directory.
5.3.3 Compiling the code
Go to the directory claw/clawpack/1d/example1. There is a ﬁle in this directory named
compile, which should be executable so that you can type
unix> compile
This should invoke f77 to compile all the necessary ﬁles and create an executable called
xclaw. To run the program, type
unix> xclaw
and the program should run, producing output ﬁles that start with fort. In particular,
fort.q0000 contains the initial data, and fort.q0001 the solution at the ﬁrst output time.
The ﬁle fort.info has some information about the performance of CLAWPACK.
5.3.4 Makeﬁles
The compile ﬁle simply compiles all of the routines needed to run CLAWPACK on this
example. This is simple, but if you make one small change in one routine, then everything
has to be recompiled. Instead it is generally easier to use a Makefile, which speciﬁes what
set of object ﬁles (ending with .o) are needed to make the executable, and which Fortran
ﬁles (ending with .f) are needed to make the object ﬁles. If a Fortran ﬁle is changed, then it
is only necessary to recompile this one rather than everything. This is done simply by typing
unix> make
5.4 Using CLAWPACK – a Guide through example1 91
Acomplication arises in that the example1 directory only contains a fewof the necessary
Fortran ﬁles, the ones speciﬁc to this particular problem. All the standard CLAWPACK ﬁles
are in the directory claw/clawpack/1d/lib. You should ﬁrst go into that directory and
type make to create the object ﬁles for these library routines. This only needs to be done
once if these ﬁles are never changed. Nowgo to the example1 directory and also type make.
Again an executable named xclaw should be created. See the comments at the start of the
Makefile for some other options.
5.3.5 Matlab Graphics
If you wish to use Matlab to view the results, you should download the directory
claw/matlab and then set the environment variable
unix> setenv MATLABPATH ".:\$CLAW/matlab"
before starting Matlab, in order to add this directory to your Matlab search path. This
directory contains the plotting routines plotclaw1.m and plotclaw2.m for plotting results
in one and two dimensions respectively.
With Matlab running in the example1 directory, type
Matlab> plotclaw1
tosee the results of this computation. Youshouldsee a pulse advectingtothe right withveloc
ity 1, and wrapping around due to the periodic boundary conditions applied in this example.
5.4 Using CLAWPACK – a Guide through example1
The program in claw/clawpack/1d/example1 solves the advection equation
q
t
+uq
x
= 0
with constant velocity u = 1 and initial data consisting of a Gaussian hump
q(x, 0) = exp(−β(x −0.3)
2
). (5.10)
The parameters u = 1 and β = 200 are speciﬁed in the ﬁle setprob.data. These values
are read in by the routine setprob.f described in Section 5.5.
5.4.1 The Main Program (driver.f)
The main program is located in the ﬁle driver.f. It simply allocates storage for the arrays
needed in CLAWPACK and then calls claw1ez, described below. Several parameters are set
and used to declare these arrays. The proper values of these parameters depends on the
particular problem. They are:
maxmx: The maximum number of grid cells to be used. (The actual number mx is later
read in from the input ﬁle claw1ez.data and must satisfy mx ≤ maxmx.)
meqn: The number of equations in the hyperbolic system, e.g., meqn = 1 for a scalar
equation, meqn = 2 for the acoustics equations (2.50), etc.
92 5 Introduction to the CLAWPACK Software
mwaves: The number of waves produced in each Riemann solution, called M
w
in the
text. Often mwaves = meqn, but not always.
mbc: The number of ghost cells used for implementing boundary conditions, as de
scribed in Chapter 7. Setting mbc = 2 is sufﬁcient unless changes have been made to
the CLAWPACK software resulting in a larger stencil.
mwork: A work array of dimension mwork is used internally by CLAWPACK for various
purposes. How much space is required depends on the other parameters:
mwork ≥(maxmx + 2
*
mbc)
*
(2 + 4
*
meqn + mwaves + meqn
*
mwaves)
If the value of mwork is set too small, CLAWPACK will halt with an error message telling
how much space is required.
maux: The number of “auxiliary” variables needed for information specifying the prob
lem, which is used in declaring the dimensions of the array aux (see below).
Three arrays are declared in driver.f:
q(1mbc:maxmx+mbc, meqn): This array holds the approximation Q
n
i
(a vector with
meqn components) at each time t
n
. The value of i ranges from 1 to mx where mx
<= maxmx is set at run time from the input ﬁle. The additional ghost cells numbered
(1mbc):0 and (mx+1):(mx+mbc) are used in setting boundary conditions.
work(mwork): Used as work space.
aux(1mbc:maxmx+mbc, maux): Used for auxiliary variables if maux > 0. For ex
ample, in a variablecoefﬁcient advection problem the velocity in the i th cell might be
stored in aux(i,1). See Section 5.6 for an example and more discussion. If maux = 0,
then there are no auxiliary variables, and aux can simply be declared as a scalar or not
declared at all, since this array will not be referenced.
5.4.2 The Initial Conditions (qinit.f)
The subroutine qinit.f sets the initial data in the array q. For a system with meqn com
ponents, q(i,m) should be initialized to a cell average of the mth component in the ith
grid cell. If the data is given by a smooth function, then it may be simplest to evaluate this
function just at the center of the cell, which agrees with the cell average to O((x)
2
). The
left edge of the cell is at xlower + (i1)*dx, and the right edge is at xlower + i*dx. It is
only necessary to set values in cells i = 1:mx, not in the ghost cells. The values of xlower,
dx, and mx are passed into qinit.f, having been set in claw1ez.
5.4.3 The claw1ez Routine
The main program driver.f sets up array storage and then calls the subroutine claw1ez,
which is located in claw/clawpack/1d/lib, along with other standard CLAWPACK sub
routines described below. The claw1ez routine provides an easy way to use CLAWPACK
that should sufﬁce for many applications. It reads input data from a ﬁle claw1ez.data,
which is assumed to be in a standard formdescribed below. It also makes other assumptions
about what the user is providing and what type of output is desired. After checking the
5.4 Using CLAWPACK – a Guide through example1 93
inputs for consistency, claw1ez calls the CLAWPACK routine claw1 repeatedly to produce
the solution at each desired output time.
The claw1 routine (located in claw/clawpack/1d/lib/claw1.f) is much more gen
eral and can be called directly by the user if more ﬂexibility is needed. See the documentation
in the source code for this routine.
5.4.4 Boundary Conditions
Boundary conditions must be set in every time step, and claw1 calls a subroutine bc1 in
every step to accomplish this. The manner in which this is done is described in detail in
Chapter 7. For many problems the choice of boundary conditions provided in the default
routine claw/clawpack/1d/lib/bc1.f will be sufﬁcient. For other boundary conditions
the user must provide an appropriate routine. This can be done by copying the bc1.f routine
to the application directory and modifying it to insert the appropriate boundary conditions
at the points indicated.
When using claw1ez, the claw1ez.data ﬁle contains parameters specifying what
boundary condition is to be used at each boundary (see Section 5.4.6, where the mthbc
array is described).
5.4.5 The Riemann Solver
The ﬁle claw/clawpack/1d/example1/rp1ad.f contains the Riemann solver, a sub
routine that should be named rp1 if claw1ez is used. (More generally the name of the
subroutine can be passed as an argument to claw1.) The Riemann solver is the crucial
usersupplied routine that speciﬁes the hyperbolic equation being solved. The input data
consists of two arrays ql and qr. The value ql(i,:) is the value Q
L
i
at the left edge of
the i th cell, while qr(i,:) is the value Q
R
i
at the right edge of the i th cell, as indicated in
Figure 5.1. Normally ql = qr and both values agree with Q
n
i
, the cell average. More ﬂexibil
ity is allowed because in some applications, or in adapting CLAWPACKto implement different
algorithms, it is useful to allow different values at each edge. For example, we might want
to deﬁne a piecewise linear function within the grid cell as illustrated in Figure 5.1 and
x
i−1/2
Q
i
Q
i−1
Q
L
i
Q
R
i−1
Fig. 5.1. The states used in solving the Riemann problem at the interface x
i −1/2
.
94 5 Introduction to the CLAWPACK Software
then solve the Riemann problems between these values. This approach to highresolution
methods is discussed in Section 10.1.
Note that the Riemann problem at the interface x
i −1/2
between cells i −1 and i has data
left state: Q
R
i −1
= qr(i −1, :),
right state: Q
L
i
= ql(i, :).
(5.11)
This notation is potentially confusing in that normally we use q
l
to denote the left state and
q
r
to denote the right state in specifying Riemann data. The routine rp1 must solve the
Riemann problem for each value of i, and return the following:
amdq(i,1:meqn), the vector A
−
Q
i −1/2
containing the leftgoing ﬂuctuation as
described in Section 4.12.
apdq(i,1:meqn), the vector A
+
Q
i −1/2
containing the rightgoing ﬂuctuation as
described in Section 4.12.
wave(i,1:meqn,p), the vector W
p
i −1/2
representing the jump in q across the pth wave in
the Riemann solution at x
i −1/2
, for p = 1, 2, . . . , mwaves. (In the code mw is typically
used in place of p.)
s(i,p), the wave speed s
p
i −1/2
for each wave.
For Godunov’s method, only the ﬂuctuations amdq and apdq are actually used, and the
update formula (5.6) is employed. The waves and speeds are only used for highresolution
correction terms as described in Chapter 6.
For the advection equation, the Riemann solver in example1 returns
wave(i, 1, 1) = ql(i) −qr(i −1),
s(i, 1) = u,
amdq(i, 1) = min(u, 0)∗wave(i, 1, 1),
apdq(i, 1) = max(u, 0)∗wave(i, 1, 1).
Sample Riemann solvers for a variety of other applications can be found in claw/book
and claw/applications. Often these can be used directly rather than writing a new
Riemann solver.
5.4.6 The Input File claw1ez.data
The claw1ez routine reads data froma ﬁle named claw1ez.data. Figure 5.2 shows the ﬁle
from example1. Typically one value is read from each line of this ﬁle. Any text following
this value on each line is not read and is there simply as documentation. The values read are:
mx: The number of grid cells for this computation. (Must have mx < maxmx, where
maxmx is set in driver.f.)
nout: Number of output times at which the solution should be written out.
outstyle: There are three possible ways to specify the output times. This parameter
selects the desired manner to specify the times, and affects what is required next.
outstyle = 1: The next line contains a single value tfinal. The computation should
proceed to this time, and the nout outputs will be at times t0 + (tfinal 
t0)/nout, where the initial time t0 is set below.
5.4 Using CLAWPACK – a Guide through example1 95
50 mx = cells in x direction
11 nout = number of output times to print results
1 outstyle = style of specifying output times
2.2d0 tfinal = final time
0.1d0 dtv(1) = initial dt (used in all steps if method(1)=0)
1.0d99 dtv(2) = max allowable dt
1.0d0 cflv(1) = max allowable Courant number
0.9d0 cflv(2) = desired Courant number
500 nv(1) = max number of time steps per call to claw1
1 method(1) = 1 for variable dt
2 method(2) = order
0 method(3) = not used in one dimension
1 method(4) = verbosity of output
0 method(5) = source term splitting
0 method(6) = mcapa
0 method(7) = maux (should agree with parameter in driver)
1 meqn = number of equations in hyperbolic system
1 mwaves = number of waves in each Riemann solution
3 mthlim(mw) = limiter for each wave (mw=1,mwaves)
0.d0 t0 = initial time
0.0d0 xlower = left edge of computational domain
1.0d0 xupper = right edge of computational domain
2 mbc = number of ghost cells at each boundary
2 mthbc(1) = type of boundary conditions at left
2 mthbc(2) = type of boundary conditions at right
Fig. 5.2. A typical claw1ez.data ﬁle, from claw/clawpack/1d/example1 for advection.
outstyle = 2: The next line(s) contain a list of nout times at which the outputs are
desired. The computation will end when the last of these times is reached.
outstyle = 3: The next line contains two values
nstepout, nsteps
A total of nsteps time steps will be taken, with output after every nstepout time
steps. The value of nout is ignored. This is most useful if you want to insure that
time steps of maximum length are always taken with a desired Courant number.
With the other output options, the time steps are adjusted to hit the desired times
exactly. This option is also useful for debugging if you want to force the solution to
be output every time step, by setting nstepout = 1.
dtv(1): The initial value of t used in the ﬁrst time step. If method(1) = 0 below, then
ﬁxedsize time steps are used and this is the value of t in all steps. In this case t
must divide the time increment between all requested outputs an integer number of
times.
dtv(2): The maximum time step t to be allowed in any step (in the case where
method(1) = 1 and variable t is used). Variable time steps are normally chosen
96 5 Introduction to the CLAWPACK Software
based on the Courant number, and this parameter can then simply be set to some very
large value so that it has no effect. For some problems, however, it may be necessary to
restrict the time step to a smaller value based on other considerations, e.g., the behavior
of source terms in the equations.
cflv(1): The maximum Courant number to be allowed. The Courant number is calcu
lated after all the Riemann problems have been solved by determining the maximum
wave speed seen. If the Courant number is no larger than cflv(1), then this step is
accepted. If the Courant number is larger, then:
method(1)=0: (ﬁxed time steps), the calculation aborts.
method(1)=1: (variable time steps), the step is rejected and a smaller time step is
taken.
Usually cflv(1) = 1 can be used.
cflv(2): The desired Courant number for this computation. Used only if method(1)=1
(variable time steps). In each time step, the next time increment t is based on the
maximum wave speed found in solving all Riemann problems in the previous time
step. If the wave speeds do not change very much, then this will lead to roughly the
desired Courant number. It’s typically best to take cflv(2) to be slightly smaller than
cflv(1), say cflv(2) = 0.9.
nv(1): The maximum number of time steps allowed in any single call to claw1. This
is provided as a precaution to avoid too lengthy runs.
method(1): Tells whether ﬁxed or variable size time steps are to be used.
method(1) = 0: A ﬁxed time step of size dtv(1) will be used in all steps.
method(1) = 1: CLAWPACKwill automatically select the time step as described above,
based on the desired Courant number.
method(2): The order of the method.
method(2) = 1: The ﬁrstorder Godunov’s method described in Chapter 4 is used.
method(2) = 2: Highresolution correction terms are also used, as described in
Chapter 6.
method(3): This parameter is not used in one space dimension. In two and three di
mensions it is used to further specify which highorder correction terms are applied.
method(4): This controls the amount of output printed by claw1 on the screen as
CLAWPACK progresses.
method(4) = 0: Information is printed only when output ﬁles are created.
method(4) = 1: Every time step the value t and Courant number are reported.
method(5): Tells whether there is a source term in the equation. If so, then a fractional
step method is used as described in Chapter 17. Time steps on the homogeneous
hyperbolic equation are alternated with time steps on the source term. The solution
operator for the source terms must be provided by the user in the routine src1.f.
method(5) = 0: There is no source term. In this case the default routine
claw/clawpack/1d/lib/src1.f can be used, which does nothing, and in fact
this routine will never be called.
method(5) = 1: A source term is speciﬁed in src1.f, and the ﬁrstorder (Godunov)
fractionalstep method should be used.
method(5) = 2: A source term is speciﬁed in src1.f, and a Strang splitting is used.
The Godunov splitting is generally recommended rather than the Strang splitting, for
reasons discussed in Chapter 17.
5.4 Using CLAWPACK – a Guide through example1 97
method(6): Tells whether there is a “capacity function” in the equation, as introduced
in Section 2.4.
method(6) = 0: No capacity function; κ ≡ 1 in (2.27).
method(6) = mcapa > 0: There is a capacity function, and the value of κ in the i th
cell is given by aux(i,mcapa), i.e., the mcapa component of the aux array is used
to store this function. In this case capacityform differencing is used, as described
in Section 6.16.
method(7): Tells whether there are any auxiliary variables stored in an aux array.
method(7) = 0: No auxiliary variables. In this case the array aux is not referenced
and can be a dummy variable.
method(7) = maux > 0: There is an aux array with maux components. In this case
the array must be properly declared in driver.f.
Note that we must always have maux ≥ mcapa. The value of method(7) speciﬁed
here must agree with the value of maux set in driver.f.
meqn: The number of equations in the hyperbolic system. This is also set in driver.f
and the two should agree.
mwaves: The number of waves in each Riemann solution. This is often equal to meqn
but need not be. This is also set in driver.f, and the two should agree.
mthlim(1:mwaves): The limiter to be applied in each wave family as described in
Chapter 6. Several different limiters are provided in CLAWPACK [see (6.39)]:
mthlim(mw) = 0: No limiter (Lax–Wendroff)
mthlim(mw) = 1: Minmod
mthlim(mw) = 2: Superbee
mthlim(mw) = 3: van Leer
mthlim(mw) = 4: MC (monotonized centered)
Other limiters can be added by modifying the routine
claw/clawpack/1d/lib/philim.f, which is called by
claw/clawpack/1d/lib/limiter.f.
t0: The initial time.
xlower: The left edge of the computational domain.
xupper: The right edge of the computational domain.
mbc: The number of ghost cells used for setting boundary conditions. Usually mbc = 2 is
used. See Chapter 7.
mthbc(1): The type of boundary condition to be imposed at the left boundary. See
Chapter 7 for more description of these and how they are implemented. The following
values are recognized:
mthbc(1) = 0: The user will specify a boundary condition. In this case you must copy
the ﬁle claw/clawpack/1d/lib/bc1.f to your application directory and modify
it to insert the proper boundary conditions in the location indicated.
mthbc(1) = 1: Zeroorder extrapolation.
mthbc(1) = 2: Periodic boundary conditions. In this case you must also set
mthbc(2) = 2.
mthbc(1) = 3: Solid wall boundary conditions. This set of boundary conditions only
makes sense for certain systems of equations; see Section 7.3.3.
mthbc(2): The type of boundary condition to be imposed at the right boundary. The
same values are recognized as described above.
98 5 Introduction to the CLAWPACK Software
5.5 Other UserSupplied Routines and Files
Several other routines may be provided by the user but are not required. In each case there
is a default version provided in the library claw/clawpack/1d/lib that does nothing
but return. If you wish to provide a version, copy the library version to the application
directory, modify it as required, and also modify the Makefile to point to the modiﬁed
version rather than to the library version.
setprob.f The claw1ez routine always calls setprob at the beginning of execution.
The user can provide a subroutine that sets any problemspeciﬁc parameters or does
other initialization. For the advection problem solved in example1, this is used to
set the advection velocity u. This value is stored in a common block so that it can be
passed into the Riemann solver, where it is required. The parameter beta is also set and
passed into the routine qinit.f for use in setting the initial data according to (5.10).
When claw1ez is used, a setprob subroutine must always be provided. If there is
nothing to be done, the default subroutine claw/clawpack/1d/lib/setprob.f can
be used, which does nothing but return.
setaux.f The claw1ez routine calls a subroutine setaux before the ﬁrst call to claw1.
This routine should set the array aux to contain any necessary data used in specifying
the problem. For the example inexample1noauxarrayis used(maux = 0indriver.f)
and the default subroutine claw/clawpack/1d/lib/setaux.f is speciﬁed in the
Makefile.
b4step1.f Within claw1 there is a call to a routine b4step1 before each call to step1
(the CLAWPACK routine that actually takes a single time step). The user can supply a
routine b4step1inplace of the default routine claw/clawpack/1d/lib/b4step1.f
in order to performadditional tasks that might be required each time step. One example
might be to modify the aux array values each time step, as described in Section 5.6.
src1.f If the equation includes a source term ψ as in (5.1), then a routine src1 must
be provided in place of the default routine claw/clawpack/1d/lib/src1.f. This
routine must solve the equation q
t
=ψ over one time step. Often this requires solving
an ordinary differential equation in each grid cell. In some cases a partial differential
equation must be solved, for example if diffusive terms are included with ψ = q
xx
,
then the diffusion equation must be solved over one time step.
5.6 Auxiliary Arrays and setaux.f
The array q(i,1:meqn) contains the ﬁnitevolume solution in the i th grid cell. Often
other arrays deﬁned over the grid are required to specify the problem in the ﬁrst place. For
example, in a variablecoefﬁcient advection problem
q
t
+u(x)q
x
=0
the Riemann solution at any cell interface x
i −1/2
depends on the velocities u
i −1
and u
i
.
The aux array can be used to store these values and pass them into the Riemann solver.
In the advection example we need only one auxiliary variable, so maux = 1 and we store
the velocity u
i
in aux(i,1). See Chapter 9 for more discussion of variablecoefﬁcient
problems.
Exercises 99
Of course one could hardwire the speciﬁc function u(x) into the Riemann solver or pass
it in using a common block, but the use of the auxiliary arrays gives a uniform treatment of
such data arrays. This is useful in particular when adaptive mesh reﬁnement is applied, in
which case there are many different q grids covering different portions of the computational
domain and it is very convenient to have an associated aux array corresponding to each.
The claw1ez routine always calls a subroutine setaux before beginning the compu
tation. This routine, normally stored in setaux.f, should set the values of all auxiliary
arrays. If maux = 0 then the default routine claw/clawpack/1d/lib/setaux.f can be
used, which does nothing. See Section 5.6 for an example of the use of auxiliary arrays.
In some problems the values stored in the aux arrays must be timedependent, for
example in an advection equation of the form q
t
+ u(x, t )q
x
=0. The routine setaux
is called only once at the beginning of the computation and cannot be used to mod
ify values later. The user can supply a routine b4step1 in place of the default routine
claw/clawpack/1d/lib/b4step1.f in order to modify the aux array values each time
step.
5.7 An Acoustics Example
The directory claw/clawpack/1d/example2 contains a sample code for the constant
coefﬁcient acoustics equations (2.50). The values of the density and bulk modulus are set
in setprob.f (where they are read in from a data ﬁle setprob.data). In this routine
the sound speed and impedance are also computed and passed to the Riemann solver in a
common block. The Riemann solver uses the formulas (3.31) to obtain α
1
and α
2
, and then
the waves are W
p
=α
p
r
p
. The boundary conditions are set for a reﬂecting wall at x =−1
and nonreﬂecting outﬂow at x =1.
Exercises
The best way to do these exercises, or more generally to use CLAWPACK on a new problem,
is to copy an existing directory to a new directory with a unique name and modify the
routines in that new directory.
5.1. The example in claw/clawpack/1d/example2 has method(2)=2 set in
claw1ez.data, and hence uses a highresolution method. Set method(2)=1 to
use the upwind method instead, and compare the computed results.
5.2. Modify the data from Exercise 5.1 to take time steps for which the Courant number
is 1.1. (You must change both cflv(1) and cflv(2) in claw1ez.data.) Observe
that the upwind method is unstable in this case.
5.3. The initial data in claw/clawpack/1d/example2/qinit.f has q
2
(x, 0) = 0 and
hence the initial pressure pulse splits into left going and right going pulses. Modify
q
2
(x, 0) so that the initial pulse is purely left going.
6
HighResolution Methods
In Chapter 4 we developed the basic ideas of Godunov’s method, an upwind ﬁnite vol
ume method for hyperbolic systems, in the context of constantcoefﬁcient linear systems.
Godunov’s method is only ﬁrstorder accurate and introduces a great deal of numerical
diffusion, yielding poor accuracy and smeared results, as can be seen in Figure 6.1(a), for
example. In this chapter we will see howthis method can be greatly improved by introducing
correction terms into (4.43), to obtain a method of the form
Q
n+1
i
= Q
i
−
t
x
A
+
Q
i −1/2
+ A
−
Q
i +1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
. (6.1)
The ﬂuxes
˜
F
i −1/2
are based on the waves resulting from the Riemann solution, which have
already been computed in the process of determining the ﬂuctuations A
±
Q
i −1/2
. The
basic form of these correction terms is motivated by the Lax–Wendroff method, a standard
secondorder accurate method described in the next section. The addition of crucial limiters
leads to great improvement, as discussed later in this chapter.
6.1 The Lax–Wendroff Method
The Lax–Wendroff method for the linear system q
t
+ Aq
x
= 0 is based on the Taylor series
expansion
q(x, t
n+1
) = q(x, t
n
) +t q
t
(x, t
n
) +
1
2
(t )
2
q
t t
(x, t
n
) +· · · . (6.2)
From the differential equation we have that q
t
= −Aq
x
, and differentiating this gives
q
t t
= −Aq
xt
= A
2
q
xx
,
where we have used q
xt
= q
t x
= (−Aq
x
)
x
. Using these expressions for q
t
and q
t t
in (6.2)
gives
q(x, t
n+1
) = q(x, t
n
) −t Aq
x
(x, t
n
) +
1
2
(t )
2
A
2
q
xx
(x, t
n
) +· · · . (6.3)
100
6.1 The Lax–Wendroff Method 101
(a)
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Upwind at t=1
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Upwind at t = 5
(b)
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Lax–Wendroff at t = 1
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Lax–Wendroff at t = 5
(c)
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Beam–Warming at t = 1
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Beam–Warming at t = 5
Fig. 6.1. Tests on the advection equation with different linear methods. Results at time t =1 and t =5
are shown, corresponding to 1 and 5 revolutions through the domain in which the equation q
t
+q
x
=0
is solved with periodic boundary conditions: (a) upwind, (b) Lax–Wendroff, (c) Beam–Warming.
[claw/book/chap6/compareadv]
Keeping only the ﬁrst three terms on the righthand side and replacing the spatial derivatives
by central ﬁnite difference approximations gives the Lax–Wendroff method,
Q
n+1
i
= Q
n
i
−
t
2 x
A
Q
n
i +1
− Q
n
i −1
+
1
2
t
x
2
A
2
Q
n
i −1
−2Q
n
i
+ Q
n
i +1
. (6.4)
By matching three terms in the Taylor series and using centered approximations, we obtain
a secondorder accurate method.
This derivation of the method is based on a ﬁnite difference interpretation, with Q
n
i
approximating the pointwise value q(x
i
, t
n
). However, we can reinterpret (6.4) as a ﬁnite
102 6 HighResolution Methods
volume method of the form (4.4) with the ﬂux function
F
n
i −1/2
=
1
2
A
Q
n
i −1
+ Q
n
i
−
1
2
t
x
A
2
Q
n
i
− Q
n
i −1
. (6.5)
Note that this looks like the unstable averaged ﬂux (4.18) plus a diffusive ﬂux, but that the
diffusion chosen exactly matches what appears in the Taylor series expansion (6.3). Indeed,
this shows why the averaged ﬂux (4.18) alone is unstable – the Taylor series expansion for
the true solution contains a diffusive q
xx
term that is missing from the numerical method
when the unstable ﬂux is used.
To compare the typical behavior of the upwind and Lax–Wendroff methods, Figure 6.1
shows numerical solutions to the scalar advection equation q
t
+q
x
=0, which is solved on
the unit interval up to time t = 1 with periodic boundary conditions. Hence the solution
should agree with the initial data, translated back to the initial location. The data, shown as a
solid line in each plot, consists of both a smooth pulse and a squarewave pulse. Figure 6.1(a)
shows the results when the upwind method is used. Excessive dissipation of the solution
is evident. Figure 6.1(b) shows the results when the Lax–Wendroff method is used instead.
The smooth pulse is captured much better, but the square wave gives rise to an oscillatory
solution. This can be explained in terms of the Taylor series expansion (6.2) as follows.
By matching the ﬁrst three terms in the series expansion, the dominant error is given by
the next term, q
t t t
= −A
3
q
xxx
. This is a dispersive term, which leads to oscillations, as
explained in more detail in Section 8.6 where modiﬁed equations are discussed. In this
chapter we will see a different explanation of these oscillations, along with a cure based on
limiters.
In each of these ﬁgures the results were computed using a Courant number t /x = 0.8.
Choosing different values gives somewhat different results, though the same basic behavior.
Each method works best when the Courant number is close to 1 (and in fact is exact if the
Courant number is exactly 1 for this simple problem) and less well for smaller values of
t /x. The reader is encouraged to experiment with the CLAWPACKcodes in the directories
referenced in the ﬁgures.
6.2 The Beam–Warming Method
The Lax–Wendroff method (6.4) is a centered threepoint method. If we have a system for
which all the eigenvalues of A are positive (e.g., the scalar advection equation with ¯ u > 0),
then we might think it is preferable to use a onesided formula. In place of the centered
formula for q
x
and q
xx
, we might use
q
x
(x
i
, t
n
) =
1
2 x
[3q(x
i
, t
n
) −4q(x
i −1
, t
n
) +q(x
i −2
, t
n
)] +O(x
2
),
q
xx
(x
i
, t
n
) =
1
(x)
2
[q(x
i
, t
n
) −2q(x
i −1
, t
n
) +q(x
i −2
, t
n
)] +O(x).
(6.6)
Using these in (6.3) gives a method that is again secondorder accurate,
Q
n+1
i
= Q
n
i
−
t
2 x
A
3Q
n
i
−4Q
n
i −1
+ Q
n
i −2
+
1
2
t
x
2
A
2
Q
n
i
−2Q
n
i −1
+ Q
n
i −2
.
(6.7)
6.3 Preview of Limiters 103
This is known as the Beam–Warming method, and was originally introduced in [481]. It can
be written as a ﬂuxdifferencing ﬁnite volume method with
F
n
i −1/2
= AQ
n
i −1
+
1
2
A
1 −
t
x
A
Q
n
i −1
− Q
n
i −2
. (6.8)
Figure 6.1(c) shows the results of the previous advection test using the Beam–Warming
method. The behavior is similar to that of the Lax–Wendroff method in that oscillations
appear, though the oscillations are now ahead of the discontinuities rather than behind.
6.3 Preview of Limiters
Secondorder accurate methods such as the Lax–Wendroff or Beam–Warming give much
better accuracy on smooth solutions than the upwind method, as seen in Figure 6.1, but
fail near discontinuities, where oscillations are generated. In fact, even when the solution is
smooth, oscillations may appear due to the dispersive nature of these methods, as evident
in Figure 6.1. Upwind methods have the advantage of keeping the solution monotonically
varying in regions where the solution should be monotone, even though the accuracy is not
very good. The idea with highresolution methods is to combine the best features of both
methods. Secondorder accuracy is obtained where possible, but we don’t insist on it in
regions where the solution is not behaving smoothly (and the Taylor series expansion is not
even valid). With this approach we can achieve results like those shown in Figure 6.2.
The dispersive nature of the Lax–Wendroff method also causes a slight shift in the
location of the smooth hump, a phase error, that is visible in Figure 6.1, particularly
at the later time t =5. Another advantage of using limiters is that this phase error can
be essentially eliminated. Figure 6.3 shows a computational example where the initial
data consists of a wave packet, a highfrequency signal modulated by a Gaussian. With a
dispersive method such a packet will typically propagate at an incorrect speed corresponding
to the numerical group velocity of the method. The Lax–Wendroff method is clearly quite
dispersive. The highresolution method shown in Figure 6.3(c) performs much better. There
is some dissipation of the wave, but much less than with the upwind method. The main goal
of this chapter is to develop the class of highresolution methods used to obtain these results.
A hint of how this can be done is seen by rewriting the LaxWendroff ﬂux (6.5) as
F
n
i −1/2
=
A
−
Q
n
i
+ A
+
Q
n
i −1
+
1
2
 A
I −
t
x
 A
Q
n
i
− Q
n
i −1
, (6.9)
using the notation A
−
, A
+
,  A deﬁned in Section 4.12. This nowhas the formof the upwind
ﬂux (4.56) with a correction term. Using this in the ﬂuxdifferencing method (4.4) gives a
method of the form (6.1). Note that the correction term in (6.9) looks like a diffusive ﬂux,
since it depends on Q
n
i
− Q
n
i −1
and has the form of (4.10), but the coefﬁcient is positive
if the CFL condition is satisﬁed. Hence it corresponds to an antidiffusive ﬂux that has the
effect of sharpening up the overly diffusive upwind approximation.
The idea is now to modify the ﬁnal term in (6.9) by applying some form of limiter that
changes the magnitude of the correction actually used, depending on how the solution is
behaving. The limiting process is complicated by the fact that the solution to a hyperbolic
systemtypically consists of a superposition of waves in several different families. At a given
104 6 HighResolution Methods
(a)
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Minmod at t = 1
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Minmod at t = 5
(b)
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Superbee at t = 1
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
Superbee at t = 5
(c)
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
MC limiter at t = 1
0 0.2 0.4 0.6 0.8 1
−0.5
0
0.5
1
1.5
MC limiter at t = 5
Fig. 6.2. Tests on the advection equation with different highresolution methods, as in Figure 6.1:
(a) minmod limiter, (b) superbee limiter, (c) MC limiter. [claw/book/chap6/compareadv]
point and time, some of the waves passing by may be smooth while others are discontinuous.
Ideally we would like to apply the limiters in such a way that the discontinuous portion
of the solution remains nonoscillatory while the smooth portion remains accurate. To do
so we must use the characteristic structure of the solution. We will see that this is easily
accomplishedonce we have solvedthe Riemannproblemnecessarytoimplement the upwind
Godunov method. The secondorder correction terms can be computed based on the waves
arising in that Riemann solution, with each wave limited independently from the others.
This process is fully described later in this chapter.
More generally, one can consider combining any loworder ﬂux formula F
L
(Q
i −1
, Q
i
)
(such as the upwind ﬂux) and any higherorder formula F
H
(Q
i −1
, Q
i
) (such as the
6.3 Preview of Limiters 105
(a)
0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
1.5
Upwind at t = 1
0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
1.5
Upwind at t = 10
(b)
0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
1.5
Lax–Wendroff at t = 1
0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
1.5
Lax–Wendroff at t = 10
(c)
0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
1.5
Superbee at t = 1
0 0.2 0.4 0.6 0.8 1
−1
−0.5
0
0.5
1
1.5
Superbee at t = 10
Fig. 6.3. Tests on the advection equation with different methods on a wave packet. Results at time t =1
and t =10 are shown, corresponding to 1 and 10 revolutions through the domain in which the equation
q
t
+q
x
=0 is solved with periodic boundary conditions. [claw/book/chap6/wavepacket]
Lax–Wendroff) to obtain a ﬂuxlimiter method with
F
n
i −1/2
= F
L
(Q
i −1
, Q
i
) +
n
i −1/2
[F
H
(Q
i −1
, Q
i
) −F
L
(Q
i −1
, Q
i
)]. (6.10)
If
n
i −1/2
=0, then this reduces to the loworder method, while if
n
i −1/2
=1, we obtain the
highorder method. This idea of applying limiters to improve the behavior of highorder
methods appeared in the early 1970s in the hybrid method of Harten and Zwas [190] and
the ﬂuxcorrected transport (FCT) method of Boris and Book [38] (see also [348], [496]).
A wide variety of other methods of this form have since been developed, along with better
106 6 HighResolution Methods
theoretical techniques to analyze them. In this chapter we combine many of these ideas to
develop a class of methods that is relatively easy to extend to harder problems.
In the next section we start by giving a geometric interpretation for the scalar advection
equation, leading to slopelimiter methods of the type pioneered in van Leer’s work [464]–
[468]. For the scalar advection equation there are many ways to interpret the same method,
and it is illuminating to explore these. In particular we will see how this relates to ﬂux
limiter methods of the type studied by Sweby [429], who used the algebraic total variation
diminishing (TVD) conditions of Harten [179] to derive conditions that limiter functions
should satisfy for more general nonlinear conservation laws. We will, however, ultimately
use a different approach to apply these limiters to nonlinear problems, closer to the geometric
approach in Goodman & LeVeque [160]. This can be interpreted as applying the limiter
functions to the waves resulting fromthe Riemann solution. Extending this to linear systems
of equations gives the algorithm introduced in Section 6.13. The method is then easily
generalized to nonlinear systems, as described brieﬂy in Section 6.15 and more fully in
Chapter 15. Multidimensional versions are discussed in Chapters 19 through 23.
6.4 The REA Algorithm with Piecewise Linear Reconstruction
Recall the reconstruct–evolve–average (REA) Algorithm4.1 introduced in Section 4.10. For
the scalar advection equation we derived the upwind method by reconstructing a piecewise
constant function ˜ q
n
(x, t
n
) from the cell averages Q
n
i
, solving the advection equation with
this data, and averaging the result at time t
n+1
over each grid cell to obtain Q
n+1
i
. To achieve
better than ﬁrstorder accuracy, we must use a better reconstruction than a piecewise constant
function. From the cell averages Q
n
i
we can construct a piecewise linear function of the
form
˜ q
n
(x, t
n
) = Q
n
i
+σ
n
i
(x − x
i
) for x
i −1/2
≤ x < x
i +1/2
, (6.11)
where
x
i
=
1
2
x
i −1/2
+ x
i +1/2
= x
i −1/2
+
1
2
x (6.12)
is the center of the i th grid cell and σ
n
i
is the slope on the i th cell. The linear function (6.11) on
the i th cell is deﬁned in such a way that its value at the cell center x
i
is Q
n
i
. More importantly,
the average value of ˜ q
n
(x, t
n
) over cell C
i
is Q
n
i
(regardless of the slope σ
n
i
), so that the
reconstructed function has the cell average Q
n
i
. This is crucial in developing conservative
methods for conservation laws. Note that steps 2 and 3 are conservative in general, and so
Algorithm 4.1 is conservative provided we use a conservative reconstruction in step 1, as
we have in (6.11). Later we will see how to write such methods in the standard conservation
form (4.4).
For the scalar advection equation q
t
+ ¯ uq
x
=0, we can easily solve the equation with this
data, and compute the new cell averages as required in step 3 of Algorithm 4.1. We have
˜ q
n
(x, t
n+1
) = ˜ q
n
(x − ¯ u t, t
n
).
6.5 Choice of Slopes 107
Until further notice we will assume that ¯ u > 0 and present the formulas for this particular
case. The corresponding formulas for ¯ u < 0 should be easy to derive, and in Section 6.10
we will see a better way to formulate the methods in the general case.
Suppose also that  ¯ u t /x ≤ 1, as is required by the CFL condition. Then it is
straightforward to compute that
Q
n+1
i
=
¯ u t
x
Q
n
i −1
+
1
2
(x − ¯ u t )σ
n
i −1
+
1 −
¯ u t
x
Q
n
i
−
1
2
¯ u t σ
n
i
= Q
n
i
−
¯ u t
x
Q
n
i
− Q
n
i −1
−
1
2
¯ u t
x
(x − ¯ u t )
σ
n
i
−σ
n
i −1
. (6.13)
Again note that this is the upwind method with a correction termthat depends on the slopes.
6.5 Choice of Slopes
Choosing slopes σ
n
i
≡ 0 gives Godunov’s method (the upwind method for the advection
equation), since the ﬁnal termin (6.13) drops out. To obtain a secondorder accurate method
we want to choose nonzero slopes in such a way that σ
n
i
approximates the derivative q
x
over the i th grid cell. Three obvious possibilities are
Centered slope: σ
n
i
=
Q
n
i +1
− Q
n
i −1
2 x
(Fromm), (6.14)
Upwind slope: σ
n
i
=
Q
n
i
− Q
n
i −1
x
(Beam–Warming), (6.15)
Downwind slope: σ
n
i
=
Q
n
i +1
− Q
n
i
x
(Lax–Wendroff). (6.16)
The centered slope might seemlike the most natural choice to obtain secondorder accuracy,
but in fact all three choices give the same formal order of accuracy, and it is the other two
choices that give methods we have already derived using the Taylor series expansion. Only
the downwind slope results in a centered threepoint method, and this choice gives the
Lax–Wendroff method. The upwind slope gives a fullyupwinded 3point method, which
is simply the Beam–Warming method.
The centered slope (6.14) may seemthe most symmetric choice at ﬁrst glance, but because
the reconstructed function is then advected in the positive direction, the ﬁnal updating
formula turns out to be a nonsymmetric fourpoint formula,
Q
n+1
i
= Q
n
i
−
¯ u t
4 x
Q
n
i +1
+3Q
n
i
−5Q
n
i −1
+ Q
n
i −2
−
¯ u
2
t
2
4 x
2
Q
n
i +1
− Q
n
i
− Q
n
i −1
+ Q
n
i −2
. (6.17)
This method is known as Fromm’s method.
108 6 HighResolution Methods
6.6 Oscillations
As we have seen in Figure 6.1, secondorder methods such as the Lax–Wendroff or Beam–
Warming (and also Fromm’s method) give oscillatory approximations to discontinuous
solutions. This can be easily understood using the interpretation of Algorithm 4.1.
Consider the Lax–Wendroff method, for example, applied to piecewise constant data
with values
Q
n
i
=
1 if i ≤ J,
0 if i > J.
Choosing slopes in each grid cell based on the Lax–Wendroff prescription (6.16) gives the
piecewise linear function shown in Figure 6.4(a). The slope σ
n
i
is nonzero only for i = J.
The function ˜ q
n
(x, t
n
) has an overshoot with a maximum value of 1.5 regardless of x.
When we advect this proﬁle a distance ¯ u t , and then compute the average over the Jth cell,
we will get a value that is greater than 1 for any t with 0 < ¯ u t < x. The worst case is
when ¯ u t = x/2, in which case ˜ q
n
(x, t
n+1
) is shown in Figure 6.4(b) and Q
n+1
J
= 1.125.
In the next time step this overshoot will be accentuated, while in cell J − 1 we will now
have a positive slope, leading to a value Q
n+1
J−1
that is less than 1. This oscillation then grows
with time.
The slopes proposed in the previous section were based on the assumption that the
solution is smooth. Near a discontinuity there is no reason to believe that introducing this
slope will improve the accuracy. On the contrary, if one of our goals is to avoid nonphysical
oscillations, then in the above example we must set the slope to zero in the Jth cell. Any
σ
n
J
<0 will lead to Q
n+1
J
>1, while a positive slope wouldn’t make much sense. On the
other hand we don’t want to set all slopes to zero all the time, or we simply have the
ﬁrstorder upwind method. Where the solution is smooth we want secondorder accuracy.
Moreover, we will see below that even near a discontinuity, once the solution is somewhat
smeared out over more than one cell, introducing nonzero slopes can help keep the solution
from smearing out too far, and hence will signiﬁcantly increase the resolution and keep
discontinuities fairly sharp, as long as care is taken to avoid oscillations.
This suggests that we must pay attention to how the solution is behaving near the i th
cell in choosing our formula for σ
n
i
. (And hence the resulting updating formula will be
nonlinear even for the linear advection equation). Where the solution is smooth, we want to
choose something like the Lax–Wendroff slope. Near a discontinuity we may want to limit
this slope, using a value that is smaller in magnitude in order to avoid oscillations. Methods
based on this idea are known as slopelimiter methods. This approach was introduced by van
(a)
Q
n
J
(b)
Fig. 6.4. (a) Gridvalues Q
n
andreconstructed ˜ q
n
(·, t
n
) usingLax–Wendroff slopes. (b) After advection
with ¯ u t = x/2. The dots show the new cell averages Q
n+1
. Note the overshoot.
6.7 Total Variation 109
Leer in a series of papers, [464] through [468], where he developed the approach known
as MUSCL (monotonic upstreamcentered scheme for conservation laws) for nonlinear
conservation laws.
6.7 Total Variation
Howmuch should we limit the slope? Ideally we would like to have a mathematical prescrip
tion that will allow us to use the Lax–Wendroff slope whenever possible, for secondorder
accuracy, while guaranteeing that no nonphysical oscillations will arise. To achieve this we
need a way to measure oscillations in the solution. This is provided by the notion of the
total variation of a function. For a grid function Q we deﬁne
TV(Q) =
∞
i =−∞
Q
i
− Q
i −1
. (6.18)
For an arbitrary function q(x) we can deﬁne
TV(q) = sup
N
j =1
q(ξ
j
) −q(ξ
j −1
), (6.19)
where the supremum is taken over all subdivisions of the real line −∞= ξ
0
< ξ
1
< · · · <
ξ
N
= ∞. Note that for the total variation to be ﬁnite, Q or q must approach constant values
q
±
as x →±∞.
Another possible deﬁnition for functions is
TV(q) = limsup
→0
1
∞
−∞
q(x) −q(x −) dx. (6.20)
If q is differentiable, then this reduces to
TV(q) =
∞
−∞
q
(x) dx. (6.21)
We can use (6.21) also for nondifferentiable functions (distributions) if we interpret q
(x)
as the distribution derivative (which includes delta functions at points where q is discon
tinuous). Note that if we deﬁne a function ˜ q(x) from a grid function Q using a piecewise
constant approximation, then TV( ˜ q) = TV(Q).
The true solution to the advection equation simply propagates at speed ¯ u with unchanged
shape, so that the total variation TV(q(·, t )) must be constant in time. A numerical solution
to the advection equation might not have constant total variation, however. If the method
introduces oscillations, then we would expect the total variation of Q
n
to increase with
time. We can thus attempt to avoid oscillations by requiring that the method not increase
the total variation:
Deﬁnition 6.1. A twolevel method is called total variation diminishing (TVD) if, for any
set of data Q
n
, the values Q
n+1
computed by the method satisfy
TV(Q
n+1
) ≤ TV(Q
n
). (6.22)
110 6 HighResolution Methods
Note that the total variation need not actually diminish in the sense of decreasing; it
may remain constant in time. A better term might be total variation nonincreasing. In
fact this term (and the abbreviation TVNI) was used in the original work of Harten [179],
who introduced the use of this tool in developing and analyzing numerical methods for
conservation laws. It was later changed to TVD as a less cumbersome term.
If a method is TVD, then in particular data that is initially monotone, say
Q
n
i
≥ Q
n
i +1
for all i,
will remain monotone in all future time steps. Hence if we discretize a single propagating
discontinuity (as in Figure 6.4), the discontinuity may become smeared in future time steps
but cannot become oscillatory. This property is especially useful, and we make the following
deﬁnition.
Deﬁnition 6.2. A method is called monotonicitypreserving if
Q
n
i
≥ Q
n
i +1
for all i
implies that
Q
n+1
i
≥ Q
n+1
i +1
for all i.
Any TVD method is monotonicitypreserving; see Exercise 6.3.
6.8 TVD Methods Based on the REA Algorithm
How can we derive a method that is TVD? One easy way follows from the reconstruct–
evolve–average approach to deriving methods described by Algorithm 4.1. Suppose that
we perform the reconstruction in such a way that
TV( ˜ q
n
(·, t
n
)) ≤ TV(Q
n
). (6.23)
Then the method will be TVD. The reason is that the evolving and averaging steps cannot
possibly increase the total variation, and so it is only the reconstruction that we need to
worry about.
In the evolve step we clearly have
TV( ˜ q
n
(·, t
n+1
)) = TV( ˜ q
n
(·, t
n
)) (6.24)
for the advection equation, since ˜ q
n
simply advects without changing shape. The total
variation turns out to be a very useful concept in studying nonlinear problems as well;
for we will see later that a wide class of nonlinear scalar conservation laws also have this
property, that the true solution has a nonincreasing total variation.
It is a simple exercise (Exercise 6.4) to show that the averaging step gives
TV(Q
n+1
) ≤ TV( ˜ q
n
(·, t
n+1
)). (6.25)
Combining (6.23), (6.24), and (6.25) then shows that the method is TVD.
6.9 SlopeLimiter Methods 111
6.9 SlopeLimiter Methods
We nowreturn to the derivation of numerical methods based on piecewise linear reconstruc
tion, and consider how to limit the slopes so that (6.23) is satisﬁed. Note that setting σ
n
i
≡ 0
works, since the piecewise constant function has the same TV as the discrete data. Hence
the ﬁrstorder upwind method is TVD for the advection equation. The upwind method may
smear solutions but cannot introduce oscillations.
One choice of slope that gives secondorder accuracy for smooth solutions while still
satisfying the TVD property is the minmod slope
σ
n
i
= minmod
Q
n
i
− Q
n
i −1
x
,
Q
n
i +1
− Q
n
i
x
, (6.26)
where the minmod function of two arguments is deﬁned by
minmod(a, b) =
a if a < b and ab > 0,
b if b < a and ab > 0,
0 if ab ≤ 0.
(6.27)
If a and b have the same sign, then this selects the one that is smaller in modulus, else it
returns zero.
Rather than deﬁning the slope on the i th cell by always using the downwind difference
(which would give the Lax–Wendroff method), or by always using the upwind difference
(which would give the Beam–Warming method), the minmod method compares the two
slopes and chooses the one that is smaller in magnitude. If the two slopes have different
sign, then the value Q
n
i
must be a local maximum or minimum, and it is easy to check in
this case that we must set σ
n
i
= 0 in order to satisfy (6.23).
Figure 6.2(a) shows results using the minmod method for the advection problem con
sidered previously. We see that the minmod method does a fairly good job of maintaining
good accuracy in the smooth hump and also sharp discontinuities in the square wave, with
no oscillations.
Sharper resolution of discontinuities can be achieved with other limiters that do not
reduce the slope as severely as minmod near a discontinuity. Figure 6.5(a) shows some
sample data representing a discontinuity smeared over two cells, along with the minmod
slopes. Figure 6.5(b) shows that we can increase the slopes in these two cells to twice the
value of the minmod slopes and still have (6.23) satisﬁed. This sharper reconstruction will
lead to sharper resolution of the discontinuity in the next time step than we would obtain
with the minmod slopes.
(a) (b)
Fig. 6.5. Grid values Q
n
and reconstructed ˜ q
n
(·, t
n
) using (a) minmod slopes, (b) superbee or MC
slopes. Note that these steeper slopes can be used and still have the TVD property.
112 6 HighResolution Methods
One choice of limiter that gives the reconstruction of Figure 6.5(b), while still giving
second order accuracy for smooth solutions, is the socalled superbee limiter introduced by
Roe [378]:
σ
n
i
= maxmod
σ
(1)
i
, σ
(2)
i
, (6.28)
where
σ
(1)
i
= minmod
Q
n
i +1
− Q
n
i
x
, 2
Q
n
i
− Q
n
i −1
x
,
σ
(2)
i
= minmod
2
Q
n
i +1
− Q
n
i
x
,
Q
n
i
− Q
n
i −1
x
.
Eachonesidedslope is comparedwithtwice the opposite onesidedslope. Thenthe maxmod
function in (6.28) selects the argument with larger modulus. In regions where the solution
is smooth this will tend to return the larger of the two onesided slopes, but will still be
giving an approximation to q
x
, and hence we expect secondorder accuracy. We will see
later that the superbee limiter is also TVD in general.
Figure 6.2(b) shows the same test problem as before but with the superbee method. The
discontinuity stays considerably sharper. On the other hand, we see a tendency of the smooth
hump to become steeper and squared off. This is sometimes a problem with superbee – by
choosing the larger of the neighboring slopes it tends to steepen smooth transitions near
inﬂection points.
Another popular choice is the monotonized centraldifference limiter (MClimiter), which
was proposed by van Leer [467]:
σ
n
i
= minmod
Q
n
i +1
− Q
n
i −1
2x
, 2
Q
n
i
− Q
n
i −1
x
, 2
Q
n
i +1
− Q
n
i
x
. (6.29)
This compares the central difference of Fromm’s method with twice the onesided slope to
either side. In smooth regions this reduces to the centered slope of Fromm’s method and
hence does not tend to artiﬁcially steepen smooth slopes to the extent that superbee does.
Numerical results with this limiter are shown in Figure 6.2(c). The MC limiter appears to
be a good default choice for a wide class of problems.
6.10 Flux Formulation with Piecewise Linear Reconstruction
The slopelimiter methods described above can be written as ﬂuxdifferencing methods
of the form (4.4). The updating formulas derived above can be manipulated algebraically
to determine what the numerical ﬂux function must be. Alternatively, we can derive the
numerical ﬂux by computing the exact ﬂux through the interface x
i −1/2
using the piecewise
linear solution ˜ q
n
(x, t ), byintegrating ¯ u ˜ q
n
(x
i −1/2
, t ) intime fromt
n
tot
n+1
. For the advection
6.10 Flux Formulation with Piecewise Linear Reconstruction 113
equation this is easy to do and we ﬁnd that
F
n
i −1/2
=
1
t
t
n+1
t
n
¯ u ˜ q
n
x
i −1/2
, t
dt
=
1
t
t
n+1
t
n
¯ u ˜ q
n
x
i −1/2
− ¯ u(t −t
n
), t
n
dt
=
1
t
t
n+1
t
n
¯ u
¸
Q
n
i −1
+
x
i −1/2
− ¯ u(t −t
n
) − x
i −1
σ
n
i −1
¸
dt
= ¯ uQ
n
i −1
+
1
2
¯ u(x − ¯ u t )σ
n
i −1
.
Using this in the ﬂuxdifferencing formula (4.4) gives
Q
n+1
i
= Q
n
i
−
¯ u t
x
Q
n
i
− Q
n
i −1
−
1
2
¯ u t
x
(x − ¯ u t )
σ
n
i
−σ
n
i −1
,
which agrees with (6.13).
If we also consider the case ¯ u < 0, then we will ﬁnd that in general the numerical ﬂux
for a slopelimiter method is
F
n
i −1/2
=
¸
¯ uQ
n
i −1
+
1
2
¯ u(x − ¯ u t )σ
n
i −1
if ¯ u ≥ 0,
¯ uQ
n
i
−
1
2
¯ u(x + ¯ u t )σ
n
i
if ¯ u ≤ 0,
(6.30)
where σ
n
i
is the slope in the i th cell C
i
, chosen by one of the formulas discussed previously.
Rather than associating a slope σ
n
i
with the i th cell, the idea of writing the method in
terms of ﬂuxes between cells suggests that we should instead associate our approximation
to q
x
with the cell interface at x
i −1/2
where F
n
i −1/2
is deﬁned. Across the interface x
i −1/2
we have a jump
Q
n
i −1/2
= Q
n
i
− Q
n
i −1
, (6.31)
and this jump divided by x gives an approximation to q
x
. This suggests that we write the
ﬂux (6.30) as
F
n
i −1/2
= ¯ u
−
Q
n
i
+ ¯ u
+
Q
n
i −1
+
1
2
 ¯ u
1 −
¯ u t
x
δ
n
i −1/2
, (6.32)
where
δ
n
i −1/2
= a limited version of Q
n
i −1/2
. (6.33)
If δ
n
i −1/2
is the jump Q
n
i −1/2
itself, then (6.32) gives the Lax–Wendroff method (see
Exercise 6.6). From the form (6.32), we see that the Lax–Wendroff ﬂux can be interpreted
as a modiﬁcation to the upwind ﬂux (4.33). By limiting this modiﬁcation we obtain a
different form of the highresolution methods, as explored in the next section.
114 6 HighResolution Methods
6.11 Flux Limiters
From the above discussion it is natural to view the Lax–Wendroff method as the basic
secondorder method based on piecewise linear reconstruction, since deﬁning the jump
δ
n
i −1/2
in (6.33) in the most obvious way as Q
n
i −1/2
at the interface x
i −1/2
results in that
method. Other secondorder methods have ﬂuxes of the form (6.32) with different choices
of δ
n
i −1/2
. The slopelimiter methods can then be reinterpreted as ﬂuxlimiter methods by
choosing δ
n
i −1/2
to be a limited version of (6.31). In general we will set
δ
n
i −1/2
= φ
θ
n
i −1/2
Q
n
i −1/2
, (6.34)
where
θ
n
i −1/2
=
Q
n
I −1/2
Q
n
i −1/2
. (6.35)
The index I here is used to represent the interface on the upwind side of x
i −1/2
:
I =
i −1 if ¯ u > 0,
i +1 if ¯ u < 0.
(6.36)
The ratio θ
n
i −1/2
can be thought of as a measure of the smoothness of the data near x
i −1/2
.
Where the data is smooth we expect θ
n
i −1/2
≈ 1 (except at extrema). Near a discontinuity
we expect that θ
n
i −1/2
may be far from 1.
The function φ(θ) is the ﬂuxlimiter function, whose value depends on the smoothness.
Setting φ(θ) ≡ 1 for all θ gives the Lax–Wendroff method, while setting φ(θ) ≡ 0 gives
upwind. More generally we might want to devise a limiter function φ that has values near
1 for θ ≈ 1, but that reduces (or perhaps increases) the slope where the data is not smooth.
There are many other ways one might choose to measure the smoothness of the data
besides the variable θ deﬁned in (6.35). However, the framework proposed above results in
very simple formulas for the function φ corresponding to many standard methods, including
all the methods discussed so far.
In particular, note the nice feature that choosing
φ(θ) = θ (6.37)
results in (6.34) becoming
δ
n
i −1/2
=
Q
n
I −1/2
Q
n
i −1/2
Q
n
i −1/2
= Q
n
I −1/2
.
Hence this choice results in the jump at the interface upwind from x
i −1/2
being used to
deﬁne δ
n
i −1/2
instead of the jump at this interface. As a result, the method (6.32) with the
choice of limiter (6.37) reduces to the Beam–Warming method.
Since the centered difference (6.14) is the average of the onesided slopes (6.15) and
(6.16), we also ﬁnd that Fromm’s method can be obtained by choosing
φ(θ) =
1
2
(1 +θ). (6.38)
6.12 TVD Limiters 115
Also note that φ(θ) = 2 corresponds to using δ
n
i −1/2
= 2 Q
n
i −1/2
, i.e., twice the jump at
this interface, while φ(θ) = 2θ results in using twice the jump at the upwind interface. Recall
that these are necessary ingredients in some of the slope limiters discussed in Section 6.9.
Translating the various slope limiters into ﬂuxlimiter functions, we obtain the functions
found below for the methods previously introduced.
Linear methods:
upwind : φ(θ) = 0,
Lax–Wendroff : φ(θ) = 1,
Beam–Warming : φ(θ) = θ,
Fromm : φ(θ) =
1
2
(1 +θ).
(6.39a)
Highresolution limiters:
minmod : φ(θ) = minmod(1, θ),
superbee : φ(θ) = max(0, min(1, 2θ), min(2, θ)),
MC : φ(θ) = max(0, min((1 +θ)/2, 2, 2θ))
van Leer : φ(θ) =
θ +θ
1 +θ
.
(6.39b)
The van Leer limiter listed here was proposed in [465]. A wide variety of other limiters
have also been proposed in the literature. Many of these limiters are built into CLAWPACK.
The parameter mthlim in claw1ez (see Section 5.4.6) determines which limiter is used.
Other limiters are easily added to the code by modifying the ﬁle claw/clawpack/1d/lib/
philim.f.
The ﬂuxlimiter method has the ﬂux (6.32) with δ
n
i −1/2
given by (6.34). Let ν = ¯ u t /x
be the Courant number. Then the ﬂuxlimiter method takes the form
Q
n+1
i
= Q
n
i
−ν
Q
n
i
− Q
n
i −1
−
1
2
ν(1 −ν)
φ
θ
n
i +1/2
Q
n
i +1
− Q
n
i
−φ
θ
n
i −1/2
Q
n
i
− Q
n
i −1
(6.40)
if ¯ u > 0, or
Q
n+1
i
= Q
n
i
−ν
Q
n
i +1
− Q
n
i
+
1
2
ν(1 +ν)
φ
θ
n
i +1/2
Q
n
i +1
− Q
n
i
−φ
θ
n
i −1/2
Q
n
i
− Q
n
i −1
(6.41)
if ¯ u < 0.
6.12 TVD Limiters
For simple limiters such as minmod, it is clear from the derivation as a slope limiter
(Section 6.9) that the resulting method is TVD, since it is easy to check that (6.23) is
satisﬁed. For more complicated limiters we would like to have an algebraic proof that the
116 6 HighResolution Methods
resulting method is TVD. A fundamental tool in this direction is the following theorem
of Harten [179], which can be used to derive explicit algebraic conditions on the function
φ required for a TVD method. For some other discussions of TVD conditions, see [180],
[349], [429], [435], [465].
Theorem 6.1 (Harten). Consider a general method of the form
Q
n+1
i
= Q
n
i
−C
n
i −1
Q
n
i
− Q
n
i −1
+ D
n
i
Q
n
i +1
− Q
n
i
(6.42)
over one time step, where the coefﬁcients C
n
i −1
and D
n
i
are arbitrary values (which in
particular may depend on values of Q
n
in some way, i.e., the method may be nonlinear).
Then
TV(Q
n+1
) ≤ TV(Q
n
)
provided the following conditions are satisﬁed:
C
n
i −1
≥ 0 ∀i,
D
n
i
≥ 0 ∀i, (6.43)
C
n
i
+ D
n
i
≤ 1 ∀i.
Note: the updating formula for Q
n+1
i
uses C
n
i −1
and D
n
i
, but the last condition involves C
n
i
and D
n
i
.
For the proof see Exercise 8.5. We can apply this theorem to the ﬂuxlimiter method for
q
t
+ ¯ uq
x
=0. We consider the case ¯ u > 0 here (see Exercise 6.7 for the case ¯ u < 0), so
that the method has the form (6.40). There are many ways to rewrite this in the form (6.42),
since C
n
i −1
and D
n
i
are allowed to depend on Q
n
. The obvious choice is
C
n
i −1
= ν −
1
2
ν(1 −ν)φ
θ
n
i −1/2
,
D
n
i
= −
1
2
ν(1 −ν)φ
θ
n
i +1/2
,
but this can’t be effectively used to prove the method is TVD, as there is no hope of satisfying
the condition (6.43) using this. If 0 ≤ ν ≤ 1 then D
n
i
< 0 when φ is near 1.
Instead note that
Q
n
i +1
− Q
n
i
=
Q
n
i
− Q
n
i −1
/θ
n
i +1/2
,
and so the formula (6.40) can be put into the form (6.42) with
C
n
i −1
= ν +
1
2
ν(1 −ν)
φ
θ
n
i +1/2
θ
n
i +1/2
−φ
θ
n
i −1/2
,
D
n
i
= 0.
6.12 TVD Limiters 117
The conditions (6.43) are then satisﬁed provided that
0 ≤ C
n
i −1
≤ 1.
This in turn holds provided that the CFL condition 0 ≤ ν ≤ 1 holds, along with the bound
φ(θ
1
)
θ
1
−φ(θ
2
)
≤ 2 for all values of θ
1
, θ
2
. (6.44)
If θ ≤ 0, then we are at an extremum, and we know from our previous discussion that we
should take φ(θ) =0 in this case to achieve a TVD method. Also, when θ > 0 we want
φ(θ) > 0, since it generally doesn’t make sense to negate the sign of the slope in applying
the limiter. Since θ
1
and θ
2
in (6.44) are independent, we then see that we must require
0 ≤
φ(θ)
θ
≤ 2 and 0 ≤ φ(θ) ≤ 2 (6.45)
for all values of θ ≥ 0 in order to guarantee that condition (6.44) is satisﬁed (along with
φ(θ) = 0 for θ < 0). These constraints can be rewritten concisely as
0 ≤ φ(θ) ≤ minmod(2, 2θ). (6.46)
This deﬁnes the TVD region in the θ–φ plane: the curve φ(θ) must lie in this region, which
is shown as the shaded region in Figure 6.6(a). This ﬁgure also shows the functions φ(θ)
(a)
θ
φ
1
1
2
2
Lax–Wendroﬀ
Beam–Warming
Fromm
(b)
θ
φ
1
1
2
2
Minmod
(c)
θ
φ
1
1
2
2
Superbee
(d)
θ
φ
1
1
2
2
MC
3 1/3
Fig. 6.6. Limiter functions φ(θ). (a) The shaded regions shows where function values must lie for
the method to be TVD. The secondorder linear methods have functions φ(θ) that leave this region.
(b) The shaded region is the Sweby region of secondorder TVD methods. The minmod limiter lies
along the lower boundary. (c) The superbee limiter lies along the upper boundary. (d) The MC limiter
is smooth at φ = 1.
118 6 HighResolution Methods
from (6.39a) for the Lax–Wendroff, Beam–Warming, and Fromm methods. All of these
functions lie outside the shaded region for some values of θ, and indeed these methods are
not TVD. This graphical analysis of φ was ﬁrst presented by Sweby [429], who analyzed a
wide class of ﬂuxlimiter methods (for nonlinear conservation laws as well as the advection
equation).
Note that for any secondorder accurate method we must have φ(1) =1. Sweby found,
moreover, that it is best to take φ to be a convex combination of φ =1 (Lax–Wendroff)
and φ =θ (Beam–Warming). Other choices apparently give too much compression, and
smooth data such as a sine wave tends to turn into a square wave as time evolves, as is
already seen to happen with the superbee limiter. Imposing this additional restriction gives
the secondorder TVD region of Sweby, which is shown in Figure 6.6(b).
The highresolution limiter functions from (6.39b) are all seen to satisfy the constraints
(6.46), and these limiters all give TVD methods. The functions φ are graphed in Figure 6.6.
Note that minmod lies along the lower boundary of the Sweby region, while superbee lies
along the upper boundary. The fact that these functions are not smooth at θ = 1 corresponds
to the fact that there is a switch in the choice of onesided approximation used as θ crosses
this point. For full secondorder accuracy we would like the function φ to be smooth near
θ = 1, as for the MC limiter. The van Leer limiter is an even smoother version of this.
We also generally want to impose a symmetry condition on the function φ(θ). If the data
Q
n
is symmetric in x, then we might expect the reconstructed piecewise linear function to
have this same property. It can be shown (Exercise 6.8) that this requires that the function
φ also satisfy
φ(1/θ) =
φ(θ)
θ
. (6.47)
All of the highresolution functions listed in (6.39b) satisfy this condition.
6.13 HighResolution Methods for Systems
The slopelimiter or ﬂuxlimiter methods can also be extended to systems of equations.
This is most easily done in the ﬂuxlimiter framework. First recall that the Lax–Wendroff
method (6.4) can be written in ﬂuxdifferencing form (4.4) if we deﬁne the ﬂux by
F(Q
i −1
, Q
i
) =
1
2
A(Q
i −1
+ Q
i
) −
1
2
t
x
A
2
(Q
i
− Q
i −1
). (6.48)
Since A = A
+
+ A
−
, we can rewrite this as
F(Q
i −1
, Q
i
) = (A
+
Q
i −1
+ A
−
Q
i
) +
1
2
 A
I −
t
x
 A
(Q
i
− Q
i −1
), (6.49)
where  A = A
+
− A
−
.
In the form (6.49), we see that the Lax–Wendroff ﬂux can be viewed as being composed
of the upwind ﬂux (4.56) plus a correction term, just as for the scalar advection equation. To
deﬁne a ﬂuxlimiter method we must limit the magnitude of this correction term according
to howthe data is varying. But for a systemof equations, Q
i −1/2
= Q
i
−Q
i −1
is a vector,
and it is not so clear how to compare this vector with the neighboring jump vector Q
i −3/2
6.13 HighResolution Methods for Systems 119
or Q
i +1/2
to generalize (6.34). It is also not clear which neighboring jump to consider,
since the “upwind” direction is different for each eigencomponent. The solution, of course,
is that we must decompose the correction term in (6.49) into eigencomponents and limit
each scalar eigencoefﬁcient separately, based on the algorithm for scalar advection.
We can rewrite the correction term as
1
2
 A
I −
t
x
 A
(Q
i
− Q
i −1
) =
1
2
 A
I −
t
x
 A
m
p=1
α
p
i −1/2
r
p
,
where r
p
are the eigenvectors of A and the coefﬁcients α
p
i −1/2
are deﬁned by (4.38). The
ﬂuxlimiter method is deﬁned by replacing the scalar coefﬁcient α
p
i −1/2
by a limited version,
based on the scalar formulas of Section 6.11. We set
˜ α
p
i −1/2
= α
p
i −1/2
φ
θ
p
i −1/2
, (6.50)
where
θ
p
i −1/2
=
α
p
I −1/2
α
p
i −1/2
with I =
i −1 if λ
p
> 0,
i +1 if λ
p
< 0,
(6.51)
and φ is one of the limiter functions of Section 6.11. The ﬂux function for the ﬂuxlimiter
method is then
F
i −1/2
= A
+
Q
i −1
+ A
−
Q
i
+
˜
F
i −1/2
, (6.52)
where the ﬁrst term is the upwind ﬂux and the correction ﬂux
˜
F
i −1/2
is deﬁned by
˜
F
i −1/2
=
1
2
 A
1 −
t
x
 A
m
p=1
˜ α
p
i −1/2
r
p
. (6.53)
Note that in the case of a scalar equation, we can take r
1
=1 as the eigenvector of A = ¯ u, so
that Q
i −1/2
=α
1
i −1/2
, which is what we called δ
i −1/2
in Section 6.11. The formula (6.52)
then reduces to (6.32). Also note that the ﬂux
˜
F
i −1/2
(and hence F
i −1/2
) depends not only
on Q
i −1
and Q
i
, but also on Q
i −2
and Q
i +1
in general, because neighboring jumps are
used in deﬁning the limited values ˜ α
p
i −1/2
in (6.50). The ﬂuxlimiter method thus has a ﬁve
point stencil rather than the threepoint stencil of the Lax–Wendroff. This is particularly
important in specifying boundary conditions (see Chapter 7). Note that this widening of the
stencil gives a relaxation of the CFL restriction on the time step. For a ﬁvepoint method
the CFL condition requires only that the Courant number be less than 2. However, the CFL
condition gives only a necessary condition on stability, and in fact these highresolution
methods are generally not stable for Courant numbers between 1 and 2. The larger stencil
does not lead to a greater stability limit because the additional information is used only to
limit the secondorder correction terms.
Note that  Ar
p
= λ
p
r
p
, so that (6.53) may be rewritten as
˜
F
i −1/2
=
1
2
m
p=1
λ
p

1 −
t
x
λ
p

˜ α
p
i −1/2
r
p
. (6.54)
120 6 HighResolution Methods
This method for a system of equations can also be viewed as a slopelimiter method, if
we think of (Q
i
− Q
i −1
)/x as approximating the slope vector, with each element giving
an approximation to the slope for the corresponding element of q in a piecewise linear
reconstruction. One might be tempted to limit the slope for each element of the vector
separately, but in fact it is much better to proceed as above and limit the eigencoefﬁcients
obtained when the slope vector is expanded in eigenvectors of A. As a result, each wave is
limited independently of other families, and the accuracy of smooth waves is not adversely
affected by limiters being applied to other waves that may not be smooth.
For these wavepropagation algorithms it is perhaps most natural to view the limiter
function as being a wave limiter rather than a slope limiter or ﬂux limiter, since it is really the
individual waves that are being limited after solving the Riemann problem. This viewpoint
carries over naturally to nonlinear systems as introduced in Section 6.15 and explored more
fully in Chapter 15. In the more general context, it is natural to use the notation
W
p
i −1/2
= ˜ α
p
i −1/2
r
p
(6.55)
to denote the limited wave appearing in (6.54).
6.14 Implementation
For the constantcoefﬁcient linear system, we could compute the matrices A
+
, A
−
, and  A
once and for all and compute the ﬂuxes directly from the formulas given above. However,
with limiters we must solve the Riemann problemat each interface to obtain a decomposition
of Q
i −1/2
into waves α
p
i −1/2
r
p
and wave speeds λ
p
, and these can be used directly in the
computation of Q
n+1
i
without ever forming the matrices. This approach also generalizes
directly to nonlinear systems of conservation laws, where we do not have a single matrix
A, but can still solve a Riemann problem at each interface for waves and wave speeds. This
generalization is discussed brieﬂy in the next section.
To accomplish this most easily, note that if we use the ﬂux (6.52) in the ﬂuxdifferencing
formula (4.4) and then rearrange the upwind terms, we can write the formula for Q
n+1
i
as
Q
n+1
i
= Q
i
−
t
x
A
+
Q
i −1/2
+ A
−
Q
i +1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
,
where we drop the superscript n from the current time step because we will need to use
superscript p below to denote the wave family. Each of the terms in this expression can be
written in terms of the waves W
p
i −1/2
= α
p
i −1/2
r
p
and wave speeds λ
p
:
A
+
Q
i −1/2
=
m
p=1
(λ
p
)
+
W
p
i −1/2
,
A
−
Q
i −1/2
=
m
p=1
(λ
p
)
−
W
p
i −1/2
,
˜
F
i −1/2
=
1
2
m
p=1
λ
p

1 −
t
x
λ
p

W
p
i −1/2
.
(6.56)
6.15 Extension to Nonlinear Systems 121
6.15 Extension to Nonlinear Systems
The full extension of these methods to nonlinear problems will be discussed in Chapter 15
after developing the theory of nonlinear equations. However, the main idea is easily ex
plainedas a simple extensionof what has beendone for linear systems. Givenstates Q
i −1
and
Q
i
, the solution to the Riemann problem will be seen to yield a set of waves W
p
i −1/2
∈ R
m
and speeds s
p
i −1/2
∈ R, analogous to the linear problem, though now the speeds will vary
with i , and so will the directions of the vectors W
p
i −1/2
in phase space; they will no longer
all be scalar multiples of a single set of eigenvectors r
p
.
The quantities A
+
Q
i −1/2
and A
−
Q
i −1/2
have been generalized to ﬂuctuations in
Chapter 4, denoted by A
+
Q
i −1/2
and A
−
Q
i −1/2
, with the property that
A
−
Q
i −1/2
+A
+
Q
i −1/2
= f (Q
i
) − f (Q
i −1
). (6.57)
Note that for the linear case f (Q
i
) − f (Q
i −1
) = AQ
i −1/2
, and this property is satisﬁed.
In general we can think of setting
A
−
Q
i −1/2
=
m
p=1
s
p
i −1/2
−
W
p
i −1/2
,
A
+
Q
i −1/2
=
m
p=1
s
p
i −1/2
+
W
p
i −1/2
,
(6.58)
a direct extension of (6.56). There are, however, some issues concerned with rarefaction
waves and entropy conditions that make the nonlinear case more subtle, and the proper
speciﬁcation of these ﬂux differences will be discussed later. Once the waves, speeds, and
ﬂux differences have been suitably deﬁned, the algorithm is virtually identical with what
has already been deﬁned in the linear case. We set
Q
n+1
i
= Q
n
i
−
t
x
A
−
Q
i +1/2
+A
+
Q
i −1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
, (6.59)
where
˜
F
i −1/2
=
1
2
m
p=1
s
p
i −1/2
1 −
t
x
s
p
i −1/2
W
p
i −1/2
. (6.60)
Here
W
p
i −1/2
represents a limited version of the wave W
p
i −1/2
, obtained by comparing this
jump with the jump W
p
I −1/2
in the same family at the neighboring Riemann problem in the
upwind direction, so
I =
i −1 if s
p
i −1/2
> 0,
i +1 if s
p
i −1/2
< 0.
(6.61)
This limiting procedure is slightly more complicated than in the constantcoefﬁcient case,
in that W
p
i −1/2
and W
p
I −1/2
are in general no longer scalar multiples of the same vector
r
p
. So we cannot simply apply the scalar limiter function φ(θ) to the ratio of these scalar
coefﬁcients as in the constantcoefﬁcient linear case. Instead we can, for example, project
122 6 HighResolution Methods
the vector W
p
I −1/2
onto W
p
i −1/2
and compare the length of this projection with the length
of W
p
i −1/2
. This same issue arises for variablecoefﬁcient linear systems and is discussed in
Section 9.13.
When no limiting is used, this method is formally secondorder accurate provided certain
conditions are satisﬁed by the Riemann solution used; see Section 15.6. The methods
generally perform much better, however, when limiters are applied.
6.16 CapacityForm Differencing
In many applications the system of conservation laws to be solved most naturally takes the
form
κ(x)q
t
+ f (q)
x
= 0, (6.62)
where κ(x) is a spatially varying capacity function as introduced in Section 2.4. In the
remainder of this chapter we will see how to extend the highresolution methods deﬁned
above to this situation. In particular, this allows us to extend the methods to nonuniform
grids as we do in Section 6.17. This material can be skipped without loss of continuity.
The equation (6.62) generally arises from an integral conservation law of the form
d
dt
x
2
x
1
κ(x)q(x, t ) dx = f (q(x
1
, t )) − f (q(x
2
, t )), (6.63)
in which κ(x)q(x, t ) is the conserved quantity while the ﬂux at a point depends most
naturally on the value of q itself. It may then be most natural to solve Riemann problems
corresponding to the ﬂux function f (q), i.e., by solving the equation
q
t
+ f (q)
x
= 0 (6.64)
locally at each cell interface, and then use the resulting wave structure to update the solution
to (6.62). This suggests a method of the form
κ
i
Q
n+1
i
= κ
i
Q
n
i
−
t
x
F
Q
n
i
, Q
n
i +1
−F
Q
n
i −1
, Q
n
i
. (6.65)
Dividing by κ
i
gives
Q
n+1
i
= Q
n
i
−
k
κ
i
x
F
Q
n
i
, Q
n
i +1
−F
Q
n
i −1
, Q
n
i
. (6.66)
The formof equation(6.66) will be calledcapacityformdifferencing. It is a generalizationof
conservationformdifferencing to include the capacity function. The factor κ
i
x appearing
in (6.66) has a natural interpretation as the effective volume of the i th grid cell if we think of
κ
i
as a fraction of the volume available to the ﬂuid (as in porousmedia ﬂow, for example).
Note that the updating formula (6.66) has the advantage of being conservative in the proper
manner for the conservation law (6.63), since computing
x
i
κ
i
Q
n+1
i
= x
i
κ
i
Q
n
i
+boundary ﬂuxes
6.17 Nonuniform Grids 123
from (6.65) shows that all the ﬂuxes cancel except at the boundaries, where the boundary
conditions must come into play.
We can rewrite the method (6.66) in the framework of the highresolution wave
propagation algorithm as
Q
n+1
i
= Q
n
i
−
t
κ
i
x
A
+
Q
n
i −1/2
+A
−
Q
n
i +1/2
−
t
κ
i
x
˜
F
n
i +1/2
−
˜
F
n
i −1/2
, (6.67)
where as usual A
±
Q
i −1/2
are the ﬂuctuations and
˜
F
i −1/2
is the correction ﬂux based on
the Riemann solution for (6.64) at the interface x
i −1/2
. We now use the correction ﬂux
˜
F
i −1/2
=
1
2
M
w
p=1
1 −
t
κ
i −1/2
x
s
p
i −1/2
s
p
i −1/2
W
p
i −1/2
. (6.68)
This is the general form for a system of m equations with M
w
waves, as introduced in
Section 6.15. The wave
W
p
i −1/2
is a limited version of the wave W
p
i −1/2
, just as before, and
these waves again are obtained by solving the Riemann problem for (6.64), ignoring the
capacity function. The only modiﬁcation from the formula for
˜
F
i −1/2
given in (6.60) is that
x is replaced by κ
i −1/2
x, where
κ
i −1/2
=
1
2
(κ
i −1
+κ
i
). (6.69)
Clearly, replacing x by some form of κx is necessary on the basis of dimensional
arguments. If κ(x) is smoothly varying, then using either κ
i −1
x or κ
i
x would also
work, and the resulting method is secondorder accurate for smooth solutions with any of
these choices.
The choice κ
i −1/2
seems most reasonable, however, since the ﬂux
˜
F
i −1/2
is associated
with the interface between cells C
i −1
and C
i
, rather than with either of the two cells. This
term in the correction ﬂux gives an approximation to the
1
2
t
2
q
t t
term in the Taylor series
expansion once it is inserted in the ﬂuxdifferencing termof (6.67). We compute, for smooth
solutions, that
q
t t
=
1
κ
1
κ
[ f
(q)]
2
q
x
x
,
and centering of these terms again suggests that the inner 1/κ should be evaluated at x
i ±1/2
.
In Section 6.17.1, where nonuniform grids are discussed, we will see that this choice makes
clear physical sense in that case, and is correct even if κ is not smoothly varying.
6.17 Nonuniform Grids
One natural example of a capacity function arises if we solve a standard conservation law
q
t
+ f (q)
x
= 0 on a nonuniform grid such as shown on the right of Figure 6.7. There are
two philosophically different approaches that could be taken to derive a numerical method
on this grid:
124 6 HighResolution Methods
ξ
i−1/2
ξ
i+1/2
∆ξ
t
n
t
n+1
X(ξ)
t
n
t
n+1
x
i−1/2
x
i+1/2
∆x
i
Fig. 6.7. The grid mapping X(ξ) maps a uniform computational grid in ξ–t space (on the left) to the
nonuniform x–t grid in physical space (on the right).
1. Work directly in the physical space (the right side of Figure 6.7), and derive a ﬁnite
volume method on the nonuniform gird for the integral form of the conservation law on
the physicalgrid cells.
2. View the nonuniform grid as resulting from some coordinate mapping applied to a uni
form grid in computational space. Such a grid is illustrated on the left side of Figure 6.7,
where ξ is constant and the mapping function X(ξ) deﬁnes x
i −1/2
= X(ξ
i −1/2
). If we
can transform the equation in x and t to an equivalent equation in ξ and t , then we can
solve the transformed equation on the uniform grid.
The ﬁrst approach is generally easier to use in developing ﬁnite volume methods for
conservation laws, for several reasons:
•
The transformed equation in computational space includes metric terms involving X
(ξ),
as we will see below. The mapping must be smooth in order to achieve good accuracy if
we attempt to discretize the transformed equations directly. In practice we might want to
use a highly nonuniform grid corresponding to a nonsmooth function X(ξ).
•
Even if X(ξ) is smooth, it may not be easy to discretize the transformed equation in ξ
in a way that exactly conserves the correct physical quantities in x. By contrast, a ﬁnite
volume method in the physical space automatically achieves this if we write it in terms
of ﬂuxes at the cell edges.
•
Using a Godunovtype method requires solving a Riemann problemat each cell interface,
and the transformed equations lead to a transformed Riemann problem. It is often simpler
to solve the original, physically meaningful Riemann problem in x.
For these reasons we will derive ﬁnite volume methods in the physical domain. However,
once the method has been derived, we will see that we can then view it as a discretization
of the transformed equation. This viewpoint is useful in implementing the methods, as we
can then express the method as a ﬁnite volume method with a capacity function applied
on the uniform ξgrid. As we will see, the capacity κ
i
of the i th grid cell [ξ
i −1/2
, ξ
i +1/2
] is
then the ratio of the physical cell length x
i
≡ (x
i +1/2
− x
i −1/2
) to ξ, which is a natural
measure of the capacity of the computational cell. For a smooth mapping X(ξ) this can
be viewed as an approximation to the capacity function κ(x) ≡ X
(ξ), the Jacobian of the
mapping, but the ﬁnite volume method remains valid and accurate even if the mapping is
not smooth.
In Chapter 23, we will see that this approach extends naturally to quadrilateral grids
in more than one space dimension. Again we will derive ﬁnite volume methods in the
6.17 Nonuniform Grids 125
irregular physical grid cells, but implement the methods using capacityform differencing
on a uniform rectangular grid.
We now derive a ﬁnite volume method in the physical domain. We have
x
i +1/2
x
i −1/2
q(x, t
n+1
) dx =
x
i +1/2
x
i −1/2
q(x, t
n
) dx
−
t
n+1
t
n
f
q
x
i +1/2
, t
dt −
t
n+1
t
n
f
q
x
i −1/2
, t
dt
,
(6.70)
which suggests the ﬁnite volume method
Q
n+1
i
= Q
n
i
−
t
x
i
F
Q
n
i
, Q
n
i +1
−F
Q
n
i −1
, Q
n
i
, (6.71)
where x
i
= x
i +1/2
− x
i −1/2
is the width of the i th cell and
Q
n
i
≈
1
x
i
x
i +1/2
x
i −1/2
q(x, t
n
) dx.
The numerical ﬂux F(Q
n
i −1
, Q
n
i
) should be, as usual, an approximation to
1
t
t
n+1
t
n
f
q
x
i −1/2
, t
dt.
For Godunov’s method, this is determined simply by solving the Riemann problem and
evaluating the ﬂux along x/t = 0. The fact that the grid is nonuniform is immaterial in
computing the Godunov ﬂux. The nonuniformity of the grid does come into the second
order correction terms, however, since approximating the slopes q
x
with cell values requires
paying attention to the grid spacing. This is discussed in Section 6.17.1.
Next we will see that the method (6.71) can be reinterpreted as a method on the uniform
computational grid. Let
κ
i
= x
i
/ξ,
where ξ is the uniform cell size in the computational grid shown on the left in Figure 6.7.
Then the method (6.71) can be written as
Q
n+1
i
= Q
n
i
−
t
κ
i
ξ
F
Q
n
i
, Q
n
i +1
−F
Q
n
i −1
, Q
n
i
. (6.72)
Let
¯ q(ξ, t ) = q(X(ξ), t ).
If we now assume that the coordinate mapping X(ξ) is differentiable, then the change of
variables x = X(ξ), for which dx = X
(ξ) dξ, gives
x
i +1/2
x
i −1/2
q(x, t ) dx =
ξ
i +1/2
ξ
i −1/2
q(X(ξ), t ) X
(ξ) dξ
=
ξ
i +1/2
ξ
i −1/2
¯ q(ξ, t )κ(ξ) dξ,
126 6 HighResolution Methods
where the capacity function κ(ξ) is the Jacobian X
(ξ), as expected. Hence the conservation
law
d
dt
x
i +1/2
x
i −1/2
q(x, t ) dx = f
q
x
i −1/2
, t
− f
q
x
i +1/2
, t
is transformed into
d
dt
ξ
i +1/2
ξ
i −1/2
¯ q(ξ, t )κ(ξ) dξ = f
¯ q
ξ
i −1/2
, t
− f
¯ q
ξ
i +1/2
, t
.
This has the form of the integral conservation law (6.63) in the computational domain. The
ﬁnite volume method (6.71), when rewritten as (6.72), can be viewed as a capacityform
differencing method on the uniform ξgrid.
We can also interpret Q
n
i
as an approximation to a cell average of ¯ q over the computational
domain:
Q
n
i
≈
1
x
i
x
i +1/2
x
i −1/2
q(x, t
n
) dx
=
1
κ
i
ξ
ξ
i +1/2
ξ
i −1/2
¯ q(ξ, t
n
)κ(ξ) dξ
≈
1
ξ
ξ
i +1/2
ξ
i −1/2
¯ q(ξ, t
n
) dξ. (6.73)
6.17.1 HighResolution Corrections
One way to derive highresolution methods for the advection equation q
t
+ ¯ uq
x
= 0 (with
¯ u > 0, say) on a nonuniform grid is to use the REA algorithm approach from Section 6.4,
which is easily extended to nonuniform grids. Given cell averages, we reconstruct a piece
wise linear function on each of the grid cells, evolve the advection equation exactly by
shifting this function over a distance ¯ u t , and average onto the grid cells to obtain new cell
averages. If the slopes are all chosen to be σ
n
i
= 0, then this reduces to the upwind method
Q
n+1
i
= Q
n
i
−
¯ u t
κ
i
ξ
Q
n
i
− Q
n
i −1
,
which has the form (6.72) with F(Q
n
i −1
, Q
n
i
) = ¯ uQ
n
i −1
. With nonzero slopes we obtain
Q
n+1
i
= Q
n
i
−
¯ u t
κ
i
ξ
Q
n
i
− Q
n
i −1
−
1
2
¯ u t
κ
i
ξ
(κ
i
ξ − ¯ u t )σ
n
i
−(κ
i −1
ξ − ¯ u t )σ
n
i −1
. (6.74)
Recall that on a uniform grid the Lax–Wendroff method is obtained by taking slopes
σ
n
i −1
=(Q
n
i
− Q
n
i −1
)/x. On a nonuniform grid the distance between cell centers is
Exercises 127
κ
i −1/2
ξ, where κ
i −1/2
=
1
2
(κ
i −1
+κ
i
), and the natural generalization of the Lax–Wendroff
method is obtained by setting
σ
n
i −1
=
Q
n
i
− Q
n
i −1
κ
i −1/2
ξ
. (6.75)
This corresponds to a correction ﬂux
˜
F
i −1/2
=
1
2
κ
i −1
κ
i −1/2
−
¯ u t
κ
i −1/2
ξ
¯ u
Q
n
i
− Q
n
i −1
. (6.76)
The natural generalization of this to systems of equations gives a correction ﬂux similar to
(6.68) but with the 1 replaced by κ
i
/κ
i −1/2
:
˜
F
i −1/2
=
1
2
M
w
p=1
κ
i −1
κ
i −1/2
−
t
κ
i −1/2
ξ
s
p
i −1/2
s
p
i −1/2
W
p
i −1/2
. (6.77)
For smooth κ this is essentially the same as (6.68), but for nonsmooth κ (6.77) might give
better accuracy.
Exercises
6.1. Verify that (6.13) results from integrating the piecewise linear solution ˜ q
n
(x, t
n+1
).
6.2. Compute the total variation of the functions
(a)
q(x) =
1 if x < 0,
sin(πx) if 0 ≤ x ≤ 3,
2 if x > 3,
(b)
q(x) =
1 if x < 0 or x = 3,
1 if 0 ≤ x ≤ 1 or 2 ≤ x < 3,
−1 if 1 < x < 2,
2 if x > 3.
6.3. Show that any TVD method is monotonicitypreserving. (But note that the converse
is not necessarily true: a monotonicitypreserving method may not be TVD on more
general data.)
6.4. Show that (6.25) is valid by showing that, for any function q(x), if we deﬁne discrete
values Q
i
by averaging q(x) over grid cells, then TV(Q) ≤ TV(q). Hint: Use the
deﬁnition (6.19) and the fact that the average value of q lies between the maximum
and minimum values on each grid cell.
6.5. Show that the minmod slope guarantees that (6.23) will be satisﬁed in general, and
hence the minmod method is TVD.
128 6 HighResolution Methods
6.6. Show that taking
δ
n
i −1/2
= Q
n
i
− Q
n
i −1
in (6.32) corresponds to using the downwind slope for σ in both cases ¯ u > 0 and
¯ u < 0, and that the resulting ﬂux gives the Lax–Wendroff method.
6.7. Show that if ¯ u < 0 we can apply Theorem 6.1 to the ﬂuxlimiter method (6.41) by
choosing
C
n
i −1
= 0,
D
n
i
= −ν +
1
2
ν(1 +ν)
φ
θ
n
i −1/2
−
φ
θ
n
i +1/2
θ
n
i +1/2
in order to show that the method is TVD provided −1 ≤ν ≤0 and the bound (6.44)
holds. Hence the same restrictions on limiter functions are found in this case as
discussed in Section 6.12.
6.8. Verify that (6.47) is required for symmetry.
6.9. Verify that (6.48) and (6.49) are equivalent and yield the Lax–Wendroff method.
6.10. Plot the van Leer limiter from (6.39b), and verify that it lies in the Sweby region
shown in Figure 6.6.
7
Boundary Conditions and Ghost Cells
So far we have only studied methods for updating the cell average Q
n
i
assuming that we
have neighboring cell values Q
n
i −1
and Q
n
i +1
and perhaps values further away as needed in
order to compute the ﬂuxes F
n
i −1/2
and F
n
i +1/2
. In practice we must always compute on some
ﬁnite set of grid cells covering a bounded domain, and in the ﬁrst and last cells we will not
have the required neighboring information. Instead we have some set of physical boundary
conditions, as discussed in Section 3.11, that must be used in updating these cell values.
One approach is to develop special formulas for use near the boundaries, which will
depend both on what type of boundary conditions are speciﬁed and on what sort of method
we are trying to match. However, in general it is much easier to think of extending the
computational domain to include a few additional cells on either end, called ghost cells,
whose values are set at the beginning of each time step in some manner that depends on the
boundary conditions and perhaps the interior solution.
Figure 7.1 shows a grid with two ghost cells at each boundary. These values provide
the neighboringcell values needed in updating the cells near the physical domain. The
updating formula is then exactly the same in all cells, and there is no need to develop
a special ﬂuxlimiter method, say, that works with boundary data instead of initial data.
Instead the boundary conditions must be used in deciding how to set the values of the ghost
cells, but this can generally be done in a way that depends only on the boundary conditions
and is decoupled entirely from the choice of numerical method that is then applied.
Suppose the problem is on the physical domain [a, b], which is subdivided into cells
C
1
, C
2
, . . . , C
N
with x
1
=a and x
N+1
=b, so that x =(b −a)/N. If we use a method for
which F
n
i −1/2
depends only on Q
n
i −1
and Q
n
i
, then we need only one ghost cell on either end.
The ghost cell C
0
= (a − x, a) allows us to calculate the ﬂux F
1/2
at the left boundary
while the ghost cell C
N+1
=(b, b + x) is used to calculate F
n
N+1/2
at x =b. With a ﬂux
limiter method of the type developed in Chapter 6, we will generally need two ghost cells at
each boundary, since, for example, the jump Q
0
− Q
−1
will be needed in limiting the ﬂux
correction in F
1/2
. For a method with an even wider stencil, additional ghost cells would be
needed. In general we might have m
BC
ghost cells at each side.
We will refer to the solution in the original domain [a, b] as the interior solution; it is
computed in each time step by the numerical method. At the start of each time step we have
the interior values Q
n
1
, . . . , Q
n
N
obtained from the previous time step (or from the initial
conditions if n = 0), and we apply a boundarycondition procedure to ﬁll the ghost cells
with values Q
n
i
for i = 1 −m
BC
, . . . , 0 and i = N +1, . . . , N +m
BC
before applying the
129
130 7 Boundary Conditions and Ghost Cells
....
Q
−1
Q
0 Q
1
Q
2
Q
N
Q
N+1
Q
N+2
x
1/2
x = a
x
N+1/2
x = b
Fig. 7.1. The computational domain [a, b] is extended to a set of ghost cells for specifying boundary
conditions.
method on the next time step. In CLAWPACK this is done in a subroutine bc1.f that is called
at the beginning of each time step. The default routine claw/clawpack/1d/lib/bc1
implements most of the particular boundary conditions discussed in this chapter. We will
look at several examples to see howthe ghostcell values might be set in order to implement
various physical boundary conditions. In general we will discuss the boundary conditions
for the case m
BC
= 2, but they can easily be extended to larger values if necessary.
7.1 Periodic Boundary Conditions
Periodic boundary conditions q(a, t ) = q(b, t ) are very easy to impose with any numerical
method. In updating Q
1
we need values Q
0
to the left and Q
2
to the right (for a threepoint
method). By periodicity the value Q
0
should agree with the value Q
N
in the last cell. One
could code the formula for updating Q
1
specially to use Q
N
in place of the value Q
i −1
that would normally be used for i > 1, but it is simpler to use the ghostcell approach and
simply set Q
n
0
= Q
n
N
before computing ﬂuxes and updating the cell values, so that the same
formula can then be used everywhere. With a ﬁvepoint stencil we need to ﬁll two ghost
cells at each boundary, and we set
Q
n
−1
= Q
n
N−1
, Q
n
0
= Q
n
N
, Q
n
N+1
= Q
n
1
, Q
n
N+2
= Q
n
2
(7.1)
at the start of each time step. These boundary conditions are implemented in the
CLAWPACKroutine claw/clawpack/1d/lib/bc1.f and invoked by setting mthbc(1) = 2
and mthbc(2) = 2.
7.2 Advection
Consider the advection equation on [a, b] with ¯ u > 0 and the boundary condition
q(a, t ) = g
0
(t ), (7.2)
where g
0
(t ) is a given function. Recall from Section 3.11 that we cannot specify a boundary
condition at x = b. We may need to specify a boundary condition at x = b for the numerical
method, however, if the stencil for computing Q
n+1
i
involves points to the right of x
i
.
7.2.1 Outﬂow Boundaries
First we consider the outﬂow boundary at x = b. If we use a onesided method such as
upwind or Beam–Warming, then we do not need any numerical boundary condition. If we
7.2 Advection 131
implement the method using ghost cells, then we can assign arbitrary values to the ghost
cells on the right with no effect on the interior solution, since these values will never be used.
If we use a threepoint method such as Lax–Wendroff that does use values to the right,
then some numerical boundary conditions must be speciﬁed. We must in general take some
care in how we specify these to obtain a stable and accurate method.
One possibility is to use a fully upwind method at the rightmost point, together with the
Lax–Wendroff method at all other points. This works quite well. Note, however, that the
Lax–Wendroff method allows information to propagate from right to left, even though
the exact solution to the advection equation does not. So there is the possibility that noise
generated at the right boundary by this switch in method will propagate back into the domain
and contaminate the solution elsewhere, and perhaps even cause an instability. The Lax–
Wendroff method is highly dissipative for leftgoing waves, and so this does not cause a
noticeable problem, and one can prove that the resulting method is stable. Indeed, a similar
change in method occurs frequently with ﬂuxlimiter methods, with only slight loss in
accuracy.
In general, the theory of stability for the IBVP is much more subtle and difﬁcult than for
the Cauchy problem. See, for example, [427], [459] for an introduction to this topic.
Rather than explicitly switching to a different formula at the right boundary, we can
achieve the same effect by setting ghost cell values by extrapolation from the interior
solution. If the ghostcell value Q
n
N+1
is set based on Q
n
N
, Q
n
N−1
, . . . , then the new value
Q
n+1
N
will effectively be computed on the basis of values to the left alone, even if the formula
depends on Q
n
N+1
, and hence this reduces to some sort of upwind method. The simplest
approach is to use a zeroorder extrapolation, meaning extrapolation by a constant function.
We simply set
Q
n
N+1
= Q
n
N
, Q
n
N+2
= Q
n
N
(7.3)
at the start of each time step. Then we have Q
n
N+1
= 0 as the value δ
n
N+1/2
used in the
ﬂux modiﬁcation to F
n
N+1/2
in (6.32). This ﬂux then reduces to the upwind ﬂux,
F
n
N+1/2
= ¯ uQ
n
N
,
since ¯ u > 0. Note that the method may not reduce to the standard ﬁrstorder upwind method
in the last cell, however, since δ
n
N−1/2
( = Q
n
N−1/2
= Q
n
N
− Q
n
N−1
for the Lax–Wendroff
method) may be nonzero. But the resulting method behaves in roughly the same manner.
One might also consider ﬁrstorder extrapolation, based on ﬁtting a linear function
through the interior solution. This gives
Q
n
N+1
= Q
n
N
+
Q
n
N
− Q
n
N−1
= 2Q
n
N
− Q
n
N−1
. (7.4)
In this case Q
n
N+1/2
=Q
n
N−1/2
and the correction terms in F
n
N−1/2
and F
n
N+1/2
will cancel
out (assuming the limiter function satisﬁes ø(1) = 1). Nowthe update for Q
n+1
n
does reduce
to the standard ﬁrstorder upwind method.
The idea of extrapolation at outﬂow boundaries turns out to be extremely powerful more
generally, even for systems of equations where there are both incoming and outgoing charac
teristics. Often we have artiﬁcial computational boundaries that arise simply because we can
only solve the problem on a bounded domain. At such boundaries we often want to have no
132 7 Boundary Conditions and Ghost Cells
incoming signal, though there may be outgoing waves that should leave the domain cleanly
without generating spurious reﬂections at the artiﬁcial boundary. Zeroorder extrapolation,
coupled with the methods we are studying that perform characteristic decomposition in the
solution to each Riemann problem, is often a very effective way to accomplish this. This is
discussed in Section 7.3.1 for linear acoustics and will be investigated later for nonlinear
and multidimensional problems. Firstorder extrapolation might seem even better, but can
lead to stability problems and is not recommended in general.
Zeroorder extrapolation boundary conditions are implemented in CLAWPACK as one
of the options that can be automatically invoked when using claw1ez as described in
Chapter 5. The ghostcell values are set in claw/clawpack/1d/lib/bc1.f and invoked
by setting mthbc(i) = 1, where i=1 for the left boundary or i=2 for the right boundary.
(See Section 5.4.6.)
7.2.2 Inﬂow Boundary Conditions
Now consider the inﬂow boundary at x = a for the advection equation, where we specify
the boundary condition (7.2). One approach would be to compute the exact ﬂux F
n
1/2
by
integrating along the boundary,
F
n
1/2
=
1
t
t
n+1
t
n
¯ uq(a, t ) dt
=
¯ u
t
t
n+1
t
n
g
0
(t ) dt, (7.5)
and use this in the ﬂuxdifferencing formula for Q
n+1
1
. Alternatively, a secondorder accurate
approximation such as
F
n
1/2
= ¯ ug
0
(t
n
+t /2) (7.6)
could be used instead.
Note that for a ﬁvepoint method we also need a special formula for the ﬂux F
n
3/2
, which
might be more difﬁcult to compute by this approach.
Again, for generality it is often simpler instead to ﬁnd a way to set the ghostcell values
Q
n
0
(and perhaps Q
n
−1
) so that the same interior method can be used at all points. For the
advection equation we can easily compute sensible values using our knowledge of the exact
solution. We would like to set
Q
n
0
=
1
x
a
a−x
q(x, t
n
) dx.
Of course the true solution isn’t even deﬁned for x <a, but we can easily extend the solution
past the boundary using our knowledge of characteristics, setting
q(x, t
n
) = q
a, t
n
+
a − x
¯ u
= g
0
t
n
+
a − x
¯ u
. (7.7)
7.3 Acoustics 133
Then
Q
n
0
=
1
x
a
a−x
g
0
t
n
+
a − x
¯ u
dx
=
¯ u
x
t
n
+x/¯ u
t
n
g
0
(τ) dτ. (7.8)
Again we could approximate this integral by the secondorder midpoint approximation,
obtaining
Q
n
0
= g
0
t
n
+
x
2¯ u
, (7.9)
which is also what we would get if we simply evaluated the cellcenter value q(a−x/2, t
n
)
using (7.7). Similarly, for the second ghost cell we could set
Q
n
−1
= g
0
t
n
+
3 x
2¯ u
.
Specifying such boundary conditions in CLAWPACK requires modifying the bc1 routine
to set the ghostcell values appropriately. See [claw/book/chap7/advinflow] for an
example.
7.3 Acoustics
Similar ideas can be applied to develop boundarycondition procedures for systems of
equations. The situation may be complicated by the fact that the system can have both
positive and negative eigenvalues, so that each boundary will typically have both incoming
and outgoing characteristics. Other sorts of physical boundary conditions, such as a solid
wall where waves are expected to reﬂect, must also be studied. Many of these issues can be
illustrated for the simple case of linear acoustics as developed in Section 2.7, a linear system
of two equations with one eigenvalue of each sign. The boundarycondition procedures
developed here will later be seen to extend very easily to nonlinear systems such as the full
Euler equations of compressible ﬂow.
We consider the acoustics equations from (2.52),
p
t
+ K
0
u
x
= 0
ρ
0
u
t
+ p
x
= 0,
(7.10)
with a variety of different boundary conditions. The characteristic variables for this system
are
w
1
(x, t ) =
1
2Z
0
(−p + Z
0
u),
w
2
(x, t ) =
1
2Z
0
( p + Z
0
u),
(7.11)
where Z
0
is the impedance, as derived in Section 2.8.
134 7 Boundary Conditions and Ghost Cells
7.3.1 Nonreﬂecting Boundary Conditions
Suppose we wish to solve the Cauchy problemwith initial data u
◦
(x) and p
◦
(x) that vary with
x only in some region a
1
< x < b
1
, and are constant outside this interval, say
( p, u) =
( p
L
, u
L
) if x < a
1
,
( p
R
, u
R
) if x > b
1
.
We knowfromChapter 3 that the solution to the Cauchy problemwill consist of two waves,
each with ﬁxed shape depending on u
◦
and p
◦
. One propagates to the left with speed −c
0
and the other to the right with speed c
0
. Eventually these waves will separate completely
from one another (certainly for times t > (b
1
− a
1
)/c
0
) and leave a new constant state in
between. Note that the characteristic variables (7.11) satisfy
w
2
(a
1
, t ) =
1
2Z
0
( p
L
+ Z
0
u
L
) for all t ≥ 0,
w
1
(b
1
, t ) =
1
2Z
0
(−p
R
+ Z
0
u
R
) for all t ≥ 0.
(7.12)
If we nowwant to compute this solution numerically, we must choose some ﬁnite domain
a ≤ x ≤ b on which to perform the computation, and we will suppose this domain includes
the interval where the data is speciﬁed, i.e., a < a
1
< b
1
< b. For short times the solution
should remain constant at the boundaries a and b, but eventually the acoustic waves should
pass out through these boundaries. If we want to compute over longer times, then we must
specify the boundary conditions in such a way that the waves leave the region cleanly,
without generating any signal in the incoming characteristic variable propagating back into
the computational domain.
The points x = a and x = b are artiﬁcial boundaries, in the sense that they are only intro
duced to make the computational domain ﬁnite, and do not correspond to physical bound
aries. Hence we want to impose nonreﬂecting boundary conditions at these boundaries that
do not introduce spurious reﬂections of the outgoing acoustic waves. Such boundary condi
tions are also called absorbing boundary conditions, since they are supposed to completely
absorb any wave that hits them. Such boundary conditions are extremely important in many
practical applications. We often wish to model what is happening in a small portion of
physical space that must be truncated artiﬁcially at some point. Consider the problem of
modeling seismic waves in the earth, or ﬂow around an airplane. We cannot hope to model
the entire earth or atmosphere, nor should we need to in order to understand localized phe
nomena. We want to cut off the domain far enough away that we will have a good model,
but as close in as possible to reduce the size of the computational domain and the computing
time required. Specifying good absorbing boundary conditions is often crucial in obtaining
useful results. A variety of sophisticated approaches have been developed for specifying
appropriate numerical boundary conditions. See Section 21.8.5 for some references and
further discussion.
With Godunovtype methods that involve solving the Riemann problem at each inter
face, it turns out that simply using zeroorder extrapolation often gives a reasonable set
of absorbing boundary conditions that is extremely simple to implement. For the simple
7.3 Acoustics 135
onedimensional acoustics problem, we can analyze this choice completely using the char
acteristic decomposition.
In fact, one approach to solving the problemfor this linear systemwould be to diagonalize
the equations, obtaining scalar advection equations for the characteristic variables w
1
and w
2
from (7.11). The numerical method can also be diagonalized and yields updating formulas
for W
1
= (−Q
1
+ Z
0
Q
2
)/2Z
0
and W
2
= (Q
1
+ Z
0
Q
2
)/2Z
0
. At the boundary x = a,
for example, the variable w
1
is the outgoing variable and we already know that zeroorder
extrapolation can be used for this variable from Section 7.2.1. For the incoming variable
w
2
we want to set the value as a function g
0
(t ), following Section 7.2.2. Since we want
to insure that no signal ﬂows into the domain, regardless of what is ﬂowing out in w
1
, the
correct value to set is
w
2
(a, t ) =
1
2Z
0
( p
L
+ Z
0
u
L
)
for all t (recall (7.12)). Following Section 7.2.1 this would suggest setting both the ghost
cell values to this value,
W
2
0
=
1
2Z
0
( p
L
+ Z
0
u
L
), W
2
−1
=
1
2Z
0
( p
L
+ Z
0
u
L
), (7.13)
together with extrapolation of W
1
. From these ghostcell values for W we could then
compute the required ghostcell values for Q.
However, since W
2
is already constant near the point x =a, we expect that W
2
1
=( p
L
+
Z
0
u
L
)/2Z
0
, and so the boundary conditions (7.13) can also be obtained by simply using
zeroorder extrapolation for W
2
as well as for W
1
. But now, if we extrapolate both of the
characteristic variables and then compute Q
0
and Q
−1
, we will ﬁnd that these values are
simply what would be obtained by zeroorder extrapolation of Q. So we do not need to go
through the diagonalization at all in setting the boundary conditions, but can simply set
Q
n
0
= Q
n
1
, Q
n
−1
= Q
n
1
in each time step.
Note that by setting Q
0
= Q
1
we insure that the solution to the Riemann problem at the
interface x
1/2
consists of no waves, or more properly that the wave strengths α
p
1/2
are all
zero. So in particular there are no waves generated at the boundary regardless of what is
happening in the interior, as desired for nonreﬂecting boundary conditions.
There are also no outgoing waves generated at x
1/2
, which may be incorrect if an acoustic
wave in w
1
should in fact be leaving the domain. But any outgoing waves would only be
used to update the solution in the ghost cell C
0
, and it is not important that we update this
cell properly. In fact, the value Q
0
is not updated at all by the interior algorithm. Instead
this value is reset by extrapolation again at the start of the next time step.
7.3.2 Incoming Waves
In the previous section we assumed that we wanted incoming waves to have zero strength.
In some problems we may need to specify some incoming signal. For example, we might
136 7 Boundary Conditions and Ghost Cells
wish to study what happens when a sinusoidal sound wave at some frequency ω hits a region
with different material properties, in which case some of the energy will be reﬂected (see
Section 9.6). Suppose the material properties vary only in a region a
1
< x < b
1
and we
wish to compute on a larger region a < x < b. Then we want to impose the boundary
condition
w
2
(a, t ) = sin(ωt ) (7.14)
as the incoming signal, together with nonreﬂection of any outgoing signal that has been
generated within the domain. We must now apply some characteristic decomposition in
the process of applying the boundary procedure in order to impose the correct boundary
conditions. If we decompose Q
1
into Q
1
= W
1
1
r
1
+ W
2
1
r
2
, then the ghost cell value Q
0
should be set as
Q
0
= W
1
1
r
1
+sin(ω(t
n
+x/2c
0
)) r
2
.
Alternatively, we couldﬁrst extrapolate the whole vector Q andthenreset the w
2
component,
setting
Q
0
= Q
1
+
sin(ω(t
n
+x/2c
0
)) − W
1
1
r
2
.
See [claw/book/chap7/acouinflow] for an example.
For the acoustics system with only two equations, the two approaches are essentially
equivalent in terms of the work required. But if we had a larger system of m equations and
wanted to impose an incoming wave in only one characteristic family, e.g.,
w
j
(a, t ) = g
0
(t ),
for some j (with zerostrength signal in other incoming characteristics and nonreﬂection
of outgoing waves), then we could set
Q
0
= Q
1
+
g
0
(t
n
+x/2λ
j
) − W
j
1
r
j
,
where W
j
1
=
j
Q
1
is the eigencoefﬁcient of r
j
in Q
1
and λ
j
is the corresponding eigen
value.
7.3.3 Solid Walls
Consider a tube of gas with a solid wall at one end. In this case we expect acoustic waves
to reﬂect at this boundary in a particular way – see Section 3.11 for the relation between
w
1
and w
2
. Rather than working with the characteristic variables, however, in this case it is
easier to return to the physical boundary condition itself. For a solid wall at x = a this is
u(a, t ) = 0. (7.15)
7.3 Acoustics 137
The key observation is the following: Suppose we take any data ( p
0
(x), u
0
(x)) deﬁned for
all x > a and extend it to x < a by setting
p
0
(a −ξ) = p
0
(a +ξ),
u
0
(a −ξ) = −u
0
(a +ξ),
(7.16)
for ξ > 0. Then if we solve the Cauchy problem with this extended data, the solution we
obtain for x > a will agree exactly with the solution to the halfspace problem on x > a
with a solid wall boundary condition (7.15) at x = a. This follows from symmetry: the
conditions (7.16) will continue to hold for t > 0 and in particular u(a) = −u(a) must be
zero. See also Exercise 7.2.
This suggests the following formulas for ghostcell values in each time step:
for Q
0
: p
0
= p
1
, u
0
= −u
1
,
for Q
−1
: p
−1
= p
2
, u
−1
= −u
2
.
(7.17)
This imposes the necessary symmetry at the start of each time step.
Solidwall boundary conditions are implemented in the CLAWPACK library routine
claw/clawpack/1d/lib/bc1.f and invoked by setting mthbc(i) = 3, where i = 1 for
the left boundary or i = 2 for the right boundary. This assumes that the solidwall bound
ary condition can be set by reﬂecting all components of Q and then negating the second
component, as in (7.17). This works for the acoustics equations and also for several other
systems of equations that we will study in this book, including the shallow water equations
and several forms of the gas dynamics equations. Related boundary conditions can also be
used for elastic waves in solids with ﬁxed or free boundaries; see Section 22.4.
7.3.4 Oscillating Walls
Now suppose that the solid wall at x = a is oscillating with some very small amplitude,
generating an acoustic wave in the gas. This is a common situation in acoustics: small
scale molecular vibrations of solid objects give rise to many familiar sounds. For very
smallamplitude motions we can still use the linear acoustics equations on the ﬁxed domain
a ≤ x ≤ b but with the boundary condition
u(a, t ) = U(t ) (7.18)
to simulate the vibrating wall. For a puretone oscillation we might take
U(t ) = sin(ωt ), (7.19)
for example. We can implement this by setting the following ghostcell values:
for Q
0
: p
0
= p
1
, u
0
= 2U(t
n
) −u
1
,
for Q
−1
: p
−1
= p
2
, u
−1
= 2U(t
n
) −u
2
.
(7.20)
These reduce to (7.17) if U(t ) ≡ 0. The rationale for this set of boundary conditions is
explored in Exercise 7.2.
138 7 Boundary Conditions and Ghost Cells
Exercises
7.1. If we use the ghostcell value Q
n
0
from (7.9) in the Lax–Wendroff method, what ﬂux
F
n
1/2
will be computed, and how does it compare with (7.6)? Note that if the Courant
number is near 1, then x/¯ u ≈ t .
7.2. (a) For acoustics with a solidwall boundary, we set the ghostcell values (7.17)
and then solve a Riemann problem at x
1/2
= a with data
Q
0
=
p
1
−u
1
, Q
1
=
p
1
u
1
.
Show that the solution to this Riemann problem has an intermediate state q
∗
with u
∗
= 0 along the wall, another reason why this is the sensible boundary
condition to impose.
(b) Give a similar interpretation for the oscillatingwall boundary conditions (7.20).
7.3. The directory [claw/book/chap7/standing] models a standing wave. The acous
tics equations are solved with ρ
0
= K
0
= 1 in a closed tube of length 1 with with
initial data p
◦
(x) = cos(2πx) and u
◦
(x) = 0. Solidwall boundary conditions are
used at each end. Modify the input data in claw1ez.data to instead use zeroorder
extrapolation at the right boundary x = 1. Explain the resulting solution using the
theory of Section 3.11.
8
Convergence, Accuracy, and Stability
Whenever we use a numerical method to solve a differential equation, we should be con
cerned about the accuracy and convergence properties of the method. In practice we must
apply the method on some particular discrete grid with a ﬁnite number of points, and we
wish to ensure that the numerical solution obtained is a sufﬁciently good approximation
to the true solution. For real problems we generally do not have the true solution to com
pare against, and we must rely on some combination of the following techniques to gain
conﬁdence in our numerical results:
•
Validation on test problems. The method (and particular implementation) should be tested
on simpler problems for which the true solution is known, or on problems for which a
highly accurate comparison solution can be computed by other means. In some cases
experimental results may also be available for comparison.
•
Theoretical analysis of convergence and accuracy. Ideally one would like to prove that
the method being used converges to the correct solution as the grid is reﬁned, and also
obtain reasonable error estimates for the numerical error that will be observed on any
particular ﬁnite grid.
In this chapter we concentrate on the theoretical analysis. Here we consider only the Cauchy
problem on the unbounded spatial domain, since the introduction of boundary conditions
leads to a whole new set of difﬁculties in analyzing the methods. We will generally assume
that the initial data has compact support, meaning that it is nonzero only over some bounded
region. Then the solution to a hyperbolic problem(which has ﬁnite propagation speeds) will
have compact support for all time, and so the integrals over the whole real line that appear
below really reduce to ﬁnite intervals and we don’t need to worry about issues concerning
the behavior at inﬁnity.
8.1 Convergence
In order to talk about accuracy or convergence, we ﬁrst need a way to quantify the error. We
are trying to approximate a function of space and time, and there are many possible ways to
measure the magnitude of the error. In one space dimension we have an approximation Q
n
i
at each point on space–time grid, or in each grid cell when using a ﬁnite volume method.
For comparison we will let q
n
i
represent the exact value we are hoping to approximate well.
139
140 8 Convergence, Accuracy, and Stability
For a ﬁnite difference method we would probably choose the pointwise value
q
n
i
= q(x
i
, t
n
), (8.1)
while for a ﬁnite volume method we might instead want to compare Q
n
i
with
q
n
i
=
1
x
x
i +1/2
x
i −1/2
q(x, t
n
) dx. (8.2)
If the function q(x, t ) is sufﬁciently smooth, then the pointwise value (8.1) evaluated at
the cell center x
i
agrees with the cell average (8.2) to O(x
2
), and so for the methods
considered in this book (which are generally at most secondorder accurate), comparison
with the pointwise value can be used even for ﬁnite volume methods and is often simpler.
To discuss convergence we must ﬁrst pick some ﬁnite time T over which we wish to
compute. We expect errors generally to grow with time, and so it would be unreasonable to
expect that any ﬁnite grid would be capable of yielding good solutions at arbitrarily large
times. Note that as we reﬁne the grid, the number of time steps to reach time T will grow
like T/t and go to inﬁnity (in the limit that must be considered in convergence theory),
and so even in this case we must deal with an unbounded number of time steps. We will
use N to indicate the time level corresponding to time T = Nt . The global error at this
time will be denoted by
E
N
= Q
N
−q
N
,
and we wish to obtain bounds on this grid function as the grid is reﬁned.
To simplify notation we will generally assume that t and x are related in a ﬁxed
manner as we reﬁne the grid. For hyperbolic problems it is reasonable to assume that the
ratio t /x is ﬁxed, for example. Then we can speak of letting t →0 to reﬁne the grid,
and speak of convergence with order s if the errors vanish like O(t
s
) or as O(x
s
), which
are the same thing.
8.1.1 Choice of Norms
To quantify the error, we must choose some norm in which to measure the error at a ﬁxed
time. The standard set of norms most commonly used are the pnorms
E
p
=
x
∞
i =−∞
E
i

p
1/p
. (8.3)
These are discrete analogues of the functionspace norms
E
p
=
∞
−∞
E(x)
p
dx
1/p
. (8.4)
Note that the factor x in (8.3) is very important to give the correct scaling and order of
accuracy as the grid is reﬁned.
In particular, the 1norm (with p =1) is commonly used for conservation laws, since
integrals of the solution itself are of particular importance. The 2norm is often used for
8.2 OneStep and Local Truncation Errors 141
linear problems because of the utility of Fourier analysis in this case (the classical von
Neumann analysis of linear ﬁnite difference methods; see Section 8.3.3). We will use ·
without any subscript when we don’t wish to specify a particular norm. Note that for a
system of m equations, E ∈ R
m
and the absolute value in (8.3) and (8.4) represents some
vector norm on R
m
.
We say that the method is convergent at time T in the norm · if
lim
t →0
Nt =T
E
N
= 0.
The method is said to be accurate of order s if
E
N
= O(t
s
) as t → 0. (8.5)
Ideally we might hope to have pointwise convergence as the grid is reﬁned. This amounts
to using the max norm (or ∞norm) to measure the error:
E
∞
= max
−∞<i <∞
E
i
. (8.6)
This is the limiting case p → ∞of (8.3).
If the solution q(x, t ) is smooth, then it may be reasonable to expect pointwise conver
gence. For problems with discontinuous solutions, on the other hand, there will typically
always be some smearing at one or more grid points in the neighborhood of the disconti
nuity. In this case we cannot expect convergence in the max norm, no matter how good the
method is. In such cases we generally don’t care about pointwise convergence, however.
Convergence in the 1norm is more relevant physically, and we may still hope to obtain
this. In general, the rate of convergence observed can depend on what norm is being used,
and it is important to use an appropriate norm when measuring convergence. Differences
are typically greatest between the max norm and other choices (see Section 8.5 for another
example). Except in fairly rare cases, the 1norm and 2norm will give similar results, and
the choice of norm may depend mostly on which yields an easier mathematical analysis,
e.g., the 1norm for conservation laws and the 2norm for linear equations.
8.2 OneStep and Local Truncation Errors
It is generally impossible to obtain a simple closedform expression for the global error
after hundreds or thousands of time steps. Instead of trying to obtain the error directly,
the approach that is widely used in studying numerical methods for differential equations
consists of a twopronged attack on the problem:
•
Study the error introduced in a single time step, showing that the method is consistent
with the differential equation and introduces a small error in any one step.
•
Show that the method is stable, so that these local errors do not grow catastrophically
and hence a bound on the global error can be obtained in terms of these local errors.
If we can get a bound on the local error in an appropriate sense, then stability can be used
to convert this into a bound on the global error that can be used to prove convergence.
142 8 Convergence, Accuracy, and Stability
Moreover we can generally determine the rate of convergence and perhaps even obtain
reasonable error bounds. The fundamental theorem of numerical methods for differential
equations can then be summarized brieﬂy as
consistency +stability ⇐⇒convergence. (8.7)
This theorem appears in various forms in different contexts, e.g., the Lax equivalence
theorem for linear PDEs (Section 8.3.2) or Dahlquist’s equivalence theorem for ODEs. The
exact formof “stability” needed depends on the type of equation and method. In this section
we will study the local error, and in Section 8.3 we turn to the question of stability.
A general explicit numerical method can be written as
Q
n+1
= N(Q
n
),
where N(·) represents the numerical operator mapping the approximate solution at one time
step to the approximate solution at the next. The onestep error is deﬁned by applying the
numerical operator to the true solution (restricted to the grid) at some time and comparing
this with the true solution at the next time:
onestep error = N(q
n
) −q
n+1
. (8.8)
Here q
n
and q
n+1
represent the true solution restricted to the grid by (8.1) or (8.2). This
gives an indication of how much error is introduced in a single time step by the numerical
method. The local truncation error is deﬁned by dividing this by t :
τ
n
=
1
t
[N(q
n
) −q
n+1
]. (8.9)
As we will see in Section 8.3, the local truncation error typically gives an indication of
the magnitude of the global error, and particularly the order of accuracy, in cases when the
method is stable. If the local truncation error is O(x
s
) as s →0, then we expect the global
error to have this same behavior.
We say that the method is consistent with the differential equation if the local truncation
error vanishes as t →0for all smoothfunctions q(x, t ) satisfyingthe differential equation.
In this case we expect the method to be convergent, provided it is stable.
The local truncation error is relatively easy to investigate, and for smooth solutions can
be well approximated by simple Taylor series expansions. This is illustrated very brieﬂy in
the next example.
Example 8.1. Consider the ﬁrstorder upwind method for the advection equation with
¯ u > 0,
Q
n+1
i
= Q
n
i
−
t
x
¯ u
Q
n
i
− Q
n
i −1
.
Applying this method to the true solution gives the local truncation error
τ
n
=
1
t
q(x
i
, t
n
) −
t
x
¯ u[q(x
i
, t
n
) −q(x
i −1
, t
n
)] −q(x
i
, t
n+1
)
.
(8.10)
8.3 Stability Theory 143
We nowexpand q(x
i −1
, t
n
) and q(x
i
, t
n+1
) in Taylor series about (x
i
, t
n
) and cancel common
terms to obtain
τ
n
= −[q
t
(x
i
, t
n
) + ¯ uq
x
(x
i
, t
n
)] +
1
2
x ¯ uq
xx
(x
i
, t
n
) −
1
2
t q
t t
(x
i
, t
n
) +· · · . (8.11)
The ﬁrst term in this expression is identically zero, because we assume that q is an exact
solution to the advection equation and hence q
t
+ ¯ uq
x
= 0, so we ﬁnd that
Upwind: τ
n
=
1
2
¯ u x q
xx
(x
i
, t
n
) −
1
2
t q
t t
(x
i
, t
n
) +O(t
2
)
=
1
2
¯ u x (1 −ν) q
xx
(x
i
, t
n
) +O(t
2
), (8.12)
where
ν ≡ ¯ u t /x (8.13)
is the Courant number. The truncation error is dominated by an O(x) term, and so the
method is ﬁrstorder accurate.
Similarly, one can compute the local truncation errors for other methods, e.g.,
Lax–Friedrichs: τ
n
=
1
2
x
2
t
− ¯ u
2
t
q
xx
(x
i
, t
n
) +O(t
2
) (8.14)
=
1
2
¯ u x (1/ν −ν)q
xx
(x
i
, t
n
) +O(t
2
), (8.15)
Lax–Wendroff: τ
n
= −
1
6
¯ u(x)
2
(1 −ν
2
)q
xxx
(x
i
, t
n
) +O(t
3
). (8.16)
Note that the Lax–Wendroff method is secondorder accurate and the dominant term
in the truncation error depends on the third derivative of q, whereas the upwind and
Lax–Friedrichs methods are both ﬁrstorder accurate with the dominant error term de
pending on q
xx
. The relation between these errors and the diffusive or dispersive nature of
the methods is discussed in Section 8.6.
8.3 Stability Theory
In this section we review the basic ideas of stability theory and the derivation of global
error bounds from information on the local truncation error. The form of stability bounds
discussed here are particularly useful in analyzing linear methods. For nonlinear methods
they may be hard to apply, and in Section 12.12 we discuss a different approach to stability
theory for such methods.
The essential requirements and importance of stability can be easily seen from the fol
lowing attempt to bound the global error using a recurrence relation. In time step n suppose
we have an approximation Q
n
with error E
n
, so that
Q
n
= q
n
+ E
n
.
144 8 Convergence, Accuracy, and Stability
We apply the numerical method to obtain Q
n+1
:
Q
n+1
= N(Q
n
) = N(q
n
+ E
n
),
and the global error is now
E
n+1
= Q
n+1
−q
n+1
= N(q
n
+ E
n
) −q
n+1
= N(q
n
+ E
n
) −N(q
n
) +N(q
n
) −q
n+1
= [N(q
n
+ E
n
) −N(q
n
)] +t τ
n
. (8.17)
By introducing N(q
n
) we have written the new global error as the sum of two terms:
•
N(q
n
+E
n
) −N(q
n
), which measures the effect of the numerical method on the previous
global error E
n
,
•
t τ
n
, the new onestep error introduced in this time step.
The study of the local truncation error allows us to bound the new onestep error. Stability
theory is required to bound the other term, N(q
n
+ E
n
) −N(q
n
).
8.3.1 Contractive Operators
The numerical solution operator N(·) is called contractive in some norm · if
N(P) −N(Q) ≤ P − Q (8.18)
for any two grid functions P and Q. If the method is contractive, then it is stable in this norm
and we can obtain a bound on the global error from (8.17) very simply using P = q
n
+ E
n
and Q = q
n
:
E
n+1
≤ N(q
n
+ E
n
) −N(q
n
) +t τ
n
≤ E
n
+t τ
n
. (8.19)
Applying this recursively gives
E
N
≤ E
0
+t
N−1
n=1
τ
n
.
Suppose the local truncation error is bounded by
τ ≡ max
0≤n≤N
τ
n
.
Then we have
E
N
≤ E
0
+ Nt τ
≤ E
0
+ Tτ (for Nt = T). (8.20)
8.3 Stability Theory 145
The term E
0
measures the error in the initial data on the grid, and we require that
E
0
→0 as t →0 in order to be solving the correct initialvalue problem. If the method
is consistent, then also τ →0 as t →0 and we have proved convergence. Moreover,
if τ = O(t
s
), then the global error will have this same behavior as t →0 (provided
the initial data is sufﬁciently accurate), and the method has global order of accuracy s.
Actually a somewhat weaker requirement on the operator N is sufﬁcient for stability.
Rather than the contractive property (8.18), it is sufﬁcient to have
N(P) −N(Q) ≤ (1 +α t )P − Q (8.21)
for all P and Q, where α is some constant independent of t as t →0. (Recall that
the onestep operator N depends on t even though we haven’t explicitly included this
dependence in the notation.) If (8.21) holds then the above proof still goes through with a
slight modiﬁcation. We now have
E
n+1
≤ (1 +α t )E
n
+t τ,
and so
E
N
≤ (1 +α t )
N
E
0
+t
N−1
n=1
(1 +α t )
N−1−n
τ
≤ e
αT
(E
0
+ Tτ) (for Nt = T). (8.22)
In this case the error may grow exponentially in time, but the key fact is that this growth is
bounded independently of the time step t . For ﬁxed T we have a bound that goes to zero
with t . This depends on the fact that any growth in error resulting from the operator N is
at most order O(t ) in one time step, which is what (8.21) guarantees.
8.3.2 Lax–Richtmyer Stability for Linear Methods
If the operator N(·) is a linear operator, then N(q
n
+ E
n
) = N(q
n
) + N(E
n
), and so
N(q
n
+ E
n
) −N(q
n
) reduces to simply N(E
n
). In this case, the condition (8.21) reduces
simply to requiring that
N(E
n
) ≤ (1 +α t )E
n
(8.23)
for any grid function E
n
, which is generally simpler to check. This can also be expressed
as a bound on the norm of the linear operator N,
N ≤ 1 +α t. (8.24)
An even looser version of this stability requirement can be formulated in the linear case.
We really only need that, for each time T, there is a constant C such that
N
n
≤ C (8.25)
for all n ≤ N = T/t , i.e., the nth power of the operator N is uniformly bounded up to this
time, for then all the terms in (8.22) are uniformly bounded. For linear methods, this form
146 8 Convergence, Accuracy, and Stability
of stability is generally referred to as Lax–Richtmyer stability. The result (8.7) is called the
Lax equivalence theorem in this context. See [369] for a rigorous proof. Note that if (8.24)
holds, then we can take C = e
αT
in (8.25).
Classical methods such as the ﬁrstorder upwind or the Lax–Wendroff method for the
linear advection equation are all linear methods, and this form of the stability condition
can be used. (See Section 8.3.4 for an example.) The highresolution methods developed in
Chapter 6 are not linear methods, however, since the limiter function introduces nonlinearity.
Proving stability of these methods is more subtle and is discussed brieﬂy in Section 8.3.5
and Chapter 15.
8.3.3 2Norm Stability and von Neumann Analysis
For linear difference equations, stability analysis is often particularly easy in the 2norm,
since Fourier analysis can then be used to simplify the problem. This is the basis of von
Neumann stability analysis, which is described more completely in many books on ﬁnite
difference methods for partial differential equations (e.g., [333] or [427]).
Let Q
n
I
(−∞< I < ∞) represent an arbitrary grid function for the Cauchy problem. In
this section we use I for the grid index (x
I
= I x) so that i =
√
−1 can be used in the
complex exponentials below. We suppose that Q
n
I
has ﬁnite norm, so that it can be expressed
as a Fourier series
Q
n
I
=
1
√
2π
∞
−∞
ˆ
Q(ξ) e
i ξ I x
dξ. (8.26)
Applying a linear ﬁnite difference method to Q
n
I
and manipulating the exponentials typically
gives an expression of the form
Q
n+1
I
=
1
√
2π
∞
−∞
ˆ
Q(ξ) g(ξ, x, t ) e
i ξ I x
dξ, (8.27)
where g(ξ, x, t ) is called the ampliﬁcation factor for wave number ξ, since
ˆ
Q
n+1
(ξ) = g(ξ, x, t )
ˆ
Q
n
(ξ). (8.28)
The 2norm is now convenient because of Parseval’s relation, which states that
Q
n
2
=
ˆ
Q
n
2
, (8.29)
where
Q
n
2
=
x
∞
I =−∞
Q
n
I
2
1/2
and
ˆ
Q
n
2
=
∞
−∞

ˆ
Q
n
(ξ)
2
dξ
1/2
.
To show that the 2norm of Q
n
remains bounded it sufﬁces to show that the 2norm of
ˆ
Q
n
does. But whereas all elements of Q
n
(as I varies) are coupled together via the difference
equations, each element of
ˆ
Q
n
(as ξ varies) satisﬁes an equation (8.28) that is decoupled
8.3 Stability Theory 147
from all other wave numbers. (The Fourier transform diagonalizes the linear difference
operator.) So it sufﬁces to consider an arbitrary single wave number ξ and data of the form
Q
n
I
= e
i ξ I x
. (8.30)
From this we can compute g(ξ, x, t ). Then requiring that g(ξ, x, t ) ≤ 1 for all ξ
gives a sufﬁcient condition for stability. In fact it sufﬁces to have g(ξ, x, t ) ≤ 1+α t
for some constant α independent of ξ.
Example 8.2. Consider the upwind method (4.25) for the advection equation q
t
+ ¯ uq
x
= 0
with ¯ u > 0. Again use ν ≡ ¯ u t /x as shorthand for the Courant number, and write the
upwind method (4.25) as
Q
n+1
I
= Q
n
I
−ν
Q
n
I
− Q
n
I −1
= (1 −ν)Q
n
I
+νQ
n
I −1
. (8.31)
We will use von Neumann analysis to demonstrate that this method is stable in the 2norm
provided that
0 ≤ ν ≤ 1 (8.32)
is satisﬁed, which agrees exactly with the CFL condition for this method (see Section 4.4).
Using the data (8.30) yields
Q
n+1
I
= (1 −ν)e
i ξ I x
+νe
i ξ(I −1)x
= [(1 −ν) +νe
−i ξx
] e
i ξ I x
= g(ξ, x, t ) Q
n
I
(8.33)
with
g(ξ, x, t ) = (1 −ν) +νe
−i ξx
. (8.34)
As ξ varies, g(ξ, x, t ) lies on a circle of radius ν in the complex plane, centered on the
real axis at 1 −ν. This circle lies entirely inside the unit circle (i.e., g ≤ 1 for all ξ) if and
only if 0 ≤ ν ≤ 1, giving the stability limit (8.32) for the upwind method.
8.3.4 1Norm Stability of the Upwind Method
For conservation laws the 1norm is often used, particularly for nonlinear problems. We
will demonstrate that the upwind method (4.25) considered in the previous example is also
stable in the 1norm under the timestep restriction (8.32). We revert to the usual notation
with i as the grid index and write the upwind method (8.31) as
Q
n+1
i
= (1 −ν)Q
n
i
+νQ
n
i −1
, (8.35)
148 8 Convergence, Accuracy, and Stability
where ν is again the Courant number (8.13). From this we compute
Q
n+1
1
= x
i
Q
n+1
i
= x
i
(1 −ν)Q
n
i
+νQ
n
i −1
≤ x
i
(1 −ν)
Q
n
i
+ν
Q
n
i −1
. (8.36)
In the ﬁnal step we have used the triangle inequality and then pulled 1 − ν and ν outside
the absolute values, since these are both positive if (8.32) is satisﬁed. The sum can be split
up into two separate sums, each of which gives Q
n
1
, obtaining
Q
n+1
1
≤ (1 −ν)Q
n
1
+νQ
n
1
= Q
n
1
.
This proves stability in the 1norm. Note that this only works if (8.32) is satisﬁed, since we
need both 1 −ν and ν to be positive.
8.3.5 TotalVariation Stability for Nonlinear Methods
For a nonlinear numerical method, showing that (8.23) holds is generally not sufﬁcient
to prove convergence. The stronger contractivity property (8.21) would be sufﬁcient, but
is generally difﬁcult to obtain. Even for the linear advection equation, the highresolution
methods of Chapter 6 are nonlinear (since the limiter function depends on the data), and so
a different approach to stability must be adopted to prove convergence of these methods.
The total variation introduced in Section 6.7 turns out to be an effective tool for studying
stability of nonlinear problems. We make the following deﬁnition.
Deﬁnition 8.1. A numerical method is totalvariation bounded (TVB) if, for any data Q
0
(with TV(Q
0
) < ∞) and time T, there is a constant R > 0 and a value t
0
> 0 such that
TV(Q
n
) ≤ R (8.37)
for all n t ≤ T whenever t < t
0
.
This simply requires that we have a uniform bound on the total variation up to time T on
all grids sufﬁciently ﬁne (and hence as t →0).
In Section 12.12 we will see how this can be used to prove convergence of the numerical
method (using a more subtle argument than the approach taken above for linear problems,
based on the compactness of an appropriate function space). For now we just note that,
in particular, a method that is TVD (see Section 6.7) is certainly TVB with R = TV(Q
0
)
in (8.37) for any T. So the notion of a TVD method, useful in insuring that no spurious
oscillations are introduced, is also sufﬁcient to prove convergence. In particular the high
resolution TVD methods introduced in Chapter 6 are all convergent provided the CFL
condition is satisﬁed (since this is required in order to be TVD).
8.4 Accuracy at Extrema 149
Of course a weaker condition than TVD is sufﬁcient for convergence, since we only need
a uniform bound of the form (8.37). For example, a method that satisﬁes
TV(Q
n+1
) ≤ (1 +α t )TV(Q
n
) (8.38)
for some constant α independent of t (at least for all t sufﬁciently small) will also be
TVB.
8.4 Accuracy at Extrema
Examining the results of Figure 6.1 and Figure 6.3 shows that the highresolution methods
developed in Chapter 6 give rather poor accuracy at extrema (local maxima or minima in
q), even though the solution is smooth. Figure 8.1(a) gives an indication of why this occurs.
All of the limiters discussed in Section 6.9 will give slopes σ = 0 in cells i −2 and i −1
for this data. This is required in order to prove that the method is truly TVD, as any other
choice will give a reconstructed function ˜ q
n
(x, t
n
) with TV( ˜ q
n
(·, t
n
)) > TV(Q
n
), allowing
the possibility that TV(Q
n+1
) > TV(Q
n
) with suitable choices of the data and time step.
If the solution is smooth near the extremum, then the Lax–Wendroff slope should be close
to zero anyway, so this is perhaps not a bad approximation. However, setting the slope to
zero will lead to a clipping of the solution, and the extreme value will be diminished by
O(x
2
) = O(t
2
) in each time step. After T/t time steps this can lead to a global error
near extrema that is O(t ), reducing the method to ﬁrstorder accuracy in this region. This
can be observed in Figure 6.2. Osher and Chakravarthy [351] prove that TVDmethods must
in fact degenerate to ﬁrstorder accuracy at extremal points.
Using a better approximation to q
x
near extrema, as indicated in Figure 8.1(b), would give
a reconstruction that allows smooth peaks to be better represented over time, since the peaks
are then reconstructed more accurately from the data. The cost is that the total variation will
need to increase slightly at times in order to reconstruct such a peak. But as indicated in
Section 8.3.5, the TVD property is not strictly needed for stability. The challenge is to ﬁnd
looser criteria that allow a small increase in the total variation near extremal points while
still suppressing oscillations where necessary. This goal has led to several suggestions on
(a)
Q
i
Q
i−1
Q
i−2
(b)
Fig. 8.1. (a) A smooth maximum and cell averages. A TVD slope reconstruction will give clipping
of the peak. (b) Better accuracy can be obtained with a reconstruction that is not TVD relative to the
cell averages.
150 8 Convergence, Accuracy, and Stability
other ways to choose the limiter function and criteria other than strictly requiring the TVD
property. Shu [407] has developed the theory of TVB methods for which convergence can
still be proved while better accuracy at extremal points may be obtained. The essentially
nonoscillatory (ENO) methods are another approach to obtaining highresolution that often
give better than secondorder accuracy in smooth regions, including extrema. These are
brieﬂy described in Section 10.4.4.
8.5 Order of Accuracy Isn’t Everything
The quality of a numerical method is often summarized by a single number, its order of
accuracy. This is indeed an important consideration, but it can be a mistake to put too much
emphasis on this one attribute. It is not always true that a method with a higher order of
accuracy is more accurate on a particular grid or for a particular problem.
Suppose a method has order of accuracy s. Then we expect the error to behave like
E
N
= C(x)
s
+higherorder terms (8.39)
as the grid is reﬁned and x →0. Here C is some constant that depends on the particular
solution being computed (and the time T). The magnitude of the constant C is important
as well as the value of s. Also, note that the “higherorder” terms, which depend on higher
powers of x, are asymptotically negligible as x →0, but may in fact be larger than the
“dominant” term C(x)
s
on the grid we wish to use in practice.
As a speciﬁc example, consider the highresolution TVDmethods developed in Chapter 6
for the scalar advection equation. Because of the nonlinear limiter function, these methods
are formally not secondorder accurate, even when applied to problems with smooth solu
tions. The limiter typically leads to a clipping of the solution near extrema, as discussed in
Section 8.4.
For discontinuous solutions, as illustratedinFigure 6.1andFigure 6.2, these methods have
clear advantages over the “secondorder” Lax–Wendroff or Beam–Warming methods, even
thoughfor discontinuous solutions none of these methods exhibit secondorder convergence.
But suppose we compare these methods on a problem where the solution is smooth.
At least in this case one might think the secondorder methods should be better than the
highresolution methods, which have a lower order of accuracy. This is true on a sufﬁciently
ﬁne grid, but may not be at all true on the sort of grids we want to use in practice.
Consider the wavepacket propagation problem illustrated in Figure 6.3. Here the data is
smooth and yet the highresolution method shows a clear advantage over the Lax–Wendroff
on the grid shown in this ﬁgure. Figure 8.2 shows the results of a mesh reﬁnement study
for this particular example. The true and computed solutions are compared on a sequence
of grids, and the norm of the error is plotted as a function of x. These are shown on a
log–log scale because from (8.39) we have
log E ≈ log C +s log x, (8.40)
so that we expect linear behavior in this plot, with a slope given by the order of accuracy
s. Figure 8.2(a) shows errors in the max norm, while Figure 8.2(b) shows the errors in
the 1norm. The Lax–Wendroff method is secondorder accurate in both norms; the slope
8.6 Modiﬁed Equations 151
(a)
10
−4
10
−3
10
−2
10
−3
10
−2
10
−1
10
0
10
1
maxnorm errors at t = 2
Slope 2
LaxWendroff
MClimiter
(b)
10
−4
10
−3
10
−2
10
−4
10
−3
10
−2
10
−1
10
0
10
1
1norm errors at t = 2
Slope 2
LaxWendroff
MClimiter
Fig. 8.2. Log–log plot of the error vs. grid size for the Lax–Wendroff and a highresolution
method on the wavepacket problem of Figure 6.3: (a) maxnorm errors, (b) 1norm errors.
[claw/book/chap8/wavepacket]
of the corresponding curves is about 1.999. Due to the clipping of peaks observed with
TVD methods, the error with the highresolution method is dominated by errors near these
few locations, and so the max norm shows larger errors than the 1norm, which averages
over the entire domain. In the max norm the observed order of accuracy is about 1.22, and
on sufﬁciently ﬁne grids the Lax–Wendroff method is superior. However, the crossover
point for this particular example is at about x = 0.00035, meaning about 2800 grid cells
in the unit interval. This is a much ﬁner grid than one would normally want to use for
this problem. Certainly for two or threedimensional analogues of this problem it would
be unthinkable to use this many grid points in each direction. On the coarser grids one
might use in practice, the highresolution method is superior in spite of its lower order of
accuracy.
In the 1norm the highresolution method looks even better. In this norm the observed
order of accuracy is about 1.92, but the error constant C is about 5 times smaller than
what is observed for the Lax–Wendroff method, so that on all the grids tested the error is
essentially 5 times smaller. Of course, for very small x the Lax–Wendroff method would
eventually prove superior, but extrapolating from the results seen in Figure 8.2(b) we ﬁnd
that the crossover point in the 1norm is around x = 10
−33
.
Later on we will see other examples where it is wise to look beyond order of accuracy in
comparing different methods. For example, in Chapter 17 we will see that a fractionalstep
method for source terms that is often dismissed as being “only ﬁrstorder accurate” is in fact
essentially identical to secondorder accurate methods for many practical purposes, and is
often more efﬁcient to use.
8.6 Modiﬁed Equations
As discussed in Section 8.2, the local truncation error of a method is determined by seeing
how well the true solution of the differential equation satisﬁes the difference equation. Now
we will study a slightly different approach that can be very illuminating in that it reveals
much more about the structure and behavior of the numerical solution in addition to the
order of the error.
152 8 Convergence, Accuracy, and Stability
The idea is to ask the following question: Is there a PDE to which our numerical ap
proximation Q
n
i
is actually the exact solution? Or, less ambitiously, can we at least ﬁnd an
equation that is better satisﬁed by Q
n
i
than the original PDE we were attempting to solve?
If so, then studying the behavior of solutions to this PDE should tell us much about how the
numerical approximation is behaving. This can be advantageous because it is often easier to
study the behavior of solutions of differential equations than of ﬁnitedifference formulas.
In fact it is possible to ﬁnd a PDE that is exactly satisﬁed by the Q
n
i
, by doing Taylor
series expansions as we do to compute the local truncation error. However, this PDE will
have an inﬁnite number of terms involving higher and higher powers of t and x. By
truncating this series at some point we will obtain a PDE that is simple enough to study and
yet gives a good indication of the behavior of the Q
n
i
. If the method is accurate to order s,
then this equation is generally a modiﬁcation of the original PDE with newterms of order s,
and is called the modiﬁed equation for the method, or sometimes the model equation. Good
descriptions of the theory and use of modiﬁed equations can be found in Hedstrom [193]
or Warming & Hyett [480]. See [61], [114], [126], [170] for some further discussion and
other applications of this approach.
8.6.1 The Upwind Method
The derivation of a modiﬁed equation is best illustrated with an example. Consider the
ﬁrstorder upwind method for the advection equation q
t
+ ¯ uq
x
= 0 in the case ¯ u > 0,
Q
n+1
i
= Q
n
i
−
¯ u t
x
Q
n
i
− Q
n
i −1
. (8.41)
The process of deriving the modiﬁed equation is very similar to computing the local trun
cation error, only now we insert a function v(x, t ) into the numerical method instead of the
true solution q(x, t ). Our goal is to determine a differential equation satisﬁed by v. We view
the method as a ﬁnite difference method acting on gridpoint values, and v is supposed to
be a function that agrees exactly with Q
n
i
at the grid points. So, unlike q(x, t ), the function
v(x, t ) satisﬁes (8.41) exactly:
v(x, t +t ) = v(x, t ) −
¯ u t
x
[v(x, t ) −v(x −x, t )].
Expanding these terms in Taylor series about (x, t ) and simplifying gives
v
t
+
1
2
t v
t t
+
1
6
(t )
2
v
t t t
+· · ·
+ ¯ u
v
x
−
1
2
x v
xx
+
1
6
(x)
2
v
xxx
+· · ·
= 0.
We can rewrite this as
v
t
+ ¯ uv
x
=
1
2
( ¯ u x v
xx
−t v
t t
) −
1
6
[ ¯ u(x)
2
v
xxx
+(t )
2
v
t t t
] +· · · . (8.42)
This is the PDE that v satisﬁes. If we take t /x ﬁxed, then the terms on the righthand
side are O(t ), O(t
2
), etc., so that for small t we can truncate this series to get a PDE
that is quite well satisﬁed by the Q
n
i
.
8.6 Modiﬁed Equations 153
If we drop all the terms on the righthand side, we just recover the original advection
equation. Since we have then dropped terms of O(t ), we expect that Q
n
i
satisﬁes this
equation to O(t ), as we know to be true, since this upwind method is ﬁrstorder accurate.
If we keep the O(t ) terms then we get something more interesting:
v
t
+ ¯ uv
x
=
1
2
( ¯ u x v
xx
−t v
t t
). (8.43)
This involves second derivatives in both x and t , but we can derive a slightly different
modiﬁed equation with the same accuracy by differentiating (8.43) with respect to t to
obtain
v
t t
= −¯ uv
xt
+
1
2
( ¯ u x v
xxt
−t v
t t t
)
and with respect to x to obtain
v
t x
= −¯ uv
xx
+
1
2
( ¯ u x v
xxx
−t v
t t x
).
Combining these gives
v
t t
= ¯ u
2
v
xx
+O(t ).
Inserting this in (8.43) gives
v
t
+ ¯ uv
x
=
1
2
( ¯ u x v
xx
− ¯ u
2
t v
xx
) +O(t
2
).
Since we have already decided to drop terms of O(t
2
), we can drop these terms here also
to obtain
v
t
+ ¯ uv
x
=
1
2
¯ u x (1 −ν)v
xx
, (8.44)
where ν = ¯ u t /x is the Courant number. This is now a familiar advection–diffusion
equation. The grid values Q
n
i
can be viewed as giving a secondorder accurate approx
imation to the true solution of this equation (whereas they only give ﬁrstorder accurate
approximations to the true solution of the advection equation).
For higherorder methods this elimination of t derivatives in terms of xderivatives can
also be done, but must be done carefully and is complicated by the need to include higher
order terms. Warming and Hyett [480] present a general procedure.
The fact that the modiﬁed equation for the upwind method is an advection–diffusion
equation tells us a great deal about how the numerical solution behaves. Solutions to the
advection–diffusion equation translate at the proper speed ¯ u but also diffuse and are smeared
out. This was clearly visible in Figures 6.1 and 6.3, for example.
Note that the diffusion coefﬁcient in (8.43) vanishes in the special case ¯ u t = x. In
this case we already know that the exact solution to the advection equation is recovered by
the upwind method; see Figure 4.4 and Exercise 4.2.
Also note that the diffusion coefﬁcient is positive only if 0 < ¯ u t /x <1. This is pre
cisely the stability limit of the upwind method. If it is violated, then the diffusion coefﬁcient
154 8 Convergence, Accuracy, and Stability
in the modiﬁed equation is negative, giving an illposed backward heat equation with ex
ponentially growing solutions. Hence we see that some information about stability can also
be extracted from the modiﬁed equation.
8.6.2 Lax–Wendroff Method
If the same procedure is followed for the Lax–Wendroff method, we ﬁnd that all O(t )
terms drop out of the modiﬁed equation, as is expected because this method is secondorder
accurate on the advection equation. The modiﬁed equation obtained by retaining the O(t
2
)
term and then replacing time derivatives by spatial derivatives is
v
t
+ ¯ uv
x
= −
1
6
¯ u(x)
2
(1 −ν
2
)v
xxx
. (8.45)
The Lax–Wendroff method produces a thirdorder accurate solution to this equation. This
equation has a very different character from (8.43). The v
xxx
term leads to dispersive
behavior rather than diffusion.
This dispersion is very clearly seen in the wavepacket computation of Figure 6.3, where
the Q
n
i
computed with the Lax–Wendroff method clearly travels at the wrong speed. Dis
persive wave theory predicts that such a packet should travel at the group velocity, which
for wavenumber ξ in the Lax–Wendroff method is
c
g
= ¯ u −
1
2
¯ u(x)
2
(1 −ν
2
)ξ
2
.
See for example [8], [50], [298], [427], [486] for discussions of dispersive equations and
group velocities. The utility of this concept in the study of numerical methods has been
stressed by Trefethen, in particular in relation to the stability of boundary conditions. A
nice summary of some of this theory may be found in Trefethen [458].
The computation shown in Figure 6.3 has ξ = 80, ¯ u = 1, x = 1/200, and ¯ u t /x =
0.8, giving a group velocity of 0.9712 rather than the correct advection speed of 1. At time
10 this predicts the wave packet will be lagging the correct location by a distance of about
0.288, which agrees well with what is seen in the ﬁgure.
For data such as that used in Figure 6.1, dispersion means that the highfrequency com
ponents of data such as the discontinuity will travel substantially more slowly than the
lowerfrequency components, since the group velocity is less than ¯ u for all wave numbers
and falls with increasing ξ. As a result the numerical result can be expected to develop a
train of oscillations behind the peak, with the high wave numbers lagging farthest behind
the correct location.
If we retain one more term in the modiﬁed equation for the Lax–Wendroff method, we
ﬁnd that the Q
n
i
are fourthorder accurate solutions to an equation of the form
v
t
+ ¯ uv
x
=
1
6
¯ u(x)
2
(ν
2
−1)v
xxx
−v
xxxx
, (8.46)
where the in the fourthorder dissipative term is O(x
3
) and positive when the stability
bound holds. This higherorder dissipation causes the highest wave numbers to be damped,
so that there is a limit to the oscillations seen in practice.
8.7 Accuracy Near Discontinuities 155
Note that the dominant new term in the modiﬁed equation corresponds to the dominant
term in the local truncation error for each of these methods. Compare (8.45) with (8.16),
for example.
8.6.3 Beam–Warming Method
The secondorder Beam–Warming method (6.7) has a modiﬁed equation similar to that of
the Lax–Wendroff method,
v
t
+ ¯ uv
x
=
1
6
¯ u(x)
2
(2 −3ν +ν
2
)v
xxx
. (8.47)
In this case the group velocity is greater than ¯ u for all wave numbers in the case 0 < ν < 1,
so that the oscillations move ahead of the main hump. This can be observed in Figure 6.1,
where ν = ¯ u t /x = 0.8 was used. If 1 < ν < 2, then the group velocity is less than ¯ u
and the oscillations will fall behind.
8.7 Accuracy Near Discontinuities
In the previous section we derived the modiﬁed equation for various numerical methods, a
PDE that models the behavior of the numerical solution. This equation was derived using
Taylor series expansion, and hence is based on the assumption of smoothness, but it turns
out that the modiﬁed equation is often a good model even when the true solution of the
original hyperbolic problem contains discontinuities. This is because the modiﬁed equation
typically contains diffusive terms that cause the discontinuities to be immediately smeared
out, as also happens with the numerical solution, and so the solution we are studying is
smooth and the Taylor series expansion is valid.
Figure 8.3 shows a simple example in which the upwind method has been applied to the
scalar advection equation q
t
+ ¯ uq
x
= 0 with discontinuous data q
◦
(x) having the value 2
for x < 0 and 0 for x > 0. The parameters ¯ u = 1, x = 0.05, and t = 0.04 were used
giving a Courant number ν = 0.8. The dashed line is the true solution to this equation,
q(x, t ) = q
◦
(x − ¯ ut ). The solid line is the exact solution to the modiﬁed equation (8.44).
This advection–diffusion equation can be solved exactly to yield
v(x, t ) = erfc
x − ¯ ut
√
4βt
, (8.48)
where
β =
1
2
¯ u x(1 −ν) (8.49)
is the diffusion coefﬁcient from(8.44), and the complementary error function erfc is deﬁned
by
erfc(x) =
2
√
π
∞
x
e
−z
2
dz. (8.50)
156 8 Convergence, Accuracy, and Stability
(a)
0 0.5 1 1.5 2 2.5 3 3.5 4
−0.5
0
0.5
1
1.5
2
2.5
Time t = 1
(b)
0 0.5 1 1.5 2 2.5 3 3.5 4
−0.5
0
0.5
1
1.5
2
2.5
Time t = 3
Fig. 8.3. Dashed line: exact solution to the advection equation. Points: numerical solution obtained
with the upwind method. Solid line: exact solution to the modiﬁed equation (8.44). (a) At time t = 1.
(b) At time t = 3. [book/chap8/modeqn]
The numerical solution to the advection equation obtained using the upwind method, marked
by the symbols in Figure 8.3, is well approximated by the exact solution to the modiﬁed
equation.
It follows that we can use the modiﬁed equation to give us some insight into the expected
accuracy of the upwind method on this problem. Comparing v(x, t ) from (8.48) to the true
solution q(x, t ) = 2H( ¯ ut − x), it is possible to show that the 1norm of the difference is
q(·, t ) −v(·, t )
1
= 2
∞
0
erfc
x
√
4βt
dx
= 2
4βt
∞
0
erfc(z) dz
= C
1
βt (8.51)
for some constant C
1
independent of β and t . Since β is given by (8.49), this gives
q(·, t ) −v(·, t )
1
≈ C
2
√
x t (8.52)
as x → 0 with t /x ﬁxed. This indicates that the 1norm of the error decays only
like (x)
1/2
even though the method is formally “ﬁrstorder accurate” based on the local
truncation error, which is valid only for smooth solutions.
This informal analysis only gives an indication of the accuracy one might expect from a
ﬁrstorder method on a problem with a discontinuous solution. More detailed error analysis
of numerical methods for discontinuous solutions (to nonlinear scalar equations) can be
found, for example, in [251], [316], [339], [390], [436], [438].
Exercises
8.1. Consider the centered method (4.19) for the scalar advection equation q
t
+ ¯ uq
x
= 0.
Apply von Neumann analysis to show that this method is unstable in the 2norm for
any ﬁxed t /x.
Exercises 157
8.2. Following the proof of Section 8.3.4, show that the upwind method (4.30) is stable
provided the CFL condition (4.32) is satisﬁed.
8.3. Consider the equation
q
t
+ ¯ uq
x
= aq, q(x, 0) = q
◦
(x),
with solution q(x, t ) = e
at
q
◦
(x − ¯ ut ).
(a) Show that the method
Q
n+1
i
= Q
n
i
−
¯ u t
x
Q
n
i
− Q
n
i −1
+t aQ
n
i
is ﬁrstorder accurate for this equation by computing the local truncation error.
(b) Show that this method is Lax–Richtmyerstable in the 1norm provided
 ¯ u t /x ≤ 1, by showing that a bound of the form (8.23) holds. Note that
when a > 0 the numerical solution is growing exponentially in time (as is the
true solution) but the method is stable and convergent at any ﬁxed time.
(c) Show that this method is TVB. Is it TVD?
8.4. Showthat a method Q
n+1
= N(Q
n
) that is contractive inthe 1norm(L
1
contractive),
so that N(P)−N(Q)
1
≤ P−Q
1
, must also be TVD, so TV(N(Q)) ≤ TV(Q).
Hint: Deﬁne the grid function P by P
i
= Q
i −1
.
8.5. Prove Harten’s Theorem 6.1. Hint: Note that
Q
n+1
i +1
− Q
n+1
i
=
1 −C
n
i
− D
n
i
Q
n
i +1
− Q
n
i
+ D
n
i +1
Q
n
i +2
− Q
n
i +1
+ C
n
i −1
Q
n
i
− Q
n
i −1
.
Sum Q
n+1
i +1
− Q
n+1
i
 over i and use the nonnegativity of each coefﬁcient, as in the
stability proof of Section 8.3.4.
8.6. Use the method of Section 8.3.4 to showthat the method (4.64) is stable in the 1norm
for x ≤ ¯ u t ≤ 2x.
8.7. View (8.41) as a numerical method for the equation (8.44). Compute the local trun
cation error, and verify that it is O(t
2
).
8.8. Derive the modiﬁed equation (8.45) for the Lax–Wendroff method.
8.9. Determine the modiﬁed equation for the centered method (4.19), and show that the
diffusion coefﬁcient is always negative and this equation is hence ill posed. Recall
that the method (4.19) is unstable for all ﬁxed t /x.
9
VariableCoefﬁcient Linear Equations
In the preceding chapters we have primarily studied linear problems with constant co
efﬁcients. Many interesting problems involve spatiallyvarying coefﬁcients. This chapter is
devoted to exploring some of the issues that arise, both analytically and numerically, in this
case.
There are several distinct forms that a variablecoefﬁcient hyperbolic system might take,
each of which arises naturally in some contexts. One possibility is that the coefﬁcient matrix
A multiplying q
x
varies with x, so the system is
q
t
+ A(x)q
x
= 0. (9.1)
This system is hyperbolic in some domain if A(x) is diagonalizable with real eigenvalues
at each x in the domain. Such problems still model wave propagation, and the ﬁnite volume
methods developed in previous chapters can be applied fairly directly, in spite of the fact
that this system (9.1) is not in conservation form and there is no ﬂux function.
Another form of variablecoefﬁcient problem that often arises is
q
t
+(A(x)q)
x
= 0, (9.2)
in which the matrix A(x) appears within the xderivative. For the constantcoefﬁcient prob
lemwith A(x) ≡ A, the two forms (9.1) and (9.2) are identical, but with variable coefﬁcients
they are distinct and have different solutions. The equation (9.2) is a conservation law, with
the ﬂux function
f (q, x) = A(x)q. (9.3)
In this case the ﬂux function depends explicitly on the location x as well as on the value of the
conserved quantities q. Again this equation is hyperbolic whenever A(x) is diagonalizable
with real eigenvalues.
For a given physical problem it may be possible to derive an equation of either form (9.1)
or (9.2), depending on how the vector q is chosen. For example, in Section 9.1 we will see
how ﬂow through a pipe can lead to an advection equation of either form, depending on
how q is deﬁned.
We can go back and forth between the forms at the expense of introducing source terms.
By applying the product rule to the xderivative in (9.2), we could rewrite this equation in
158
9.1 Advection in a Pipe 159
the form
q
t
+ A(x)q
x
= −A
(x)q,
which has the formof (9.1) with the addition of a source term. Conversely, we could rewrite
(9.1) as
q
t
+(A(x)q)
x
= A
(x)q,
which now has the form of a conservation law with a source term. Normally we wish to
avoid adding source terms to the equation if they can be avoided by a better choice of
variables.
Another form of variable coefﬁcients that often arises naturally is a capacity function
κ(x), as described in the context of heat capacity in Section 2.3, giving systems of the form
κ(x)q
t
+(A(x)q)
x
= 0, (9.4)
for example. Again this could be manipulated into other forms, e.g.,
q
t
+κ
−1
(x)A(x)q
x
= −κ
−1
(x)A
(x)q,
but for problems where κq is the proper conserved quantity it may be preferable to work
directly with the form (9.4), using the capacityform differencing algorithms introduced in
Section 6.16.
9.1 Advection in a Pipe
Consider an incompressible ﬂuid ﬂowing through a pipe with variable crosssectional area
κ(x), and suppose we want to model the advection of some tracer down the length of the
pipe. We denote the area by κ, since we will see that this is a natural capacity function.
There are several ways we might model this, depending on how we choose our variables,
leading to different forms of the variablecoefﬁcient advection equation.
We are assuming here that a onedimensional formulation is adequate, i.e., that all quanti
ties vary only with x (distance along the pipe) and t , and are essentially constant across any
given cross section. In reality the ﬂow through a pipe with varying diameter cannot be truly
onedimensional, since there must be a velocity component in the radial direction in regions
where the walls converge or diverge. But we will assume this is sufﬁciently small that it can
be safely ignored, which is true if the variation in κ is sufﬁciently smooth. The ﬂuid velocity
is then given by a single axial velocity u(x) that varies only with x. (See Sections 9.4.1 and
9.4.2 for other contexts where this makes sense even if u is discontinuous.)
Note that if κ(x) is measured in square meters and u(x) in meters per second, say, then
the product κ(x)u(x) has units of cubic meters per second and measures the volume of ﬂuid
passing any point per unit time. Since the ﬂuid is assumed to be incompressible, this must
be the same at every point in the pipe, and we will denote the ﬂow rate by U,
U = κ(x)u(x) ≡ constant. (9.5)
160 9 VariableCoefﬁcient Linear Equations
If we know U and the crosssectional area κ(x), then we can compute
u(x) = U/κ(x). (9.6)
(In Section 9.4 we consider a formulation in which κ(x)u(x) need not be constant.)
Nowsuppose that we introduce a tracer into the ﬂuid (e.g., some food coloring or chemical
contaminant into water, with very small concentration so that it does not affect the ﬂuid
dynamics). We wish to study how a given initial concentration proﬁle advects downstream.
There are two distinct ways we might choose to measure the concentration, leading to
different forms of the advection equation.
One approach would be to measure the concentration in grams per cubic meter (mass per
unit volume of ﬂuid), which is what we would probably actually measure if we took a small
sample of ﬂuid from the pipe and determined the concentration. Call this variable ¯ q(x, t ).
However, since we are solvinga onedimensional problemwithquantities assumedtovary
in only the xdirection, another natural possibility would be to measure the concentration in
units of mass per unit length of the pipe (grams per meter). If we call this variable q(x, t ),
then
x
2
x
1
q(x, t ) dx (9.7)
measures the total mass
1
of tracer in the section of pipe from x
1
to x
2
. Since this mass can
only change due to tracer moving past the endpoints, q is the proper conserved quantity for
this problem. The onedimensional velocity u(x) measures the rate at which tracer moves
past a point and the product u(x)q(x, t ) is the ﬂux in grams per second. Hence with this
choice of variables we obtain the conservative advection equation
q
t
+(u(x)q)
x
= 0. (9.8)
There is a simple relation between q and ¯ q, given by
q(x, t ) = κ(x) ¯ q(x, t ), (9.9)
since multiplying the mass per unit volume by the crosssectional area gives the mass per
unit length. Hence the total mass of tracer in [x
1
, x
2
], given by (9.7), can be rewritten as
x
2
x
1
κ(x) ¯ q(x, t ) dx.
With this choice of variables we see that the crosssectional area acts as a capacity function,
which is quite natural in that this area clearly determines the ﬂuid capacity of the pipe at
each point.
Using the relation (9.9) in (9.8) gives an advection equation for ¯ q,
κ(x) ¯ q
t
+(u(x)κ(x) ¯ q)
x
= 0. (9.10)
1
In problems where chemical kinetics is involved, we should measure the “mass” in moles rather than grams,
and the density in moles per meter or moles per cubic meter.
9.2 Finite Volume Methods 161
But now notice that applying (9.5) allows us to rewrite this as
κ(x) ¯ q
t
+U ¯ q
x
= 0. (9.11)
Dividing by κ and using (9.6) gives
¯ q
t
+u(x) ¯ q
x
= 0 (9.12)
as another form of the advection equation.
Comparing the advection equations (9.8) and (9.12) shows that they have the form of
(9.2) and (9.1), respectively. The velocity u(x) is the same in either case, but depending on
howwe measure the concentration, we obtain either the nonconservative or the conservative
formof the equation. The form(9.11) is a third distinct form, in which the capacity function
and ﬂow rate appear instead of the velocity.
The nonconservative form (9.12) of the advection equation is often called the transport
equation or the color equation. If we think of food coloring in water, then it is ¯ q, the mass per
unit volume, that determines the color of the water. If we follow a parcel of water through
the pipe, we expect the color to remain the same even as the area of the pipe and velocity of
the water change. This is easily veriﬁed, since ¯ q(x, t ) is constant along characteristic curves
(recall the discussion of Section 2.1.1). By contrast the conserved quantity q is not constant
along characteristic curves. The mass per unit length varies with the crosssectional area
even if the color is constant. From (9.8) we obtain q
t
+ u(x)q
x
= −u
(x)q, so that along
any characteristic curve X(t ) satisfying X
(t ) = u(X(t )) we have
d
dt
q(X(t ), t ) = −u
(X(t )) q(X(t ), t ). (9.13)
9.2 Finite Volume Methods
Natural upwind ﬁnite difference methods for the equations (9.8) and (9.12) are easy to
derive and take the following form in the case U > 0:
Q
n+1
i
= Q
n
i
−
t
x
u(x
i
)Q
n
i
−u(x
i −1
)Q
n
i −1
(9.14)
and
¯
Q
n+1
i
=
¯
Q
n
i
−
t
x
u(x
i
)
¯
Q
n
i
−
¯
Q
n
i −1
(9.15)
respectively. Variations of each formula are possible in which we use u(x
i −1/2
) in place of
u(x
i
). Either choice gives a ﬁrstorder accurate approximation. In this section we will see
how to derive these methods using the ﬁnite volume framework of Godunov’s method, in
a manner that allows extension to highresolution methods.
The Riemann problem at the cell interface x
i −1/2
now takes the form of an advection
equation with piecewise constant coefﬁcients as well as piecewise constant initial data. The
solution depends on what form of the advection equation we are solving. It also depends
on how we discretize the velocity u(x). Two natural possibilities are:
162 9 VariableCoefﬁcient Linear Equations
1. Associate a velocity u
i
with each grid cell. We might deﬁne u
i
as the pointwise value
u
i
= u(x
i
), or we could compute the cell average of u(x), or we could view the pipe as
having a piecewise constant crosssectional area with value κ
i
in the i th cell, and then
take u
i
= U/κ
i
.
2. Associate a velocity u
i −1/2
with each cell interface x
i −1/2
.
There are certain advantages and disadvantages of each form, and which is chosen may
depend on the nature of the problem being solved. To begin, we will concentrate on the
ﬁrst choice. For some problems, however, it is more natural to use edge velocities u
i −1/2
,
and this choice is discussed in Section 9.5. This is true in particular when we extend the
algorithms to more than one space dimension; see Section 18.2.
9.3 The Color Equation
In the case of the color equation (9.12), the Riemann problem models a jump in color from
¯
Q
i −1
to
¯
Q
i
at x
i −1/2
. Since color is constant along particle paths, this jump in color will
simply propagate into cell C
i
at the velocity u
i
in this cell, and so in the notation of Chapter 4
we have a wave W
i −1/2
(omitting the superscript 1, since there is only one wave) with jump
W
i −1/2
=
¯
Q
i
−
¯
Q
i −1
,
and speed
s
i −1/2
= u
i
.
Again we are assuming positive velocities u
i
in each cell C
i
. If U <0, then we would have
s
i −1/2
= u
i −1
, since the wave would enter cell i − 1. In spite of the fact that the color
equation is not in conservation form, we can still view
¯
Q
n
i
as an approximation to the cell
average of ¯ q(x, t ) at time t
n
. In this case
¯
Q
n
i
is simply the “average color” over this cell, and
x
¯
Q
n
i
is not the total mass of any conserved quantity. It is no longer true that the change in
this cell average is given by a ﬂux difference, but it is true that the change can be computed
from the wave and speed. Note that (for U >0) only the wave W
i −1/2
enters cell C
i
, and
the value of ¯ q in this cell is changed by
¯
Q
i
−
¯
Q
i −1
at each point the wave has reached. The
wave propagates a distance s
i −1/2
t over the time step and hence has covered the fraction
s
i −1/2
t /x of the cell. The cell average is thus modiﬁed by
¯
Q
n+1
i
=
¯
Q
n
i
−
t
x
s
i −1/2
W
i −1/2
.
This gives the upwind method (9.15). Also note that this has exactly the form (4.43),
¯
Q
n+1
i
=
¯
Q
n
i
−
t
x
A
+
¯
Q
i −1/2
+A
−
¯
Q
i +1/2
,
if we deﬁne
A
+
¯
Q
i −1/2
= s
i −1/2
W
i −1/2
,
A
−
¯
Q
i −1/2
= 0.
(9.16)
9.3 The Color Equation 163
These formulas have been presented for the case U >0, so that all velocities u
i
are
positive. The more general formulas that can also be used in the case U <0 are
W
i −1/2
=
¯
Q
n
i
−
¯
Q
n
i −1
,
s
i −1/2
=
u
i
if U > 0,
u
i −1
if U < 0,
= u
+
i
+u
−
i −1
,
A
+
¯
Q
i −1/2
= s
+
i −1/2
W
i −1/2
,
A
−
¯
Q
i −1/2
= s
−
i −1/2
W
i −1/2
,
(9.17)
using the notation (4.40).
9.3.1 HighResolution Corrections
The ﬁrstorder upwind method for the color equation can be greatly improved by including
highresolution corrections as developed in Chapter 6. The improved method again has the
form (5.7),
¯
Q
n+1
i
=
¯
Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
, (9.18)
where
˜
F
i −1/2
=
1
2
s
i −1/2
1 −
t
x
s
i −1/2
W
i −1/2
. (9.19)
The modiﬁed wave
W
i −1/2
is obtained by applying a wave limiter as described in Chapter 6.
It is important to note, however, that this method is not formally secondorder accu
rate when applied to a smooth solution, even when no limiter function is used. The local
truncation error is found to be (see Exercise 9.1)
local truncation error = −
1
2
[x −u(x) t ]u
(x)q
x
(x, t ) +O(x
2
). (9.20)
The methodis formallysecondorder accurate onlyinthe case of constant coefﬁcients, where
u
(x) ≡ 0. However, this truncation error has a quite different formthan the truncation error
for the ﬁrstorder upwind method (9.15), which is
x u(x)q
xx
(x, t ) +O(x
2
). (9.21)
This truncation error depends on q
xx
and leads to substantial numerical dissipation, as with
any ﬁrstorder upwind method. The truncation error (9.20), on the other hand, is a multiple
of q
x
instead. This can be viewed as corresponding to a small error in the propagation speed.
The modiﬁed equation (see Section 8.6) for the highresolution method is
q
t
+u(x)q
x
= −
1
2
[x −u(x) t ]u
(x)q
x
,
164 9 VariableCoefﬁcient Linear Equations
which we can rewrite (ignoring higherorder terms) as
q
t
+u
x +
1
2
[x −u(x) t ]
q
x
= 0 (9.22)
This is again the color equation, but with the velocity evaluated at a point that is shifted
by less than a grid cell. The solution to this equation looks essentially the same as for the
correct color equation, but slightly offset. In particular there is no diffusion or smearing of
the solution (at least not at the O(x) level), and hence we expect the solution obtained with
this method to look much better than what would be obtained from the ﬁrstorder upwind
method.
A true secondorder accurate method can be derived using the Lax–Wendroff approach
(Exercise 9.2), but results are typically similar to what is produced by the method above
when the solution is smooth. The highresolution method with limiters included works very
well in practice, and much better than the formally secondorder method in cases where the
solution is discontinuous.
9.3.2 Discontinuous Velocities
For ﬂow in a pipe, reducing the problem to a onedimensional advection equation is only
valid if the diameter of the pipe, and hence the velocity, is very slowly varying. Otherwise
the true ﬂuid velocity may have a substantial radial component. This is particularly true at a
point where the diameter is discontinuous. Here the motion will be fully multidimensional
and perhaps even turbulent. However, onedimensional approximations are frequently used
even in this case in many engineering applications involving transport through complicated
networks of pipes, for example.
There are also other applications where a onedimensional advection equation with
rapidly varying or even discontinuous velocities is physically relevant. One example, dis
cussed in Section 9.4.2, arises in trafﬁc ﬂow along a onelane road with a discontinuous
speed limit. Another example is discussed in Section 9.4.1.
An advantage of the highresolution ﬁnite volume methods is that they typically perform
very well even when the coefﬁcients in the equation are discontinuous. You may wish to
experiment with the examples in [claw/book/chap9/color/discontu].
9.4 The Conservative Advection Equation
Nowsuppose we are solving the conservative equation (9.8), q
t
+(u(x)q)
x
=0, with veloci
ties u
i
given in each grid cell. Again we can use the form(5.7) after deﬁning the ﬂuctuations
A
+
Q
i −1/2
and A
−
Q
i −1/2
in terms of waves via the solution to the Riemann problem at
x
i −1/2
. To do so properly we must carefully consider the Riemann problem, which nowcon
sists of using piecewise constant data deﬁned by Q
i −1
and Q
i
and also piecewise constant
coefﬁcients in the advection equation,
q
t
+u
i −1
q
x
= 0 if x < x
i −1/2
,
q
t
+u
i
q
x
= 0 if x > x
i −1/2
.
(9.23)
9.4 The Conservative Advection Equation 165
Q
i−1
Q
i
Q
∗
i−1/2
u
i−1
∆t u
i
t
x
i−1/2
W
i−1/2
∆t
Fig. 9.1. Solution to the Riemann problem for the conservative advection equation when u
i −1
> u
i
.
The solution is not simply a single wave propagating at velocity u
i
with strength Q
i
−Q
i −1
.
The correct solution is indicated in Figure 9.1, and consists of two discontinuities in the
solution: a stationary one at x
i −1/2
where Q
i −1
jumps to some new value Q
∗
i −1/2
, and the
wave
W
i −1/2
= Q
i
− Q
∗
i −1/2
(9.24)
propagating at the expected speed
s
i −1/2
= u
i
(9.25)
(again we assume U > 0). The discontinuity at x
i −1/2
arises from the fact that the jump in
u at x
i −1/2
corresponds to a jump in the crosssectional area of the pipe. (A jump to a larger
area κ
i
> κ
i −1
is shown in Figure 9.1, in which case u
i
< u
i −1
.) Consequently, the density
of tracer q, which is measured in the onedimensional manner as mass per unit length, must
increase, since there is suddenly more liquid and hence more tracer per unit length of pipe.
The “color” ¯ q measured in mass per unit volume, on the other hand, does not experience
any discontinuity at x
i −1/2
, and so we did not have to worry about this effect in solving the
color equation.
The new value Q
∗
i −1/2
that arises in solving the Riemann problem can be found using the
fact that the ﬂux f = uq must be continuous at x
i −1/2
in the Riemann solution. The same
amount of tracer is leaving cell C
i −1
as entering cell C
i
. This yields
u
i −1
Q
i −1
= u
i
Q
∗
i −1/2
and hence
Q
∗
i −1/2
=
u
i −1
Q
i −1
u
i
. (9.26)
This value is used in the wave (9.24). The ﬂuctuation is computed in terms of this wave and
166 9 VariableCoefﬁcient Linear Equations
the speed (9.25) as
A
+
Q
i −1/2
= s
i −1/2
W
i −1/2
= u
i
Q
i
−
u
i −1
Q
i −1
u
i
= u
i
Q
i
−u
i −1
Q
i −1
. (9.27)
Again this is for the case U > 0, and in this case we have no ﬂuctuation to the left:
A
−
Q
i −1/2
= 0. (9.28)
Note that the sum of the ﬂuctuations has the form of a ﬂux difference, as we expect for this
conservative equation. The ﬁnite volume method
Q
n+1
i
= Q
i
−
t
x
A
+
Q
i −1/2
+ A
−
Q
i +1/2
(9.29)
reduces to the natural upwind method (9.14).
If U < 0, then we ﬁnd that
Q
∗
i −1/2
=
u
i
Q
i
U
i −1
,
W
i −1/2
= Q
∗
i −1/2
− Q
i −1
,
s
i −1/2
= u
i −1
,
A
−
Q
i −1/2
= s
i −1/2
W
i −1/2
= u
i
Q
i
−u
i −1
Q
i −1
,
A
+
Q
i −1/2
= 0.
(9.30)
In this case (9.29) again reduces to the natural upwind method. Highresolution correction
terms can be added using (9.18) and (9.19).
Since the Riemann solution now involves two jumps, one might wonder why we don’t
need two waves W
1
i −1/2
and W
2
i −1/2
instead of just one, as introduced above. The answer is
that the secondwave moves at speeds = 0. We couldinclude it inthe Riemannsolution, but it
would drop out of the expression for A
+
Q
i −1/2
, since we sum s
p
W
p
. The corresponding
highresolution corrections also drop out when s = 0. So nothing would be gained by
including this wave except additional work in applying the updating formulas.
9.4.1 Conveyer Belts
The solution illustrated in Figure 9.1 can perhaps be better understood by considering a
different context than ﬂuid ﬂowin a pipe. Consider a series of conveyer belts, each going for
the length of one grid cell with velocity u
i
, and let q(x, t ) measure the density of packages
traveling down this series of belts. See Figure 9.2. If the velocity u
i
is less than u
i −1
, then
the density will increase at the junction x
i −1/2
just as illustrated in Figure 9.1. See also
Figure 9.3 for another interpretation, discussed in the next subsection.
The structure illustrated in Figure 9.1 with two waves can also be derived by solving the
Riemann problem for a system of two conservation laws, obtained by introducing u as a
second conserved variable; see Exercise 13.11.
9.4 The Conservative Advection Equation 167
u
i−1
u
i
Fig. 9.2. Packages moving from a conveyer belt with speed u
i −1
to a slower belt with speed u
i
. The
density of packages increases at the junction.
9.4.2 Trafﬁc Flow
Similar advection equations arise in studying the ﬂow of cars along a onelane highway.
To obtain a linear equation, we assume trafﬁc is light enough that cars are always traveling
at the speed limit u(x), which can vary with x, the distance along the highway. If u(x)
is piecewise constant, then this is exactly the same problem as the conveyerbelt problem
mentioned in Section 9.4.1, with cars replacing packages.
For heavier trafﬁc the speed typically also depends on the density of cars and the problem
becomes nonlinear. This more interesting case is examined in detail in Chapter 11.
Let q(x, t ) be the density of cars at point x at time t . Of course, at any particular point x
there is either a car or no car, so the concept of density at a point appears to be meaningless.
What we mean should be clear, however: over a reasonably long stretch of road from x
1
to
x
2
the number of cars present at time t should be roughly
number of cars between x
1
and x
2
≈
x
2
x
1
q(x, t ) dx. (9.31)
It will be convenient to measure the density in units of cars per car length, assuming all
cars have the same length. Then empty highway corresponds to q = 0, bumpertobumper
trafﬁc corresponds to q = 1, and in general 0 ≤ q ≤ 1. Then for (9.31) to make sense we
must measure distance x in car lengths. Also we measure the speed limit u(x) in car lengths
per time unit. The ﬂux of cars is given by f (q) = u(x)q (in cars per time unit) and we
obtain the conservation law (9.8).
One way to simulate trafﬁc ﬂow is to track the motion of individual vehicles, assuming
a ﬁnite set of m cars on the highway. Let X
k
(t ) be the location of the kth car at time t . Then
the motion of each car can be obtained by solving the ordinary differential equation
X
k
(t ) = u(X
k
(t ))
with initial conditions corresponding to its initial location X
k
(0). Note that cars move along
characteristics of the advection equation. (This is not true more generally if the velocity
depends on the density; see Chapter 11.)
Figure 9.3 illustrates the simulation of a line of cars with an initial density variation
corresponding to a Riemann problem, traveling along a highway with a discontinuous
speed limit
u(x) =
2 if x < 0,
1 if x > 0.
The paths of individual cars are plotted over time 0 ≤ t ≤ 20. The density q
k
(t ) observed
by each driver is also plotted at both the initial and ﬁnal times. For this discrete simulation
168 9 VariableCoefﬁcient Linear Equations
−40 −30 −20 −10 0 10 20 30 40
0
0.2
0.4
0.6
0.8
1
Density at time 20
−40 −30 −20 −10 0 10 20 30 40
0
5
10
15
20
25
−40 −30 −20 −10 0 10 20 30 40
0
0.2
0.4
0.6
0.8
1
Density at time 0
Fig. 9.3. Trafﬁc ﬂow model corresponding to the Riemann problem of Figure 9.1, with a change in
speed limit at x = 0. Vehicle trajectories are shown, along with the density observed by each driver.
We can also view the cars as representing packages moving from one conveyer belt to a slower one
as in Figure 9.2. [claw/book/chap9/traffic]
9.5 Edge Velocities 169
a discrete density is deﬁned for each car by
q
k
(t ) =
1
X
k+1
(t ) − X
k
(t )
, (9.32)
based on the distance to the car immediately ahead. This can be shown to be consistent with
the previous notion of density; see Exercise 9.4.
The density at intermediate times can also be observed from the car paths in Figure 9.3.
Taking a slice at any ﬁxed time, the density is inversely proportional to the distance between
paths.
Note that the density of cars changes discontinuously at the point x =0 where the speed
limit changes. In this simple model we assume cars and drivers can adjust speed instanta
neously in response to the speed limit. This viewpoint may help to understand Figure 9.1.
Of course if u
i −1
/u
i
is sufﬁciently large, then Q
∗
i −1/2
in (9.26) may be greater than 1 even
if Q
i −1
is not. Although this causes no problem mathematically, with our deﬁnition of
density this shouldn’t happen physically. This is a case where cars are approaching the
discontinuity in speed limit too rapidly to be accommodated in the slower region even at the
bumpertobumper density of q = 1. In this case the linear model is deﬁnitely inadequate,
and instead a nonlinear shock wave would arise in the real world. See Section 16.4.1 for a
discussion of nonlinear trafﬁc ﬂow with a discontinuous speed limit.
For the linear trafﬁc ﬂowproblem, the density naturally satisﬁes a conservative advection
equation of the form (9.8). One can, however, deﬁne a new variable ¯ q(x, t ) that instead
satisﬁes the color equation (9.12), by setting
¯ q(x, t ) = u(x)q(x, t ).
This is simply the ﬂux of cars. We have
¯ q
t
= (uq)
t
= uq
t
= −u(uq)
x
= −u ¯ q
x
,
and so (9.12) is satisﬁed. You should convince yourself that it makes sense for the ﬂux of
cars to be constant along characteristics, as must hold for the color equation.
9.5 Edge Velocities
So far we have assumed that the variable velocity u(x) is speciﬁed by a constant value u
i
within the i th grid cell. In some cases it is more natural to instead assume that a velocity
u
i −1/2
is speciﬁed at each cell interface. This can be viewed as a transfer rate between the
cells C
i −1
and C
i
.
9.5.1 The Color Equation
Solving the color equation ¯ q
t
+ u(x) ¯ q
x
= 0 with edge velocities speciﬁed is very simple.
We need only set
W
i −1/2
=
¯
Q
i
−
¯
Q
i −1
,
s
i −1/2
= u
i −1/2
,
(9.33)
170 9 VariableCoefﬁcient Linear Equations
and use the usual formula
A
+
Q
i −1/2
=
s
i −1/2
+
W
i −1/2
,
A
−
Q
i −1/2
=
s
i −1/2
−
W
i −1/2
.
(9.34)
9.5.2 The Conservative Equation
The conservative advection equation q
t
+(u(x)q)
x
= 0 can also be solved using the waves
and speeds
W
i −1/2
= Q
i
− Q
i −1
,
s
i −1/2
= u
i −1/2
,
(9.35)
to deﬁne secondorder corrections (perhaps modiﬁed by limiters). However, we cannot use
the expressions (9.34) to deﬁne the ﬂuctuations. This would not lead to a conservative
method, since (4.54) would not be satisﬁed. There are several different approaches that can
be used to deﬁne ﬂuctuations that do satisfy (4.54) and lead to successful methods. One
approach is to notice that an upwind ﬂux F
i −1/2
is naturally deﬁned by
F
i −1/2
= u
+
i −1/2
Q
i −1
+u
−
i −1/2
Q
i
at the edge between the cells. Recall that the goal in deﬁning A
±
Q
i −1/2
is to implement
the ﬂuxdifferencing algorithm
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
(9.36)
via the formula
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
. (9.37)
We can accomplish this by setting
A
+
Q
i −1/2
= F
i
− F
i −1/2
,
A
−
Q
i −1/2
= F
i −1/2
− F
i −1
,
(9.38)
where the cellcentered ﬂux values F
i
are chosen in an arbitrary way. When inserted into
(9.37) the value F
i
cancels out and (9.36) results. For simplicity one could even use F
i
= 0
in each cell.
Aesthetically it is nicer to use some approximation to the ﬂux in cell i , for example
F
i
=
u
+
i −1/2
+u
−
i +1/2
Q
i
, (9.39)
so that A
±
Q
i −1/2
have the physical interpretation of ﬂux differences. Note that if all
velocities are positive, then these formulas reduce to
F
i −1/2
= u
i −1/2
Q
i −1
, F
i
= u
i −1/2
Q
i
,
9.6 VariableCoefﬁcient Acoustics Equations 171
so that
A
+
Q
i −1/2
= u
i −1/2
(Q
i
− Q
i −1
),
A
−
Q
i −1/2
=
u
i −1/2
−u
i −3/2
Q
i −1
.
(9.40)
The rightgoing ﬂuctuation is s
i −1/2
W
i −1/2
(as for the color equation), while the leftgoing
ﬂuctuation accounts for the variation of u across cell C
i −1
. Note that even though all ﬂow
is to the right, some information must ﬂow to the left, since the accumulation rate in cell
C
i −1
depends on the outﬂow velocity u
i −1/2
as well as the inﬂow velocity u
i −3/2
. These
ﬂuctuations result in the ﬁrstorder method
Q
n+1
i
= Q
n
i
−
t
x
u
i +1/2
Q
n
i
−u
i −1/2
Q
n
i −1
. (9.41)
Note also that the splitting of (9.40) gives distinct approximations to the two terms that
arise when we rewrite the conservative equation in the form
q
t
+u(x)q
x
+u
(x)q = 0. (9.42)
Another way to derive the method (9.37) with the splitting (9.40) is to start with the form
(9.42) and view this as the color equation with a source term−u
(x)q. Then W
i −1/2
, s
i −1/2
,
and A
+
Q
i −1/2
all come from the color equation. The term A
−
Q
i −1/2
from (9.40) is
different from the value 0 that would be used for the color equation, and can be viewed
as a device for introducing the appropriate source term into cell C
i −1
(rather than using
a fractionalstep method as discussed in Chapter 17). This approach has the advantage of
maintaining conservation, while a fractionalstep method might not.
If secondorder correction terms are added to this algorithm using the waves and speeds
(9.35) and the formula (9.18), then it can be shown that the method is formally secondorder
accurate if no limiters are used (Exercise 9.6).
9.6 VariableCoefﬁcient Acoustics Equations
Previously we have studied the equations of linear acoustics in a uniform medium where
the density ρ
0
and the bulk modulus K
0
are the same at every point. We now consider
acoustics in a onedimensional heterogeneous medium in which the values ρ(x) and K(x)
vary with x. The theory and numerical methods developed here also apply to elasticity
or electromagnetic waves in heterogeneous media, and to other hyperbolic systems with
variable coefﬁcients.
An important special case is a layered medium in which ρ and K are piecewise constant.
In applying ﬁnite volume methods we will assume the medium has this structure, at least at
the level of the grid cells. We assume the i th cell contains a uniform material with density
ρ
i
and bulk modulus K
i
. Smoothly varying material parameters can be approximated well
in this manner on a sufﬁciently ﬁne grid. Our discussion will focus primarily on the case
of piecewise constant media, since we need to understand this case in detail in order to
implement methods based on Riemann solvers. See Section 9.14 for discussion of how to
choose the ρ
i
and K
i
if the coefﬁcients vary on the subgrid scale.
172 9 VariableCoefﬁcient Linear Equations
It is possible to solve the variablecoefﬁcient acoustics equations in conservation form
by writing them in terms of momentum and strain; see [273] for example. Here we explore
the nonconservative formulation that arises when pressure and velocity are used as the
dependent variables. These are the quantities that must be continuous at an interface between
different materials and are also physically more intuitive. This example provides a nice case
study in solving a nonconservative variablecoefﬁcient system, which can form a basis for
developing algorithms for other hyperbolic systems that perhaps cannot be rewritten in
conservation form.
The form (2.52) of the constantcoefﬁcient acoustic equations generalizes naturally to
q
t
+ A(x)q
x
= 0, (9.43)
where
q(x, t ) =
p(x, t )
u(x, t )
, A(x) =
0 K(x)
1/ρ(x) 0
. (9.44)
At each point x we can diagonalize this matrix as in Section 2.8,
A(x) = R(x)(x)R
−1
(x). (9.45)
If we deﬁne the sound speed
c(x) =
K(x)/ρ(x) (9.46)
and the impedance
Z(x) = ρ(x)c(x) =
K(x)ρ(x), (9.47)
then the eigenvector and eigenvalue matrix of (9.45) are
R(x) =
−Z(x) Z(x)
1 1
, (x) =
−c(x) 0
0 c(x)
. (9.48)
9.7 ConstantImpedance Media
An interesting special case arises if ρ(x) and K(x) are related in such a way that Z(x) =
Z
0
is constant, which happens if K(x) = Z
2
0
/ρ(x) everywhere. Then the eigenvector
matrix R(x) ≡ R is constant in space. In this case we can diagonalize the system (9.43) by
multiplying by R
−1
to obtain
(R
−1
q)
t
+[R
−1
A(x)R](R
−1
q)
x
= 0.
Deﬁning
w(x, t ) = R
−1
q(x, t )
as in Section 2.9, we can write the above system as
w
t
+(x)w
x
= 0. (9.49)
9.8 Variable Impedance 173
This diagonal system decouples into two scalar advection equations (color equations in the
terminology of Section 9.1)
w
1
t
−c(x)w
1
x
= 0 and w
2
t
+c(x)w
2
x
= 0.
Leftgoing and rightgoing sound waves propagate independently of one another with the
variable sound speed c(x).
Example 9.1. Consider a piecewise constant medium with a single discontinuity at x = 0,
ρ(x) =
ρ
l
if x < 0,
ρ
r
if x > 0,
K(x) =
K
l
if x < 0,
K
r
if x > 0.
(9.50)
Take ρ
l
= 1, ρ
r
= 2 and K
l
= 1, K
r
= 0.5, so that the impedance is Z
0
= 1 everywhere
although the sound speed jumps from c
l
= 1 to c
r
= 0.5. Figure 9.4 shows a rightgoing
acoustic wave having p(x, t ) = Z
0
u(x, t ) everywhere. As it passes through the interface
the pulse is compressed due to the change in velocity ( just as would happen with the scalar
color equation), but the entire wave is transmitted and there is no reﬂection at the interface.
Compare with Figure 9.5, where there is also a jump in the impedance.
9.8 Variable Impedance
Note that the diagonalization (9.49) is possible only because R is constant in space. If R(x)
varies with x then R
−1
(x)q
x
= (R
−1
(x)q)
x
− R
−1
x
(x)q, where R
−1
x
(x) is the derivative of
R
−1
(x) with respect to x. In this case multiplying (9.43) by R
−1
(x) yields
w
t
+(x)w
x
= R
−1
x
(x)q
= B(x)w, (9.51)
where the matrix B(x) is given by B(x) = R
−1
x
(x)R(x) and is not a diagonal matrix. In this
case we still have advection equations for w
1
and w
2
, but they are now coupled together
by the source terms. The leftgoing and rightgoing acoustic waves no longer propagate
independently of one another.
Rather than attempting to work with this system, we will see that the Riemann problem
can be posed and solved at a general interface between two different materials. By assuming
the medium is layered (so the impedance is piecewise constant), we can reduce the general
problem with variable coefﬁcients to solving such Riemann problems.
Before considering the general Riemann problem, consider what happens when a wave
hits an interface in a medium of the form (9.50) if there is a jump in impedance at the
interface.
Example 9.2. Consider the medium (9.50) with ρ
l
= 1, ρ
r
= 4 and K
l
= 1, K
r
= 1. As
in Example 9.1, the velocity jumps from c
l
= 1 to c
r
= 0.5, but now the impedance is also
discontinuous with Z
l
= 1and Z
r
= 2. Figure 9.5shows what happens as a rightgoingwave
hits the interface. Part of the wave is transmitted, but part is reﬂected as a leftgoing wave.
174 9 VariableCoefﬁcient Linear Equations
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 4
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 4
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 5
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 5
Fig. 9.4. Rightgoing acoustic pulse hitting a material interface (dashed line) where the sound speed
changes from 1 to 0.5 but the impedance is the same. Left column: pressure. Right column: velocity.
[claw/book/chap9/acoustics/interface]
If the incident pressure pulse has magnitude p
0
, then the transmitted pulse has magnitude
C
T
p
0
and the reﬂected pulse has magnitude C
R
p
0
, where the transmission and reﬂection
coefﬁcients are given by
C
T
=
2Z
r
Z
l
+ Z
r
, C
R
=
Z
r
− Z
l
Z
l
+ Z
r
. (9.52)
For the example in Figure 9.5, we have C
T
= 4/3 and C
R
= 1/3. Partial reﬂection always
occurs at any interface where there is an impedance mismatch with Z
l
= Z
r
. There are
several ways to derive these coefﬁcients. We will do so below by solving an appropriate
Riemann problem, as motivated by the next example.
9.8 Variable Impedance 175
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 4
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 4
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 5
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 5
Fig. 9.5. Rightgoing acoustic pulse hitting a material interface (dashed line) where the sound speed
changes from1 to 0.5 and the impedance changes from1 to 2. Part of the wave is reﬂected at the inter
face. Left column: pressure. Right column: velocity. [claw/book/chap9/acoustics/interface]
Example 9.3. To see how the transmission and reﬂection coefﬁcients are related to a
Riemann problem, consider the situation where the incident wave is a jump discontinuity
as shown in Figure 9.6. When this discontinuity hits the interface, part of it is transmitted
and part is reﬂected. Now suppose we ignore the ﬁrst two frames of the time sequence
shown in Figure 9.6 (at times t =−2 and t =−1) and consider what happens only from
time t =0 onwards. At time t =0 we have data that is piecewise constant with a jump
discontinuity at x =0 in a medium that also has a jump discontinuity at x =0. This is
the proper generalization of the classic Riemann problem to the case of a heterogeneous
medium. As time advances the discontinuity in the data resolves into two waves, one
176 9 VariableCoefﬁcient Linear Equations
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = −2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = −2
−5 −4 − 3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = −1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = −1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(1) at time t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
q(2) at time t = 3
Fig. 9.6. Rightgoing square pulse hitting a material interface (dashed line) where the sound speed
changes from 1 to 0.5 and the impedance changes from 1 to 2. The sequence from t = 0 onwards
corresponds to the Riemann problem for variablecoefﬁcient acoustics. Left column: pressure. Right
column: velocity. [claw/book/chap9/acoustics/interface]
moving to the left at the sound speed of the medium on the left and the other moving
to the right at the sound speed of that medium. Determining the magnitude of these two
waves relative to the original jump will give the expressions (9.52) for the transmission and
reﬂection coefﬁcients. Being able to solve the general Riemann problem will also allow us
to apply highresolution ﬁnite volume methods to the general variablecoefﬁcient acoustics
problem.
9.9 Solving the Riemann Problem for Acoustics 177
9.9 Solving the Riemann Problem for Acoustics
The general Riemann problem for acoustics in a heterogeneous medium is deﬁned by con
sidering a piecewise constant medium of the form (9.50) together with piecewise constant
initial data
q(x, 0) =
q
l
if x < 0,
q
r
if x > 0.
(9.53)
The solution to the Riemann problem consists of two acoustic waves, one moving to the
left with velocity −c
l
and the other to the right with velocity +c
r
. Each wave moves at
the sound speed of the material in which it propagates, as indicated in Figure 9.7. At the
interface x = 0 the pressure and velocity perturbations are initially discontinuous, but they
should be continuous for t >0, after the waves have departed. Hence there should be a
single state q
m
between the two waves as indicated in Figure 9.7 and as seen in Figure 9.6.
We know from the theory of Section 2.8 that the jump across each wave must be an
eigenvector of the coefﬁcient matrix from the appropriate material. Hence we must have
q
m
−q
l
= α
1
−Z
l
1
and q
r
−q
m
= α
2
Z
r
1
(9.54)
for some scalar coefﬁcients α
1
and α
2
. Adding these two equations together yields
q
r
−q
l
= α
1
−Z
l
1
+α
2
Z
r
1
.
This leads to a linear system of equations to solve for α
1
and α
2
,
R
lr
α = q
r
−q
l
,
−c
l
c
r
q
l
q
r
q
m
Fig. 9.7. Structure of the solution to the Riemann problem for variablecoefﬁcient acoustics, in the
x–t plane. The dashed line shows the interface between two different materials. The waves propagate
at the speed of sound in each material. Between the waves is a single state q
m
.
178 9 VariableCoefﬁcient Linear Equations
where
R
lr
=
−Z
l
Z
r
1 1
. (9.55)
This is essentially the same process used to solve the Riemann problem for constant
coefﬁcient acoustics, but with an eigenvector matrix R
lr
that is not the matrix R(x) from
either side of the interface, but rather consists of the leftgoing eigenvector from the left
medium and the rightgoing eigenvector from the right medium.
Since
R
−1
lr
=
1
Z
l
+ Z
r
−1 Z
r
1 Z
l
, (9.56)
we ﬁnd that
α
1
=
−( p
r
− p
l
) + Z
r
(u
r
−u
l
)
Z
l
+ Z
r
,
α
2
=
( p
r
− p
l
) + Z
l
(u
r
−u
l
)
Z
l
+ Z
r
.
(9.57)
We also ﬁnd that the intermediate state q
m
= q
l
+α
1
W
1
is given by
p
m
= p
l
−α
1
Z
l
=
Z
r
p
l
+ Z
l
p
r
Z
l
+ Z
r
−
Z
r
Z
l
Z
l
+ Z
r
(u
r
−u
l
),
u
m
= u
l
+α
1
=
Z
l
u
l
+ Z
r
u
r
Z
l
+ Z
r
−
1
Z
l
+ Z
r
( p
r
− p
l
).
(9.58)
If Z
l
= Z
r
, then these reduce to the formulas (3.31) and (3.32) for acoustics in a constant
medium.
9.10 Transmission and Reﬂection Coefﬁcients
Returning to Example 9.3, we can nowcompute the transmission and reﬂection coefﬁcients
for a wave hitting an interface. If the Riemann problem arises from an incident wave hitting
an interface as shown in Figure 9.6, then q
l
and q
r
are not arbitrary but must be related by
the fact that q
r
−q
l
is the jump across the incident rightgoing wave, and hence
q
r
−q
l
= β
Z
l
1
(9.59)
for some scalar β. After solving the Riemann problem at the heterogeneous interface, the
outgoing waves have strengths α
1
and α
2
given by
α = R
−1
lr
(q
r
−q
l
)
=
β
Z
l
+ Z
r
−1 Z
r
1 Z
l
Z
l
1
=
β
Z
l
+ Z
r
Z
r
− Z
l
2Z
l
. (9.60)
9.11 Godunov’s Method 179
We thus ﬁnd that the magnitudes of the reﬂected and transmitted waves are
α
1
=
Z
r
− Z
l
Z
l
+ Z
r
β and α
2
=
2Z
l
Z
l
+ Z
r
β (9.61)
respectively. The waves are thus
reﬂected wave: α
1
−Z
l
1
= β
Z
r
− Z
l
Z
l
+ Z
r
−Z
l
1
,
transmitted wave: α
2
Z
r
1
= β
2Z
l
Z
l
+ Z
r
Z
r
1
.
Note that the pressure jump in the transmitted wave can be written as
β
2Z
l
Z
l
+ Z
r
Z
r
=
2Z
r
Z
l
+ Z
r
βZ
l
.
Comparingthis withthe pressure jumpβZ
l
of the incident wave (9.59) gives the transmission
coefﬁcient C
T
of (9.52). The reﬂected wave has a pressure jump −C
R
(βZ
l
), where C
R
is
given in (9.52). The minus sign arises from the fact that we measure the pressure jump by
subtracting the value to the left of the wave from the value to the right. Since the wave
is leftgoing, however, the gas experiences a jump in pressure of the opposite sign as the
wave passes by, and it is this jump that is normally considered in deﬁning the reﬂection
coefﬁcient C
R
.
9.11 Godunov’s Method
Having determined the solution to the Riemann problem for acoustics in a heterogeneous
medium, it is easy to implement Godunov’s method and other ﬁnite volume methods. Each
grid cell is assigned a density ρ
i
and a bulk modulus K
i
, and Q
n
i
represents the cell average
of q over this cell at time t
n
. The Riemann problem at x
i −1/2
is solved as described in
Section 9.9 with ρ
l
= ρ
i −1
, ρ
r
= ρ
i
, etc. We obtain two waves
W
1
i −1/2
= α
1
i −1/2
r
1
i −1/2
, W
2
i −1/2
= α
2
i −1/2
r
2
i −1/2
,
where
r
1
i −1/2
=
−Z
i −1
1
, r
2
i −1/2
=
Z
i
1
.
These waves propagate at speeds s
1
i −1/2
= −c
i −1
and s
2
i −1/2
= +c
i
. The coefﬁcients α
1
i −1/2
and α
2
i −1/2
are given by (9.57):
α
1
i −1/2
=
−( p
i
− p
i −1
) + Z
i
(u
i
−u
i −1
)
Z
i −1
+ Z
i
,
α
2
i −1/2
=
( p
i
− p
i −1
) + Z
i −1
(u
i
−u
i −1
)
Z
i −1
+ Z
i
.
(9.62)
180 9 VariableCoefﬁcient Linear Equations
Godunov’s method can be implemented in the ﬂuctuation form
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
if we deﬁne
A
−
Q
i −1/2
= s
1
i −1/2
W
1
i −1/2
, A
+
Q
i −1/2
= s
2
i −1/2
W
2
i −1/2
, (9.63)
following the general prescription (4.42). Note that the variablecoefﬁcient acoustic equa
tions (9.43) are not in conservation form, and so this is not a ﬂuxdifference splitting in this
case, but it still leads to the proper updating of cell averages based on waves moving into
the grid cells.
For constantcoefﬁcient acoustics, we saw in Section 4.12 that we could interpret the
ﬂuctuation A
−
Q
i −1/2
as A
−
(Q
i
− Q
i −1
), the “negative part” of the matrix A multiplied
bythe jumpin Q, with A
−
deﬁnedin(4.45). For variablecoefﬁcient acoustics it is interesting
to note that we can make a similar interpretation in spite of the fact that the matrix A varies.
In this case we have A
−
Q
i −1/2
= A
i −1/2
(Q
i
−Q
i −1
), where the matrix A
i −1/2
is different
than the coefﬁcient matrices
A
i
=
0 K
i
1/ρ
i
0
= R
i
i
R
−1
i
deﬁned in the grid cells. Deﬁne
R
i −1/2
=
−Z
i −1
Z
i
1 1
,
analogous to R
lr
in (9.55). Then the wave strengths α
1
i −1/2
and α
2
i −1/2
are determined by
α
i −1/2
= R
−1
i −1/2
(Q
i
− Q
i −1
).
The ﬂuctuations (9.63) are thus given by
A
−
Q
i −1/2
= R
i −1/2
−
i −1/2
R
−1
i −1/2
(Q
i
− Q
i −1
) = A
−
i −1/2
(Q
i
− Q
i −1
),
A
+
Q
i −1/2
= R
i −1/2
+
i −1/2
R
−1
i −1/2
(Q
i
− Q
i −1
) = A
+
i −1/2
(Q
i
− Q
i −1
),
(9.64)
where we deﬁne
i −1/2
=
s
1
i −1/2
0
0 s
2
i −1/2
=
−c
i −1
0
0 c
i
and hence
A
i −1/2
= R
i −1/2
i −1/2
R
−1
i −1/2
=
1
Z
i −1
+ Z
i
c
i
Z
i
−c
i −1
Z
i −1
(c
i −1
+c
i
)Z
i −1
Z
i
c
i −1
+c
i
c
i
Z
i −1
−c
i −1
Z
i
. (9.65)
If A
i −1
= A
i
, then A
i −1/2
also reduces to this same coefﬁcient matrix. In general it is
different from the coefﬁcient matrix on either side of the interface, and can be viewed as a
9.13 Wave Limiters 181
special average of the coefﬁcient matrix from the two sides. If the coefﬁcients are smoothly
varying, then A
i −1/2
≈ A(x
i −1/2
).
Note that implementing the method does not require working with this matrix A
i −1/2
.
We work directly with the waves and speeds. The Riemann solver is implemented in
[claw/book/chap9/acoustics/interface/rp1acv.f].
9.12 HighResolution Methods
Godunov’s method for variablecoefﬁcient acoustics is easily extended to a highresolution
method via a natural extension of the methods presented in Section 6.13, together with
appropriate wave limiters. The method has the general form
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i +1/2
+A
−
Q
i −1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
, (9.66)
where
˜
F
i −1/2
=
1
2
m
¸
p=1
s
p
i −1/2
1 −
t
x
s
p
i −1/2
¯
W
p
i −1/2
. (9.67)
Before discussing limiters, ﬁrst consider the unlimited case in which
¯
W
p
i −1/2
= W
i −1/2
.
Then a calculation shows that the method (9.66) can be rewritten as
Q
n+1
i
= Q
n
i
−
t
2 x
¸
A
i −1/2
(Q
i
− Q
i −1
) + A
i +1/2
(Q
i +1
− Q
i
)
¸
+
t
2
2 x
2
¸
A
2
i +1/2
(Q
i +1
− Q
i
) − A
2
i −1/2
(Q
i
− Q
i −1
)
¸
. (9.68)
This is a Lax–Wendroffstyle method based on the coefﬁcient matrices deﬁned at the in
terface as in (9.65). As for the case of the variablecoefﬁcient color equation discussed
in Section 9.5, this method is not formally secondorder accurate when A varies, be
cause the ﬁnal term approximates
1
2
t
2
(A
2
q
x
)
x
while the Taylor series expansion requires
1
2
t
2
q
t t
=
1
2
t
2
A(Aq
x
)
x
. These differ by
1
2
t
2
A
x
Aq
x
. However, we have captured the
1
2
t
2
A
2
q
xx
term correctly, which is essential in eliminating the numerical diffusion of the
Godunov method.
This approach yields good highresolution results in practice in spite of the lack of
formal secondorder accuracy (as we’ve seen before, e.g., Section 8.5, Section 9.3.1). Since
these highresolution methods are of particular interest for problems where the solution or
coefﬁcients are discontinuous, formal secondorder accuracycannot be expectedinanycase.
If the problem is in conservation form q
t
+(A(x)q)
x
= 0, then this approach in fact gives
formal secondorder accuracy. See Section 16.4, where this is discussed in the more general
context of a conservation law with a spatially varying ﬂux function, q
t
+ f (q, x)
x
= 0.
9.13 Wave Limiters
Applying limiters to the waves W
p
i −1/2
is slightly more difﬁcult for variablecoefﬁcient
systems of equations than in the constantcoefﬁcient case. To obtain a highresolution
182 9 VariableCoefﬁcient Linear Equations
method, we wish to replace the wave W
p
i −1/2
by a limited version in (9.67),
W
p
i −1/2
= φ
θ
p
i −1/2
W
p
i −1/2
, (9.69)
as described in Chapter 6. Again θ
p
i −1/2
should be some measure of the smoothness of
the pth characteristic component of the solution. When A is constant the eigenvectors r
1
and r
2
are the same everywhere and so W
p
i −1/2
= α
p
i −1/2
r
p
can easily be compared to the
corresponding wave W
p
I −1/2
= α
p
I −1/2
r
p
arising from the neighboring Riemann problem
by simply comparing the two scalar wave strengths,
θ
p
i −1/2
=
α
p
I −1/2
α
p
i −1/2
. (9.70)
(Recall that I = i ± 1 as in (6.61), looking in the upwind direction as determined by the
sign of s
p
i −1/2
.) Note that in this constantcoefﬁcient case we have
θ
p
i −1/2
=
W
p
I −1/2
W
p
i −1/2
(9.71)
in any vector norm.
For a variablecoefﬁcient problem, the two waves
W
p
i −1/2
= α
p
i −1/2
r
p
i −1/2
=
p
i −1/2
Q
i −1/2
r
p
i −1/2
(9.72)
and
W
p
I −1/2
= α
p
I −1/2
r
p
I −1/2
=
p
I −1/2
Q
I −1/2
r
p
I −1/2
(9.73)
are typically not scalar multiples of one another, since the eigenvector matrices R(x) and
L(x) = R
−1
(x) vary with x. In this case it may make no sense to compare α
p
i −1/2
with
α
p
I −1/2
, since these coefﬁcients depend entirely on the normalization of the eigenvectors,
which may vary with x. It would make more sense to compare the magnitudes of the full
waves, using the expression (9.71) for some choice of vector norm, but some way must be
found to assign a sign, which we expect to be negative near extreme points. More generally,
a problem with (9.71) is that it would give θ ≈ 1 whenever the two waves are of similar
magnitude, regardless of whether they are actually similar vectors in phase space or not. If
the solution is truly smooth, then we expect W
p
i −1/2
≈W
p
I −1/2
and not just that these vectors
have nearly the same magnitude (which might be true for two vectors pointing in very
different directions in phase space at some discontinuity in the medium, or in the solution
for a nonlinear problem).
We would like to deﬁne θ
p
i −1/2
in a way that reduces to (9.70) in the constantcoefﬁcient
case but that takes into account the degree of alignment of the wave vectors as well as
their magnitudes. This can be accomplished by projecting the vector W
p
I −1/2
onto the
vector W
p
i −1/2
to obtain a vector θ
p
i −1/2
W
p
i −1/2
that is aligned with W
p
i −1/2
. Using the scalar
coefﬁcient of this projection as θ
p
i −1/2
gives
θ
p
i −1/2
=
W
p
I −1/2
· W
p
i −1/2
W
p
i −1/2
· W
p
i −1/2
, (9.74)
9.14 Homogenization of Rapidly Varying Coefﬁcients 183
where · is the dot product in R
m
. This works well in most cases, also for nonlinear problems,
and this general procedure is implemented in the limiter.f routine of CLAWPACK.
Another approach has been proposed by Lax & Liu [264], [313] in deﬁning their positive
schemes. Recall that we have used (9.72) and (9.73) to deﬁne the limiter. Lax and Liu instead
use
W
p
I −1/2
= ˆ α
p
I −1/2
r
p
i −1/2
=
p
i −1/2
Q
I −1/2
r
p
i −1/2
(9.75)
in place of W
p
I −1/2
. The vector
W
p
I −1/2
is obtained by decomposing the jump Q
I −1/2
into
eigenvectors of the matrix R
i −1/2
rather than into eigenvectors of R
I −1/2
. The vector
W
p
I −1/2
is now a scalar multiple of W
p
i −1/2
, and so we can simply use
θ
p
i −1/2
=
ˆ α
p
I −1/2
α
p
i −1/2
=
W
p
I −1/2
· W
p
i −1/2
W
p
i −1/2
· W
p
i −1/2
. (9.76)
This is slightly more expensive to implement, but since we compute the left eigenvectors
at each cell interface in any case in order to compute the W
p
i −1/2
, we can also use them to
compute
W
p
I −1/2
at the same time if the computations are organized efﬁciently.
For most problems the simpler expression (9.74) seems to work well, but for some prob
lems with rapid variation in the eigenvectors the Lax–Liu limiter is superior. For example,
in solving the acoustics equations in a rapidly varying periodic medium an instability at
tributed to nonlinear resonance was observed in [139] using the standard CLAWPACK limiter.
A transmissionbased limiter, closely related to the Lax–Liu limiter, was introduced to ad
dress this problem. This is similar to (9.76) but decomposes only the wave W
p
I −1/2
into
eigenvectors r
p
i −1/2
rather than starting with the full jump Q
I −1/2
:
W
p
I −1/2
= ˆ α
p
I −1/2
r
p
i −1/2
=
p
i −1/2
W
p
I −1/2
r
p
i −1/2
. (9.77)
The formula (9.76) is then used. For acoustics this has the interpretation of taking the wave
from the neighboring Riemann problem that is approaching the interface x
i −1/2
and using
only the portion of this wave that would be transmitted through the interface in deﬁning the
limiter. See [139] for more discussion of this and several examples where these methods
are used in periodic or random media.
9.14 Homogenization of Rapidly Varying Coefﬁcients
If the physical parameters varysubstantiallywithina single gridcell, thenit will be necessary
to apply some sort of homogenization theory to determine appropriate averaged values to
use for ρ
i
and K
i
. This might be the case in a seismology problem, for example, where each
grid cell represents a sizable block of earth that is typically not uniform.
Since ρ is the density (mass per unit length, in one dimension), the average density of
the i th cell is properly computed as the total mass in the cell divided by the length of the
cell, i.e., as the arithmetic average of ρ within the cell,
ρ
i
=
1
x
x
i +1/2
x
i −1/2
ρ(x) dx. (9.78)
184 9 VariableCoefﬁcient Linear Equations
For the bulk modulus K it turns out that instead of an arithmetic average, it is necessary to
use the harmonic average
K
i
=
1
x
x
i +1/2
x
i −1/2
1
K(x)
dx
−1
. (9.79)
Alternatively, we can viewthis as using the arithmetic average of the parameter 1/K, which
is called the coefﬁcient of compressibility (see, e.g., [255]),
1
K
i
=
1
x
x
i +1/2
x
i −1/2
1
K(x)
dx. (9.80)
This is most easily motivated by considering the linear elasticity interpretation of acoustics
from Section 2.12, with Lam´ e parameters λ = K and µ = 0 and the stress–strain relation
σ = K (9.81)
resulting from (2.89) (dropping superscripts on σ
11
and
11
). Rewriting this as
=
1
K
σ (9.82)
shows that this has the form of Hooke’s law with spring constant 1/K. Recalling that
= X
x
−1, we see that for a grid cell of homogeneous material (K
i
= constant) with rest
length x
i −1/2
− x
i +1/2
= x, applying a force σ results in a strain
¸
X
x
i +1/2
− X
x
i −1/2
¸
−x
x
=
1
K
i
σ. (9.83)
If the material in the cell is heterogeneous (with σ still constant), then instead we have
¸
X
x
i +1/2
− X
x
i −1/2
¸
−x
x
=
1
x
x
i +1/2
x
i −1/2
[X
x
(x) −1] dx
=
1
x
x
i +1/2
x
i −1/2
(x) dx
=
1
x
x
i +1/2
x
i −1/2
1
K(x)
dx
σ. (9.84)
Comparing this with (9.83) motivates the averaging (9.80).
Homogenization theory is often used to derive simpler systems of partial differential
equations to model the effective behavior of a medium with rapidly varying heterogeneties.
As a simple example, consider a layered medium composed of thin layers of width L
1
of
material characterized by parameters (ρ
1
, K
1
), which alternate with thin layers of width
L
2
where the parameters are (ρ
2
, K
2
). Numerically we could solve this problem using
the highresolution methods developed above, provided we can take x small enough to
resolve the layers. We do this in Example 9.4 below. Analytically, however, we might
like to predict the behavior of waves propagating in this layered medium by solving some
simpliﬁed equation in place of the variablecoefﬁcient acoustics equation. If we consider
9.14 Homogenization of Rapidly Varying Coefﬁcients 185
(a)
0 20 40 60 80 100 120
−1
−0.5
0
0.5
1
Pressure at time t = 100
(b)
0 20 40 60 80 100 120
−1
−0.5
0
0.5
f
Pressure at time t = 100
Fig. 9.8. (a) Pressure pulse in a homogeneous medium. (b) Pressure pulse in a layered medium.
waves whose wavelength is considerably longer than L
1
and L
2
, then it turns out that
the wave propagation can be reasonably well modeled by solving a homogenized system
of equations that is simply the constantcoefﬁcient acoustics equation with appropriate
averages of ρ and 1/K,
¯ ρ =
1
L
1
+ L
2
(L
1
ρ
1
+ L
2
ρ
2
) and
ˆ
K
−1
=
1
L
1
+ L
2
L
1
K
1
+
L
2
K
2
. (9.85)
This is illustrated in Example 9.4. More accurate homogenized equations can also be de
rived, which for this problem requires adding higherorder dispersive terms to the constant
coefﬁcient acoustics equation, as shown by Santosa & Symes [393].
In practical problems the material parameters often vary randomly, but with some slowly
varying mean values ρ(x) and K
−1
(x). This might be the case in a seismology problem,
for example, where the basic type of rock or soil varies slowly (except for certain sharp
interfaces) but is full of randomheterogeneous structures at smaller scales. Similar problems
arise in studying ultrasound waves in biological tissue, electromagnetic waves in a hazy
atmosphere, and many other applications.
Example 9.4. Figure 9.8shows the results fromtwoacoustics problems withthe same initial
data and boundary conditions but different material properties. In each case the initial data
is p ≡ u ≡ 0, and at the left boundary
u(0, t ) =
0.2
1 +cos
π(t −15)
10
if t −15 < 10,
0 otherwise.
(9.86)
This inandout wall motion creates a pressure pulse that propagates to the right. In
Figure 9.8(a) the material is uniform with ρ ≡1 and K ≡1, and so the sound speed is
c ≡1. The peak pressure is generated at time t =15, and at t =100 is visible at x =85, as
should be expected.
Figure 9.8(b) shows a case where the material varies periodically with
ρ = K =
3 for 2i < x < 2i +1,
1 for 2i +1 < x < 2i +2.
(9.87)
The layers have width L
1
=L
2
=1 as seen in the zoomed view of Figure 9.9(a), where
ρ =K =3 in the dark layers and ρ =K =1 in the light layers. For the choice (9.87), the
sound speed is c ≡ 1 in all layers. However, the pressure pulse does not propagate at
186 9 VariableCoefﬁcient Linear Equations
(a)
50 55 60 65 70 75 80 85 90
−0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
(b)
50 55 60 65 70 75 80 85 90
−0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
Fig. 9.9. (a) Zoom view of Figure 9.8(b) with the layers indicated. (b) The solid line is the “exact”
solution. The symbols indicate the numerical solution computed with only four grid cells per layer.
[claw/book/chap9/acoustics/layered]
speed 1. Instead, it propagates at the speed predicted by the homogenized acoustic equation
as described above. The effective speed is
¯ c =
ˆ
K/ ¯ ρ ≈ 0.866, (9.88)
based on the arithmetic average ¯ ρ =
1
2
(3 + 1) =2 and the harmonic average
ˆ
K =(
1
2
(
1
3
+
1))
−1
=1.5. The peak pressure generated at t =15 is now observed at x =(85)(0.866) ≈
73.6, as is clearly seen in Figure 9.9(a).
What’s going on? Even though the sound speed c ≡1 is constant everywhere, the impe
dance Z =ρc =ρ is not, and so the eigenvectors of the coefﬁcient matrix are different in
each layer. Recall from Section 9.8 that the wave will be partially reﬂected at each interface
in this case. The wave observed in Figure 9.8(a) is not a simple wave in the 2characteristic
family translating to the right as in the constantcoefﬁcient case. Instead it is composed of
waves moving in both directions that are constantly bouncing back and forth between the
interfaces, so that the energy moves more slowly to the right than we would expect from the
sound speed. It is the group velocity that we are observing rather than the phase velocity.
Notice from Figure 9.9(a) that the waveform is not completely smooth, but appears to
have jump discontinuities in p
x
at each interface. This is expected, since
u
t
+
1
ρ
p
x
= 0.
The velocity u must be continuous at all times, from which it follows that u
t
and hence
p
x
/ρ must also be continuous. This means that p
x
will be discontinuous at points where ρ
is discontinuous.
Figure 9.9(a) also shows dispersive oscillations beginning to formbehind the propagating
pressure pulse in the periodic medium. This is not due to numerical dispersion, but rather is
a correct feature of the exact solution, as predicted by the dispersive homogenized equation
derived in [393].
In fact, the curve shown in Figure 9.8(b) and Figure 9.9(a) is essentially the exact solution.
It was calculated on a ﬁne grid with 2400 cells, and hence 20 grid cells in each layer.
More importantly, the time step t =x was used. Since c ≡1 everywhere, this means
Exercises 187
that each wave propagates through exactly one grid cell each time step, and there are no
numerical errors introducedbyaveragingontothe grid. Inessence we are usingthe methodof
characteristics, with the Riemann solver providing the correct characteristic decomposition
at each cell interface.
We might now ask how accurate the highresolution ﬁnite volume method would be
on this problem, since for practical problems it will not always be possible to choose the
time step so that c t =x everywhere. This can be tested by choosing t <x, so that
the method no longer reduces to the method of characteristics. Now the piecewise linear
reconstruction with limiter functions is being used together with averaging onto grid cells.
Using t =0.8 x on the same grid with 2400 cells gives numerical results that are
nearly indistinguishable from the exact solution shown in Figure 9.9(a). As a much more
extreme test, the calculation was performed on a grid with only four grid cells in each layer.
The results are still reasonable, as shown by the circles in Figure 9.9(b). Some accuracy is
lost at this resolution, but the basic structure of the solution is clearly visible, with the wave
propagating at the correct effective velocity.
Exercises
9.1. Compute the local truncation error for the method (9.18) in the case where no limiter
is applied. Show that when u(x) is not constant the method fails to be formally
secondorder accurate.
9.2. Use the Lax–Wendroff approach described in Section 6.1, expanding in Taylor series,
to derive a method that is formally secondorder accurate for the variablecoefﬁcient
color equation (9.12). Compare this method with (9.18) using (9.17).
9.3. Show that if we add secondorder correction terms (with no limiters) to (9.41) based
on (9.35), then we obtain a secondorder accurate method for the conservative ad
vection equation.
9.4. Explain why (9.32) is consistent with the notion of density as “cars per unit length.”
9.5. In the discussion of variablecoefﬁcient advection we have assumed u(x) has the
same sign everywhere. Consider the conservative equation q
t
+ (u(x)q)
x
= 0 with
q(x, 0) ≡ 1 and
u(x) =
−1 if x < 0,
+1 if x > 0,
or u(x) =
+1 if x < 0,
−1 if x > 0.
What is the solution to each? (You might want to consider the conveyerbelt inter
pretation of Section 9.4.1.) How well will the methods presented here work for these
problems? (See also Exercise 13.11.)
9.6. Show that the method developed in Section 9.5.2 with the correction terms (9.18)
added is formally secondorder accurate if no limiter is applied.
10
Other Approaches to High Resolution
In this book we concentrate on one particular approach to developing highresolution ﬁnite
volume methods, based on solving Riemann problems, using the resulting waves to deﬁne
a secondorder accurate method, and then applying wave limiters to achieve nonoscillatory
results. A variety of closely related approaches have also been developed for achieving
highresolution results, and in this chapter a few alternatives are brieﬂy introduced.
10.1 CenteredinTime Fluxes
Recall the general form (4.4) of a ﬂuxdifferencing method,
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
, (10.1)
where
F
n
i −1/2
≈
1
t
t
n+1
t
n
f
q
x
i −1/2
, t
dt. (10.2)
The formula (10.1) can be arbitrarily accurate if we can approximate the integral appearing
in (10.2) well enough. With the approach taken in Chapter 6, we approximate this integral
using data at time t
n
and the Taylor series, in a manner that gives secondorder accuracy.
There are many ways to derive methods of this type, and the approach taken in Chapter 6
is one way. Another is to ﬁrst approximate
Q
n+1/2
i −1/2
≈ q
x
i −1/2
, t
n+1/2
(10.3)
by some means and then use
F
n
i −1/2
= f
Q
n+1/2
i −1/2
(10.4)
in (10.1). Since this is centered in time, the resulting method will be secondorder accurate
provided that the approximation (10.3) is sufﬁciently good. Again Taylor series expansions
can be used to approximate q(x
i −1/2
, t
n+1/2
) based on the data at time t
n
. The Richtmyer
twostep method (4.23) gives a secondorder accurate method of this form.
To obtain highresolution results we want to use the ideas of upwinding and limiting.
An approach that is often used (e.g., [80]) is to ﬁrst deﬁne two edge states Q
L,n+1/2
i −1/2
and
188
10.1 CenteredinTime Fluxes 189
t
n
t
n+1/2
t
n+1
Q
n
i
Q
n
i−1
Q
L,n+1/2
i−1/2
Q
R,n+1/2
i−1/2
Fig. 10.1. The cell averages Q
n
are used to obtain two approximations Q
L,n+1/2
i −1/2
and Q
R,n+1/2
i −1/2
to the
states adjacent to x
i −1/2
at time t
n+1/2
. Solving the Riemann problem between these states gives the
ﬂux (10.5).
Q
R,n+1/2
i −1/2
as indicated in Figure 10.1, and then solve the Riemann problem between these
states to obtain Q
n+1/2
i −1/2
as the value along x/t = 0 in the solution to this Riemann problem,
Q
n+1/2
i −1/2
= q
∨

Q
L,n+1/2
i −1/2
, Q
R,n+1/2
i −1/2
. (10.5)
In order to obtain two approximate values at time t
n+1/2
we can use the Taylor series,
expanding from both x
i
and x
i +1
:
Q
L,n+1/2
i −1/2
≈ q
x
i −1/2
, t
n+1/2
= q(x
i −1
, t
n
) +
x
2
q
x
(x
i −1
, t
n
) +
t
2
q
t
(x
i −1
, t
n
) +· · ·
(10.6)
and
Q
R,n+1/2
i −1/2
≈ q
x
i −1/2
, t
n+1/2
= q(x
i
, t
n
) −
x
2
q
x
(x
i
, t
n
) +
t
2
q
t
(x
i
, t
n
) +· · · . (10.7)
The cell averages Q
n
i −1
and Q
n
i
are used to approximate q(x
i −1
, t
n
) and q(x
i
, t
n
). The
q
x
terms are approximated by reconstructing slopes in each cell, typically using limiter
functions to avoid nonphysical oscillations. The timederivative terms are replaced by spatial
derivatives using the differential equation. For a general conservation law q
t
+ f (q)
x
= 0
we have
q
t
= −f
(q)q
x
, (10.8)
so that the same approximations to q
x
can be used in these terms. For systems of equations,
a characteristic decomposition of q is often used in the process of estimating q
x
, so that lim
iting can be done by looking in the appropriate upwind direction for each eigencomponent
of q
x
.
A disadvantage of this approach is that we must ﬁrst perform some sort of character
istic decomposition in order to estimate q
x
in each cell and obtain the values Q
L,n+1/2
i −1/2
and Q
R,n+1/2
i −1/2
. This characteristic decomposition is similar to solving a Riemann problem,
190 10 Other Approaches to High Resolution
though it may be simpliﬁed for speciﬁc systems of equations (or q
x
may be approximated
by applying limiters componentwise instead on using the more expensive characteristic
decomposition). Then a Riemann problem is solved between these two states Q
L,n+1/2
i −1/2
and
Q
R,n+1/2
i −1/2
.
The wavepropagation algorithm, by contrast, only solves a Riemann problem between
Q
i −1
and Q
i
and uses the resulting structure to determine both a ﬁrstorder ﬂux and second
order correction terms. The waves coming from the Riemann solver can be viewed as an
eigendecomposition of q
x
(since Q
i
−Q
i −1
≈x q
x
) and these are used in the Taylor series
expansion. The Riemann solution thus does double duty in a sense, and the methods are
easily formulated in a way that applies to arbitrary hyperbolic systems.
The idea of ﬁrst approximating Q
n+1/2
i −1/2
at the midpoint in time and then evaluating f at
these points to update Q
n
to Q
n+1
is reminiscent of a twostage Runge–Kutta method. In
Section 10.4 we will see a more direct application of Runge–Kutta methods that also allows
the derivation of higherorder accurate methods.
10.2 HigherOrder HighResolution Methods
For a linear problem with a smooth (many times differentiable) solution, such as the ad
vection equation with wavepacket data as used in Figure 6.3, it is possible to obtain better
accuracy by using a higherorder method. Fourthorder accurate methods are often used in
practice for such problems, or even spectral methods that have a formal order of accuracy
higher than any ﬁxed power of x. For constantcoefﬁcient linear problems these are often
a more appropriate choice than the highresolution methods developed in this book. How
ever, in many contexts these highorder methods are not easily or successfully applied, such
as when the solution or the coefﬁcients of the problem are discontinuous.
One might wonder, however, why we start with a secondorder method and then apply
limiters to improve the behavior. Why not start with higherorder methods instead, and
develop highresolution versions of these? Ideally one would like to have a method that
gives a higher order of accuracy in regions where the solution is smooth together with good
resolution of discontinuities. In fact this can be done with some success, and a number of
different approaches have been developed.
One possible approach is to follow the REA algorithm of Section 4.10 but to use a
piecewise quadratic reconstruction of the solution in each grid cell in place of a piecewise
constant or linear function. A popular method based on this approach is the piecewise
parabolic method (PPM). This method was originally developed in [84] for gas dynamics
and has been adapted to various other problems.
Another approach that is widely used is the class of essentially nonoscillatory (ENO)
methods, which are brieﬂy described later in this chapter. For onedimensional linear prob
lems, methods of this class can be developed with high order of accuracy that give very nice
results on problems where the solution has both smooth regions and discontinuities.
Some care is required in assessing the accuracy of these higherorder methods in gen
eral. They are typically developed following the same general approach we used above for
secondorder methods: ﬁrst for the scalar advection equation, generalizing to linear sys
tems via characteristic decomposition, and then to nonlinear problems by solving Riemann
problems, which gives a local characteristic decomposition. It is important to keep in mind
10.4 Semidiscrete Methods plus Time Stepping 191
that this decomposition is only local and that the problem cannot be decoupled into inde
pendent scalar equations except in the simplest constantcoefﬁcient linear case. As a result
there is a coupling between the characteristic components that can make it very difﬁcult
to maintain the formal high order of accuracy even on smooth solutions. Moreover, any
limiting that is applied to one family near a discontinuity or steep gradient can adversely
affect the accuracy of smooth waves ﬂowing past in other families. For these reasons, such
methods may not exhibit higher accuracy even in regions of the solution that appear to be
smooth. See [111], [113], [120], [125], [444] for some further discussion.
For practical problems with interesting solutions involving shock waves, it appears difﬁ
cult to formally achieve highorder accuracy in smooth regions with any method. This is
not to say that highresolution methods based on higherorder methods are not worth using.
As stressed in Section 8.5, the order of accuracy is not the only consideration and these
methods may give better resolution of the solution even if not formally higher order. But
the accuracy and the efﬁciency of a method must be carefully assessed without assuming
a priori that a higherorder method will be better.
10.3 Limitations of the Lax–Wendroff (Taylor Series) Approach
The Lax–Wendroff approach to obtaining secondorder accuracy (see Section 6.1) is to
expand in a Taylor series in time and replace the terms q
t
and q
t t
by expressions involving
spatial derivatives of x. The ﬁrst comes directly from the PDE, whereas the expression for
q
t t
is obtained by manipulating derivatives of the PDE. For the linear system q
t
+ Aq
x
= 0
one easily obtains q
t t
= A
2
q
xx
, but for more complicated problems this may not be so easy
to do; e.g., see Section 17.2.1, where an advection equation with a source termis considered.
In Chapter 19 we will see that extending these methods to more than one space dimension
leads to crossderivative terms that require special treatment. In spite of these limitations,
methods based on secondorder Taylor series expansion are successfully used in practice
and are the basis of the CLAWPACK software, for example.
There are also other approaches, however. One of the most popular is described in the next
section: an approach in which the spatial and temporal discretizations are decoupled. This is
particularly useful when trying to derive methods with greater than secondorder accuracy,
where the Lax–Wendroff approach becomes even more cumbersome. For the linear system
above, we easily ﬁnd that q
t t t
= −A
3
q
xxx
, but it is not so clear howthis should be discretized
in order to maintain the desired highresolution properties near discontinuities, and this term
may be difﬁcult to evaluate at all for other problems.
10.4 Semidiscrete Methods plus Time Stepping
The methods discussed so far have all been fully discrete methods, discretized in both space
and time. At times it is useful to consider the discretization process in two stages, ﬁrst
discretizing only in space, leaving the problemcontinuous in time. This leads to a systemof
ordinary differential equations in time, called the semidiscrete equations. We then discretize
in time using any standard numerical method for systems of ordinary differential equations
(ODEs). This approach of reducing a PDE to a system of ODEs, to which we then apply an
ODE solver, is often called the method of lines.
192 10 Other Approaches to High Resolution
This approach is particularly useful in developing methods with order of accuracy greater
than 2, since it allows us to decouple the issues of spatial and temporal accuracy. We can
deﬁne highorder approximations to the ﬂux at a cell boundary at one instant in time
using highorder interpolation in space, and then achieve highorder temporal accuracy by
applying any of the wide variety of highorder ODE solvers.
10.4.1 Evolution Equations for the Cell Averages
Let Q
i
(t ) represent a discrete approximation to the cell average of q over the i th cell at time
t , i.e.,
Q
i
(t ) ≈ ¯ q
i
(t ) ≡
1
x
x
i +1/2
x
i −1/2
q(x, t ) dx. (10.9)
We know from the integral form of the conservation law (2.2) that the cell average ¯ q
i
(t )
evolves according to
¯ q
i
(t ) = −
1
x
f
q
x
i +1/2
, t
− f
q(x
i −1/2
, t
. (10.10)
We now let F
i −1/2
(Q(t )) represent an approximation to f (q(x
i −1/2
, t )), obtained from the
discrete data Q(t ) = {Q
i
(t )}. For example, taking the Godunov approach of Section 4.11,
we might solve the Riemann problem with data Q
i −1
(t ) and Q
i
(t ) for the intermediate state
q
∨

(Q
i −1
(t ), Q
i
(t )) and then set
F
i −1/2
(Q(t )) = f (q
∨

(Q
i −1
(t ), Q
i
(t ))). (10.11)
Replacing the true ﬂuxes in (10.10) by F
i ±1/2
(Q(t )) and the exact cell average ¯ q
i
(t ) by
Q
i
(t ), we obtain a discrete system of ordinary differential equations for the Q
i
(t ),
Q
i
(t ) = −
1
x
F
i +1/2
(Q(t )) − F
i −1/2
(Q(t ))
≡L
i
(Q(t )). (10.12)
This is the i th equation in a coupled system of equations
Q
(t ) = L(Q(t )), (10.13)
since each of the ﬂuxes F
i ±1/2
(t ) depends on two or more of the Q
i
(t ).
We can nowdiscretize in time. For example, if we discretize (10.12) using Euler’s method
with time step t , and let Q
n
i
now represent our fully discrete approximation to Q
i
(t
n
),
then we obtain
Q
n+1
i
= Q
n
i
+t L
i
(Q
n
)
= Q
n
i
−
t
x
F
i +1/2
(Q
n
) − F
i −1/2
(Q
n
)
, (10.14)
which is in the familiar form of a conservative method (4.4). In particular, if F is given by
(10.11), then (10.14) is simply Godunov’s method. More generally, however, F
i −1/2
(Q
n
)
represents an approximation to the value of f (q(x
i −1/2
, t )) at one point in time, whereas
10.4 Semidiscrete Methods plus Time Stepping 193
the numerical ﬂux F
n
i −1/2
used before has always represented an approximation to the time
average of f (q(x
i −1/2
, t )) over the time interval [t
n
, t
n+1
]. InGodunov’s methodthese are the
same, since q(x
i −1/2
, t ) is constant in time in the Riemann solution. With the Lax–Wendroff
approach the time average is approximated more accurately using approximations to time
derivatives, which have been rewritten in terms of spatial derivatives. With the semidiscrete
approach we do not attempt to approximate this time average at all, but rather use only
pointwise values of the ﬂux.
To obtain higherorder accuracy, we must make two improvements: the value F
i −1/2
ob
tained by piecewise constant approximations in (10.11) must be improved to give better
spatial accuracy at this one time, and the ﬁrstorder accurate Euler method must be replaced
by a higherorder timestepping method in solving the systemof ODEs (10.13). One advan
tage of the methodoflines approach is that the spatial and temporal accuracy are decoupled
and can be considered separately. This is particularly useful in several space dimensions.
One way to obtain greater spatial accuracy is to use a piecewise linear approximation in
deﬁning F
i −1/2
(Q(t )). From the data {Q
i
(t )} we can construct a piecewise linear function
˜ q(x) using slope limiters as discussed in Chapter 6. Then at the interface x
i −1/2
we have
values on the left and right from the two linear approximations in each of the neighboring
cells (see Figure 10.2). Denote these values by
Q
R
i −1
= Q
i −1
+
x
2
σ
i −1
and Q
L
i
= Q
i
−
x
2
σ
i
.
A secondorder accurate approximation to the ﬂux at this cell boundary at time t is then
obtained by solving the Riemann problem with left and right states given by these two
values, and setting
F
i −1/2
(Q) = f
q
∨

Q
R
i −1
, Q
L
i
. (10.15)
This type of semidiscrete MUSCL scheme is discussed in more detail by Osher [350].
If we use this ﬂux in the fully discrete method (10.14), then the method is secondorder
accurate in space but only ﬁrstorder accurate in time, i.e., the global error is O(x
2
+t ),
since the time discretization is still Euler’s method. For timedependent problems this
improvement in spatial accuracy alone is usually not advantageous, but for steadystate
x
i−1/2
Q
i
Q
i−1
Q
L
i
Q
R
i−1
Fig. 10.2. Piecewise linear reconstruction of ˜ q(x) used to deﬁne left and right states at x
i −1/2
.
194 10 Other Approaches to High Resolution
problems this type of method will converge as time evolves to a secondorder accurate
approximation to the steadystate solution, in spite of the fact that it is not secondorder
accurate in time along the way.
To obtain a method that is secondorder accurate in time as well as space, we can discretize
the ODEs (10.12) using a secondorder accurate ODE method. One possibility is a two
stage explicit Runge–Kutta method. One standard Runge–Kutta method is the following
(which is not recommended, for reasons explained in Section 10.4.2):
Q
∗
i
= Q
n
i
−
t
2 x
F
i +1/2
(Q
n
) − F
i −1/2
(Q
n
)
= Q
n
i
+
1
2
t L
i
(Q
n
),
Q
n+1
i
= Q
n
i
−
t
x
F
i +1/2
(Q
∗
) − F
i −1/2
(Q
∗
)
= Q
n
i
+t L
i
(Q
∗
).
(10.16)
Note that this requires solving two Riemann problems at each cell boundary in each time
step. We ﬁrst solve Riemann problems based on the cell averages Q
n
and use these to
obtain Q
∗
, an approximation to the cell averages at time t
n
+t /2. We next solve Riemann
problems based on these cell averages in order to compute the ﬂuxes used to advance Q
n
to
Q
n+1
. This second set of ﬂuxes can nowbe viewed as approximations to the time integral of
the true ﬂux over [t
n
, t
n+1
], but it is based on estimating the pointwise ﬂux at the midpoint in
time rather than on a Taylor series expansion at time t
n
. This is similar in spirit to the method
described in Section 10.1. But now higherorder ODE methods can be used to obtain better
approximations based only on pointwise values rather than attempting to compute more
terms in the Taylor series. This is the basic idea behind most highorder methods for ODEs,
such as Runge–Kutta methods and linear multistep methods, which are generally easier
to apply than highorder Taylor series methods. (See for example [145], [177], [253] for
some general discussions of ODE methods.)
10.4.2 TVD Time Stepping
Some care must be exercised in choosing a timestepping method for the system of ODEs
(10.13). In order to obtain a highresolution method we would wish to avoid spurious
oscillations, and we knowfromour experience with the Lax–Wendroff method that applying
higherorder methods blindly can be disastrous. In Section 10.4.3 we will look at methods
of achieving better spatial accuracy of the pointwise ﬂuxes in a nonoscillatory manner, but
regardless of what spatial approximation is used, we must also insure that the timestepping
algorithm does not introduce new problems. At ﬁrst glance it seems that it might be very
difﬁcult to analyze the TVD properties of methods based on this decoupling into spatial
and temporal operators. The second step of the Runge–Kutta method (10.16), for example,
involves updating Q
n
using ﬂuxes based on Q
∗
. How can we hope to apply limiters to Q
∗
in a way that will make the full method TVD?
The development of TVD methods based on semidiscretizations is greatly simpliﬁed,
however, by the observation that certain ODE methods will be guaranteed to result in TVD
methods provided they are applied to a spatial discretization for which forward Euler time
stepping is TVD. In other words, suppose we know that L(Q) is a discretization for which
10.4 Semidiscrete Methods plus Time Stepping 195
the forward Euler method
Q
n+1
= Q
n
+t L(Q
n
) (10.17)
is a TVDmethod, which may be easy to check. Then if we apply a TVDRunge–Kutta method
to this operator, the resulting method will also be TVD. The Runge–Kutta method (10.16)
is not one of these special methods, but the following twostage secondorder Runge–Kutta
method is, and is equally easy to apply:
Q
∗
= Q
n
+t L(Q
n
),
Q
∗∗
= Q
∗
+t L(Q
∗
),
Q
n+1
=
1
2
(Q
n
+ Q
∗∗
).
(10.18)
Again two applications of L, and hence two sets of Riemann problems, are required. It
is easy to verify that this method is TVD using the property (10.17), since we then have
TV(Q
∗
) ≤ TV(Q
n
) and TV(Q
∗∗
) ≤ TV(Q
∗
), and hence
TV(Q
n+1
) ≤
1
2
[TV(Q
n
) +TV(Q
∗∗
)] ≤
1
2
[TV(Q
n
) +TV(Q
n
)] = TV(Q
n
).
Shu & Osher [410] and Shu [408] present a number of methods of this type and also
TVD multistep methods. See also [165], [214], [295], [409]. More recently such methods
have been called strong stabilitypreserving (SSP) time discretizations, e.g., [166], [423].
10.4.3 Reconstruction by Primitive Functions
To obtain high spatial accuracy we need to deﬁne F
i −1/2
in such a way that it is a good ap
proximation to f (q(x
i −1/2
, t )). Recall that ¯ q(t ) is the vector of exact cell averages, and from
these we want to obtain a value Q
i −1/2
that approximates the pointwise value q(x
i −1/2
, t ).
One approach to this was outlined above: deﬁne Q
R
i −1
and Q
L
i
using slopelimited piecewise
linears, and then set
Q
i −1/2
= q
∨

Q
R
i −1
, Q
L
i
.
To obtain higherorder accuracy we can take the same approach but deﬁne Q
L
i −1
and Q
R
i
via some higherorder polynomial approximation to q over the cells to the left and right of
x
i −1/2
.
This raises the following question: Given only the cell averages ¯ q
i
(t ), how can we con
struct a polynomial approximation to q that is accurate pointwise to high order?
A very elegant solution to this problem uses the primitive function for q(x, t ). This
approach was apparently ﬁrst introduced by Colella and Woodward [84] in their PPM
method and has since been used in a variety of other methods, particularly the ENOmethods
discussed below.
At a ﬁxed time t , the primitive function w(x) is deﬁned by
w(x) =
x
x
1/2
q(ξ, t ) dξ. (10.19)
196 10 Other Approaches to High Resolution
The lower limit x
1/2
is arbitrary; any ﬁxed point could be used. Changing the lower limit
only shifts w(x) by a constant, and the property of w that we will ultimately use is that
q(x, t ) = w
(x), (10.20)
which is unaffected by a constant shift. Equation (10.20) allows us to obtain pointwise
values of q if we have a good approximation to w.
Now the crucial observation is that knowing cell averages of q gives us pointwise values
of w at the particular points x
i +1/2
. Set
W
i
= w
x
i +1/2
=
x
i +1/2
x
1/2
q(ξ, t ) dξ. (10.21)
This is x times the average of q over a collection of j cells, and hence
W
i
= x
i
j =1
¯ q
j
(t ).
Of course this only gives us pointwise values of w at the points x
i +1/2
, but it gives us
the exact values at these points (assuming we start with the exact cell averages ¯ q
i
, as we
do in computing the truncation error). If w is sufﬁciently smooth (i.e., if q is sufﬁciently
smooth), we can then approximate w more globally to arbitrary accuracy using polynomial
interpolation. In particular, to approximate w in the i th cell C
i
, we can use an interpolating
polynomial of degree s passing through some s + 1 points W
i −j
, W
i −j +1
, . . . ,W
i −j +s
for
some j . (The choice of j is discussed below.) If we call this polynomial p
i
(x), then we have
p
i
(x) = w(x) +O(x
s+1
) (10.22)
for x ∈ C
i
, provided w ∈ C
s+1
(which requires q(·, t ) ∈ C
s
).
Using the relation (10.20), we can obtain an approximation to q(x, t ) by differentiating
p
i
(x). We lose one order of accuracy by differentiating the interpolating polynomial, and so
p
i
(x) = q(x, t ) +O(x
s
) on C
i
.
We can nowuse this to obtain approximations to q at the left and right cell interfaces, setting
Q
L
i
= p
i
x
i −1/2
,
Q
R
i
= p
i
x
i +1/2
.
Performing a similar reconstruction on the cell [x
i −3/2
, x
i −1/2
] gives p
i −1
(x), and we set
Q
R
i −1
= p
i −1
x
i −1/2
and then deﬁne F
i −1/2
as in (10.15). This gives spatial accuracy of order s for sufﬁciently
smooth q.
10.4 Semidiscrete Methods plus Time Stepping 197
10.4.4 ENO Methods
In the above description of the interpolation process, the value of j was left unspeciﬁed
(recall that we interpolate W
i −j
, . . . ,W
i −j +s
to approximate q on cell C
i
). When q(·, t ) ∈ C
s
in the vicinity of x
i
, interpolation based on any value of j between 1 and s will give sthorder
accuracy. However, for a highresolution method we must be able to automatically cope
with the possibility that the data is not smooth. Near discontinuities we do not expect to
maintain the high order of accuracy, but want to choose a stencil of interpolation points that
avoids introducing oscillations. It is well known that a highdegree polynomial interpolant
can be highly oscillatory even on smooth data, and certainly will be on nonsmooth data.
In the piecewise linear version described initially, this was accomplished by using a
slope limiter. For example, the minmod slope compares linear interpolants based on cells
to the left and right and takes the one that is less steep. This gives a global piecewise linear
approximation that is nonoscillatory in the sense that its total variation is no greater than
that of the discrete data.
This same idea can be extended to higherorder polynomials by choosing the value of
j for each i so that the interpolant through W
i −j
, . . . ,W
i −j +s
has the least oscillation over
all possible choices j =1, . . . , s. This is the main idea in the ENO methods originally
developed by Chakravarthy, Engquist, Harten, and Osher. Complete details, along with
several variations and additional references, can be found in the papers [182], [183], [189],
[188], [410], [411].
One variant uses the following procedure. Start with the linear function passing through
W
i −1
and W
i
to deﬁne p
(1)
i
(x) (where superscripts now indicate the degree of the poly
nomial). Next compute the divided difference based on {W
i −2
, W
i −1
, W
i
} and the divided
difference based on {W
i −1
, W
i
, W
i +1
}. Either of these can be used to extend p
(1)
i
(x) to a
quadratic polynomial using the Newton form of the interpolating polynomial. We deﬁne
p
(2)
i
(x) by choosing the divided difference that is smaller in magnitude.
We continue recursively in this manner, adding either the next point to the left or to the
right to our stencil depending on the magnitude of the divided difference, until we have a
polynomial of degree s based on some s + 1 points.
Note that the ﬁrstorder divided differences of W are simply the values ¯ q
i
,
W
i
− W
i −1
x
= ¯ q
i
,
andsodivideddifferences of W are directlyrelatedtodivideddifferences of the cell averages
¯ q
i
. In practice we need never compute the W
i
. (The zeroorder divided difference, W
i
itself,
enters p
i
(x) only as the constant term, which drops out when we compute p
i
(x).)
More recently, weighted ENO (WENO) methods have been introduced, which combine
the results obtained using all possible stencils rather than choosing only one. A weighted
combination of the results from all stencils is used, where the weights are based on the
magnitudes of the divided differences in such a way that smoother approximations receive
greater weight. This is more robust than placing all the weight on a single stencil, since it
responds more smoothly to changes in the data. These methods are developed in [219] and
[314]. See the survey [409] for an overview and other references.
198 10 Other Approaches to High Resolution
10.5 Staggered Grids and Central Schemes
For nonlinear systems of equations, solving a Riemann problem can be an expensive oper
ation, as we will see in Chapter 13, and may not even be possible exactly. A variety of ap
proximate Riemann solvers have been developed to simplify this process (see Section 15.3),
but algorithms based on Riemann problems are still typically expensive relative to ap
proaches that only require evaluating the ﬂux function.
The Lax–Friedrichs (LxF) method (Section 4.6) is one very simple method that only
uses ﬂux evaluation and is broadly applicable. However, it is only ﬁrstorder accurate and
is very dissipative. Consequently a very ﬁne grid must be used to obtain good approximate
solutions, which also leads to an expensive algorithm.
Recently a class of algorithms known as central schemes have been introduced, starting
with the work of Nessyahu and Tadmor [338], which extends the LxF idea to higher
order accuracy. The basic idea is most easily explained using a staggered grid as shown in
Figure 10.3(a), starting with an interpretation of the LxF method on this grid.
Note that the LxF method
Q
n+1
i
=
1
2
Q
n
i −1
+ Q
n
i +1
−
t
2 x
f
Q
n
i +1
− f
Q
n
i −1
(10.23)
computes Q
n+1
i
based only on Q
n
i −1
and Q
n
i +1
, so it makes sense to use a grid on which only
oddnumbered indices appear at one time and only evennumbered indices at the next. It is
interesting to note that on this grid we can view the LxF method as a variant of Godunov’s
method in which Riemann problems are solved and the resulting solution averaged over
grid cells. Figure 10.3(b) indicates how this can be done. We integrate the conservation law
over the rectangle [x
i −1
, x
i +1
] ×[t
n
, t
n+1
] and obtain
Q
n+1
i
≈
1
2 x
x
i +1
x
i −1
˜ q
n
(x, t
n+1
) dx
=
1
2 x
x
i +1
x
i −1
˜ q
n
(x, t
n
) dx
−
1
2 x
t
n+1
t
n
f ( ˜ q
n
(x
i +1
, t )) dt −
t
n+1
t
n
f ( ˜ q
n
(x
i −1
, t )) dt
, (10.24)
(a)
t
n
t
n+1
t
n+2
Q
n
i−1
Q
n
i+1
Q
n+1
i−2
Q
n+1
i+2
Q
n+1
i
Q
n+2
i−1
Q
n+2
i+1
(b)
Q
n+1
i
x
i−1
x
i+1
x
i
Fig. 10.3. Interpretation of the Lax–Friedrichs method on a staggered grid. (a) The grid labeling.
(b) Integrating the conservation law over the region [x
i −1
, x
i +1
] × [t
n
, t
n+1
], which includes the full
Riemann solution at x
i
.
10.5 Staggered Grids and Central Schemes 199
where ˜ q
n
(x, t ) is the exact solution to the conservation law with the piecewise constant data
Q
n
. This is analogous to Godunov’s method as described in Section 4.10 and Section 4.11,
but now implemented over a cell of width 2 x. Because of the grid staggering we have
1
x
x
i +1
x
i −1
˜ q
n
(x, t
n
) dx =
1
2
Q
n
i −1
+ Q
n
i +1
. (10.25)
As in Godunov’s method, the ﬂux integrals in (10.24) can be calculated exactly because
˜ q
n
(x
i ±1
, t ) are constant in time. However, these are even simpler than in Godunov’s method
because we do not need to solve Riemann problems to ﬁnd the values. The Riemann
problems are now centered at x
i
, x
i ±2
, . . . , and the waves from these Riemann solutions
do not affect the values we need at x
i ±1
provided the Courant number is less than 1. We
simply have ˜ q
n
(x
i ±1
, t ) = Q
n
i ±1
, and so evaluating the integrals in (10.24) exactly gives the
Lax–Friedrichs method (10.23).
To obtain better accuracy we might construct approximations to ˜ q
n
(x, t
n
) in each cell
on the staggered grid by a piecewise linear function, or some higherorder polynomial,
again using limiters or an ENO reconstruction to choose these functions. As the solution ˜ q
n
evolves the values ˜ q
n
(x
i ±1
, t ) will no longer be constant and the ﬂux integrals in (10.24) must
typically be approximated. But the large jump discontinuities in the piecewise polynomial
˜ q
n
(x, t
n
) are still at the points x
i
, x
i ±2
, . . . and the solution remains smooth at x
i ±1
over
time t , and so simple approximations to the ﬂux integrals can be used.
The original secondorder Nessyahu–Tadmor scheme is based on using a piecewise linear
representation in each grid cell, choosing slopes σ
n
i −1
and σ
n
i +1
in the two cells shown in
Figure 10.3(a), for example. For a scalar problem this can be done using any standard
limiter, such as those described in Chapter 6. For systems of equations, limiting is typically
done componentwise rather than using a characteristic decomposition, to avoid using any
characteristic information. The updating formula takes the form
Q
n+1
i
=
¯
Q
n
i
−
t
x
F
n+1/2
i +1
− F
n+1/2
i −1
. (10.26)
Now
¯
Q
n
i
is the cell average at time t
n
based on integrating the piecewise linear function
over the cell x
i
as in (10.25), but now taking into account the linear variation. This yields
¯
Q
n
i
=
1
2
Q
n
i −1
+ Q
n
i +1
+
1
8
x
σ
n
i −1
−σ
n
i +1
. (10.27)
The ﬂux F
n+1/2
i −1
is computed by evaluating f at some approximation to ˜ q
n
(x
i −1
, t
n+1/2
)
to give give secondorder accuracy in time. Since ˜ q
n
remains smooth near x
i −1
, we can
approximate this well by
˜ q
n
x
i −1
, t
n+1/2
≈ Q
n
i −1
−
1
2
t
∂ f
∂x
Q
n
i −1
. (10.28)
We use
F
n+1/2
i +1
= f
Q
n
i −1
−
1
2
t φ
n
i −1
, (10.29)
where
φ
n
i −1
≈
∂ f
∂x
Q
n
i −1
. (10.30)
200 10 Other Approaches to High Resolution
This can be chosen either as
φ
n
i −1
= f
Q
n
i −1
σ
n
i −1
(10.31)
or as a direct estimate of the slope in f (q) based on nearby cell values f (Q
j
) and the same
limiting procedure used to obtain slopes σ
n
i −1
from the data Q
j
. The latter approach avoids
the need for the Jacobian matrix f
(q).
This is just the basic idea of the highresolution central schemes. Several different vari
ants of this method have been developed, including nonstaggered versions, higherorder
methods, and multidimensional generalizations. For some examples see the papers [13],
[36], [206], [220], [221], [250], [294], [315], [391], and references therein.
Exercises
10.1. Show that the ENO method described in Section 10.4.4 with s =2 (quadratic inter
polation of W) gives a piecewise linear reconstruction of q with slopes that agree
with the minmod formula (6.26).
10.2. Derive the formula (10.27).
Part two
Nonlinear Equations
11
Nonlinear Scalar Conservation Laws
We begin our study of nonlinear conservation laws by considering scalar conservation laws
of the form
q
t
+ f (q)
x
= 0. (11.1)
When the ﬂux function f (q) is linear, f (q) = ¯ uq, then this is simply the advection equation
with a very simple solution. The equation becomes much more interesting if f (q) is a
nonlinear function of q. The solution no longer simply translates uniformly. Instead, it
deforms as it evolves, and in particular shock waves can form, across which the solution is
discontinuous. At such points the differential equation (11.1) cannot hold in the classical
sense. We must remember that this equation is typically derived from a more fundamental
integral conservation law that does still make sense even if q is discontinuous. In this
chapter we develop the mathematical theory of nonlinear scalar equations, and then in
the next chapter we will see how to apply highresolution ﬁnite volume methods to these
equations. In Chapter 13 we turn to the even more interesting case of nonlinear hyperbolic
systems of conservation laws.
In this chapter we assume that the ﬂux function f (q) has the property that f
(q) does not
change sign, i.e., that f (q) is a convex or concave function. This is often called a convex ﬂux
in either case. The nonconvex case is somewhat trickier and is discussed in Section 16.1.
For the remainder of the book we consider only conservation laws. In the linear case,
hyperbolic problems that are not in conservation formcan be solved using techniques similar
to those developed for conservation laws, and several examples were explored in Chapter 9.
In the nonlinear case it is possible to apply similar methods to a nonconservative quasilinear
hyperbolic problem q
t
+ A(q)q
x
= 0, but equations of this form must be approached with
caution for reasons discussed in Section 16.5. The vast majority of physically relevant
nonlinear hyperbolic problems arise from integral conservation laws, and it is generally
best to keep the equation in conservation form.
11.1 Trafﬁc Flow
As a speciﬁc motivating example, we consider the ﬂow of cars on a onelane highway, as
introduced in Section 9.4.2. This is frequently used as an example of nonlinear conservation
laws, and other introductory discussions can be found in [175], [457], [486], for example.
203
204 11 Nonlinear Scalar Conservation Laws
This model provides a good introduction to the effects of nonlinearity in a familiar context
where the results will probably match readers’ expectations. Moreover, a good understand
ing of this example provides at least some physical intuition for the types of solutions seen
in gas dynamics, an important application area for this theory. A gas is a dilute collection
of molecules that are quite far apart and hence can be compressed or expanded. The density
(measured in mass or molecules per unit volume) can vary by many orders of magnitude
depending on how much space is available, and so a gas is a compressible ﬂuid.
Cars on the highway can also be thought of as a compressible ﬂuid. The density (measured
in cars per car length, as introduced in Section 9.4.2), can vary from 0 on an empty highway
to 1 in bumpertobumper trafﬁc. (We ignore the compressibility of individual cars in a
major collision)
Since the ﬂux of cars is given by uq, we obtain the conservation law
q
t
+(uq)
x
= 0. (11.2)
In Section 9.4.2 we considered the variablecoefﬁcient linear problem in which cars always
travel at the speed limit u(x). This is a reasonable assumption only for very light trafﬁc.
As trafﬁc gets heavier, it is more reasonable to assume that the speed also depends on
the density. At this point we will suppose the speed limit and road conditions are the
same everywhere, so that u depends only on q and not explicitly on x. Suppose that the
velocity is given by some speciﬁc known function u = U(q) for 0 ≤ q ≤ 1. Then (11.2)
becomes
q
t
+(q U(q))
x
= 0, (11.3)
which in general is now a nonlinear conservation law since the ﬂux function
f (q) = qU(q) (11.4)
will be nonlinear in q. This is often called the LWR model for trafﬁc ﬂow, after Lighthill &
Whitham [299] and Richards [368]. (See Section 17.17 for a brief discussion of other
models.)
Various forms of U(q) might be hypothesized. One simple model is to assume that U(q)
varies linearly with q,
U(q) = u
max
(1 −q) for 0 ≤ q ≤ 1. (11.5)
At zero density (empty road) the speed is u
max
, but decreases to zero as q approaches 1. We
then have the ﬂux function
f (q) = u
max
q(1 −q). (11.6)
This is a quadratic function. Note that the ﬂux of cars is greatest when q =1/2. As q
decreases, the ﬂux decreases because there are few cars on the road, and as q increases, the
ﬂux decreases because trafﬁc slows down.
Before attempting to solve the nonlinear conservation law (11.3), we can develop some
intuition for howsolutions behave by doing simulations of trafﬁc ﬂowin which we track the
motion of individual vehicles X
k
(t ), as described in Section 9.4.2. If we deﬁne the density
11.1 Trafﬁc Flow 205
(a) (b)
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Density at time t = 25
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Density at time t = 25
−30 −20 −10 0 10 20 30
0
5
10
15
20
25
30
−30 −20 −10 0 10 20 30
0
5
10
15
20
25
30
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Density at time t = 0
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Density at time t = 0
Fig. 11.1. Solution to the trafﬁc ﬂow model starting with a bulge in the density. (a) Trajectories of
individual vehicles and the density observed by each driver. (b) The characteristic structure is shown
along with the density as computed by CLAWPACK. [claw/book/chap11/congestion]
seen by the kth driver as q
k
(t ), as in (9.32), then the velocity of the kth car at time t will be
U(q
k
(t )). This is a reasonable model of driver behavior: the driver chooses her speed based
only on the distance to the car she is following. This viewpoint can be used to justify the
assumption that U depends on q. The ordinary differential equations for the motion of the
cars now become a coupled set of nonlinear equations:
X
k
(t ) = U(q
k
(t )) = U([X
k+1
(t ) − X
k
(t )]
−1
) (11.7)
for k = 1, 2, . . . , m, where m is the number of cars.
Figure 11.1(a) shows an example of one such simulation. The speed limit is u
max
= 1,
and the cars are initially distributed so there is a Gaussian increase in the density near x = 0.
Note the following:
•
The disturbance in density does not move with the individual cars, the way it would for the
linear advection equation. Individual cars move through the congested region, slowing
down and later speeding up.
•
The hump in density changes shape with time. By the end of the simulation a shock wave
is visible, across which the density increases and the velocity decreases very quickly
(drivers who were zipping along in light trafﬁc must suddenly slam on their brakes).
206 11 Nonlinear Scalar Conservation Laws
(a) (b)
−40 −35 −30 −25 −20 −15 −10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
Density at time t = 36
−40 −35 −30 −25 −20 −15 −10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
Density at time t = 36
−40 −35 −30 −25 −20 −15 −10 −5 0 5 10
0
5
10
15
20
25
30
35
40
−40 −35 −30 −25 −20 −15 −10 −5 0 5 10
0
5
10
15
20
25
30
35
40
−40 −35 −30 −25 −20 −15 −10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
Density at time t = 0
−40 −35 −30 −25 −20 −15 −10 −5 0 5 10
0
0.2
0.4
0.6
0.8
1
Density at time t = 0
Fig. 11.2. Riemann problem for the trafﬁc ﬂow model at a red light. (a) Trajectories of individual
vehicles and the density observed by each driver. (b) The characteristic structure is shown along with
the density as computed by CLAWPACK. [claw/book/chap11/redlight]
•
As cars move out of the congested region, they accelerate smoothly and the density
decreases smoothly. This is called a rarefaction wave, since the ﬂuid is becoming more
rareﬁed as the density decreases.
Figures 11.2 and 11.3 show two more simulations for special cases corresponding to
Riemann problems in which the initial data is piecewise constant. Figure 11.2 can be in
terpreted as cars approaching a trafﬁc jam, or a line of cars waiting for a light to change;
Figure 11.3 shows how cars accelerate once the light turns green. Note that the solution to
the Riemann problem may consist of either a shock wave as in Figure 11.2 or a rarefaction
wave as in Figure 11.3, depending on the data.
11.2 Quasilinear Form and Characteristics
By differentiating the ﬂux function f (q) we obtain the quasilinear form of the conservation
law (11.1),
q
t
+ f
(q)q
x
= 0. (11.8)
11.2 Quasilinear Form and Characteristics 207
(a) (b)
−30 −25 −20 −15 −10 −5 0 5 10 15 20
0
0.2
0.4
0.6
0.8
1
Density at time t = 18
−30 −25 −20 −15 −10 5 0 5 10 15 20
0
0.2
0.4
0.6
0.8
1
Density at time t = 18
−30 −25 −20 −15 −10 −5 0 5 10 15 20
0
2
4
6
8
10
12
14
16
18
20
−30 −25 −20 −15 −10 −5 0 5 10 15 20
0
2
4
6
8
10
12
14
16
18
20
−30 −25 −20 −15 −10 −5 0 5 10 15 20
0
0.2
0.4
0.6
0.8
1
Density at time t = 0
−30 −25 −20 −15 −10 −5 0 5 10 15 20
0
0.2
0.4
0.6
0.8
1
Density at time t = 0
Fig. 11.3. Riemann problem for the trafﬁc ﬂow model at a green light. (a) Trajectories of individual
vehicles and the density observed by each driver. (b) The characteristic structure is shown, along with
the density as computed by CLAWPACK. [claw/book/chap11/greenlight]
It is normally preferable to work directly with the conservative form, but it is the quasilinear
formthat determines the characteristics of the equation. If we assume that q(x, t ) is smooth,
then along any curve X(t ) satisfying the ODE
X
(t ) = f
(q(X(t ), t )), (11.9)
we have
d
dt
q(X(t ), t ) = X
(t )q
x
+q
t
= 0 (11.10)
by (11.8) and (11.9). Hence q is constant along the curve X(t ), and consequently X
(t ) is
also constant along the curve, and so the characteristic curve must be a straight line.
We thus see that for a scalar conservation law, q is constant on characteristics, which are
straight lines, as long as the solution remains smooth. The structure of the characteristics
depends on the initial data q(x, 0). Figure 11.1(b) shows the characteristics for the trafﬁc
ﬂow problem of Figure 11.1(a). Actually, Figure 11.1(b) shows a contour plot (in x and
t ) of the density q as computed using CLAWPACK on a very ﬁne grid. Since q is constant
208 11 Nonlinear Scalar Conservation Laws
on characteristics, this essentially shows the characteristic structure, as long as the solution
remains smooth. What we observe, however, is that characteristics may collide. This is an
essential feature of nonlinear hyperbolic problems, giving rise to shock formation. For a
linear advection equation, even one with variable coefﬁcients, the characteristics will never
cross.
Also note that the characteristic curves of Figure 11.1(b) are quite different from the
vehicle trajectories plotted in Figure 11.1(a). Only in the linear case f (q) = ¯ uq does the
characteristic speed agree with the speed at which particles are moving, since in this case
f
(q) = ¯ u.
We will explore shock waves starting in Section 11.8. For now suppose the initial data
q
◦
(x) =q(x, 0) is smooth and the solution remains smooth over some time period 0 ≤ t ≤ T
of interest. Constant values of q propagate along characteristic curves. Using the fact that
these curves are straight lines, it is possible to determine the solution q(x, t ) as
q(x, t ) = q
◦
(ξ), (11.11)
where ξ solves the equation
x = ξ + f
(q
◦
(ξ))t. (11.12)
This is generally a nonlinear equation for ξ, but will have a unique solution provided
0 ≤ t ≤ T is within the period that characteristics do not cross.
11.3 Burgers’ Equation
The trafﬁc ﬂow model gives a scalar conservation law with a quadratic ﬂux function. An
even simpler scalar equation of this form is the famous Burgers equation
u
t
+
1
2
u
2
x
= 0. (11.13)
This should more properly be called the inviscid Burgers equation, since Burgers [54]
actually studied the viscous equation
u
t
+
1
2
u
2
x
= u
xx
. (11.14)
Rather than modeling a particular physical problem, this equation was introduced as the
simplest model equation that captures some key features of gas dynamics: the nonlinear
hyperbolic termand viscosity. In the literature of hyperbolic equations, the inviscid problem
(11.13) has been widely used for developing both theory and numerical methods.
Around 1950, Hopf, and independently Cole, showed that the exact solution of the nonlin
ear equation (11.14) could be found using what is nowcalled the Cole–Hopf transformation.
This reduces (11.14) to a linear heat equation. See Chapter 4 of Whitham [486] for details
and Exercise 11.2 for one particular solution.
11.4 Rarefaction Waves 209
Solutions to the inviscid Burgers’ equation have the same basic structure as solutions to
the trafﬁc ﬂow problem considered earlier. The quasilinear form of Burgers’ equation,
u
t
+uu
x
= 0, (11.15)
shows that in smooth portions of the solution the value of u is constant along characteris
tics traveling at speed u. Note that (11.15) looks like an advection equation in which the
value of u is being carried at velocity u. This is the essential nonlinearity that appears in
the conservationofmomentum equation of ﬂuid dynamics: the velocity or momentum is
carried in the ﬂuid at the ﬂuid velocity.
Detailed discussions of Burgers’ equation can be found in many sources, e.g., [281],
[486]. All of the issues illustrated below for the trafﬁc ﬂow equation can also be illustrated
with Burgers’ equation, and the reader is encouraged to explore this equation in the process
of working through the remainder of this chapter.
11.4 Rarefaction Waves
Suppose the initial data for the trafﬁc ﬂow model satisﬁes q
x
(x, 0) < 0, so the density falls
with increasing x. In this case the characteristic speed
f
(q) = U(q) +q U
(q) = u
max
(1 −2q) (11.16)
is increasing with x. Hence the characteristics are spreading out and will never cross. The
density observed by each car will decrease with time, and the ﬂow is being rareﬁed.
Aspecial case is the Riemann problemshown in Figure 11.3. In this case the initial data is
discontinuous, but if we think of smoothing this out very slightly as in Figure 11.4(a), then
each value of q between 0 and 1 is taken on in the initial data, and each value propagates
with its characteristic speed f
(q), as is also illustrated in Figure 11.4(a). Figure 11.3(b)
shows the characteristics in the x–t plane. This is called a centered rarefaction wave, or
rarefaction fan, emanating from the point (0, 0).
For Burgers’ equation (11.13), the characteristics are all spreading out if u
x
(x, 0) > 0,
since the characteristic speed is f
(u) = u for this equation.
(a)
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
(b)
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Fig. 11.4. Tracing each value of q at its characteristic speed fromthe initial data (shown by the dashed
line) to the solution at time t = 20. (a) When q is decreasing, we obtain a rarefaction wave. (b) When
q is increasing, we obtain an unphysical triplevalued solution.
210 11 Nonlinear Scalar Conservation Laws
(a)
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
(b)
−30 −20 −10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Fig. 11.5. Tracing each value of q at its characteristic speed from the initial data from Figure 11.1
(shown by the dashed line) to the solution at two different times. (a) At t = 5 we see a compression
wave and a rarefaction wave. (b) At t = 25 we obtain an unphysical triplevalued solution.
11.5 Compression Waves
Figure 11.5(a) shows a picture similar to Figure 11.4(a) for initial data consisting of a hump
of density as in the example of Figure 11.1. In this case the right half of the hump, where the
density falls, is behaving as a rarefaction wave. The left part of the hump, where the density
is rising with increasing x, gives rise to a compression wave. A driver passing through this
region will experience increasing density with time (this can be observed in Figure 11.1).
If we try to draw a similar picture for larger times then we obtain Figure 11.5(b). As in
the case of Figure 11.4(b), this does not make physical sense. At some points x the density
appears to be triplevalued. At such points there are three characteristics reaching (x, t )
from the initial data, and the equation (11.12) would have three solutions.
An indication of what should instead happen physically is seen in Figure 11.1(a). Recall
that this was obtained by simulating the trafﬁc ﬂow directly rather than by solving a conser
vation law. The compression wave should steepen up into a discontinuous shock wave. At
some time T
b
the slope q
x
(x, t ) will become inﬁnite somewhere. This is called the break
ing time (by analogy with waves breaking on a beach; see Section 13.1). Beyond time T
b
characteristics may cross and a shock wave appears. It is possible to determine T
b
from the
initial data q(x, 0); see Exercise 11.1.
11.6 Vanishing Viscosity
As a differential equation, the hyperbolic conservation law (11.1) breaks down once shocks
form. This is not surprising, since it was derivedfromthe more fundamental integral equation
by manipulations that are only valid when the solution is smooth. When the solution is not
smooth, a different formulation must be used, such as the integral form or the weak form
introduced in Section 11.11.
Another approach is to modify the differential equation slightly by adding a bit of
viscosity, or diffusion, obtaining
q
t
+ f (q)
x
= q
xx
, (11.17)
where >0 is a small parameter. The term “viscosity” is motivated by ﬂuid dynamics
11.7 EqualArea Rule 211
(a)
−50 −40 −30 −20 −10 0 10 20 30 40 50
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
(b)
−50 −40 −30 −20 −10 0 10 20 30 40 50
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
A
1
A
2
Fig. 11.6. (a) Solutions to the viscous trafﬁc ﬂowequation (11.17) for two values of > 0, along with
the limiting shockwave solution when = 0. (b) The shock wave (heavy line) can be determined by
applying the equalarea rule to the triplevalued solution of Figure 11.5(b) so that the areas A
1
and
A
2
are equal.
equations, as discussed below. If is extremely small, then we might expect solutions to
(11.17) to be very close to solutions of (11.1), which has =0. However, the equation
(11.17) is parabolic rather than hyperbolic, and it can be proved that this equation has
a unique solution for all time t >0, for any set of initial conditions, provided only that
> 0. Away from shock waves, q
xx
is bounded and this new term is negligible. If a shock
begins to form, however, the derivatives of q begin to blow up and the q
xx
term becomes
important. Figure 11.6 shows solutions to the trafﬁc ﬂow model from Figure 11.1 with this
new term added, for various values of . As →0 we approach a limiting solution that has
a discontinuity corresponding to the shock wave seen in Figure 11.1.
The idea of introducing the small parameter and looking at the limit → 0 is called
the vanishingviscosity approach to deﬁning a sensible solution to the hyperbolic equation.
To motivate this, remember that in general any mathematical equation is only a model of
reality, in which certain effects may have been modeled well but others are necessarily
neglected. In gas dynamics, for example, the hyperbolic equations (2.38) only hold if we
ignore thermal diffusion and the effects of viscosity in the gas, which is the frictional force
of molecules colliding and converting kinetic energy into internal energy. For a dilute gas
this is reasonable most of the time, since these forces are normally small. Including the
(parabolic) viscous terms in the equations would only complicate them without changing
the solution very much. Near a shock wave, however, the viscous terms are important. In
the real world shock waves are not sharp discontinuities but rather smooth transitions over
very narrow regions. By using the hyperbolic equation we hope to capture the big picture
without modeling exactly how the solution behaves within this thin region.
11.7 EqualArea Rule
From Figure 11.1 it is clear that after a shock forms, the solution contains a discontinuity,
but that away from the shock the solution remains smooth and still has the property that it
is constant along characteristics. This solution can be constructed by taking the unphysical
solution of Figure 11.4(b) and eliminating the triplevalued portion by inserting a discon
tinuity at some point as indicated in Figure 11.6(b). It can be shown that the correct place
212 11 Nonlinear Scalar Conservation Laws
to insert the shock is determined by the equalarea rule: The shock is located so that the
two regions cut off by the shock have equal areas. This is a consequence of conservation –
the area under the discontinuous singlevalued solution (the integral of the density) must
be the same as the area “under” the multivalued solution, since it can be shown that the rate
of change of this area is the difference between the ﬂux at the far boundaries, even after it
becomes multivalued.
11.8 Shock Speed
As the solution evolves the shock will propagate with some speed s(t ) that may change with
time. We can use the integral form of the conservation law to determine the shock speed at
any time in terms of the states q
l
(t ) and q
r
(t ) immediately to the left and right of the shock.
Suppose the shock is moving as shown in Figure 11.7, where we have zoomed in on a very
short time increment from t
1
to t
1
+t over which the shock speed is essentially a constant
value s. Then the rectangle [x
1
, x
1
+x] ×[t
1
, t
1
+t ] shown in Figure 11.7 is split by
the shock into two triangles and the value of q is roughly constant in each. If we apply the
integral form of the conservation law (2.6) to this region, we obtain
x
1
+x
x
1
q(x, t
1
+t ) dx −
x
1
+x
x
1
q(x, t
1
) dx
=
t
1
+t
t
1
f (q(x
1
, t )) dt −
t
1
+t
t
1
f (q(x
1
+x, t )) dt. (11.18)
Since q is essentially constant along each edge, this becomes
x q
r
−x q
l
= t f (q
l
) −t f (q
r
) +O(t
2
), (11.19)
where the O(t
2
) term accounts for the variation in q. If the shock speed is s, then x =
−s t (for the case s < 0 shown in the ﬁgure). Using this in (11.19), dividing by −t , and
Shock with speed s
x
1
x
1
+∆x
t
1
t
1
+∆t
q = q
l
q = q
r
Fig. 11.7. The Rankine–Hugoniot jump conditions are determined by integrating over an inﬁnitesimal
rectangular region in the x–t plane.
11.9 The Rankine–Hugoniot Conditions for Systems 213
taking the limit as t →0 gives
s(q
r
−q
l
) = f (q
r
) − f (q
l
). (11.20)
This is called the Rankine–Hugoniot jump condition. This is sometimes written simply as
s[[q]] = [[ f ]], where [[·]] represents the jump across the shock.
For a scalar conservation law we can divide by q
r
−q
l
and obtain the shock speed:
s =
f (q
r
) − f (q
l
)
q
r
−q
l
. (11.21)
In general q
l
(t ) and q
r
(t ), the states just to the left and the right of the shock, vary with time
and the shock speed also varies. For the special case of a Riemann problem with piecewise
constant data q
l
and q
r
, the resulting shock moves with constant speed, given by (11.21).
Note that if q
l
≈ q
r
, then the expression (11.21) approximates f
(q
l
). A weak shock,
which is essentially an acoustic wave, thus propagates at the characteristic velocity, as we
expect from linearization.
For the trafﬁc ﬂow ﬂux (11.6) we ﬁnd that
s = u
max
[1 −(q
l
+q
r
)] =
1
2
[ f
(q
l
) + f
(q
r
)], (11.22)
since f
(q) = u
max
(1 − 2q). In this case, and for any quadratic ﬂux function, the shock
speed is simply the average of the characteristic speeds on the two sides. Another quadratic
example is Burgers’ equation (11.13), for which we ﬁnd
s =
1
2
(u
l
+u
r
). (11.23)
11.9 The Rankine–Hugoniot Conditions for Systems
The derivation of (11.20) is valid for systems of conservation laws as well as for scalar
equations. However, for a system of m equations, q
r
− q
l
and f (q
r
) − f (q
l
) will both be
mvectors and we will not be able to simply divide as in (11.21) to obtain the shock speed. In
fact, for arbitrary states q
l
and q
r
there will be no scalar value s for which (11.20) is satisﬁed.
Special relations must exist between the two states in order for them to be connected by a
shock: the vector f (q
l
) − f (q
r
) must be a scalar multiple of the vector q
r
− q
l
. We have
already seen this condition in the case of a linear system, where f (q) = Aq. In this case
the Rankine–Hugoniot condition (11.20) becomes
A(q
r
−q
l
) = s(q
r
−q
l
),
which means that q
r
− q
l
must be an eigenvector of the matrix A. The propagation speed
s of the discontinuity is then the corresponding eigenvalue λ. In Chapter 3 we used this
condition to solve the linear Riemann problem, and in Chapter 13 we will see how this
theory can be extended to nonlinear systems.
214 11 Nonlinear Scalar Conservation Laws
11.10 Similarity Solutions and Centered Rarefactions
For the special case of a Riemann problem with data
q(x, 0) =
q
l
if x < 0,
q
r
if x > 0,
(11.24)
the solution to a conservation law is a similarity solution, a function of x/t alone that is
selfsimilar at different times. The solution
q(x, t ) = ˜ q(x/t ) (11.25)
is constant along any ray x/t = constant through the origin, just as in the case of a linear
hyperbolic system (see Chapter 3). From (11.25) we compute
q
t
(x, t ) = −
x
t
2
˜ q
(x/t ) and f (q)
x
=
1
t
f
( ˜ q(x/t )) ˜ q
(x/t ).
Inserting these in the quasilinear equation q
t
+ f
(q)q
x
=0 shows that
f
( ˜ q(x/t )) ˜ q
(x/t ) =
x
t
˜ q
(x/t ). (11.26)
For the scalar equation we ﬁnd that either ˜ q
(x/t ) = 0 ( ˜ q is constant) or that
f
( ˜ q(x/t )) = x/t. (11.27)
This allows us to determine the solution through a centered rarefaction wave explicitly.
(For a system of equations we cannot simply cancel ˜ q
(x/t ) from equation (11.26). See
Section 13.8.3 for the construction of a rarefaction wave in a nonlinear system.)
Consider the trafﬁc ﬂow model, for example, with f given by (11.6). The solution to a
Riemann problem with q
l
> q
r
consists of a rarefaction fan. The left and right edges of this
fan propagate with the characteristic speeds f
(q
l
) and f
(q
r
) respectively (see Figure 11.3),
and so we have
˜ q(x/t ) =
q
l
for x/t ≤ f
(q
l
),
q
r
for x/t ≥ f
(q
r
).
(11.28)
In between, ˜ q varies and so (11.27) must hold, which gives
u
max
[1 −2˜ q(x/t )] = x/t
and hence
˜ q(x/t ) =
1
2
1 −
x
u
max
t
for f
(q
l
) ≤ x/t ≤ f
(q
r
). (11.29)
Note that at any ﬁxed time t the solution q(x, t ) is linear in x as observed in Figure 11.3(b).
This is a consequence of the fact that f (q) is quadratic and so f
(q) is linear. Adifferent ﬂux
function could give rarefaction waves with more interesting structure (see Exercise 11.8).
11.11 Weak Solutions 215
11.11 Weak Solutions
We have observed that the differential equation (11.1) is not valid in the classical sense
for solutions containing shocks (though it still holds in all regions where the solution is
smooth). The integral form of the conservation law (2.6) does hold, however, even when
q is discontinuous, and it was this form that we used to determine the Rankine–Hugoniot
condition (11.20) that must hold across shocks. More generally we can say that a function
q(x, t ) is a solution of the conservation law if (2.2) holds for all t and any choice of x
1
, x
2
.
This formulation can be difﬁcult to work with mathematically. In this section we look at
a somewhat different integral formulation that is useful in proving results about solutions.
In particular, in Section 12.10 we will investigate the convergence of ﬁnite volume methods
as the grid is reﬁned and will need this formulation to handle discontinuous solutions.
To motivate this weak form, ﬁrst suppose that q(x, t ) is smooth. In Chapter 2 we derived
the differential equation (11.1) by rewriting (2.7) as (2.9). Integrating this latter equation in
time between t
1
and t
2
gives
t
2
t
1
x
2
x
1
[q
t
+ f (q)
x
] dx dt = 0. (11.30)
Rather than considering this integral for arbitrary choices of x
1
, x
2
, t
1
, and t
2
, we could
instead consider
∞
0
∞
−∞
[q
t
+ f (q)
x
]φ(x, t ) dx dt (11.31)
for a certain set of functions φ(x, t ). In particular, if φ(x, t ) is chosen to be
φ(x, t ) =
1 if (x, t ) ∈ [x
1
, x
2
] ×[t
1
, t
2
],
0 otherwise,
(11.32)
then this integral reduces to the one in (11.30). We can generalize this notion by letting
φ(x, t ) be any function that has compact support, meaning it is identically zero outside of
some bounded region of the x–t plane. If we now also assume that φ is a smooth function
(unlike (11.32)), then we can integrate by parts in (11.31) to obtain
∞
0
∞
−∞
[qφ
t
+ f (q)φ
x
] dx dt = −
∞
0
q(x, 0)φ(x, 0) dx. (11.33)
Only one boundary term along t = 0 appears in this process, since we assume φ vanishes
at inﬁnity.
A nice feature of (11.33) is that the derivatives are on φ, and no longer of q and f (q). So
(11.33) continues to make sense even if q is discontinuous. This motivates the following
deﬁnition.
Deﬁnition 11.1. The function q(x, t ) is a weak solution of the conservation law (11.1) with
given initial data q(x, 0) if (11.33) holds for all functions φ in C
1
0
.
The function space C
1
0
denotes the set of all functions that are C
1
(continuously differen
tiable) and have compact support. By assuming φ is smooth we rule out the special choice
216 11 Nonlinear Scalar Conservation Laws
(11.32) that gave (11.30), but we can approximate this function arbitrarily well by a slightly
smoothedout version. It can be shown that any weak solution also satisﬁes the integral
conservation laws and vice versa.
11.12 Manipulating Conservation Laws
One danger to observe in dealing with conservation laws is that transforming the differential
form into what appears to be an equivalent differential equation may not give an equivalent
equation in the context of weak solutions.
Example 11.1. If we write Burgers’ equation
u
t
+
1
2
u
2
x
= 0 (11.34)
in the quasilinear form u
t
+ uu
x
= 0 and multiply by 2u, we obtain 2uu
t
+ 2u
2
u
x
= 0,
which can be rewritten as
(u
2
)
t
+
2
3
u
3
x
= 0. (11.35)
This is again a conservation law, now for u
2
rather than u itself, with ﬂux function f (u
2
) =
2
3
(u
2
)
3/2
. The differential equations (11.34) and (11.35) have precisely the same smooth
solutions. However, they have different weak solutions, as we can see by considering the
Riemann problem with u
l
> u
r
. The unique weak solution of (11.34) is a shock traveling
at speed
s
1
=
1
2
u
2
[[u]]
=
1
2
(u
l
+u
r
), (11.36)
whereas the unique weak solution to (11.35) is a shock traveling at speed
s
2
=
2
3
u
3
[[u
2
]]
=
2
3
u
3
r
−u
3
l
u
2
r
−u
2
l
. (11.37)
It is easy to check that
s
2
−s
1
=
1
6
(u
l
−u
r
)
2
u
l
+u
r
, (11.38)
and so s
2
= s
1
when u
l
= u
r
, and the two equations have different weak solutions. The
derivation of (11.35) from (11.34) requires manipulating derivatives in a manner that is
valid only when u is smooth.
11.13 Nonuniqueness, Admissibility, and Entropy Conditions
The Riemann problem shown in Figure 11.3 has a solution consisting of a rarefaction wave,
as determined in Section 11.10. However, this is not the only possible weak solution to the
11.13 Nonuniqueness, Admissibility, and Entropy Conditions 217
equation with this data. Another solution is
q(x, t ) =
q
l
if x/t < s,
q
r
if x/t > s,
(11.39)
where the speed s is determined by the Rankine–Hugoniot condition (11.21). This function
consists of the discontinuity propagating at speed s, the shock speed. We don’t expect a shock
wave in this case, since characteristics are spreading out rather than colliding, but we did
not use any information about the characteristic structure in deriving the Rankine–Hugoniot
condition. The function (11.39) is a weak solution of the conservation law regardless of
whether q
l
< q
r
or q
l
> q
r
. The discontinuity in the solution (11.39) is sometimes called
an expansion shock in this case.
We see that the weak solution to a conservation law is not necessarily unique. This is
presumably another failing of our mathematical formulation, since physically we expect
only one thing to happen for given initial data, and hence a unique solution. Again this
results from the fact that the hyperbolic equation is an imperfect model of reality. A better
model might include “viscous terms” as in Section 11.6, for example, and the resulting
parabolic equation would have a unique solution for any set of data. As in the case of shock
waves, what we hope to capture with the hyperbolic equation is the correct limiting solution
as the viscosity vanishes. As Figure 11.4(a) suggests, if the discontinuous data is smoothed
only slightly (as would happen immediately if the equation were parabolic), then there is
a unique solution determined by the characteristics. This solution clearly converges to the
rarefaction wave as → 0. So the expansion shock solution (11.39) is an artifact of our
formulation and is not physically meaningful.
The existence of these spurious solution is not merely a mathematical curiosity. Under
some circumstances nonphysical solutions of this type are all too easily computed nu
merically, in spite of the fact that numerical methods typically contain some “numerical
viscosity.” See Section 12.3 for a discussion of these numerical difﬁculties.
In order to effectively use the hyperbolic equations we must impose some additional con
dition along with the differential equation in order to insure that the problem has a unique
weak solution that is physically correct. Often the condition we want to impose is sim
ply that the weak solution must be the vanishingviscosity solution to the proper viscous
equation. However, this condition is hard to work with directly in the context of the hy
perbolic equation. Instead, a variety of other conditions have been developed that can be
applied directly to weak solutions of hyperbolic equations to check if they are physically
admissible. Such conditions are sometimes called admissibility conditions, or more often
entropy conditions. This name again comes from gas dynamics, where the second law of
thermodynamics demands that the entropy of a system must be nondecreasing with time
(see Section 14.5). Across a physically admissible shock the entropy of the gas increases.
Across an expansion shock, however, the entropy of the gas would decrease, which is not
allowed. The entropy at each point can be computed as a simple function of the pressure
and density, (2.35), and the behavior of this function can be used to test a weak solution for
admissibility. For other conservation laws it is sometimes possible to deﬁne a function η(q),
called an entropy function, which has similar diagnostic properties. This approach to devel
oping entropy conditions is discussed in Section 11.14. Expansion shocks are often called
218 11 Nonlinear Scalar Conservation Laws
entropyviolating shocks, since they are weak solutions that fail to satisfy the appropriate
entropy condition.
First we discuss some other admissibility conditions that relate more directly to the
characteristic structure. We discuss onlya fewpossibilities here andconcentrate onthe scalar
case. For some systems of equations the development of appropriate admissibilityconditions
remains a challenging research question. In some cases it is not even well understood what
the appropriate viscous regularization of the conservation lawis, and it may be that different
choices of the viscous term lead to different vanishingviscosity solutions.
For scalar equations there is an obvious condition suggested by Figures 11.2(b) and
11.3(b). A shock should have characteristics going into the shock, as time advances. A
propagating discontinuity with characteristics coming out of it would be unstable to per
turbations. Either smearing out the initial proﬁle a little, or adding some viscosity to the
system, will cause this to be replaced by a rarefaction fan of characteristics, as in Figure
11.3(b). This gives our ﬁrst version of the entropy condition:
Entropy Condition 11.1 (Lax). For a convex scalar conservation law, a discontinuity pro
pagating with speed s given by (11.21) satisﬁes the Lax entropy condition if
f
(q
l
) > s > f
(q
r
). (11.40)
Note that f
(q) is the characteristic speed. For convex or concave f , the Rankine–
Hugoniot speed s from (11.21) must lie between f
(q
l
) and f
(q
r
), so (11.40) reduces to
simply the requirement that f
(q
l
) > f
(q
r
). For the trafﬁc ﬂowﬂux (11.4), this then implies
that we need q
l
<q
r
in order for the solution to be an admissible shock since f
(q) <0. If
q
l
>q
r
then the correct solution would be a rarefaction wave. For Burgers’ equation with
f (u) =u
2
/2, on the other hand, the Lax Entropy Condition 11.1 requires u
l
>u
r
for an
admissible shock, since f
(u) is everywhere positive rather than negative.
A more general form of (11.40), due to Oleinik, also applies to nonconvex scalar ﬂux
functions and is given in Section 16.1.2. The generalization to systems of equations is
discussed in Section 13.7.2.
Another form of the entropy condition is based on the spreading of characteristics in a
rarefaction fan. We state this for the convex case with f
(q) > 0 (such as Burgers’ equation),
since this is the form usually seen in the literature. If q(x, t ) is an increasing function of
x in some region, then characteristics spread out in this case. The rate of spreading can be
quantiﬁed, and gives the following condition, also due to Oleinik [346].
Entropy Condition 11.2 (Oleinik). q(x, t ) is the entropy solution to a scalar conservation
lawq
t
+ f (q)
x
= 0 with f
(q) > 0 if there is a constant E > 0 such that for all a > 0, t > 0,
and x ∈ R,
q(x +a, t ) −q(x, t )
a
<
E
t
. (11.41)
Note that for a discontinuity propagating with constant left and right states q
l
and q
r
,
this can be satisﬁed only if q
r
− q
l
≤ 0, so this agrees with (11.40). The form of (11.41)
also gives information on the rate of spreading of rarefaction waves as well as on the form
of allowable jump discontinuities, and is easier to apply in some contexts. In particular,
11.14 Entropy Functions 219
this formulation has advantages in studying numerical methods, and is related to onesided
Lipschitz conditions and related stability concepts [339], [340], [437].
11.14 Entropy Functions
Another approachtothe entropyconditionis todeﬁne anentropyfunctionη(q), motivatedby
thermodynamic considerations in gas dynamics as described in Chapter 14. This approach
often applies to systems of equations, as in the case of gas dynamics, and is also used in
studying numerical methods; see Section 12.11.1.
In general an entropy function should be a function that is conserved (i.e., satisﬁes some
conservation law) whenever the function q(x, t ) is smooth, but which has a source or a
sink at discontinuities in q. The entropy of a gas has this property: entropy is produced
in an admissible shock but would be reduced across an expansion shock. The second law
of thermodynamics requires that the total entropy must be nondecreasing with time. This
entropy condition rules out expansion shocks.
We now restate this in mathematical form. Along with an entropy function η(q), we need
an entropy ﬂux ψ(q) with the property that whenever q is smooth an integral conservation
law holds,
x
2
x
1
η(q(x, t
2
)) dx =
x
2
x
1
η(q(x, t
1
)) dx
+
t
2
t
1
ψ(q(x
1
, t )) dt −
t
2
t
1
ψ(q(x
2
, t )) dt. (11.42)
The entropy function and ﬂux must also be chosen in such a way that if q is discontinuous
in [x
1
, x
2
] ×[t
1
, t
2
], then the equation (11.42) does not hold with equality, so that the total
entropy in [x
1
, x
2
] at time t
2
is either less or greater than what would be predicted by the
ﬂuxes at x
1
and x
2
. Requiring that an inequality of the form
x
2
x
1
η(q(x, t
2
)) dx ≤
x
2
x
1
η(q(x, t
1
)) dx
+
t
2
t
1
ψ(q(x
1
, t )) dt −
t
2
t
1
ψ(q(x
2
, t )) dt (11.43)
always holds gives the entropy condition. (For the physical entropy in gas dynamics one
would require an inequality of this form with ≥ in place of ≤, but in the mathematical
literature η(q) is usually chosen to be a convex function with η
(q)>0, leading to the
inequality (11.43).)
If q(x, t ) is smooth, then the conservation law(11.42) can be manipulated as in Chapter 2
to derive the differential form
η(q)
t
+ψ(q)
x
= 0. (11.44)
Moreover, if η and ψ are smooth function of q, we can differentiate these to rewrite (11.44)
as
η
(q)q
t
+ψ
(q)q
x
= 0. (11.45)
220 11 Nonlinear Scalar Conservation Laws
On the other hand, the smooth function q satisﬁes
q
t
+ f
(q)q
x
= 0. (11.46)
Multiplying (11.46) by η
(q) and comparing with (11.45) yields
ψ
(q) = η
(q) f
(q) (11.47)
as a relation that should hold between the entropy function and the entropy ﬂux. For a
scalar conservation law this equation admits many solutions η(q), ψ(q). One trivial choice
of η and ψ satisfying (11.47) would be η(q) = q and ψ(q) = f (q), but then η would be
conserved even across discontinuities and this would not help in deﬁning an admissibility
criterion. Instead we also require that η(q) be a convex function of q with η
(q) > 0 for all
q. This will give an entropy function for which the inequality (11.43) should hold.
For a system of equations η and ψ are still scalar functions, but now η
(q) and ψ
(q)
must be interpreted as the rowvector gradients of η and ψ with respect to q, e.g.,
η
(q) =
∂η
∂q
1
,
∂η
∂q
2
, . . . ,
∂η
∂q
m
, (11.48)
and f
(q) is the m × m Jacobian matrix. In general (11.47) is a system of m equations
for the two variables η and ψ. Moreover, we also require that η(q) be convex, which for
a system requires that the Hessian matrix η
(q) be positive deﬁnite. For m >2 this may
have no solutions. Many physical systems do have entropy functions, however, including
of course the Euler equations of gas dynamics, where the negative of physical entropy can
be used. See Exercise 13.6 for another example. For symmetric systems there is always an
entropy function η(q) = q
T
q, as observed by Godunov [158]. Conversely, if a system has a
convex entropy, then its Hessian matrix η
(q) symmetrizes the system[143]; see also [433].
In order to see that the physically admissible weak solution should satisfy (11.43), we go
back to the more fundamental condition that the admissible q(x, t ) should be the vanishing
viscosity solution. Consider the related viscous equation
q
t
+ f (q
)
x
= q
xx
(11.49)
for >0. We will investigate how η(q
) behaves for solutions q
(x, t ) to (11.49) and take
the limit as →0. Since solutions to the parabolic equation (11.49) are always smooth,
we can derive the corresponding evolution equation for the entropy following the same
manipulations we used for smooth solutions of the inviscid equation, multiplying (11.49)
by η
(q
) to obtain
η(q
)
t
+ψ(q
)
x
= η
(q
)q
xx
.
We can now rewrite the righthand side to obtain
η(q
)
t
+ψ(q
)
x
=
η
(q
)q
x
x
−η
(q
)
q
x
2
.
11.14 Entropy Functions 221
Integrating this equation over the rectangle [x
1
, x
2
] ×[t
1
, t
2
] gives
x
2
x
1
η(q
(x, t
2
)) dx =
x
2
x
1
η(q
(x, t
1
)) dx
−
t
2
t
1
ψ(q
(x
2
, t )) dt −
t
2
t
1
ψ(q
(x
1
, t )) dt
+
t
2
t
1
η
(q
(x
2
, t )) q
x
(x
2
, t ) −η
(q
(x
1
, t )) q
x
(x
1
, t )
dt
−
t
2
t
1
x
2
x
1
η
(q
)
q
x
2
dx dt. (11.50)
In addition to the ﬂux differences, the total entropy is modiﬁed by two terms involving .
As → 0, the ﬁrst of these terms vanishes. (This is clearly true if the limiting function
q(x, t ) is smooth at x
1
and x
2
, and can be shown more generally.) The other term, however,
involves integrating (q
x
)
2
over the rectangle [x
1
, x
2
] ×[t
1
, t
2
]. If the limiting weak solution
is discontinuous along a curve in this rectangle, then this term will not vanish in the limit.
However, since >0, (q
x
)
2
>0, and η
>0 (by our convexity assumption), we can conclude
that this term is nonpositive in the limit and hence the vanishingviscosity weak solution
satisﬁes (11.43).
Just as for the conservation law, an alternative weak form of the entropy condition can be
formulated by integrating against smooth test functions φ, now required to be nonnegative,
since the entropy condition involves an inequality. A weak solution q satisﬁes the weak
form of the entropy inequality if
∞
0
∞
−∞
[φ
t
η(q) +φ
x
ψ(q)] dx dt +
∞
−∞
φ(x, 0)η(q(x, 0)) dx ≥ 0 (11.51)
for all φ ∈ C
1
0
(R×R) with φ(x, t ) ≥ 0 for all x, t . In Section 12.11.1 we will see that this
form of the entropy condition is convenient to work with in proving that certain numerical
methods converge to entropysatisfying weak solutions.
The entropy inequalities (11.43) and (11.51) are often written informally as
η(q)
t
+ψ(q)
x
≤ 0, (11.52)
with the understanding that where q is smooth (11.44) is in fact satisﬁed and near discon
tinuities the inequality (11.52) must be interpreted in the integral form (11.43) or the weak
form (11.51).
Another form that is often convenient is obtained by applying the integral inequality
(11.43) to an inﬁnitesimal rectangle near a shock as illustrated in Figure 11.7. When the
integral form of the original conservation law was applied over this rectangle, we obtained
the Rankine–Hugoniot jump condition (11.20),
s(q
r
−q
l
) = f (q
r
) − f (q
l
).
Going through the same steps using the inequality (11.43) leads to the inequality
s(η(q
r
) −η(q
l
)) ≥ ψ(q
r
) −ψ(q
l
). (11.53)
222 11 Nonlinear Scalar Conservation Laws
We thus see that a discontinuity propagating with speed s satisﬁes the entropy condition if
and only if the inequality (11.53) is satisﬁed.
Example 11.2. For Burgers’ equation (11.34), the discussion of Section 11.12 shows that
the convex function η(u) =u
2
can be used as an entropy function, with entropy ﬂux ψ(u) =
2
3
u
3
. Note that these satisfy (11.47). Consider a jump from u
l
to u
r
propagating with speed
s = (u
l
+ u
r
)/2, the shock speed for Burgers’ equation. The entropy condition (11.53)
requires
1
2
(u
l
+u
r
)
u
2
r
−u
2
l
≥
2
3
u
3
r
−u
3
l
.
This can be rearranged to yield
1
6
(u
l
−u
r
)
3
≥ 0,
and so the entropy condition is satisﬁed only if u
l
> u
r
, as we already found from the Lax
Entropy Condition 11.1.
11.14.1 The Kruˇ zkov Entropies
In general an entropy function should be strictly convex, with a second derivative that is
strictly positive at every point. This is crucial in the above analysis of (11.50), since the
(q
x
)
2
term that gives rise to the inequality in (11.51) is multiplied by η
(q
).
Rather than considering a single strictly convex function that can be used to investigate
every value of q
, a different approach was adopted by Kruˇ zkov [248], who introduced the
idea of entropy inequalities. He used a whole family of entropy functions and corresponding
entropy ﬂuxes,
η
k
(q) = q −k, ψ
k
(q) = sgn(q −k) [ f (q) − f (k)], (11.54)
where k is any real number. Each function η
k
(q) is a piecewise linear function of q with a
kink at q = k, and hence η
(q) = δ(q − k) is a delta function with support at q = k. It is
a weakly convex function whose nonlinearity is concentrated at a single point, and hence
it is useful only for investigating the behavior of weak solutions near the value q = k.
However, it is sometimes easier to obtain entropy results by studying the simple piecewise
linear function η
k
(q) than to work with an arbitrary entropy function. If it can be shown that
if a weak solution satisﬁes the entropy inequality (11.51) for an arbitrary choice of η
k
(q)
(i.e., that the entropy condition is satisﬁed for all the Kruˇ zkov entropies), then (11.51) also
holds more generally for any strictly convex entropy η(q).
11.15 LongTime Behavior and NWave Decay
Figure 11.8 shows the solution to Burgers’ equation with some smooth initial data having
compact support. As time evolves, portions of the solution where u
x
<0 steepen into shock
waves while portions where u
x
>0 spread out as rarefaction waves. Over time these shocks
11.15 LongTime Behavior and NWave Decay 223
−8 −6 −4 −2 0 2 4 6 8
−3
−2
−1
0
1
2
3
4
5
6
t = 0
−6 −4 −2 0 2 4 6
−1
−0.5
0
0.5
1
1.5
t = 1
−8 −6 −4 −2 0 2 4 6 8
−3
−2
−1
0
1
2
3
4
5
6
t = 0.2
−8 −6 −4 −2 0 2 4 6 8
−1
−0.5
0
0.5
1
1.5
t = 2
−8 −6 −4 −2 0 2 4 6 8
−3
−2
−1
0
1
2
3
4
5
6
t = 0.4
−8 −6 −4 −2 0 2 4 6 8
−1
−0.5
0
0.5
1
1.5
t = 3
−8 −6 −4 −2 0 2 4 6 8
−3
−2
−1
0
1
2
3
4
5
6
t = 0.6
−8 −6 −4 −2 0 2 4 6 8
−1
−0.5
0
0.5
1
1.5
t = 4
−8 −6 −4 −2 0 2 4 6 8
−3
−2
−1
0
1
2
3
4
5
6
t = 0.8
−8 −6 −4 −2 0 2 4 6 8
−1
−0.5
0
0.5
1
1.5
t = 5
−8 −6 −4 −2 0 2 4 6 8
−3
−2
−1
0
1
2
3
4
5
6
t = 1
−8 −6 −4 −2 0 2 4 6 8
−1
−0.5
0
0.5
1
1.5
t = 6
Fig. 11.8. Decay of general initial data to an Nwave with Burgers’ equation. The left column shows
the initial behavior from time t = 0 to t = 1 (going down). The right column shows later times t = 1
to t = 6 on a different scale. [claw/book/chap11/burgers]
and rarefactions interact. The shocks travel at different speeds, and those going in the
same direction merge into stronger shocks. Meanwhile, the rarefaction waves weaken the
shocks. The most striking fact is that in the long run all the structure of the initial data
completely disappears and the solution behaves like an Nwave: one shock propagates to
the left, another to the right, and in between the rarefaction wave is essentially linear. Similar
longtime behavior would be seen starting fromany other initial data with compact support.
The position and strength of the two shocks does depend on the data, but this same Nwave
shape will always arise. The same is true for other nonlinear conservation laws, provided
the ﬂux function is convex, although the shape of the rarefaction wave between the two
shocks will depend on this ﬂux. Only for a quadratic ﬂux (such as Burgers’ equation) will it
224 11 Nonlinear Scalar Conservation Laws
be linear. For more details about the longtime behavior of solutions, see for example [98],
[308], [420].
Note that this loss of structure in the solution implies that in general a nonlinear conser
vation law models irreversible phenomena. With a linear equation, such as the advection
equation or the acoustics equations, the solution is reversible. We can start with arbi
trary data, solve the equation q
t
+ Aq
x
=0 for some time T, and then solve the equation
q
t
− Aq
x
=0 for another T time units, and the original data will be recovered. (This is
equivalent to letting t run backwards in the original equation.) For a nonlinear equation
q
t
+ f (q)
x
=0, we can do this only over times T for which the solution remains smooth.
Over such time periods the solution is constant along the characteristics, which do not cross,
and the process is reversible. Once shocks form, however, characteristics disappear into the
shock and information is lost. Many different sets of data can give rise to exactly the same
shock wave. If the equation is now solved backwards in time (or, equivalently, we solve
q
t
− f (q)
x
=0) then compression at the shock becomes expansion. There are inﬁnitely
many different weak solutions in this case. Spreading back out into the original data is
one of these, but the solution at the ﬁnal time contains no information about which of the
inﬁnitely many possibilities is “correct.”
The fact that information is irretrievably lost in a shock wave is directly related to the
notion that the physical entropy increases across a shock wave. Entropy is a measure of the
amount of disorder in the system (see Section 14.5) and a loss of structure corresponds to
an increase in entropy. Since entropy can only increase once shocks have formed, it is not
possible to recover the initial data.
Exercises
11.1. Show that in solving the scalar conservation law q
t
+ f (q)
x
= 0 with smooth initial
data q(x, 0), the time at which the solution “breaks” is given by
T
b
=
−1
min
x
[ f
(q(x, 0))q
x
(x, 0)]
(11.55)
if this is positive. If this is negative, then characteristics never cross. Hint: Use
q(x, t ) = q(ξ(x, t ), 0) from (11.11), differentiate this with respect to x, and deter
mine where q
x
becomes inﬁnite. To compute ξ
x
, differentiate the equation (11.12)
with respect to x.
11.2. Show that the viscous Burgers equation u
t
+uu
x
=u
xx
has a travelingwave
solution of the form u
(x, t ) = w
(x − st ), by deriving an ODE for w and veri
fying that this ODE has solutions of the form
w(ξ) = u
r
+
1
2
(u
l
−u
r
)
1 −tanh
(u
l
−u
r
)ξ
4
, (11.56)
when u
l
> u
r
, with the propagation speed s agreeing with the shock speed (11.23).
Note that w(ξ) →u
l
as ξ →−∞, and w(ξ) →u
r
as ξ →+∞. Sketch this solution
and indicate how it varies as → 0. What happens to this solution if u
l
< u
r
, and
why is there no travelingwave solution with limiting values of this form?
Exercises 225
11.3. For a general smooth scalar ﬂux functions f (q), showby Taylor expansion of (11.21)
that the shock speed is approximately the average of the characteristic speed on each
side,
s =
1
2
[ f
(q
l
) + f
(q
r
)] +O(q
r
− q
l

2
).
The exercises belowrequire determining the exact solution to a scalar conservation
law with particular initial data. In each case you should sketch the solution at several
instants in time as well as the characteristic structure and shockwave locations in
the x–t plane.
You may wish to solve the problem numerically by modifying the CLAWPACK
codes for this chapter in order to gain intuition for how the solution behaves and to
check your formulas.
11.4. Determine the exact solution to Burgers’ equation u
t
+(
1
2
u
2
)
x
= 0 for all t >0 when
each of the following sets of initial data is used:
(a)
u
◦
(x) =
1 if x < −1,
0 if − 1 < x < 1,
−1 if x > 1.
(b)
u
◦
(x) =
−1 if x < −1,
0 if − 1 < x < 1,
1 if x > 1.
11.5. Determine the exact solution to Burgers’ equation for t > 0 with initial data
u
◦
(x) =
2 if 0 < x < 1,
0 otherwise.
Note that the rarefaction wave catches up to the shock at some time T
c
. For t > T
c
determine the location of the shock by two different approaches:
(a) Let x
s
(t ) represent the shock location at time t . Determine and solve an ODE
for x
s
(t ) by using the Rankine–Hugoniot jump condition (11.21), which must
hold across the shock at each time.
(b) For t > T
c
the exact solution is triangularshaped. Use conservation to deter
mine x
s
(t ) based on the area of this triangle. Sketch the corresponding “over
turned” solution, and illustrate the equalarea rule (as in Figure 11.6).
11.6. Repeat Exercise 11.5 with the data
u
◦
(x) =
2 if 0 < x < 1,
4 otherwise.
Note that in this case the shock catches up with the rarefaction wave.
226 11 Nonlinear Scalar Conservation Laws
11.7. Determine the exact solution to Burgers’ equation for t > 0 with the data
u
◦
(x) =
12 if 0 < x,
8 if 0 < x < 14,
4 if 14 < x < 17,
2 if 17 < x.
Note that the three shocks eventually merge into one shock.
11.8. Consider the scalar conservation law u
t
+ (e
u
)
x
= 0. Determine the exact solution
with the following sets of initial data:
(a)
u
◦
(x) =
1 if x < 0,
0 if x > 0.
(b)
u
◦
(x) =
0 if x < 0,
1 if x > 0.
(c)
u
◦
(x) =
2 if 0 < x < 1,
0 otherwise.
Hint: Use the approach outlined in Exercise 11.5(a).
11.9. Determine an entropy function and entropy ﬂux for the trafﬁc ﬂow equation with
ﬂux (11.4). Use this to show that q
l
< q
r
is required for a shock to be admissible.
12
Finite Volume Methods for Nonlinear Scalar
Conservation Laws
We now turn to the development of ﬁnite volume methods for nonlinear conservation laws.
We will build directly on what has already been developed for linear systems in Chapter 4,
concentrating in this chapter on scalar equations, although much of what is developed will
also apply to nonlinear systems of equations. In Chapter 15 we consider some additional
issues arising for systems of equations, particularly the need for efﬁcient approximate
Riemann solvers in Section 15.3.
Nonlinearity introduces a number of new difﬁculties not seen for the linear problem.
Stability and convergence theory are more difﬁcult than in the linear case, particularly in
that we are primarily interested in discontinuous solutions involving shock waves. This
theory is taken up in Section 12.10. Moreover, we must ensure that we are converging to the
correct weak solution of the conservation law, since the weak solution may not be unique.
This requires that the numerical method be consistent with a suitable entropy condition; see
Section 12.11.
For a nonlinear conservation law q
t
+ f (q)
x
= 0 it is very important that the method be
in conservation form, as described in Section 4.1,
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
, (12.1)
in order to insure that weak solutions to the conservation law are properly approximated.
Recall that this form is derived directly from the integral form of the conservation laws,
which is the correct equation to model when the solution is discontinuous. In Section 12.9
an example is given to illustrate that methods based instead on the quasilinear form q
t
+
f
(q)q
x
=0 may be accurate for smooth solutions but may completely fail to approximate
a weak solution when the solution contains shock waves.
12.1 Godunov’s Method
Recall from Section 4.11 that Godunov’s method is obtained by solving the Riemann
problem between states Q
n
i −1
and Q
n
i
in order to determine the ﬂux F
n
i −1/2
as
F
n
i −1/2
= f
Q
∨

i −1/2
.
227
228 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
(a) (b) (c) (d) (e)
Fig. 12.1. Five possible conﬁgurations for the solution to a scalar Riemann problem between states
Q
i −1
and Q
i
, shown in the x–t plane: (a) leftgoing shock, Q
∨

i −1/2
= Q
i
; (b) leftgoing rarefac
tion, Q
∨

i −1/2
= Q
i
; (c) transonic rarefaction, Q
∨

i −1/2
=q
s
; (d) rightgoing rarefaction, Q
∨

i −1/2
= Q
i −1
;
(e) rightgoing shock, Q
∨

i −1/2
= Q
i −1
.
The value Q
∨

i −1/2
= q
∨

(Q
n
i −1
, Q
n
i
) is the value obtained along the ray x ≡ x
i −1/2
in this
Riemann solution. This value is constant for t >t
n
, since the Riemann solution is a similarity
solution. To keep the notation less cluttered, we will often drop the superscript n on Q below.
To begin, we assume the ﬂux function f (q) is convex (or concave), i.e., f
(q) does not
change sign over the range of q of interest. Then the Riemann solution consists of a single
shock or rarefaction wave. (See Section 16.1.3 for the nonconvex case.) For a scalar conser
vation law with a convex ﬂux function there are ﬁve possible forms that the Riemann solu
tion might take, as illustrated in Figure 12.1. In most cases the solution Q
∨

i −1/2
is either Q
i
(if the solution is a shock or rarefaction wave moving entirely to the left, as in Figure 12.1(a)
or (b)), or Q
i −1
(if the solution is a shock or rarefaction wave moving entirely to the right,
as in Figure 12.1(d) or (e)).
The only case where Q
∨

i −1/2
has a different value than Q
i
or Q
i −1
is if the solution
consists of a rarefaction wave that spreads partly to the left and partly to the right, as shown
in Figure 12.1(c). Suppose for example that f
(q) > 0 everywhere, in which case f
(q) is
increasing with q, so that a rarefaction wave arises if Q
i −1
< Q
i
. In this case the situation
shown in Figure 12.1(c) occurs only if
Q
i −1
< q
s
< Q
i
,
where q
s
is the (unique) value of q for which f
(q
s
) = 0. This is called the stagnation
point, since the value q
s
propagates with velocity 0. It is also called the sonic point, since
in gas dynamics the eigenvalues u ± c can take the value 0 only when the ﬂuid speed u
is equal to the sound speed c. The solution shown in Figure 12.1(c) is called a transonic
rarefaction since in gas dynamics the ﬂuid is accelerated from a subsonic velocity to a
supersonic velocity through such a rarefaction. In a transonic rarefaction the value along
x/t = x
i −1/2
is simply q
s
.
For the case f
(q) > 0 we thus see that the Godunov ﬂux function for a convex scalar
conservation law is
F
n
i −1/2
=
f (Q
i −1
) if Q
i −1
> q
s
and s > 0,
f (Q
i
) if Q
i
< q
s
and s < 0,
f (q
s
) if Q
i −1
< q
s
< Q
i
.
(12.2)
Here s = [ f (Q
i
) − f (Q
i −1
)]/(Q
i
− Q
i −1
) is the shock speed given by (11.21).
Note in particular that if f
(q) >0 for both Q
i −1
and Q
i
then F
n
i −1/2
= f (Q
i −1
) and
Godunov’s method reduces to the ﬁrstorder upwind method
Q
n+1
i
= Q
i
−
t
x
[ f (Q
i
) − f (Q
i −1
)]. (12.3)
12.2 Fluctuations, Waves, and Speeds 229
The natural upwind method is also obtained if f
(q) < 0 for both values of Q, involving
onesided differences in the other direction. Only in the case where f
(q) changes sign
between Q
i −1
and Q
i
is the formula more complicated, as we should expect, since the
“upwind direction” is ambiguous in this case and information must ﬂow both ways.
The formula (12.2) can be written more compactly as
F
n
i −1/2
=
min
Q
i −1
≤q≤Q
i
f (q) if Q
i −1
≤ Q
i
,
max
Q
i
≤q≤Q
i −1
f (q) if Q
i
≤ Q
i −1
,
(12.4)
since the stagnation point q
s
is the global minimum or maximum of f in the convex case.
This formula is valid also for the case f
(q) <0 and even for nonconvex ﬂuxes, in which
case there may be several stagnation points at each maximum and minimum of f (see
Section 16.1).
Note that there is one solution structure not illustrated in Figure 12.1, a stationary shock
with speed s = 0. In this case the value Q
∨

i −1/2
is ambiguous, since the Riemann solution is
discontinuous along x =x
i −1/2
. However, if s =0 then f (Q
i −1
) = f (Q
i
) by the Rankine–
Hugoniot condition, and so F
n
i −1/2
is still well deﬁned and the formula (12.4) is still valid.
12.2 Fluctuations, Waves, and Speeds
Godunov’s method can be implemented in our standard form
Q
n+1
i
= Q
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
(12.5)
if we deﬁne the ﬂuctuations A
±
Q
i −1/2
by
A
+
Q
i −1/2
= f (Q
i
) − f
Q
∨

i −1/2
,
A
−
Q
i −1/2
= f
Q
∨

i −1/2
− f (Q
i −1
).
(12.6)
In order to deﬁne highresolution correction terms, we also wish to compute a wave W
i −1/2
and speed s
i −1/2
resulting from this Riemann problem. The natural choice is
W
i −1/2
= Q
i
− Q
i −1
,
s
i −1/2
=
[ f (Q
i
) − f (Q
i −1
)]/(Q
i
− Q
i −1
) if Q
i −1
= Q
i
,
f
(Q
i
) if Q
i −1
= Q
i
,
(12.7)
althoughthe value of s
i −1/2
is immaterial when Q
i −1
= Q
i
. The speedchosenis the Rankine–
Hugoniot shock speed (11.21) for this data. If the Riemann solution is a shock wave, this is
clearly the right thing to do. If the solution is a rarefaction wave, then the wave is not simply
a jump discontinuity propagating at a single speed. However, this is still a suitable deﬁnition
of the wave and speed to use in deﬁning correction terms that yield secondorder accuracy
in the smooth case. This can be veriﬁed by a truncationerror analysis of the resulting
method; see Section 15.6. Note that when a smooth solution is being approximated, we
expect W
i −1/2
=O(x), and there is very little spreading of the rarefaction wave in any
case. Moreover, a wave consisting of this jump discontinuity propagating with speed s
i −1/2
230 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
does deﬁne a weak solution to the Riemann problem, although it is an expansion shock that
does not satisfy the entropy condition. However, provided it is not a transonic rarefaction,
the same result will be obtained in Godunov’s method whether we use the entropysatisfying
rarefaction wave or an expansion shock as the solution to the Riemann problem. When the
wave lies entirely within one cell, the cell average is determined uniquely by conservation
and does not depend on the structure of the particular weak solution chosen. We can compute
the ﬂuctuations A
±
Q
i −1/2
using
A
+
Q
i −1/2
= s
+
i −1/2
W
i −1/2
,
A
−
Q
i −1/2
= s
−
i −1/2
W
i −1/2
(12.8)
in place of (12.6), provided that Q
∨

i −1/2
= Q
i −1
or Q
i
. Only in the case of a transonic
rarefaction is it necessary to instead use the formulas (12.6) with Q
∨

i −1/2
=q
s
.
12.3 Transonic Rarefactions and an Entropy Fix
Note that if we were to always use (12.8), even for transonic rarefactions, then we would
still be applying Godunov’s method using an exact solution to the Riemann problem; the
Rankine–Hugoniot conditions are always satisﬁed for the jump and speed determined in
(12.7). The only problem is that the entropy condition would not be satisﬁed and we would
be using the wrong solution. For this reason the modiﬁcation to A
±
Q
i −1/2
required in the
transonic case is often called an entropy ﬁx.
This approach is used in the Riemann solver [claw/book/chap12/efix/rp1.f]. The
wave and speed are ﬁrst calculated, and the ﬂuctuations are set using (12.8). Only in the
case of a transonic rarefaction is the entropy ﬁx applied to modify the ﬂuctuations. If
f
(Q
i −1
) < 0 < f
(Q
i
) then the ﬂuctuations in (12.8) are replaced by
A
+
Q
i −1/2
= f (Q
i
) − f (q
s
),
A
−
Q
i −1/2
= f (q
s
) − f (Q
i −1
).
(12.9)
We will see in Section 15.3 that this approach generalizes to nonlinear systems of equa
tions in a natural way. An approximate Riemann solver can often be used that gives an
approximate solution involving a ﬁnite set of waves that are jump discontinuities W
p
i −1/2
propagating at some speeds s
p
i −1/2
. These are used to deﬁne ﬂuctuations and also high
resolution correction terms, as indicated in Section 6.15. A check is then performed to see
if any of the waves should really be transonic rarefactions, and if so, the ﬂuctuations are
modiﬁed by performing an entropy ﬁx.
For the scalar equation this approach may seem a rather convoluted way to specify the
true Godunov ﬂux, which is quite simple to determine directly. For nonlinear systems,
however, it is generally too expensive to determine the rarefaction wave structure exactly
and this approach is usually necessary. This is discussed further in Section 15.3, where
various entropy ﬁxes are presented.
Dealing with transonic rarefactions properly is an important component in the develop
ment of successful methods. This is illustratedinFigure 12.2, whichshows several computed
solutions to Burgers’ equation (11.13) at time t =1 for the same set of data, a Riemann
problem with u
l
= −1 and u
r
= 2. (Note that for Burgers’ equation the sonic point is at
12.3 Transonic Rarefactions and an Entropy Fix 231
(a)
−3 −2 −1 0 1 2 3
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
Godunov with no entropy fix
(b)
−3 −2 −1 0 1 2 3
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
Godunov with entropy fix
(c)
−3 −2 −1 0 1 2 3
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
High–resolution with no entropy fix
(d)
−3 −2 −1 0 1 2 3
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
High–resolution with entropy fix
Fig. 12.2. The solid line is the entropysatisfying solution to Burgers’ equation with a transonic
rarefaction wave. The circles showcomputed solutions. (a) Godunov’s method using expansionshock
solutions to each Riemann problem. This method converges to a weak solution that does not satisfy the
entropycondition. (b) Godunov’s methodusingentropysatisfyingsolutions toeachRiemannproblem.
(c) Highresolution corrections added to the expansionshock Godunov method. (d) Highresolution
corrections added to the entropysatisfying Godunov method. [claw/book/chap12/efix]
u
s
= 0.) The top row shows results obtained with Godunov’s method and the bottom row
shows results with the highresolution method, using the MC limiter. The plots on the left
were obtained using (12.8) everywhere, with no entropy ﬁx. The plots on the right were
obtained using the entropy ﬁx, which means that the ﬂuctuations were redeﬁned at a single
grid interface each time step, the one for which U
n
i −1
< 0 and U
n
i
> 0. This modiﬁcation at
a single grid interface makes a huge difference in the quality of the results. In particular, the
result obtained using Godunov’s method with the expansionshock Riemann solution looks
entirely wrong. In fact it is a reasonable approximation to a weak solution to the problem,
the function
u(x, t ) =
−1 if x < 0,
1 if 0 < x ≤ t,
x/t if t ≤ x ≤ 2t,
2 if x ≥ 2t.
This solutionconsists of anentropyviolatingstationaryshockat x = 0andalsoa rarefaction
wave. If the grid is reﬁned, the computed solution converges nicely to this weak solution.
However, this is not the physically relevant vanishingviscosity solution that we had hoped
to compute.
When the correct rarefactionwave solution to each Riemann problem is used (i.e., the
entropy ﬁx (12.9) is employed), Godunov’s method gives a result that is much closer to the
weak solution we desire. There is still a small expansion shock visible in Figure 12.2(b)
232 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
near x = 0, but this is of magnitude O(x) and vanishes as the grid is reﬁned. This feature
(sometimes called an entropy glitch) is a result of Godunov’s method lacking sufﬁcient
numerical viscosity when the wave speed is very close to zero. See [160] for one analysis
of this. In Section 12.11.1 we will prove that Godunov’s method converges to the correct
solution provided that transonic rarefactions are properly handled.
Adding in the highresolution correction terms (as discussed in Section 12.8) produces
better results, even when the entropy ﬁx is not used (Figure 12.2(c)), and convergence to the
proper weak solution is obtained. Even in this case, however, better results are seen if the
ﬁrstorder ﬂuxfor the transonic rarefactionis properlycomputed, as showninFigure 12.2(d).
12.4 Numerical Viscosity
The weak solution seen in Figure 12.2(a), obtained with Godunov’s method using the expan
sion shock solution to each Riemann problem, contains a portion of the correct rarefaction
wave along with a stationary expansion shock located at x = 0. Why does it have this
particular structure? In the ﬁrst time step a Riemann problem with u
l
=−1 and u
r
=2 is
solved, resulting in an expansion shock with speed
1
2
(u
l
+ u
r
) =
1
2
. This wave propagates
a distance
1
2
t and is then averaged onto the grid, resulting in some smearing of the initial
discontinuity. The numerical viscosity causing this smearing acts similarly to the physical
viscosity of the viscous Burgers equation (11.14), and tends to produce a rarefaction wave.
However, unlike the viscosity of ﬁxed magnitude appearing in (11.14), the magnitude of
the numerical viscosity depends on the local Courant number s
i −1/2
t /x, since it results
from the averaging process (where s
i −1/2
is the Rankine–Hugoniot shock speed for the data
Q
i −1
and Q
i
). Inparticular, if s
i −1/2
=0, thenthere is nosmearingof the discontinuityandno
numerical viscosity. For Burgers’ equation this happens whenever Q
i −1
= −Q
i
, in which
case the expansionshock weak solution is stationary. The solution shown in Figure 12.2(a)
has just such a stationary shock.
This suggests that another way to view the entropy ﬁx needed in the transonic case is as
the addition of extra numerical viscosity in the neighborhood of such a point. This can be
examined further by noting that the ﬂuctuations (12.8) result in the numerical ﬂux function
F
i −1/2
=
1
2
f (Q
i −1
) + f (Q
i
) −
s
i −1/2
(Q
i
− Q
i −1
)
, (12.10)
as in the derivation of (4.61). Recall fromSection 4.14 that this is the central ﬂux (4.18) with
the addition of a viscous ﬂux term. However, when s
i −1/2
= 0 this viscous term disappears.
This viewpoint is discussed further in Section 15.3.5 where a variety of entropy ﬁxes for
nonlinear systems are discussed.
12.5 The Lax–Friedrichs and Local Lax–Friedrichs Methods
The LaxFriedrichs (LxF) method was introduced in Section 4.6. The ﬂux function (4.21)
for this method,
F
i −1/2
=
1
2
[ f (Q
i −1
) + f (Q
i
) −a(Q
i
− Q
i −1
)], (12.11)
12.5 The Lax–Friedrichs and Local Lax–Friedrichs Methods 233
(a)
−3 −2 −1 0 1 2 3
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
Lax–Friedrichs
(b)
−3 −2 −1 0 1 2 3
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
LLF method
Fig. 12.3. The solid line is the entropysatisfying solution to Burgers’ equation with a transonic
rarefaction wave. The symbols show computed solutions. (a) Lax–Friedrichs method. (b) Local Lax–
Friedrichs (LLF) method. [claw/book/chap12/llf]
has a numerical viscosity a = x/t with a ﬁxed magnitude that does not vanish near a
sonic point. As a result, this method always converges to the correct vanishing viscosity
solution as the grid is reﬁned; see Section 12.7.
If the LxF method is applied to the same transonic rarefaction problem considered in
Figure 12.2, we obtain the results shown in Figure 12.3(a). Note that this method is more
dissipative than Godunov’s method. It also exhibits a curious stairstep pattern in which
Q
2 j
= Q
2 j +1
for each value of j . This results from the fact that the formula (4.20) for Q
n+1
i
involves only Q
n
i −1
and Q
n
i +1
, so there is a decoupling of even and odd grid points. With
the piecewise constant initial data used in this example, the even and odd points evolve
in exactly the same manner, so each solution value appears twice. (See Section 10.5 for a
discussion of the LxF method on a staggered grid in which only half the points appear. This
viewpoint allows it to be related more directly to Godunov’s method.)
An improvement to the LxF method is obtained by replacing the value a = x/t in
(12.11) by a locally determined value,
F
i −1/2
=
1
2
f (Q
i −1
) + f (Q
i
) −a
i −1/2
(Q
i
− Q
i −1
)
, (12.12)
where
a
i −1/2
= max( f
(q)) over all q between Q
i −1
and Q
i
. (12.13)
For a convex ﬂux function this reduces to
a
i −1/2
= max( f
(Q
i −1
),  f
(Q
i
)).
This resulting method is Rusanov’s method [387], though recently it is often called the
local Lax–Friedrichs (LLF) method because it has the same form as the LxF method but
the viscosity coefﬁcient is chosen locally at each Riemann problem. It can be shown that
this is sufﬁcient viscosity to make the method converge to the vanishingviscosity solution;
see Section 12.7.
234 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
Note that if the CFL condition is satisﬁed (which is a necessary condition for stability),
then  f
(q) t /x ≤ 1 for each value of q arising in the whole problem, and so
 f
(q) ≤
x
t
.
Hence using a =x/t in the standard LxF method amounts to taking a uniform vis
cosity that is sufﬁcient everywhere, at the expense of too much smearing in most cases.
Figure 12.3(b) shows the results on the same test problem when the LLF method is used.
Another related method is Murman’s method, in which (12.12) is used with (12.13)
replaced by
a
i −1/2
=
f (Q
i
) − f (Q
i −1
)
Q
i
− Q
i −1
. (12.14)
Unlike the LLF scheme, solutions generated with this method may fail to satisfy the entropy
condition because a
i −1/2
vanishes for the case of a stationary expansion shock. In fact, this
is exactly the method (12.5) with A
±
Q
i −1/2
deﬁned by (12.8), expressed in a different
form (see Exercise 12.1).
Note that all these methods are easily implemented in CLAWPACK by taking
A
−
Q
i −1/2
=
1
2
f (Q
i
) − f (Q
i −1
) −a
i −1/2
(Q
i
− Q
i −1
)
,
A
+
Q
i −1/2
=
1
2
f (Q
i
) − f (Q
i −1
) +a
i −1/2
(Q
i
− Q
i −1
)
,
(12.15)
as is done in [claw/book/chap12/llf/rp1.f].
12.6 The Engquist–Osher method
We have seen that the ﬁrstorder method (12.5) with the ﬂuctuations (12.8) can be interpreted
as an implementation of Godunov’s method in which we always use the shockwave solution
to each Riemann problem, even when this violates the entropy condition. The Engquist–
Osher method [124] takes the opposite approach and always assumes the solution is a
“rarefaction wave”, even when this wave must be triplevalued as in Figure 11.4(b). This
can be accomplished by setting
A
+
Q
i −1/2
=
Q
i
Q
i −1
( f
(q))
+
dq,
A
−
Q
i −1/2
=
Q
i
Q
i −1
( f
(q))
−
dq.
(12.16)
Here the ± superscript on f
(q) means the positive and negative part as in (4.40). These
ﬂuctuations result in an interface ﬂux F
i −1/2
that can be expressed in any of the following
12.8 HighResolution TVD Methods 235
ways:
F
i −1/2
= f (Q
i −1
) +
Q
i
Q
i −1
( f
(q))
−
dq
= f (Q
i
) −
Q
i
Q
i −1
( f
(q))
+
dq
=
1
2
[ f (Q
i −1
) + f (Q
i
)] −
1
2
Q
i
Q
i −1
 f
(q) dq. (12.17)
If f
(q) does not change sign between Q
i −1
and Q
i
, then one of the ﬂuctuations in
(12.16) will be zero and these formulas reduce to the usual upwind ﬂuxes as in (12.2). In
the sonic rarefaction case both ﬂuctuations are nonzero and we obtain the desired value
F
i −1/2
= f (q
s
) as in (12.2). It is only in the transonic shock case, when f
(Q
i −1
) > 0 >
f
(Q
i
), that the Engquist–Osher method gives a value different from (12.2). In this case
both ﬂuctuations are again nonzero and we obtain
F
i −1/2
= f (Q
i −1
) + f (Q
i
) − f (q
s
) (12.18)
rather than simply f (Q
i −1
) or f (Q
i
). This is because the triplevalued solution of
Figure 11.4(b) spans the interface x
i −1/2
in this case, so that the integral picks up three
different values of f . This ﬂux is still consistent with the conservation law, however, and by
assuming the rarefaction structure, the entropy condition is always satisﬁed. This approach
can be extended to systems of equations to derive approximate Riemann solvers that satisfy
the entropy condition, giving the Osher scheme [349], [352].
12.7 Eschemes
Osher [349] introduced the notion of an Escheme as one that satisﬁes the inequality
sgn(Q
i
− Q
i −1
)
F
i −1/2
− f (q)
≤ 0 (12.19)
for all q between Q
i −1
and Q
i
. In particular, Godunov’s method with ﬂux F
G
i −1/2
deﬁned
by (12.4) is clearly an Escheme. In fact it is the limiting case, in the sense that Eschemes
are precisely those for which
F
i −1/2
≤ F
G
i −1/2
ifQ
i −1
≤ Q
i
,
F
i −1/2
≥ F
G
i −1/2
ifQ
i −1
≥ Q
i
.
(12.20)
It can be shown that any Escheme is TVDif the Courant number is sufﬁciently small (Exer
cise 12.3). Osher [349] proves that Eschemes are convergent to the entropysatisfying weak
solution. In addition to Godunov’s method, the LxF, LLF, and Engquist–Osher methods are
all Eschemes. Osher also shows that Eschemes are at most ﬁrstorder accurate.
12.8 HighResolution TVD Methods
The methods described so far are only ﬁrstorder accurate and not very useful in their own
right. They are, however, used as building blocks in developing certain highresolution
236 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
methods. Godunov’s method, as described in Section 12.2, can be easily extended to a
highresolution method of the type developed in Chapter 6,
Q
n+1
i
= Q
i
−
t
x
A
+
Q
i −1/2
+ A
−
Q
i +1/2
−
t
x
˜
F
i +1/2
−
˜
F
i −1/2
. (12.21)
We set
˜
F
i −1/2
=
1
2
s
i −1/2
1 −
t
x
s
i −1/2
W
i −1/2
, (12.22)
just as we have done for the variablecoefﬁcient advection equation in Section 9.3.1. Again
W
i −1/2
is a limited version of the wave (12.7) obtained by comparing
W
i −1/2
to
W
i −3/2
or
W
i −1/2
, dependingonthe signof s
i −1/2
. Note that the methodremains conservative withsuch
a modiﬁcation, which is crucial in solving nonlinear conservation laws (see Section 12.9).
It is also possible to prove that the resulting method will be TVD provided that one of
the TVD limiters presented in Section 6.9 is used. This is a very important result, since it
means that these methods can be applied with conﬁdence to nonlinear problems with shock
waves where we wish to avoid spurious oscillations. Moreover, this TVD property allows
us to prove stability and hence convergence of the methods as the grid is reﬁned, as shown
in Section 12.12. (Unfortunately, these claims are valid only for scalar conservation laws.
Extending these ideas to systems of equations gives methods that are often very successful
in practice, but for which much less can be proved in general.)
Here we will prove that the limiter methods are TVD under restricted conditions to
illustrate the main ideas. (See [160] for more details.) We assume that data is monotone
(say nonincreasing) and that f
(q) does not change sign over the range of the data (say
f
(Q
n
i
) > 0). A similar approach can be used near extreme points of Q
n
and sonic points,
but more care is required, and the formulas are more complicated. We will also impose the
timestep restriction
t
x
max  f
(q) <
1
2
, (12.23)
although this can also be relaxed to the usual CFL limit of 1 with some modiﬁcation of the
method.
The main idea is to again use the REA Algorithm 4.1 to interpret the highresolution
method. The ﬁrst step is to reconstruct the piecewise linear function ˜ q
n
(x, t
n
) from the cell
averages Q
n
i
. This is where the limiters come into play, and this reconstruction does not
increase the total variation of the data. The second step is to evolve the conservation lawwith
this data. If we were to solve the conservation law exactly and then average onto the grid,
then the resulting method would clearly be TVD, because the exact solution operator for a
scalar conservation law is TVD (and so is the averaging process). But unlike the methods
we developed in Chapter 6 for the advection equation, we are not able to solve the original
conservation lawexactly in step 2 of Algorithm4.1 (except in the case of zero slopes, where
Godunov’s method does this). In principle one could do so also for more general slopes, but
the resulting correction formula would be much more complicated than (12.22). However,
the formula (12.22) can be interpreted as what results from solving a slightly different
conservation law exactly and then averaging onto the grid. Exact solutions of this modiﬁed
conservation law also have the TVD property, and it follows that the method is TVD.
12.9 The Importance of Conservation Form 237
(a)
Q
n
i
Q
n
i−1
Q
n
i+1
f(q)
ˆ
f(q)
(b)
Q
n
i
Q
n
i−1
Q
n
i+1
x
i−1/2
x
i+1/2
Fig. 12.4. (a) The ﬂux function f (q) is approximated by a piecewise linear function
ˆ
f (q). (b) The
piecewise linear data ˜ q
n
(x, t
n
) is evolved by solving the conservation law with ﬂux
ˆ
f (q). The result
is the heavy line. Note that a shock forms near the value Q
n
i
where the characteristic velocity
ˆ
f
(q)
is discontinuous.
The modiﬁed conservation law used in the time step from t
n
to t
n+1
is obtained by
replacing the ﬂux function f (q) by a piecewise linear function
ˆ
f (q) that interpolates the
values (Q
n
i
, f (Q
n
i
)), as shown in Figure 12.4(a). Then in step 2 we solve the conservation
law with this ﬂux function to evolve ˜ q
n
(x, t
n
), as shown in Figure 12.4(b). This ﬂux is
still nonlinear, but the nonlinearity has been concentrated at the points Q
n
i
. Shocks form
immediately at the points x
i
(the midpoints of the grid cells), but because of the timestep
restriction (12.23), these shocks do not reach the cell boundary during the time step.
Near each interface x
i −1/2
the data lies between Q
n
i −1
and Q
n
i
, and so the ﬂux function
is linear with constant slope s
i −1/2
= [ f (Q
n
i
) − f (Q
n
i −1
)]/(Q
n
i
− Q
n
i −1
), as arises from
the piecewise linear interpolation of f . Hence the conservation law with ﬂux
ˆ
f behaves
locally like the scalar advection equation with velocity s
i −1/2
. This is exactly the velocity
that appears in the updating formula (12.22), and it can be veriﬁed that this method produces
the correct cell averages at the end of the time step for this modiﬁed conservation law.
In this informal analysis we have assumed the data is monotone near Q
n
i
. The case where
Q
n
i
is a local extreme point must be handled differently, since we would not be able to deﬁne
a single function
ˆ
f in the same manner. However, in this case the slope in cell C
i
is zero if
a TVD limiter is used, and we can easily show that the total variation can not increase in
this case.
Some more details may be found in Goodman & LeVeque [160]. Recently Morton [332]
has performed a more extensive analysis of this type of method, including also similar
methods with piecewise quadratic reconstructions as well as methods on nonuniform grids
and multidimensional versions.
12.9 The Importance of Conservation Form
In Section 4.1 we derived the conservative form of a ﬁnite volume method based on the
integral formof the conservationlaw. Usinga methodinthis formguarantees that the discrete
solution will be conservative in the sense that (4.8) will be satisﬁed. For weak solutions
involving shock waves, this integral formis more fundamental than the differential equation
and forms the basis for the mathematical theory of weak solutions, including the derivation
238 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
of the Rankine–Hugoniot conditions (see Section 11.8) that govern the form and speed of
shock waves. It thus makes sense that a conservative method based on the integral form
might be more successful than other methods based on the differential equation. In fact, we
will see that the use of conservative ﬁnite volume methods is essential in computing weak
solutions to conservation laws. Nonconservative methods can fail, as illustrated below. With
conservative methods, one has the satisfaction of knowing that if the method converges to
some limiting function as the grid is reﬁned, then this function is a weak solution. This is
further explained and proved in Section 12.10 in the form of the Lax–Wendroff theorem.
In Section 12.11 we will see that similar ideas can be used to show that the limiting
function also satisﬁes the entropy condition, provided the numerical method satisﬁes a
natural discrete version of the entropy condition.
Consider Burgers’ equation u
t
+
1
2
(u
2
)
x
=0, for example. If u >0 everywhere, then the
conservative upwind method (Godunov’s method) takes the form
U
n+1
i
= U
n
i
−
t
x
1
2
U
n
i
2
−
1
2
U
n
i −1
2
. (12.24)
On the other hand, using the quasilinear form u
t
+ uu
x
=0, we could derive the noncon
servative upwind method
U
n+1
i
= U
n
i
−
t
x
U
n
i
U
n
i
−U
n
i −1
. (12.25)
On smooth solutions, both of these methods are ﬁrstorder accurate, and they give compara
ble results. When the solution contains a shock wave, the method (12.25) fails to converge to
a weak solution of the conservation law. This is illustrated in Figure 12.5. The conservative
method (12.24) gives a slightly smeared approximation to the shock, but it is smeared about
the correct location. We can easily see that it must be, since the method has the discrete
conservation property (4.8). The nonconservative method (12.25), on the other hand, gives
the results shown in Figure 12.5(b). These clearly do not satisfy (4.8), and as the grid is
(a)
−1 0 1 2 3 4
0
0.5
1
1.5
2
2.5
Godunov
(b)
−1 0 1 2 3 4
0
0.5
1
1.5
2
2.5
Nonconservative method
Fig. 12.5. True and computed solutions to a Riemann problemfor Burgers’ equation with data u
l
= 2,
u
r
= 1, shown at time t = 2: (a) using the conservative method (12.24), (b) using the nonconservative
method (12.25). [claw/book/chap12/nonconservative]
12.10 The Lax–Wendroff Theorem 239
reﬁned the approximation converges to a discontinuous function that is not a weak solution
to the conservation law.
This is not surprising if we recall that it is possible to derive a variety of conserva
tion laws that are equivalent for smooth solutions but have different weak solutions. For
example, the equations (11.34) and (11.35) have exactly the same smooth solutions, but
the Rankine–Hugoniot condition gives different shock speeds, and hence different weak
solutions. Consider a ﬁnite difference method that is consistent with one of these equations,
say (11.34), using the deﬁnition of consistency introduced in Section 8.2 for linear problems
(using the local truncation error derived by expanding in Taylor series). Then the method is
also consistent with (11.35), since the Taylor series expansion (which assumes smoothness)
gives the same result in either case. So the method is consistent with both (11.34) and
(11.35), and while we might then expect the method to converge to a function that is a weak
solution of both, that is impossible when the two weak solutions differ. Similarly, if we use
a nonconservative method based on the quasilinear form, then there is no reason to expect
to obtain the correct solution, except in the case of smooth solutions.
Note that the nonconservative method (12.25) can be rewritten as
U
n+1
i
= U
n
i
−
t
x
1
2
U
n
i
2
−
1
2
U
n
i −1
2
+
1
2
t x
U
n
i
−U
n
i −1
x
2
. (12.26)
Except for the ﬁnal term, this is identical to the conservative method (12.24). The ﬁnal term
approximates the time integral of
1
2
x (u
x
)
2
. For smooth solutions, where u
x
is bounded,
the effect of this term can be expected to vanish as x →0. For a shock wave, however, it
does not. Just as in the derivation of the weak form of the entropy inequality (11.51), this
term can give a ﬁnite contribution in the limit, leading to a different shock speed.
The ﬁnal term in (12.26) can also be viewed as a singular source term that is being added
to the conservation law, an approximation to a delta function concentrated at the shock. This
leads to a change in the shock speed as discussed in Section 17.12. See [203] for further
analysis of the behavior of nonconservative methods.
12.10 The Lax–Wendroff Theorem
The fact that conservative ﬁnite volume methods are based on the integral conservation law
suggests that we can hope to correctly approximate discontinuous weak solutions to the
conservation law by using such a method. Lax and Wendroff [265] proved that this is true,
at least in the sense that if the approximation converges to some function q(x, t ) as the grid
is reﬁned, through some sequence t
( j )
, x
( j )
→ 0, then this function will in fact be a
weak solution of the conservation law. The theorem does not guarantee that convergence
occurs. For that we need some form of stability, and even then, if there is more than one
weak solution, it might be that one sequence of approximations will converge to one weak
solution, while another sequence converges to a different weak solution (and therefore a
third sequence, obtained for example by merging the ﬁrst two sequences, will not converge
at all!).
Nonetheless, this is a very powerful and important theorem, for it says that we can
have conﬁdence in solutions we compute. In practice we typically do not consider a whole
240 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
sequence of approximations. Instead we compute a single approximation on one ﬁxed grid.
If this solution looks reasonable and has wellresolved discontinuities (an indication that
the method is stable and our grid is sufﬁciently ﬁne), then we can believe that it is in fact a
good approximation to some weak solution.
Before stating the theorem, we note that it is valid for systems of conservation laws
q
t
+ f (q)
x
= 0 as well as for scalar equations.
Theorem 12.1 (Lax and Wendroff [265]). Consider a sequence of grids indexed by j =1,
2, . . . , with mesh parameters t
( j )
, x
( j )
→ 0 as j → ∞. Let Q
( j )
(x, t ) denote the
numerical approximation computed with a consistent and conservative method on the j th
grid. Suppose that Q
( j )
converges to a function q as j → ∞, in the sense made precise
below. Then q(x, t ) is a weak solution of the conservation law.
The proof of this theoremdoes not use smoothness of the solution, and so we do not deﬁne
consistency in terms of Taylor series expansions. Instead we need the form of consistency
discussed in Section 4.3.1.
In the statement of this theorem, Q
( j )
(x, t ) denotes a piecewise constant function that
takes the value Q
n
i
on the space–time mesh cell (x
i −1/2
, x
i +1/2
) × [t
n
, t
n+1
). It is indexed
by j corresponding to the particular mesh used, with x
( j )
and t
( j )
both approaching zero
as j →∞. We assume that we have convergence of the function Q
( j )
(x, t ) to q(x, t ) in the
following sense:
1. Over every bounded set = [a, b] ×[0, T] in x–t space,
T
0
b
a
Q
( j )
(x, t ) −q(x, t )
dx dt →0 as j →∞. (12.27)
This is the 1norm over the set , so we can simply write
Q
( j )
−q
1,
→0 as j →∞. (12.28)
2. We also assume that for each T there is an R > 0 such that
TV
Q
( j )
(·, t )
< R for all 0 ≤ t ≤ T, j = 1, 2, . . . , (12.29)
where TV denotes the total variation function introduced in Section 6.7.
Lax and Wendroff assumed a slightly different form of convergence, namely that Q
( j )
converges to q almost everywhere (i.e., except on a set of measure zero) in a uniformly
bounded manner. Using the fact that each Q
( j )
is a piecewise constant function, it can be
shown that this requirement is essentially equivalent to (12.28) and (12.29) above. The
advantage of assuming (12.28) and (12.29) is twofold: (a) it is these properties that are
really needed in the proof, and (b) for certain important classes of methods (e.g., the total
variation diminishing methods), it is this form of convergence that we can most directly
prove.
12.10 The Lax–Wendroff Theorem 241
Proof. We will show that the limit function q(x, t ) satisﬁes the weak form (11.33), i.e., for
all φ ∈ C
1
0
,
∞
0
+∞
−∞
[φ
t
q +φ
x
f (q)] dx dt = −
∞
−∞
φ(x, 0)q(x, 0) dx. (12.30)
Let φ be a C
1
0
test function. On the j th grid, deﬁne the discrete version
( j )
by
( j )n
i
=
φ(x
( j )
i
, t
( j )
n
) where (x
( j )
i
, t
( j )
n
) is a grid point on this grid. Similarly Q
( j )n
i
denotes the
numerical approximation on this grid. To simplify notation, we will drop the superscript
( j ) below and simply use
n
i
and Q
n
i
, but remember that ( j ) is implicitly present, since in
the end we must take the limit as j →∞.
Multiply the conservative numerical method
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
by
n
i
to obtain
n
i
Q
n+1
i
=
n
i
Q
n
i
−
t
x
n
i
F
n
i +1/2
− F
n
i −1/2
. (12.31)
This is true for all values of i and n on each grid j . If we now sum (12.31) over all i and
n ≥ 0, we obtain
∞
n=0
∞
i =−∞
n
i
Q
n+1
i
− Q
n
i
= −
t
x
∞
n=0
∞
i =−∞
n
i
F
n
i +1/2
− F
n
i −1/2
. (12.32)
We nowuse summation by parts, which just amounts to recombining the terms in each sum.
A simple example is
m
i =1
a
i
(b
i
−b
i −1
) = (a
1
b
1
−a
1
b
0
) +(a
2
b
2
−a
2
b
1
) +· · · +(a
m
b
m
−a
m
b
m−1
)
= −a
1
b
0
+(a
1
b
1
−a
2
b
1
) +(a
2
b
2
−a
3
b
2
)
+· · · +(a
m−1
b
m−1
−a
m
b
m−1
) +a
m
b
m
= a
m
b
m
−a
1
b
0
−
m−1
i =1
(a
i +1
−a
i
)b
i
. (12.33)
Note that the original sum involved the product of a
i
with differences of b’s, whereas the
ﬁnal sum involves the product of b
i
with differences of a’s. This is completely analogous
to integration by parts, where the derivative is moved from one function to the other. Just
as in integration by parts, there are also boundary terms a
m
b
m
−a
1
b
0
that arise.
We will use this on both sides of (12.32) (for the nsum on the left and for the i sum on
the right). By our assumption that φ has compact support,
n
i
=0 for i  or n sufﬁciently
large, and hence the boundary terms at i = ±∞, n = ∞all drop out. The only boundary
term that remains is at n = 0, where t
0
= 0. This gives
−
∞
i =−∞
0
i
Q
0
i
−
∞
n=1
∞
i =−∞
n
i
−
n−1
i
Q
n
i
=
t
x
∞
n=0
∞
i =−∞
n
i +1
−
n
i
F
n
i −1/2
.
242 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
Note that each of these sums is in fact a ﬁnite sum, since φ has compact support. Multiplying
by x and rearranging this equation gives
x t
¸
∞
¸
n=1
∞
¸
i =−∞
n
i
−
n−1
i
t
Q
n
i
+
∞
¸
n=0
∞
¸
i =−∞
n
i +1
−
n
i
x
F
n
i −1/2
¸
= −x
∞
¸
i =−∞
0
i
Q
0
i
. (12.34)
This transformation using summation by parts is completely analogous to the derivation of
(11.33) from (11.31).
Now let j → ∞, so that t
( j )
, x
( j )
→ 0 in (12.34). (Recall that all of the symbols
in that equation should also be indexed by ( j ) as we reﬁne the grid.) It is reasonably
straightforward, using the 1norm convergence of Q
( j )
to q and the smoothness of φ, to
show that the term on the top line of (12.34) converges to
∞
0
∞
−∞
φ
t
(x, t )q(x, t ) dx as
j →∞. If we deﬁne initial data Q
0
i
by taking cell averages of the data q
◦
(x), for example,
then the righthand side converges to −
∞
−∞
φ(x, 0)q(x, 0) dx as well.
The remaining termin (12.34), involving F
n
i −1/2
, is more subtle and requires the additional
assumptions on F and Q that we have imposed. For a threepoint method (such as Godunov’s
method), we have
F
n
i −1/2
≡ F
( j )n
i −1/2
= F
Q
( j )n
i −1
, Q
( j )n
i
,
and the consistency condition (4.15), with the choice ¯ q = Q
( j )n
i
, gives
F
( j )n
i −1/2
− f
Q
( j )n
i
≤ L
Q
( j )n
i
− Q
( j )n
i −1
, (12.35)
where L is the Lipschitz constant for the numerical ﬂux function. Since Q
( j )n
has bounded
total variation, uniformly in j , it must be that
F
( j )n
i −1/2
− f
Q
( j )n
i
→0 as j →∞
for almost all values of i . Using this and the fact that Q
( j )n
converges to q, it can be shown
that
x t
∞
¸
n=1
∞
¸
i =−∞
n
i +1
−
n
i
x
F
n
i −1/2
→
∞
0
∞
−∞
φ
x
(x, t ) f (q(x, t )) dx dt
as j → ∞, which completes the demonstration that (12.34) converges to the weak form
(12.30). Since this is true for any test function φ ∈ C
1
0
, we have proved that q is in fact a
weak solution.
For simplicity we assumed the numerical ﬂux F
n
i −1/2
depends only on the two neighbor
ing values Q
n
i −1
and Q
n
i
. However, the proof is easily extended to methods with a wider
stencil provided a more general consistency condition holds, stating that the ﬂux function
is uniformly Lipschitzcontinuous in all values on which it depends.
12.11 The Entropy Condition 243
12.11 The Entropy Condition
The Lax–Wendroff theorem does not guarantee that weak solutions obtained using con
servative methods satisfy the entropy condition. As we have seen in Section 12.3, some
additional care is required to insure that the correct weak solution is obtained.
For some numerical methods, it is possible to show that any weak solution obtained by
reﬁning the grid will satisfy the entropy condition. Of course this supposes that we have
a suitable entropy condition for the system to begin with, and the most convenient form
is typically the entropy inequality introduced in Section 11.14. Recall that this requires a
convex scalar entropy function η(q) and entropy ﬂux ψ(q) for which
∂
∂t
η (q(x, t )) +
∂
∂x
ψ (q(x, t )) ≤ 0 (12.36)
in the weak sense, i.e., for which the inequality (11.51) holds for all φ ∈ C
1
0
with φ(x, t ) ≥ 0
for all x, t :
∞
0
∞
−∞
[φ
t
(x, t )η(q(x, t )) +φ
x
(x, t )ψ(q(x, t ))] dx dt
+
∞
−∞
φ(x, 0)η(q(x, 0)) dx ≥ 0. (12.37)
In order to show that the weak solution q(x, t ) obtained as the limit of Q
( j )
satisﬁes this
inequality, it sufﬁces to show that a discrete entropy inequality holds, of the form
η
Q
n+1
i
≤ η
Q
n
i
−
t
x
n
i +1/2
−
n
i −1/2
. (12.38)
Here
n
i −1/2
= (Q
n
i −1
, Q
n
i
), where (q
l
, q
r
) is some numerical entropy ﬂux function that
must be consistent with ψ in the same manner that we require F to be consistent with
f . If we can show that (12.38) holds for a suitable , then mimicking the proof of the
Lax–Wendroff theorem (i.e., multiplying (12.38) by
n
i
, summing over i and n, and using
summation by parts), we can show that the limiting weak solution q(x, t ) obtained as the
grid is reﬁned satisﬁes the entropy inequality (12.37).
12.11.1 Entropy Consistency of Godunov’s Method
For Godunov’s method we can show that the numerical approximation will always satisfy
the entropy condition provided that the Riemann solution used to deﬁne the ﬂux at each cell
interface satisﬁes the entropy condition. Recall that we can interpret Godunov’s method as
an implementation of the REA Algorithm 4.1. The piecewise constant function ˜ q
n
(x, t
n
)
is constructed from the data Q
n
, and the exact solution ˜ q
n
(x, t
n+1
) to the conservation law
is then averaged on the grid to obtain Q
n+1
. What we now require is that the solution
˜ q
n
(x, t ) satisfy the entropy condition. If so, then integrating (12.36) over the rectangle
244 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
(x
i −1/2
, x
i +1/2
) ×(t
n
, t
n+1
) gives
x
i +1/2
x
i −1/2
η( ˜ q
n
(x, t
n+1
)) dx ≤
x
i +1/2
x
i −1/2
η( ˜ q
n
(x, t
n
)) dx
+
t
n+1
t
n
ψ
˜ q
n
x
i −1/2
, t
dt −
t
n+1
t
n
ψ
˜ q
n
x
i +1/2
, t
dt.
This is almost what we need. Since ˜ q
n
is constant along three of the four sides of this
rectangle, all integrals on the righthand side can be evaluated. Doing so, and dividing by
x, yields
1
x
x
i +1/2
x
i −1/2
η( ˜ q
n
(x, t
n+1
)) dx ≤ η
Q
n
i
−
t
x
ψ
Q
∨

i +1/2
−ψ
Q
∨

i −1/2
. (12.39)
Again Q
∨

i −1/2
represents the value propagating with velocity 0 in the solution of the Riemann
problem. If we deﬁne the numerical entropy ﬂux by
n
i −1/2
= ψ
Q
∨

i −1/2
, (12.40)
then is consistent with ψ, and the righthand side of (12.39) agrees with that of (12.38).
The lefthand side of (12.39) is not equal to η(Q
n+1
i
), because ˜ q
n
is not constant in
this interval. However, since the entropy function η is convex with η
(q) >0, we can use
Jensen’s inequality. This states that the value of η evaluated at the average value of ˜ q
n
is
less than or equal to the average value of η( ˜ q
n
), i.e.,
η
1
x
x
i +1/2
x
i −1/2
˜ q
n
(x, t
n+1
) dx
≤
1
x
x
i +1/2
x
i −1/2
η( ˜ q
n
(x, t
n+1
)) dx. (12.41)
The lefthand side here is simply η(Q
n+1
i
), while the righthand side is bounded by (12.39).
Combining (12.39), (12.40), and (12.41) thus gives the desired entropy inequality (12.38).
This shows that weak solutions obtained by Godunov’s method satisfy the entropy con
dition, provided we use entropysatisfying Riemann solutions at each cell interface. This
result is valid not only for scalar conservation laws. It holds more generally for any nonlinear
system for which we have an entropy function.
For the special case of a convex scalar conservation law, this simply means that we must
use a rarefaction wave when possible rather than an expansion shock in deﬁning the state
Q
∨

i −1/2
used to compute the Godunov ﬂux. However, as we have seen in Section 12.2, this
affects the value of Q
∨

i −1/2
only in the case of a transonic rarefaction. So we conclude that
Godunov’s method will always produce the vanishingviscosity solution to a convex scalar
conservation law provided that transonic rarefactions are handled properly.
12.12 Nonlinear Stability
The Lax–Wendroff theorempresented in Section 12.10 does not say anything about whether
the method converges, only that if a sequence of approximations converges, then the limit
is a weak solution. To guarantee convergence, we need some form of stability, just as for
12.12 Nonlinear Stability 245
linear problems. Unfortunately, the Lax equivalence theorem mentioned in Section 8.3.2
no longer holds, and we cannot use the same approach (which relies heavily on linearity)
to prove convergence.
The convergence proof of Section 8.3.1 can be used in the nonlinear case if the numerical
method is contractive in some norm. In particular, this is true for the class of monotone
methods. These are methods with the property that
∂ Q
n+1
i
∂ Q
n
j
≥ 0 (12.42)
for all values of j . This means that if we increase the value of any Q
n
j
at time t
n
, then the value
of Q
n+1
i
at the next time step cannot decrease as a result. This is suggested by the fact that
the true vanishingviscosity solution of a scalar conservation lawhas an analogous property:
If q
◦
(x) and p
◦
(x) are two sets of initial data and q
◦
(x) ≥ p
◦
(x) for all x, then q(x, t ) ≥ p(x, t )
for all x at later times as well. Unfortunately, this monotone property holds only for certain
ﬁrstorder accurate methods, and so this approach cannot be applied to the highresolution
methods of greatest interest. For more details on monotone methods see, for example, [96],
[156], [185], [281].
In this chapter we consider a form of nonlinear stability based on totalvariation bounds
that allows us to prove convergence results for a wide class of practical TVD or TVB
methods. So far, this approach has been completely successful only for scalar problems. For
general systems of equations with arbitrary initial data no numerical method has been proved
to be stable or convergent in general, although convergence results have been obtained in
some special cases (see Section 15.8.2).
12.12.1 Convergence Notions
To discuss the convergence of a grid function with discrete values Q
n
i
to a function q(x, t ),
it is convenient to deﬁne a piecewiseconstant function Q
(t )
(x, t ) taking the values
Q
(t )
(x, t ) = Q
n
i
for (x, t ) ∈
x
i −1/2
, x
i +1/2
×
t
n
, t
n+1
. (12.43)
We index this function by t because it depends on the particular grid being used. It
should really be indexed by x as well, but to simplify notation we suppose there is a
ﬁxed relation between x and t as we reﬁne the grid and talk about convergence as
t →0. In Section 12.10 a similar sequence of functions was considered and labeled Q
( j )
,
corresponding to a a grid with mesh spacing t
( j )
and x
( j )
. The same notation could be
used here, but it will be more convenient below to use t as the index rather than j .
One difﬁculty immediately presents itself when we contemplate the convergence of a
numerical method for conservation laws. The global error Q
(t )
(x, t ) −q(x, t ) is not well
deﬁned when the weak solution q is not unique. Instead, we measure the global error in our
approximation by the distance from Q
(t )
(x, t ) to the set of all weak solutions W,
W = {q : q(x, t ) is a weak solution to the conservation law}. (12.44)
To measure this distance we need a norm, for example the 1norm over some ﬁnite time
246 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
interval [0, T], denoted by
v
1,T
=
T
0
v(·, t )
1
dt
=
T
0
∞
−∞
v(x, t ) dx dt. (12.45)
The global error is then deﬁned by
dist
Q
(t )
, W
= inf
w∈W
Q
(t )
− q
1,T
. (12.46)
The convergence result we would now like to prove takes the following form:
If Q
(t )
is generated by a numerical method in conservation form, consistent with the
conservation law, and if the method is stable in some appropriate sense, then
dist
Q
(t )
, W
→ 0 as t → 0.
Note that there is no guarantee that Q
(t )
− q
1,T
→ 0 as t → 0 for any ﬁxed weak
solution q(x, t ). The computed Q
(t )
might be close to one weak solution for one value of
the time step t and close to a completely different weak solution for a slightly smaller
value of t . This is of no great concern, since in practice we typically compute only on
one particular grid, not a sequence of grids with t → 0, and what the convergence result
tells us is that by taking a ﬁne enough grid, we can be assured of being arbitrarily close to
some weak solution.
Of course, in situations where there is a unique physically relevant weak solution satisfy
ing some entropy condition, we would ultimately like to prove convergence to this particular
weak solution. This can be done if we also know that the method satisﬁes a discrete form of
the entropy condition, such as (12.38). For then we knowthat any limiting solution obtained
by reﬁning the grid must satisfy the entropy condition (see Section 12.11). Since the entropy
solution q(x, t ) to the conservation law is unique, this can be used to prove that in fact any
sequence Q
(t )
must converge to this function q as t → 0.
12.12.2 Compactness
In order to prove a convergence result of the type formulated above for nonlinear problems,
we must deﬁne an appropriate notion of stability. For nonlinear problems one very useful
tool for proving convergence is compactness, and so we will take a slight detour to deﬁne
this concept and indicate its use.
There are several equivalent deﬁnitions of a compact set within some normed space. One
deﬁnition, which describes the most important property of compact sets in relation to our
goals of deﬁning stability and proving convergence, is the following.
Deﬁnition 12.1. K is a compact set in some normed space if any inﬁnite sequence of
elements of K, {κ
1
, κ
2
, κ
3
, . . . }, contains a subsequence that converges to an element of K.
12.12 Nonlinear Stability 247
This means that from the original sequence we can, by selecting certain elements from
this sequence, construct a new inﬁnite sequence
κ
i
1
, κ
i
2
, κ
i
3
, . . .
(with i
1
< i
2
< i
3
< · · · )
that converges to some element κ ∈ K,
κ
i
j
−κ
→ 0 as j → ∞.
The fact that compactness guarantees the existence of convergent subsequences, combined
with the Lax–Wendroff theorem 12.1, will give us a convergence proof of the type formu
lated above.
Example 12.1. In the space Rwith normgiven by the absolute value, any closed interval is a
compact set. So, for example, any sequence of real numbers in [0, 1] contains a subsequence
that converges to a number between 0 and 1. Of course, there may be several different
subsequences one could extract, converging perhaps to different numbers. For example, the
sequence
{0, 1, 0, 1, 0, 1, . . . }
contains subsequences converging to 0 and subsequences converging to 1.
Example 12.2. In the same space as the previous example, an open interval is not compact.
For example, the sequence
{1, 10
−1
, 10
−2
, 10
−3
, . . . }
of elements lying in the open interval (0, 1) contains no subsequences convergent to an
element of (0, 1). Of course the whole sequence, and hence every subsequence, converges
to 0, but this number is not in (0,1).
Example 12.3. An unbounded set, e.g., [0, ∞), is not compact, since the sequence {1, 2,
3, . . . } contains no convergent subsequence.
Generalizing these examples, it turns out that in any ﬁnitedimensional normed linear
space, any closed and bounded set is compact. Moreover, these are the only compact sets.
Example 12.4. In the ndimensional space R
n
with any vector norm ·, the closed ball
B
R
= {x ∈ R
n
: x ≤ R}
is a compact set.
248 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
12.12.3 Function Spaces
Since we are interested in proving the convergence of a sequence of functions Q
(t )
(x, t ),
our deﬁnition of stability will require that all the functions lie within some compact set
in some normed function space. Restricting our attention to the time interval [0, T], the
natural function space is the space L
1,T
consisting of all functions of x and t for which the
norm (12.45) is ﬁnite,
L
1,T
= {v : v
1,T
< ∞}.
This is an inﬁnitedimensional space, and so it is not immediately clear what constitutes
a compact set in this space. Recall that the dimension of a linear space is the number of
elements in a basis for the space, and that a basis is a linearly independent set of elements
with the property that any element can be expressed as a linear combination of the basis
elements. Any space with n linearly independent elements has dimension at least n.
Example 12.5. The space of functions of x alone with ﬁnite 1norm is denoted by L
1
,
L
1
= {v(x) : v
1
< ∞}.
This space is clearly inﬁnitedimensional, since the functions
v
j
(x) =
1 if j < x < j +1,
0 otherwise
(12.47)
for j = 0, 1, 2, . . . are linearly independent, for example.
Unfortunately, in an inﬁnitedimensional space, a closed and bounded set is not neces
sarily compact, as the next example shows.
Example 12.6. The sequence of functions {v
1
, v
2
, . . . } with v
j
deﬁned by (12.47) all lie in
the closed and bounded unit ball
B
1
= {v ∈ L
1
: v
1
≤ 1},
and yet this sequence has no convergent subsequences.
The difﬁculty here is that the support of these functions is nonoverlapping and marches
off to inﬁnity as j →∞. We might try to avoid this by considering a set of the form
{v ∈ L
1
: v
1
≤ R and Supp(v) ⊂ [−M, M]}
for some R, M > 0, where Supp(v) denotes the support of the function v, i.e., Supp(v) ⊂
[−M, M] means that v(x) ≡0 for x > M. However, this set is also not compact, as shown
by the sequence of functions {v
1
, v
2
, . . . } with
v
j
(x) =
sin( j x) if x ≤ 1,
0 if x > 1.
12.12 Nonlinear Stability 249
Again this sequence has no convergent subsequences, now because the functions become
more and more oscillatory as j → ∞.
12.12.4 TotalVariation Stability
In order to obtain a compact set in L
1
, we will put a bound on the total variation of the
functions, a quantity already deﬁned in (6.19) through (6.21). The set
{v ∈ L
1
: TV(v) ≤ R and Supp(v) ⊂ [−M, M]} (12.48)
is a compact set, and any sequence of functions with uniformly bounded total variation and
support must contain convergent subsequences. (Note that the 1normwill also be uniformly
bounded as a result, with v
1
≤ MR.)
Since our numerical approximations Q
(t )
are functions of x and t , we need to bound
the total variation in both space and time. We deﬁne the total variation over [0, T] by
TV
T
(q) = limsup
→0
1
T
0
∞
−∞
q(x +, t ) −q(x, t ) dx dt
+ limsup
→0
1
T
0
∞
−∞
q(x, t +) −q(x, t ) dx dt. (12.49)
It can be shown that the set
K = {q ∈ L
1,T
: TV
T
(q) ≤ R and Supp(q(·, t )) ⊂ [−M, M] ∀t ∈ [0, T]} (12.50)
is a compact set in L
1,T
.
Since our functions Q
(t )
(x, t ) are always piecewise constant, the deﬁnition (12.49) of
TV
T
reduces to simply
TV
T
Q
(t )
=
T/t
n=0
∞
j =−∞
t
Q
n
i +1
− Q
n
i
+x
Q
n+1
i
− Q
n
i
. (12.51)
Note that we can rewrite this in terms of the onedimensional total variation and 1norm as
TV
T
Q
(t )
=
T/t
n=0
[t TV(Q
n
) +Q
n+1
− Q
n
1
]. (12.52)
Deﬁnition 12.2. We will say that a numerical method is totalvariationstable, or simply
TVstable, if all the approximations Q
(t )
for t <t
0
lie in some ﬁxed set of the form
(12.50) (where R and M may depend on the initial data q
◦
(x), the time T, and the ﬂux
function f (q), but not on t ).
Note that our requirement in (12.50) that Supp(q) be uniformly bounded over [0, T] is
always satisﬁed for any explicit method if the initial data q
◦
has compact support and t /x
is constant as t → 0. This follows from the ﬁnite speed of propagation for such a method.
The other requirement for TVstability can be simpliﬁed considerably by noting the
following theorem. This says that for the special case of functions generated by conservative
250 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
numerical methods, it sufﬁces to insure that the onedimensional total variation at each time
t
n
is uniformly bounded (independent of n). Uniform boundedness of TV
T
then follows.
Theorem12.2. Consider a conservative method with a Lipschitzcontinuous numerical ﬂux
F
n
i −1/2
, and suppose that for each initial data q
◦
there exist some t
0
, R > 0 such that
TV(Q
n
) ≤ R ∀n, t with t < t
0
, n t ≤ T. (12.53)
Then the method is TVstable.
To prove this theorem we use the following lemma, which is proved below.
Lemma 1. If Q
n
is generated by a conservative method with a Lipschitzcontinuous nu
merical ﬂux function, then the bound (12.53) implies that there exists α >0 such that
Q
n+1
− Q
n
1
≤ αt ∀n, t with t < t
0
, n t ≤ T. (12.54)
Proof of Theorem 12.2. Using (12.53) and (12.54) in (12.52) gives
TV
T
Q
(t )
=
T/t
n=0
[t TV(Q
n
) +Q
n+1
− Q
n
1
]
≤
T/t
n=0
[t R +α t ]
≤ t (R +α)T/t = (R +α)T
for all t < t
0
, showing that TV
T
(Q
(t )
) is uniformly bounded as t →0. This, together
with the ﬁnitespeedofpropagation argument outlined above, shows that all Q
(t )
lie in a
set of the form (12.50) for all t < t
0
and the method is TVstable.
Proof of Lemma 1. Recall that a method in conservation form has
Q
n+1
i
− Q
n
i
=
t
x
F
n
i +1/2
− F
n
i −1/2
and hence
Q
n+1
− Q
n
1
= t
∞
j =−∞
F
n
i +1/2
− F
n
i −1/2
. (12.55)
The ﬂux F
n
i −1/2
depends on a ﬁnite number of values Q
i −p
, . . . ,Q
i +r
. The bound (12.53)
together with the compact support of each Q
n
easily gives
Q
n
i
≤ R/2 ∀i, n with n t ≤ T. (12.56)
This uniform bound on Q
n
i
, together with the Lipschitz continuity of the ﬂux function,
allows us to derive a bound of the form
F
n
i +1/2
− F
n
i −1/2
≤ K max
−p≤j ≤r
Q
n
i +j
− Q
n
i +j −1
. (12.57)
12.12 Nonlinear Stability 251
It follows that
F
n
i +1/2
− F
n
i −1/2
≤ K
r
j =−p
Q
n
i +j
− Q
n
i +j −1
,
and so (12.55) gives
Q
n+1
− Q
n
1
≤ t K
r
j =−p
∞
i =−∞
Q
n
i +j
− Q
n
i +j −1
after interchanging sums. But now the latter sum is simply TV(Q
n
) for any value of j , and
so
Q
n+1
− Q
n
1
≤ t K
r
j =−p
TV(Q
n
)
≤ t K( p +r +1)R,
yielding the bound (12.54).
We are now set to prove our convergence theorem, which requires TVstability along
with consistency.
Theorem 12.3. Suppose Q
(t )
is generated by a numerical method in conservation form
with a Lipschitz continuous numerical ﬂux, consistent with some scalar conservation
law. If the method is TVstable, i.e., if TV(Q
n
) is uniformly bounded for all n, t with
t <t
0
, n t ≤T, then the method is convergent, i.e., dist(Q
(t )
, W) →0 as t →0.
Proof. To prove this theorem we suppose that the conclusion is false, and obtain a con
tradiction. If dist(Q
(t )
, W) does not converge to zero, then there must be some >0 and
some sequence of approximations {Q
(t
1
)
, Q
(t
2
)
, . . . } such that t
j
→0 as j →∞while
dist
Q
(t
j
)
, W
> for all j. (12.58)
Since Q
(t
j
)
∈ K(the compact set of (12.50)) for all j , this sequence must have a convergent
subsequence, converging to some function v ∈ K. Hence far enough out in this subsequence,
Q
(t
j
)
must satisfy
Q
(t
j
)
−v
1,T
< for all j sufﬁciently large (12.59)
for the deﬁned above. Moreover, since the Q
(t )
are generated by a conservative and
consistent method, it follows from the Lax–Wendroff theorem (Theorem 12.1) that the
limit v must be a weak solution of the conservation law, i.e., v ∈W. But then (12.59)
contradicts (12.58), and hence a sequence satisfying (12.58) cannot exist, and we conclude
that dist(Q
(t )
, W) →0 as t →0.
There are other ways to prove convergence of approximate solutions to nonlinear scalar
problems that do not require TVstability. This is particularly useful in more than one dimen
sion, where the total variation is harder to bound; see Section 20.10.2. For nonlinear systems
252 12 Finite Volume Methods for Nonlinear Scalar Conservation Laws
of equations it is impossible to bound the total variation in most cases, and convergence
results are available only for special systems; see Section 15.8.2.
Exercises
12.1. (a) Show that the method (12.5) with A
±
Q
i −1/2
deﬁned by (12.8) corresponds
to the ﬂux function (12.12) with a
i −1/2
given by Murman’s formula (12.14).
(b) Show that this has entropyviolating solutions by computing the ﬂux F
i −1/2
everywhere for Burgers’ equation with Riemann data q
l
= −1 and q
r
=1.
12.2. Show that the LLF method (12.12) is an Escheme.
12.3. Show that any Escheme is TVD if the Courant number is sufﬁciently small. Hint:
Use Theorem 6.1 with
C
i −1
=
t
x
f (Q
i −1
) − F
i −1/2
Q
i
− Q
i −1
(12.60)
and a suitable choice for D
i
.
12.4. Show that Jensen’s inequality (12.41) need not hold if η(q) is not convex.
13
Nonlinear Systems of Conservation Laws
In Chapter 3 we developed the theory of linear systems of hyperbolic equations, in which
case the general Riemann problem can be solved by decomposing the jump in states into
eigenvectors of the coefﬁcient matrix. Each eigenvector corresponds to a wave traveling
at one of the characteristic speeds of the system, which are given by the corresponding
eigenvalues of the coefﬁcient matrix.
In Chapter 11 we explored nonlinear scalar problems, and saw that when the wave
speed depends on the solution, then waves do not propagate unchanged, but in general
will deform as compression waves or expansion waves, and that shock waves can form
from smooth initial data. The solution to the Riemann problem (in the simplest case where
the ﬂux function is convex) then consists of a single shock wave or centered rarefaction
wave.
In this chapter we will see that these two theories can be melded together into an elegant
general theory for nonlinear systems of equations. As in the linear case, solving the Riemann
problem for a system of m equations will typically require splitting the jump in states into
m separate waves. Each of these waves, however, can now be a shock wave or a centered
rarefaction wave.
We will develop this general theory using the onedimensional shallow water equations
as a concrete example. The same theory will later be illustrated for several other systems of
equations, including the Euler equations of gas dynamics in Chapter 14. The shallow water
equations are a nice example to consider ﬁrst, for several reasons. It is a system of only two
equations, and hence the simplest step up from the scalar case. The nonlinear structure of
the equations is fairly simple, making it possible to solve the Riemann problem explicitly,
and yet the structure is typical of what is seen in other important examples such as the Euler
equations. Finally, it is possible to develop intuition quite easily for how solutions to the
shallow water equations should behave, and even perform simple experiments illustrating
some of the results we will see.
In [281] the isothermal equations are used as the primary example. This is also a simple
system of two equations with a nonlinear structure very similar to that of the shallow water
equations. This system is discussed brieﬂy in Section 14.6. More details and development
of the theory of nonlinear systems based on the isothermal equations may be found in
[281].
253
254 13 Nonlinear Systems of Conservation Laws
13.1 The Shallow Water Equations
To derive the onedimensional shallow water equations, we consider ﬂuid in a channel of
unit width and assume that the vertical velocity of the ﬂuid is negligible and the horizontal
velocity u(x, t ) is roughly constant throughout any cross section of the channel. This is true
if we consider smallamplitude waves in a ﬂuid that is shallow relative to the wavelength.
We nowassume the ﬂuid is incompressible, so the density ¯ ρ is constant. Instead we allow
the depth of the ﬂuid to vary, and it is this depth, or height h(x, t ), that we wish to determine.
The total mass in [x
1
, x
2
] at time t is
x
2
x
1
¯ ρh(x, t ) dx.
The density of momentum at each point is ¯ ρu(x, t ), and integrating this vertically gives
the mass ﬂux to be ¯ ρu(x, t )h(x, t ). The constant ¯ ρ drops out of the conservationofmass
equation, which then takes the familiar form (compare (2.32))
h
t
+(uh)
x
= 0. (13.1)
The quantity hu is often called the discharge in shallow water theory, since it measures the
ﬂow rate of water past a point.
The conservationofmomentum equation also takes the same form as in gas dynamics
(see (2.34)),
( ¯ ρhu)
t
+( ¯ ρhu
2
+ p)
x
= 0, (13.2)
but now p is determined from a hydrostatic law, stating that the pressure at distance h − y
below the surface is ¯ ρg(h − y), where g is the gravitational constant. This pressure arises
simply from the weight of the ﬂuid above. Integrating this vertically from y = 0 to y =
h(x, t ) gives the total pressure felt at (x, t ), the proper pressure term in the momentum ﬂux:
p =
1
2
¯ ρgh
2
. (13.3)
Using this in (13.2) and canceling ¯ ρ gives
(hu)
t
+
hu
2
+
1
2
gh
2
x
= 0. (13.4)
We can combine equations (13.1), (13.4) into the system of onedimensional shallow water
equations
h
hu
t
+
uh
hu
2
+
1
2
gh
2
x
= 0. (13.5)
Note that this is equivalent to the isentropic equations of gas dynamics (discussed in
Section 2.6) with the value γ = 2, since setting P(ρ) =
1
2
gρ
2
in (2.38) gives the same
system.
13.1 The Shallow Water Equations 255
If we assume that h and u are smooth, then equation (13.4) can be simpliﬁed by expanding
the derivatives and using (13.1) to replace the h
t
term. Then several terms drop out, and
(13.4) is reduced to
u
t
+
1
2
u
2
+ gh
x
= 0. (13.6)
Finally, the explicit dependence on g can be eliminated by introducing the variable ϕ = gh
into (13.1) and (13.6). The system then becomes
u
ϕ
t
+
u
2
/2 +ϕ
uϕ
x
= 0. (13.7)
This set of equations is equivalent to the previous set (13.5) for smooth solutions, but it
is important to note that the manipulations performed above depend on smoothness. For
problems with shock waves, the two sets of conservation laws are not equivalent, and we
know from Section 12.9 that it is crucial that we use the correct set in calculating shock
waves. The form (13.5), which is derived directly from the original integral equations, is
the correct set to use.
Since we will be interested in studying shock waves, we use the form (13.5) and take
q(x, t ) =
h
hu
=
q
1
q
2
, f (q) =
hu
hu
2
+
1
2
gh
2
=
q
2
(q
2
)
2
/q
1
+
1
2
g(q
1
)
2
.
For smooth solution, these equations can equivalently be written in the quasilinear form
q
t
+ f
(q)q
x
= 0,
where the Jacobian matrix f
(q) is
f
(q) =
0 1
−(q
2
/q
1
)
2
+ gq
1
2q
2
/q
1
=
0 1
−u
2
+ gh 2u
. (13.8)
The eigenvalues of f
(q) are
λ
1
= u −
gh, λ
2
= u +
gh, (13.9)
with the corresponding eigenvectors
r
1
=
1
u −
√
gh
, r
2
=
1
u +
√
gh
. (13.10)
Note that the eigenvalues and eigenvectors are functions of q for this nonlinear system.
If we wish to study waves with very small amplitude, then we can linearize these equa
tions to obtain a linear system. Suppose the ﬂuid is essentially at a constant depth h
0
>0
and moving at a constant velocity u
0
(which may be zero), and let q now represent the
perturbations from this constant state, so
q =
h −h
0
hu −h
0
u
0
and q
0
=
h
0
h
0
u
0
.
256 13 Nonlinear Systems of Conservation Laws
Then expanding the ﬂux function and dropping terms of O(q
2
) gives the linear system
q
t
+ Aq
x
= 0 where A = f
(q
0
). Hence smallamplitude waves move at the characteristic
velocities λ
1
0
= u
0
− c
0
and λ
2
0
= u
0
+ c
0
, where c
0
=
√
gh
0
. These waves propagate at
speed ±c
0
relative to the ﬂuid, exactly analogous to acoustic waves in a moving ﬂuid as in
Section 2.8. These shallowwater waves should not be confused with sound waves, however.
Sound does propagate in water, due to its slight compressibility, but in the shallow water
equations we are ignoring this compressibility and hence ignoring sound waves. The waves
we are modeling are often called gravity waves, since they are driven by the hydrostatic
pressure resulting from gravity. They typically propagate at a speed
√
gh that is much less
than the speed of sound in water.
Note that λ
1
and λ
2
can be of either sign, depending on the magnitude of u relative to c.
In shallow water theory the ratio
Fr = u/c (13.11)
is called the Froude number, and is analogous to the Mach number of gas dynamics.
The wave speed
√
gh
0
depends on the depth of the ﬂuid; waves in deeper water move
faster. Note that within a wave the depth of the ﬂuid varies (it is deeper at a crest than in
a trough), and so we should expect the crest of a wave to propagate slightly faster than
a trough. If the amplitude of the wave is very small compared to h
0
, then we can safely
ignore this slight variation in speed, which is what we do in linearizing the equations. Then
all parts of the wave travel at the same speed based on the background depth h
0
, and the
wave propagates with its shape unchanged. For waves with larger amplitude, however, the
deformation of the wave due to differing wave speeds may be quite noticeable. In this case
the linearized equations will not be an adequate model and the full nonlinear equations must
be solved.
The nonlinear distortion of a wave leads to a steepening of the wave in the region where
the fastmoving crest is catching up with the slower trough ahead of it (a compression wave),
and a ﬂattening of the wave (an expansion or rarefaction) in the region where the crest is
pulling away from the following trough. This is similar to what is illustrated in Figure 11.1
for the nonlinear equations of trafﬁc ﬂow.
This behavior is familiar from watching waves break on the beach. Far from shore the
waves we normally observe have a wavelength that is very small compared to the water
depth, and hence they are governed by surfacewave theory rather than shallow water
theory. Near the beach, however, the water depth is small enough that nonlinear shallow
water theory applies. In this shallow water, the difference in h between crests and troughs
is signiﬁcant and the waves steepen. In fact the crest is often observed to move beyond the
position of the preceding trough, somewhat like what is shown in Figure 11.4(b). At this
point the assumptions of shallow water theory no longer hold, and a more complicated set
of equations would have to be used to model breakers. Beyond the breaking time the depth
h is triplevalued, a situation that obviously can’t occur with other systems of conservation
laws (such as trafﬁc ﬂow or gas dynamics) where the corresponding variable is a density
that must be singlevalued.
This extreme behavior of breaking waves results from the additional complication of a
sloping beach. This leads to a continuous decrease in the ﬂuid depth seen by the wave and
a severe accentuation of the nonlinear effects. (The sloping beach, or more generally any
13.1 The Shallow Water Equations 257
variation in the bottomtopography, also leads to additional source terms in the shallowwater
equations.) Shallow water waves in a domain with a ﬂat bottom will typically not exhibit
this type of breakers. Instead the gradual steepening of the wave due to nonlinearity would
be counterbalanced by other effects such as surface tension (and also the vertical velocity,
which is ignored in the onedimensional model). Modeling these other effects would lead
to higherorder derivatives in the equations (with small coefﬁcients) and consequently the
equations would have smooth solutions for all time, analogous to what is seen in Figure 11.6
for the viscous scalar equation. When these coefﬁcients are small, the wave can become
nearly discontinuous, and the shockwave solution to the hyperbolic system gives a good
approximation to such solutions. In shallow water ﬂow, a shock wave is often called a
hydraulic jump.
Example 13.1. Figure 13.1 shows the evolution of a hump of water (with initial velocity 0).
As with the acoustics equations (see Figure 3.1), the hump gives rise to two waves, one
moving in each direction. If the height of the hump were very small compared to the
−5 −4 −3 −2 −1 0 1 2 3 4 5
0.5
1
1.5
h at t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
hu at t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
0.5
1
1.5
h at t = 0.5
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
hu at t = 0.5
−5 −4 −3 −2 −1 0 1 2 3 4 5
0.5
1
1.5
h at t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
hu at t = 1
−5 −4 −3 −2 −1 0 1 2 3 4 5
0.5
1
1.5
h at t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
hu at t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
0.5
1
1.5
h at t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
hu at t = 3
Fig. 13.1. Evolution of an initial depth perturbation, concentrated near the origin, into leftgoing and
rightgoing waves. The shallow water equations are solved with g = 1. The left column shows the
depth q
1
= h, the right column shows the momentum q
2
= hu. [claw/book/chap13/swhump]
258 13 Nonlinear Systems of Conservation Laws
0
1
2
0
1
2
0
0.5
1
1.5
time = 7.2
0
1
2
0
1
2
0
0.5
1
1.5
time = 7.6
Fig. 13.2. Shallow water sloshing in a rectangular pan that is oscillated along the diagonal.
[claw/book/chap13/slosh]
background depth h
0
=1, then these would propagate with their shape essentially un
changed, at the characteristic speeds ±
√
gh
0
=1. In Figure 13.1 the variation in depth
is sufﬁciently large that the nonlinearity plays a clear role, and each wave shows the same
behavior as the nonlinear trafﬁcﬂowexample of Figure 11.1. The front of the wave (relative
to its direction of motion) steepens through a compression wave into a shock, while the
back spreads out as a rarefaction wave.
Example 13.2. One can experiment with shock waves in shallow water by putting a little
water into a shallow rectangular pan and adding some food coloring to make the waves
more visible. Oscillate the pan slowly along one axis and you should be able to excite a
single “shock wave” propagating back and forth in the dish. Oscillate the dish along the
diagonal and a pair of waves will be excited as shown in Figure 13.2.
Example 13.3. A stationary shock wave of the sort shown in Figure 13.3 is easily viewed
in the kitchen sink. Turn on the faucet and hold a plate in the stream of water, a few inches
below the faucet. You should see a roughly circular region on the surface of the plate where
the water ﬂows very rapidly outwards away from the stream in a very thin layer. This
Fig. 13.3. Cartoon of water coming out of a faucet and hitting a horizontal surface such as the sink. The
water expands outwards in a thin layer that suddenly thickens through a hydraulic jump (stationary
shock wave).
13.2 DamBreak and Riemann Problems 259
region is bounded by a hydraulic jump, where the depth of the water suddenly increases
and its speed abruptly decreases. By adjusting the ﬂow rate or angle of the plate you should
be able to make the location of this shock wave move around. When the conditions are
ﬁxed, the shock is stationary and has zero propagation speed. This can be modeled by the
twodimensional shallow water equations, or in the radially symmetric case by the one
dimensional equations with additional source terms incorporated to model the geometric
effects as described in Section 18.9.
13.2 DamBreak and Riemann Problems
Consider the shallow water equations (13.5) with the piecewiseconstant initial data
h(x, 0) =
h
l
if x < 0,
h
r
if x > 0,
u(x, 0) = 0, (13.12)
where h
l
> h
r
≥ 0. This is a special case of the Riemann problem in which u
l
= u
r
= 0,
and is called the dambreak problem because it models what happens if a dam separating
two levels of water bursts at time t = 0. This is the shallow water equivalent of the shock
tube problem of gas dynamics (Section 14.13). We assume h
r
> 0.
Example 13.4. Figure 13.4 shows the evolution of the depth and ﬂuid velocity for the dam
break problem with data h
l
= 3 and h
r
= 1. Figure 13.5 shows the structure of this solution
in the x–t plane. Water ﬂows fromleft to right in a wedge that expands fromthe damlocation
x = 0. At the right edge of this wedge, moving water with some intermediate depth h
m
and
velocity u
m
> 0 slams into the stationary water with h = h
r
, accelerating it instantaneously
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
0.5
1
1.5
2
2.5
3
3.5
h at t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
2
hu at t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
0.5
1
1.5
2
2.5
3
3.5
h at t = 0.5
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
2
hu at t = 0.5
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
0.5
1
1.5
2
2.5
3
3.5
h at t = 2
−5 −4 −3 −2 −1 0 1 2 3 4 5
−0.5
0
0.5
1
1.5
2
hu at t = 2
Fig. 13.4. Solution of the dambreak Riemann problem for the shallow water equations with
u
l
=u
r
=0. On the left is the depth h and on the right is the momentum hu. [claw/book/
chap13/dambreak]
260 13 Nonlinear Systems of Conservation Laws
−2 −1 0 1 2
1
1.5
2
2.5
3
Height
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
Velocity
−2 −1 0 1 2
1
2
3
4
Vertically integrated pressure
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
Particle paths in x–t plane
Fig. 13.5. Structure of the similarity solution of the dambreak Riemann problem for the shallow
water equations with u
l
=u
r
=0. The depth h, velocity u, and vertically integrated pressure are
displayed as functions of x/t . The structure in the x–t plane is also shown with particle paths
indicated for a set of particles with the spacing between particles inversely proportional to the depth.
[claw/book/chap13/rpsoln]
through a shock wave. This is roughly analogous to the trafﬁcjam shock wave studied in
Section 11.1. On the left edge, the water is accelerated away from the deeper stationary
water through the structure of a centered rarefaction wave, analogous to the accelerating
trafﬁc situation of Section 11.1. For the scalar trafﬁc ﬂowmodel, we observed either a shock
wave or a rarefaction wave as the Riemann solution, depending on the particular data. The
shallowwater equations are a systemof two equations, and so the Riemann solution contains
two waves. For the case of the dambreak problem (u
l
= u
r
= 0), these always consist of
one shock and one rarefaction wave.
Figure 13.5 shows the structure of the exact similarity solution of this Riemann problem,
along with particle paths in x–t plane. Note that the ﬂuid is accelerated smoothly through
the rarefaction wave and abruptly through the shock. The formulas for this solution will be
worked out in Section 13.9 after developing the necessary background.
13.3 Characteristic Structure
Figure 13.6 shows the characteristic structure of the dambreak problem with data (13.12)
in the case h
l
> h
r
. Figure 13.6(a) shows typical characteristic curves satisfying d X/dt =
λ
1
= u −
√
gh (called 1characteristics), while Figure 13.6(b) shows the 2characteristic
curves satisfying d X/dt = λ
2
= u+
√
gh. Note that each characteristic direction is constant
(the curves are straight lines) in each wedge where q is constant.
13.3 Characteristic Structure 261
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
1–characteristics in the x–t plane
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
2–characteristics in the x–t plane
(a) (b)
Fig. 13.6. Solution of the dambreak Riemann problem for the shallow water equations, shown in
the x–t plane. The dark lines show the shock wave and the edges of the rarefaction wave seen in
Figure 13.4. The lighter lines show 1characteristics and 2characteristics.
In Figure 13.6(a) we see that the 1characteristics behave near the 1rarefaction wave just
as we would expect from the nonlinear scalar case. They spread out through the rarefaction
wave, and the edges of this wave move with the characteristic velocity in each constant
region bounding the rarefaction. Also note that the 1characteristics cross the 2waves in
the sense that they are approaching the 2wave on one side (for smaller time t ) and then
moving away from the 2wave on the other side, for larger t .
Onthe other hand, 2characteristics showninFigure 13.6(b) impinge onthe 2shock, again
as we would expect fromthe scalar theory. These characteristics cross the 1rarefaction with
a smooth change in velocity.
This is the standard situation for many nonlinear systems of equations. For a system of m
equations, there will be m characteristic families and m waves in the solution to the Riemann
problem. If the pth wave is a shock, then characteristics of families 1 through p − 1 will
cross the shock from left to right, characteristics of family p +1 through m will cross from
right to left, and characteristics of family p will impinge on the shock from both sides. This
classical situation is observed in many physical problems, including the Euler equations of
gas dynamics, and is the case that is best understood mathematically. Such shocks are often
called classical Lax shocks, because much of this theory was developed by Peter Lax.
In order for the classical situation to occur, certain conditions must be satisﬁed by the
ﬂux function f (q). We assume the system is strictly hyperbolic, so the eigenvalues are
always distinct. The conditions of genuine nonlinearity must also be satisﬁed, analogous
to the convexity condition for scalar equations. This as discussed further in Section 13.8.4.
Otherwise the Riemann solution can be more complicated. As in the nonconvex scalar
case discussed in Section 16.1, there can be compound waves in some family consist
ing of more than a single shock or rarefaction. For systems it could also happen that the
number of characteristics impinging on a shock is different from what has just been de
scribed, and the shock is overcompressive or undercompressive. See Section 16.2 for further
discussion.
262 13 Nonlinear Systems of Conservation Laws
13.4 A TwoShock Riemann Solution
The shallow water equations are genuinely nonlinear, and so the Riemann problem always
consists of two waves, each of which is a shock or rarefaction. In Example 13.4 the solution
consists of one of each. The following example shows that other combinations are possible.
Example 13.5. Consider the Riemann data
h(x, 0) ≡ h
0
, u(x, 0) =
u
l
if x < 0,
−u
l
if x > 0.
(13.13)
If u
l
> 0, then this corresponds to two streams of water slamming into each other, with
the resulting solution shown in Figure 13.7 for the case h
0
= 1 and u
l
= 1. The solution
is symmetric in x with h(−x, t ) = h(x, t ) and u(−x, t ) = −u(x, t ) at all times. A shock
wave moves in each direction, bringing the ﬂuid to rest, since the middle state must have
u
m
= 0 by symmetry. The solution to this problem is computed in Section 13.7.1.
The characteristic structure of this solution is shown in Figure 13.8. Note again that 1
characteristics impinge on the 1shock while crossing the 2shock, whereas 2characteristics
impinge on the 2shock.
Note that if we look at only half of the domain, say x < 0, then we obtain the solution
to the problem of shallow water ﬂowing into a wall located at x = 0 with velocity u
l
. A
shock wave moves out from the wall, behind which the ﬂuid is at rest. This is now exactly
analogous to trafﬁc approaching a red light, as shown in Figure 11.2.
−1 −0.5 0 0.5 1
1
1.1
1.2
1.3
1.4
1.5
1.6
Height
−1 −0.5 0 0.5 1
−0.4
−0.2
0
0.2
0.4
0.6
Velocity
−1 −0.5 0 0.5 1
0.5
0.6
0.7
0.8
0.9
1
1.1
1.2
Vertically integrated pressure
−1 −0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
Particle paths in x–t plane
Fig. 13.7. Structure of the similarity solution of the twoshock Riemann problem for the shallow
water equations with u
l
= − u
r
. The depth h, velocity u, and vertically integrated pressure are
displayed as functions of x/t . The structure in the x–t plane is also shown with particle paths
indicated for a set of particles with the spacing between particles inversely proportional to the depth.
[claw/book/chap13/twoshock]
13.6 Strategy for Solving the Riemann Problem 263
−1 −0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
1–characteristics in the x–t plane
−1 −0.5 0 0.5 1
0
0.2
0.4
0.6
0.8
1
2–characteristics in the x–t plane
Fig. 13.8. Solution of the twoshock Riemann problem for the shallow water equations, shown
in the x–t plane. The dark lines show the shocks. The lighter lines show 1characteristics and 2
characteristics.
13.5 Weak Waves and the Linearized Problem
To understand the characteristic structure of the shallow water equations, it is useful to
consider what happens in the solution to the Riemann problems discussed above in the case
where the initial jump is so small that the linearized equation gives a good model. Consider
the data (13.12), for example, with h
l
= h
0
+ and h
r
= h
0
− for some h
0
. Then if
we solve the Riemann problem for the linearized equation with u
0
= 0 in (13.8), we ﬁnd
that the solution consists of two acoustic waves with speeds ±
√
gh
0
, separated by a state
(h
m
, u
m
) with
h
m
= h
0
, u
m
=
gh
0
.
The solution consists of two discontinuities. If we solved the nonlinear equations with
this same data, the solution would look quite similar, but the leftgoing wave would be a
weak rarefaction wave, spreading very slightly with time, and with the 1characteristics
spreading slightly apart rather than being parallel as in the linear problem. The rightgoing
wave would be a weak shock wave, with slightly converging characteristics.
13.6 Strategy for Solving the Riemann Problem
Above we have presented a few speciﬁc examples of Riemann solutions for the shallow
water equations. In order to apply Riemannsolverbased ﬁnite volume methods, we must
be able to solve the general Riemann problem with arbitrary left and right states q
l
and q
r
.
To compute the exact solution, we must do the following:
1. Determine whether each of the two waves is a shock or a rarefaction wave (perhaps using
an appropriate entropy condition).
2. Determine the intermediate state q
m
between the two waves.
3. Determine the structure of the solution through any rarefaction waves.
The ﬁrst and third of these are similar to what must be done for a nonlinear scalar equation,
while the second step corresponds to the procedure for solving the Riemann problem for
264 13 Nonlinear Systems of Conservation Laws
a linear system, in which the Rankine–Hugoniot jump relations must be used to split the
jump q
r
− q
l
into a set of allowable waves. In the next few chapters we will explore each
of the necessary ingredients in more detail.
In practical ﬁnite volume methods, this process is often simpliﬁed by using an approxi
mate Riemann solver as discussed in Section 15.3. Computing the exact Riemann solution
can be expensive, and often excellent computational results are obtained with suitable
approximations.
13.7 Shock Waves and Hugoniot Loci
In this section we begin this process by studying an isolated shock wave separating two
constant states. We will determine the relation that must hold across such a shock and its
speed of propagation. For an arbitrary ﬁxed state we will determine the set of all other
states that could be connected to this one by a shock of a given family. This is a necessary
ingredient in order to solve a general Riemann problem.
We will continue to use the shallowwater equations as the primary example system. Con
sider, for example, a shallow water 2shock such as the rightgoing shock of Example 13.4
or Example 13.5. This shock connects some state q
m
to the right state q
r
from the Riemann
data. We will viewq
r
as being ﬁxed and determine all possible states q that can be connected
to q
r
by a 2shock. We will ﬁnd that there is a oneparameter family of such states, which
trace out a curve in state space as shown in Figure 13.9(b). Here the state space (phase plane)
is the h–hu plane. This set of states is called a Hugoniot locus.
Which one of these possible states corresponds to q
m
in the solution to the Riemann
problem depends not only on q
r
but also on q
l
. The state q
m
must lie on the curve shown in
Figure 13.9(b), but it must also lie on an analogous curve of all states that can be connected
to q
l
by a 1wave, as determined below. This is completely analogous to the manner in
which the linear Riemann problem was solved in Chapter 3.
(a)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
1–shocks
q
l
(b)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
2–shocks
q
r
Fig. 13.9. (a) Hugoniot locus of points q in shallow water state space that can be connected to a given
state q
l
by a 1shock satisfying the Rankine–Hugoniot conditions. Only some of these states (on the
solid portion of the curves) satisfy the entropy condition; see Section 13.7.2. (b) Hugoniot locus of
points in shallow water state space that can be connected to a given state q
r
by a 2shock satisfying
the Rankine–Hugoniot conditions (13.15).
13.7 Shock Waves and Hugoniot Loci 265
We now consider the problem of determining all states q that can be connected to some
ﬁxed state q
∗
(representing either q
l
or q
r
) by a shock. Recall from Section 11.8 that across
any shock the Rankine–Hugoniot condition (11.20) must be satisﬁed, so
s(q
∗
−q) = f (q
∗
) − f (q). (13.14)
For the shallow water equations, this gives a system of two equations that must simultane
ously be satisﬁed:
s(h
∗
−h) = h
∗
u
∗
−hu,
s(h
∗
u
∗
−hu) = h
∗
u
2
∗
−hu
2
+
1
2
g(h
2
∗
−h
2
).
(13.15)
Recall that (h
∗
, u
∗
) is ﬁxed and we wish to ﬁnd all states (h, u) and corresponding speeds s
satisfying these relations. We thus have two equations with three unknowns, so we expect to
ﬁnd a oneparameter family of solutions. In fact there are two distinct families of solutions,
corresponding to 1shocks and 2shocks. For the time being we use the term “shock” to
refer to a discontinuous weak solution satisfying the Rankine–Hugoniot condition. Later
we will consider the additional admissibility condition that is required to ensure that such
a solution is truly a physical shock wave.
There are many different ways to parameterize these families. Fairly simple formulas
result fromusing h as the parameter. For each value of h we will determine the corresponding
u and s, and plotting hu against h will give the curves shown in Figure 13.9.
We ﬁrst determine u by eliminating s from the system (13.15). The ﬁrst equation gives
s =
h
∗
u
∗
−hu
h
∗
−h
, (13.16)
and substituting this into the second equation gives an equation relating u to h. This is a
quadratic equation in u that, after simplifying somewhat, becomes
u
2
−2u
∗
u +
u
2
∗
−
g
2
h
∗
h
−
h
h
∗
(h
∗
−h)
= 0,
with roots
u(h) = u
∗
±
g
2
h
∗
h
−
h
h
∗
(h
∗
−h). (13.17)
Note that when h = h
∗
this reduces to u = u
∗
, as we expect, since the curves we seek must
pass through the point (h
∗
, u
∗
).
For each h = h
∗
there are two different values of u, corresponding to the two families
of shocks. In the case of a very weak shock (q ≈ q
∗
) we expect the linearized theory to
hold, and so we expect one of these curves to be tangent to the eigenvector r
1
(q
∗
) at q
∗
and
the other to be tangent to r
2
(q
∗
). This allows us to distinguish which curve corresponds to
the 1shocks and which to 2shocks. To see this more clearly, we multiply (13.17) by h and
reparameterize by a value α, with
h = h
∗
+α,
266 13 Nonlinear Systems of Conservation Laws
so that h = h
∗
at α = 0, to obtain
hu = h
∗
u
∗
+α
u
∗
±
gh
∗
1 +
α
h
∗
1 +
α
2h
∗
. (13.18)
Hence we have
q = q
∗
+α
1
u
∗
±
√
gh
∗
+O(α)
as α →0.
For α very small (as q approaches q
∗
), we can ignore the O(α) term and we see that these
curves approach the point q
∗
tangent to the vectors
1
u
∗
±
√
gh
∗
,
which are simply the eigenvectors of the Jacobian matrix (13.8) at q
∗
. From this we see that
choosing the −sign in (13.18) gives the locus of 1shocks, while the +sign gives the locus
of 2shocks. (Note: The same is not true in (13.17), where choosing a single sign gives part
of one locus and part of the other as h varies.)
13.7.1 The AllShock Riemann Solution
Now consider a general Riemann problem with data q
l
and q
r
, and suppose we know that
the solution consists of two shocks. We can then solve the Riemann problem by ﬁnding the
state q
m
that can be connected to q
l
by a 1shock and also to q
r
by a 2shock.
We found in the previous section that through the point q
r
there is a curve of points q that
can be connected to q
r
by a 2shock. For the shallow water equations, these points satisfy
(13.18) with the plus sign and with q
∗
= q
r
. Since q
m
must lie on this curve, we have
h
m
u
m
= h
r
u
r
+(h
m
−h
r
)
u
r
+
gh
r
1 +
h
m
−h
r
h
r
1 +
h
m
−h
r
2h
r
,
which can be simpliﬁed to give
u
m
= u
r
+(h
m
−h
r
)
g
2
1
h
m
+
1
h
r
. (13.19)
Similarly, there is a curve through q
l
of states that can be connected to q
l
by a 1shock,
obtained by setting q
∗
= q
l
and taking the minus sign in (13.18). Since q
m
must lie on this
curve, we ﬁnd that
u
m
= u
l
−(h
m
−h
l
)
g
2
1
h
m
+
1
h
l
. (13.20)
We thus have a system of two equations (13.19) and (13.20) for the two unknowns h
m
and
u
m
. Solving this system gives the desired intermediate state in the Riemann solution. We
13.7 Shock Waves and Hugoniot Loci 267
(a)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
l
q
r
q
m
(b)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
l
q
r
q
m
Fig. 13.10. Allshock solutions to the shallow water Riemann problem can be constructed by ﬁnding
the intersection of the appropriate Hugoniot loci. (a) For Example 13.6. (b) An entropyviolating
Riemann solution for Example 13.7.
can easily eliminate u
m
from this system by noting that this appears only on the left of each
equation, and the lefthand sides are equal, so equating the righthand sides gives a single
equation involving only the one unknown h
m
. This can be solved by an iterative method for
nonlinear equations, such as Newton’s method.
This is analogous to solving the Riemann problem for a linear hyperbolic system, as
discussed in Chapter 3, but in that case a linear system of equations results, which is more
easily solved for the intermediate state.
Example 13.6. Consider the shallow water Riemann problem with h
l
= h
r
= 1, u
l
= 0.5,
and u
r
= −0.5, as in Example 13.5. Figure 13.10(a) shows the states q
l
, q
r
, and q
m
in the
phase plane, together with the Hugoniot loci of 1shocks through q
l
and 2shocks through
q
r
. In this case we could use our knowledge that u
m
=0 to simplify the above system
further, using either (13.19) or (13.20) with the lefthand side replaced by 0. We ﬁnd that
the solution is h
m
=2.1701.
Example 13.7. What happens if we apply this same procedure to a Riemann problemwhere
the physical solution should not consist of two shocks? For example, consider the dambreak
Riemann problem of Example 13.4, where the solution should consist of a 1rarefaction
and a 2shock. We can still solve the problem in terms of two “shock waves” that satisfy
the Rankine–Hugoniot jump conditions, as illustrated in Figure 13.10(b). This gives a weak
solution of the conservation laws, but one that does not satisfy the proper entropy condition
for this system, as discussed in the next section. The procedure for ﬁnding the physically
correct solution with a rarefaction wave is given in Section 13.9.
13.7.2 The Entropy Condition
Figure 13.6 shows the characteristic structure for the physically correct solution to the dam
break Riemann problem of Example 13.4. Figure 13.11 shows the structure for the weak
solution found in Example 13.7, which consists of two discontinuities. The 1characteristics
268 13 Nonlinear Systems of Conservation Laws
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
1–characteristics in the x–t plane
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
2–characteristics in the x–t plane
Fig. 13.11. Entropyviolating solution of the dambreak Riemann problemfor the shallowwater equa
tions, shown in the x–t plane. The dark lines showthe shocks. The lighter lines show1characteristics
and 2characteristics.
are not impinging on the 1shock as they should, an indication that this structure is not stable
to small perturbations and that this shock should be replaced by a rarefaction wave.
This suggests the following criterion for judging whether a given weak solution is in
fact the physically correct solution, a generalization of the Lax Entropy Condition 11.1 to
systems of equations.
Entropy Condition 13.1 (Lax). A discontinuity separating states q
l
and q
r
, propagating at
speed s, satisﬁes the Lax entropy condition if there is an index p such that
λ
p
(q
l
) > s > λ
p
(q
r
), (13.21)
so that pcharacteristics are impinging on the discontinuity, while the other characteristics
are crossing the discontinuity,
λ
j
(q
l
) < s and λ
j
(q
r
) < s for j < p,
λ
j
(q
l
) > s and λ
j
(q
r
) > s for j > p.
(13.22)
In this deﬁnition we assume the eigenvalues are ordered so that λ
1
< λ
2
< · · · < λ
m
in
each state.
This condition can be shown to be correct for strictly hyperbolic conservation laws in
which each ﬁeld is genuinely nonlinear (as deﬁned in Section 13.8.4). For the nonstrictly
hyperbolic case shocks may instead be overcompressive or undercompressive with a dif
ferent number of characteristics impinging, as described in Section 16.2.
For the shallow water equations there is a simple criterion that can be applied to deter
mine which parts of each Hugoniot locus give physically correct shock waves satisfying
the Lax entropy condition. Across a 1shock connecting q
l
to a state q
m
, we require that
the characteristic velocity λ
1
=u −
√
gh must decrease. In conjunction with the Rankine–
Hugoniot condition, it can be shown that this implies that h must increase, so we require
13.8 Simple Waves and Rarefactions 269
h
m
>h
l
. Similarly, a 2shock connecting q
m
to q
r
satisﬁes the Lax entropy condition if
h
m
> h
r
. Note from Figure 13.5 and Figure 13.7 that this also means that ﬂuid particles
experience an increase in depth as they pass through a shock. This is similar to the phys
ical entropy condition for gas dynamics, that gas particles must experience an increase in
physical entropy as they pass through a shock wave.
Figure 13.10shows the portions of eachHugoniot locus alongwhichthe entropycondition
is satisﬁed as solid lines. These are simply the portions along which h is increasing. The
portions indicated by dashed lines are states that can be connected by a discontinuity that
satisﬁes the Rankine–Hugoniot condition, but not the entropy condition.
We see from Figure 13.10(b) that the solution to the dambreak Riemann problem con
sisting of two shocks fails to satisfy the entropy condition. Instead we must ﬁnd a solution
to the Riemann problem that consists of a 1rarefaction and a 2shock. In the next section
we investigate rarefaction waves and will see that the Hugoniot locus through q
l
must be
replaced by a different curve, the integral curve of r
1
. The intersection of this curve with
the 1shock Hugoniot locus will give the correct intermediate state q
m
, as described in
Section 13.9.
The shallow water equations also possess a convex entropy function η(q); see
Exercise 13.6. From this it follows that Godunov’s method will converge to the physi
cally correct solution, if the correct entropy solution to each Riemann problem is used; see
Section 12.11.1.
13.8 Simple Waves and Rarefactions
Solutions to a hyperbolic system of m equations are generally quite complicated, since at
any point there are typically m waves passing by, moving at different speeds, and what we
observe is some superposition of these waves. In the nonlinear case the waves are constantly
interacting with one another as well as deforming separately, leading to problems that
generally cannot be solved analytically. It is therefore essential to look for special situations
in which a single wave from one of the characteristic families can be studied in isolation.
A shock wave consisting of piecewise constant data (satisfying the Rankine–Hugoniot
conditions across the discontinuity) is one important example that was investigated in the
previous section.
In this section we will investigate solutions that are smoothly varying (rather than discon
tinuous) but whichalsohave the propertythat theyare associatedwithonlyone characteristic
family of the system. Such waves are called simple waves. These have already been intro
duced for linear systems in Section 3.4. In the linear case simple waves have ﬁxed shape
and propagate with ﬁxed speed according to a scalar advection equation. In the nonlinear
case they will deform due to the nonlinearity, but their evolution can be modeled by scalar
nonlinear equations.
Inparticular, the centeredrarefactionwaves that arise inthe solutiontoRiemannproblems
for nonlinear systems are simple waves, but these are just one special case. They are special
in that they also have the property that they are similarity solutions of the equations and
are constant along every ray x/t = constant. They arise naturally from Riemann problems
because of the special data used, which varies only at a single point x = 0, and hence all
270 13 Nonlinear Systems of Conservation Laws
variation in the solution ﬂows out from the point x = t = 0. Recall from Section 11.10 that
if q(x, t ) = ˜ q(x/t ) then the function ˜ q(ξ) must satisfy (11.26),
f
( ˜ q(x/t )) ˜ q
(x/t ) =
x
t
˜ q
(x/t ). (13.23)
For a scalar equation we could cancel ˜ q
(x/t ) from this equation. For a system of equations
˜ q
is a vector and (13.23) requires that it be an eigenvector of the Jacobian matrix f
( ˜ q(x/t )
for each value of x/t . We will see how to determine this function for centered rarefaction
waves and employ it in solving the Riemann problem, but ﬁrst we study some more basic
ideas.
Again we will concentrate on the shallowwater equations to illustrate this theory. For this
system of two equations we can easily draw diagrams in the twodimensional state space
that help to elucidate the theory.
13.8.1 Integral Curves
Let ˜ q(ξ) be a smooth curve through state space parameterized by a scalar parameter ξ. We
say that this curve is an integral curve of the vector ﬁeld r
p
if at each point ˜ q(ξ) the tangent
vector to the curve, ˜ q
(ξ), is an eigenvector of f
( ˜ q(ξ)) corresponding to the eigenvalue
λ
p
( ˜ q(ξ)). If we have chosen some particular set of eigenvectors that we call r
p
(q), e.g.,
(13.10) for the shallow water equations, then ˜ q
(ξ) must be some scalar multiple of the
particular eigenvector r
p
( ˜ q(ξ)),
˜ q
(ξ) = α(ξ)r
p
( ˜ q(ξ)). (13.24)
The value of α(ξ) depends on the particular parameterization of the curve and on the
normalization of r
p
, but the crucial idea is that the tangent to the curve is always in the
direction of the appropriate eigenvector r
p
evaluated at the point on the curve.
Example 13.8. Figure 13.12 shows integral curves of r
1
and r
2
for the shallow water equa
tions of Section 13.1, for which the eigenvectors are given by (13.10). As an example of how
these curves can be determined, consider r
1
and set α(ξ) ≡1, which selects one particular
parameterization for which the formulas are relatively simple. Then (13.24) reduces to
˜ q
(ξ) = r
1
( ˜ q(ξ)) =
1
˜ q
2
/ ˜ q
1
−
g ˜ q
1
(13.25)
by using (13.10). This gives two ordinary differential equations for the two components of
˜ q(ξ):
( ˜ q
1
)
= 1 (13.26)
and
( ˜ q
2
)
= ˜ q
2
/ ˜ q
1
−
g ˜ q
1
. (13.27)
13.8 Simple Waves and Rarefactions 271
(a)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
(b)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
Fig. 13.12. (a) Integral curves of the eigenvector ﬁeld r
1
for the shallow water equations. The eigen
vector r
1
(q) evaluated at any point on a curve is tangent to the curve at that point. (b) Integral curves
for r
2
.
If we set
˜ q
1
(ξ) = ξ, (13.28)
then (13.26) is satisﬁed. Note that since the ﬁrst component of q is h, this means we are
parameterizing the integral curve by depth. With this choice of ˜ q
1
, the second equation
(13.27) becomes
( ˜ q
2
)
= ˜ q
2
/ξ −
gξ. (13.29)
If we ﬁx one point (h
∗
, u
∗
) on the integral curve and require that ˜ q
2
(h
∗
) = h
∗
u
∗
, then
solving the differential equation (13.29) with this initial value yields the solution
˜ q
2
(ξ) = ξu
∗
+2ξ(
gh
∗
−
gξ). (13.30)
Plotting ( ˜ q
1
(ξ), ˜ q
2
(ξ)) from (13.28) and (13.30) gives the curves shown in Figure 13.12(a).
Since ξ is just the depth h, we can also state more simply that the integral curves of r
1
have
the functional form
hu = hu
∗
+2h(
gh
∗
−
gh). (13.31)
In terms of the velocity instead of the momentum, we can rewrite this as
u = u
∗
+2(
gh
∗
−
gh). (13.32)
Similarly, the integral curve of r
2
passing through the point (h
∗
, u
∗
) can be shown to have
the form
u = u
∗
−2(
gh
∗
−
gh). (13.33)
272 13 Nonlinear Systems of Conservation Laws
13.8.2 Riemann Invariants
The expression (13.32) describes an integral curve of r
1
, where (h
∗
, u
∗
) is an arbitrary point
on the curve. This can be rewritten as
u +2
gh = u
∗
+2
gh
∗
.
Since (h
∗
, u
∗
) and (h, u) are any two points on the curve, we see that the function
w
1
(q) = u +2
gh (13.34)
has the same value at all points on this curve. This function is called a Riemann invariant for
the 1family, or simply a 1Riemann invariant. It is a function of q whose value is invariant
along any integral curve of r
1
, though it will take a different value on a different integral
curve.
Similarly, from (13.33) we see that
w
2
(q) = u −2
gh (13.35)
is a 2Riemann invariant, a function whose value is constant along any integral curve of r
2
.
If ˜ q(ξ) represents a parameterization of any integral curve of r
p
, then since w
p
(q) is
constant along ˜ q(ξ) as ξ varies, we must have
d
dξ
w
p
( ˜ q(ξ)) = 0. Expanding this out gives
∇w
p
( ˜ q(ξ)) · ˜ q
(ξ) = 0,
where ∇w
p
is the gradient of w
p
with respect to q. By (13.24) this gives
∇w
p
( ˜ q(ξ)) · r
p
( ˜ q(ξ)) = 0. (13.36)
This relationmust holdat anypoint oneveryintegral curve, andhence ingeneral ∇w
p
·r
p
=0
everywhere. This gives another way to characterize a pRiemann invariant – it is a function
whose gradient is orthogonal to the eigenvector r
p
at each point q.
We can also view the integral curves of r
p
as being level sets of the function w
p
(q), so
that the curves in Figure 13.12(a), for example, give a contour plot of w
1
(q). The gradient
of w
1
(q) is orthogonal to the contour lines, as expressed by (13.36).
Note that all the integral curves shown in Figure 13.12 appear to meet at the origin
h = hu = 0. This may seem odd in that they are level sets of a function w
p
that takes
different values on each curve. But note that each w
p
involves the velocity u = (hu)/h,
which has different limiting values depending on how the point h = hu = 0 is approached.
The integral curves would look different if plotted in the h–u plane; see Exercise 13.2.
For a system of m > 2 equations, the integral curves of r
p
will still be curves through
the mdimensional state space, and can be determined by solving the system (13.24) with
α(ξ) ≡ 1, for example. This is nowa systemof m ODEs. In general there will nowbe m−1
distinct functions w
p
(ξ) that are pRiemann invariants for each family p.
13.8 Simple Waves and Rarefactions 273
13.8.3 Simple Waves
A simple wave is a special solution to the conservation law in which
q(x, t ) = ˜ q(ξ(x, t )), (13.37)
where ˜ q(ξ) traces out an integral curve of some family of eigenvectors r
p
and ξ(x, t ) is a
smooth mapping from (x, t ) to the parameter ξ. This means that all states q(x, t ) appearing
in the simple wave lie on the same integral curve. Note that any pRiemann invariant is
constant throughout the simple wave.
Of course not every function of the form (13.37) will satisfy the conservation law. The
function ξ(x, t ) must be chosen appropriately. We compute
q
t
= ˜ q
(ξ(x, t )) ξ
t
and q
x
= ˜ q
(ξ(x, t )) ξ
x
,
so to satisfy q
t
+ f (q)
x
= 0 we must have
ξ
t
˜ q
(ξ) + ξ
x
f
( ˜ q(ξ)) ˜ q
(ξ) = 0.
Since ˜ q
(ξ) is always an eigenvector of f
( ˜ q(ξ)), this yields
[ξ
t
+ ξ
x
λ
p
( ˜ q(ξ))] ˜ q
(ξ) = 0,
and hence the function ξ(x, t ) must satisfy
ξ
t
+ λ
p
( ˜ q(ξ)) ξ
x
= 0. (13.38)
Note that this is a scalar quasilinear hyperbolic equation for ξ.
In particular, if we choose initial data q(x, 0) that is restricted entirely to this integral
curve, so that
q(x, 0) = ˜ q(ξ
◦
(x))
for some smooth choice of ξ
◦
(x), then (13.37) will be a solution to the conservation law
for t > 0 provided that ξ(x, t ) solves (13.38) with initial data ξ(x, 0) = ξ
◦
(x), at least for
as long as the function ξ(x, t ) remains smooth. In a simple wave the nonlinear system of
equations reduces to the scalar nonlinear equation (13.38) for ξ(x, t ).
Since (13.38) is nonlinear, the smooth solution may eventually break down at some time
T
b
. At this time a shock forms in q(x, t ) and the solution is in general no longer a simple
wave for later times. States q that do not lie on the same integral curve will typically appear
near the shock.
In the special case where λ
p
( ˜ q(ξ(x, 0))) is monotonically increasing in x, the charac
teristics will always be spreading out and a smooth solution will exist for all time. This is
a pure rarefaction wave. If the characteristic speed λ
p
( ˜ q(ξ(x, 0))) is decreasing in x over
some region, then a compression wave arises that will eventually break.
Note that ξ(x, t ) is constant along characteristic curves of the equation (13.38), curves
X(t ) that satisfy X
(t ) = λ
p
( ˜ q(ξ(X(t ), t ))). Since ξ is constant on this curve, so is X
(t ),
and hence the characteristics are straight lines. Along these characteristics the value of
274 13 Nonlinear Systems of Conservation Laws
q(x, t ) is also constant, since q(x, t ) is determined by (13.37) and ξ is constant. Hence a
simple wave behaves exactly like the solution to a scalar conservation law, as described in
Chapter 11, up to the time it breaks.
For the special case of a linear hyperbolic system, simple waves satisfy scalar advection
equations (λ
p
is constant, independent of ˜ q(ξ)), and the theory just developed agrees with
what was presented in Section 3.4.
13.8.4 Genuine Nonlinearity and Linear Degeneracy
For the shallow water equations, the characteristic speed λ
p
( ˜ q(ξ)) varies monotonically as
we move along an integral curve. We will verify this in Example 13.9, but it can be seen
in Figure 13.13, where contours of λ
p
are plotted along with a typical integral curve. This
monotonicity is analogous to the situation for a scalar conservation law with a convex ﬂux
function f (q), in which case the single characteristic speed λ
1
(q) = f
(q) is monotonic
in q. As discussed in Section 16.1, solutions to the scalar conservation law can be con
siderably more complex if f is nonconvex. The same is true for systems of equations, but
for many physical systems we have a property analogous to convexity. If λ
p
( ˜ q(ξ)) varies
monotonically with ξ along every integral curve, then we say that the pth ﬁeld is genuinely
nonlinear. Note that the variation of λ
p
along the curve can be computed as
d
dξ
λ
p
( ˜ q(ξ)) = ∇λ
p
( ˜ q(ξ)) · ˜ q
(ξ). (13.39)
Here ∇λ
p
is the gradient vector obtained by differentiating the scalar λ
p
(q) with respect to
each component of the vector q. The quantity in (13.39) must be nonzero everywhere if the
ﬁeld is to be genuinely nonlinear. If the value of (13.39) is positive, then the characteristic
(a)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
(b)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
Fig. 13.13. (a) A typical integral curve of the eigenvector ﬁeld r
1
for the shallow water equations is
shown as the heavy line. The other lines are contour lines of λ
1
(q), curves along which λ
1
is constant.
The curves shown are for values λ
1
= 1, 0, −1, −1.5, −2, −2.5 from top to bottom. Note that λ
1
varies monotonically along the integral curve. (b) An integral curve for r
2
and contours of λ
2
(q) for
values λ
2
= 2.5, 2, 1.5, 1, 0, −1 from top to bottom.
13.8 Simple Waves and Rarefactions 275
speed is increasing with ξ and if it is negative the speed is decreasing. If this derivative were
zeroat some point, thenthe characteristic speedwouldbe locallyconstant andcharacteristics
would be essentially parallel as in a linear problem. The property of genuine nonlinearity
insures that this linear situation never occurs and characteristics are always compressing or
expanding as q varies.
Since ˜ q
(ξ) is in the direction r
p
( ˜ q(ξ)) by (13.24), we see from (13.39) that the pth ﬁeld
is genuinely nonlinear if
∇λ
p
(q) · r
p
(q) = 0 (13.40)
for all q. Note that for a scalar problem λ
1
(q) = f
(q) and we can take r
1
(q) ≡ 1, so that
(13.40) reduces to the convexity requirement f
(q) = 0.
At the other extreme, in some physical systems there are characteristic ﬁelds for which
the relation
∇λ
p
(q) · r
p
(q) ≡ 0 (13.41)
holds for all q. This means that λ
p
is identically constant along each integral curve. A
trivial example occurs in a constantcoefﬁcient linear hyperbolic system, in which case λ
p
is constant everywhere and ∇λ
p
(q) ≡ 0. But in nonlinear systems it may also happen that
some ﬁeld satisﬁes the relation (13.41) even though λ
p
takes different values along different
integral curves. This happens if the integral curves of r
p
are identical to the contour lines
of λ
p
. A ﬁeld satisfying (13.41) is said to be linearly degenerate. Through a simple wave in
such a ﬁeld the characteristics are parallel, as in a linear system, rather than compressing or
expanding. See Section 13.12 and Section 14.9 for examples of linearly degenerate ﬁelds.
13.8.5 Centered Rarefaction Waves
A centered rarefaction wave is a special case of a simple wave in a genuinely nonlinear
ﬁeld, in which ξ(x, t ) = x/t , so that the solution is constant on rays through the origin. A
centered rarefaction wave has the form
q(x, t ) =
q
l
if x/t ≤ ξ
1
,
˜ q(x/t ) if ξ
1
≤ x/t ≤ ξ
2
,
q
r
if x/t ≥ ξ
2
,
(13.42)
where q
l
and q
r
are two points on a single integral curve with λ
p
(q
l
) <λ
p
(q
r
). This condition
is required so that characteristics spread out as time advances and the rarefaction wave makes
physical sense. (The picture should look like Figure 11.4(a), not Figure 11.4(b).)
For a centered rarefaction wave a particular parameterization of the integral curve is
forced upon us by the fact that we set ξ = x/t . Rewriting this as x = ξt , we see that the
value ˜ q(ξ) observed along the ray x/t = ξ is propagating at speed ξ, which suggests that
ξ at each point on the integral curve must be equal to the characteristic speed λ
p
( ˜ q(ξ)) at
this point. This is conﬁrmed by noting that (13.38) in this case becomes
−
x
t
2
+λ
p
( ˜ q(x/t ))
1
t
= 0
276 13 Nonlinear Systems of Conservation Laws
and hence
x
t
= λ
p
( ˜ q(x/t )). (13.43)
In particular, the left edge of the rarefaction fan should be the ray x/t = λ
p
(q
l
) so that
ξ
1
=λ
p
(q
l
) in (13.42), while the right edge should be the ray x/t = λ
p
(q
r
) so that ξ
2
=
λ
p
(q
r
). We thus have
ξ
1
= λ
p
(q
l
), ˜ q(ξ
1
) = q
l
,
ξ
2
= λ
p
(q
r
), ˜ q(ξ
2
) = q
r
.
(13.44)
To determine how ˜ q(ξ) varies for ξ
1
<ξ <ξ
2
through the rarefaction wave (13.42), rewrite
(13.43) as
ξ = λ
p
( ˜ q(ξ)) (13.45)
and differentiate this with respect to ξ to obtain
1 = ∇λ
p
( ˜ q(ξ)) · ˜ q
(ξ). (13.46)
Using (13.24) in (13.46) gives
1 = α(ξ)∇λ
p
( ˜ q(ξ)) · r
p
( ˜ q(ξ)),
and hence
α(ξ) =
1
∇λ
p
( ˜ q(ξ)) · r
p
( ˜ q(ξ))
. (13.47)
Using this in (13.24) gives a system of ODEs for ˜ q(ξ):
˜ q
(ξ) =
r
p
( ˜ q(ξ))
∇λ
p
( ˜ q(ξ)) · r
p
( ˜ q(ξ))
. (13.48)
This system must be solved over the interval ξ
1
≤ ξ ≤ ξ
2
using either of the conditions
in (13.44) as an initial condition. Note that the denominator is nonzero provided that λ
p
is monotonically varying. A rarefaction wave would not make sense past a point where
the denominator vanishes. In particular, if the pth ﬁeld is genuinely nonlinear, then the
denominator is always nonzero by (13.40).
Example 13.9. For the shallow water equations we have
λ
1
= u −
gh = q
2
/q
1
−
gq
1
,
∇λ
1
=
−q
2
/(q
1
)
2
−
1
2
g/q
1
1/q
1
,
r
1
=
1
q
2
/q
1
−
gq
1
,
(13.49)
13.8 Simple Waves and Rarefactions 277
and hence
∇λ
1
· r
1
= −
3
2
g/q
1
, (13.50)
so that the equations (13.48) become
˜ q
= −
2
3
˜ q
1
/g
1
˜ q
2
/ ˜ q
1
−
g ˜ q
1
. (13.51)
The ﬁrst equation of this system is
˜
h
(ξ) = −
2
3
˜
h(ξ)/g.
The general solution is
˜
h =
1
9g
(A −ξ)
2
, (13.52)
for some constant A. This constant must be chosen so that (13.44) is satisﬁed, i.e., so that
˜
h = h
l
at ξ = u
l
−
√
gh
l
and also
˜
h = h
r
at ξ = u
r
−
√
gh
r
. Provided that q
l
and q
r
both
lie on an integral curve of r
1
, as they must if they can be joined by a centered rarefaction
wave, we can satisfy both of these conditions by taking
A = u
l
+2
gh
l
= u
r
+2
gh
r
. (13.53)
Recall that u + 2
√
gh is a 1Riemann invariant, which has the same value at all points on
the integral curve. We see that
˜
h varies quadratically with ξ = x/t through a rarefaction
wave (13.42).
Once we know h as a function of ξ, we can use the formula (13.33), which holds through
any simple wave, to determine how u varies through the rarefaction wave. (i.e., we use the
fact that the Riemann invariant is constant). Note that since we know the relation between
h and u from having previously found the Riemann invariants, we do not need to solve both
the ODEs in the system(13.51). We have chosen the simpler one to solve. This trick is often
useful for other systems as well.
Note that (13.50) is nonzero for all physically meaningful states q
1
= h > 0, showing
that this ﬁeld is genuinely nonlinear. The expressions for the 2characteristic ﬁeld are very
similar (with only a few minus signs changed), and this ﬁeld is also genuinely nonlinear;
see Exercise 13.3.
13.8.6 The AllRarefaction Riemann Solution
Nowsuppose we wish to solve a Riemann problemfor which we knowthe solution consists
of two rarefaction waves, as in the following example.
Example 13.10. Again consider the Riemann problem for the shallow water equations
with data (13.13), but now take u
l
< 0. This corresponds to two streams of water that are
moving apart from one another. Again the solution will be symmetric but will consist of
278 13 Nonlinear Systems of Conservation Laws
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
0.5
1
1.5
2
h at t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
−1
−0.5
0
0.5
1
hu at t = 0
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
0.5
1
1.5
2
h at t = 0.75
−5 −4 −3 −2 −1 0 1 2 3 4 5
−1
−0.5
0
0.5
1
hu at t = 0.75
−5 −4 −3 −2 −1 0 1 2 3 4 5
0
0.5
1
1.5
2
h at t = 3
−5 −4 −3 −2 −1 0 1 2 3 4 5
−1
−0.5
0
0.5
1
hu at t = 3
Fig. 13.14. Solution of the Riemann problem for the shallow water equations with u
l
= −u
r
< 0.
[claw/book/chap13/tworaref]
two rarefaction waves as shown in Figure 13.14. (Looking at only half the domain gives the
solution to the boundaryvalue problem with water ﬂowing away from a wall.)
To solve this Riemann problem, we can proceed in a manner similar to what we did
in Section 13.7.1 for the allshock solution. There is an integral curve of r
1
through q
l
consisting of all states that can be connected to q
l
by a 1rarefaction, and an integral curve
of r
2
through q
r
consisting of all states that can be connected to q
r
by a 2rarefaction. These
are illustrated in Figure 13.15(a) for the Riemann data
u
l
= −0.5, u
r
= 0.5, and h
l
= h
r
= 1. (13.54)
(a)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
l
q
r
q
m
(b)
−0.5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
−2.5
−2
−1.5
−1
−0.5
0
0.5
1
1.5
2
2.5
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
l
q
r
q
m
Fig. 13.15. (a) Construction of the allrarefaction Riemann solution for the problemof Example 13.5.
(b) The physically incorrect allrarefaction Riemann solution for the dambreak problem of Exam
ple 13.4.
13.9 Solving the DamBreak Problem 279
The intermediate state q
m
in the Riemann solution must lie on both of these curves, and
hence is at the intersection as shown in Figure 13.15(a). For this particular example q
m
lies
on the haxis due to symmetry. In general we can ﬁnd the intersection by using the fact that
q
m
must lie on the curve described by (13.32) with q
∗
= q
l
and on the curve described by
(13.33) with q
∗
= q
r
, so
u
m
= u
l
+2(
gh
l
−
gh
m
),
u
m
= u
r
−2(
gh
r
−
gh
m
).
(13.55)
This is a system of two nonlinear equations for h
m
and u
m
. Equating the righthand sides
gives a single equation for h
m
, which can be explicitly solved to obtain
h
m
=
1
16g
[u
l
−u
r
+2(
gh
l
+
gh
r
)]
2
. (13.56)
This is valid provided that the expression being squared is nonnegative. When it reaches
zero, the outﬂow is sufﬁciently great that the depth h
m
goes to zero. (See Exercise 13.2.)
For the symmetric data (13.54) used in Figures 13.14 and 13.15(a), the expression (13.56)
gives h
m
= (4
√
g−1)
2
/16g = 9/16, since we use g = 1. Then either equation from(13.55)
gives u
m
= 0.
The integral curves in Figure 13.15(a) are shown partly as dashed lines. For a given state
q
l
only some points on the integral curve of r
1
can be connected to q
l
by a rarefaction wave
that makes physical sense, since we are assuming q
l
is the state on the left of the rarefaction
wave. We must have λ
1
(q
l
) <λ
1
(q) for all states q in the rarefaction wave, and hence q
must lie on the portion of the integral curve shown as a solid line (see Figure 13.13(a)).
Similarly, if q
r
is the state to the right of a 2rarefaction, then states q in the rarefaction must
satisfy λ
2
(q) <λ
2
(q
r
) and must lie on the solid portion of the integral curve for r
2
sketched
through q
r
in Figure 13.15(a). For the data shown in this ﬁgure, there is a state q
m
that can
be connected to both q
l
and q
r
by physically correct rarefaction waves, and the Riemann
solution consists of two rarefactions as illustrated in Figure 13.14.
For other data this might not be the case. Figure 13.15(b) shows the data for the dam
break Riemann problem of Example 13.4, with h
l
= 3, h
r
= 1, and u
l
= u
r
= 0. We can
still use (13.56) to compute an intermediate state q
m
lying at the intersection of the integral
curves, as illustrated in Figure 13.15(b), but the resulting 2wave does not make physical
sense as a rarefaction wave, since λ
2
(q
m
) > λ
2
(q
r
). This wave would overturn, as illustrated
in Figure 13.16.
Compare Figure 13.15(b) with Figure 13.10(b), where we found an allshock solution
to this same Riemann problem. In that case the 2shock was acceptable, but the 1shock
failed to satisfy the entropy condition. The correct solution consists of a 1rarefaction and
a 2shock as shown in Figure 13.5 and determined in the next section.
13.9 Solving the DamBreak Problem
We now illustrate how to construct the general solution to a nonlinear Riemann problem,
using the theory of shock waves and rarefaction waves developed above.
280 13 Nonlinear Systems of Conservation Laws
−2 −1 0 1 2
1
1.5
2
2.5
3
Height
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
Velocity
−2 −1 0 1 2
1
2
3
4
Vertically integrated pressure
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
2–Characteristics in the x–t plane
Fig. 13.16. Unphysical solution to the dambreak Riemann problem for the shallow water equations
corresponding to the solution found in Figure 13.15(b). The 2characteristics are shown in the lower
right plot. Note that each point in the shaded region lies on three distinct 2characteristics.
The dambreak Riemann problem for the shallow water equations (introduced in
Example 13.4) has a solution that consists of a 1rarefaction and a 2shock, as illustrated
in Figure 13.5. In Figure 13.10 we saw how to construct a weak solution to this problem
that consists of two shock waves, one of which does not satisfy the Lax entropy condition.
In Figure 13.15 we found an allrarefaction solution to this problem that is not physically
realizable. To ﬁnd the correct solution we must determine an intermediate state q
m
that is
connected to q
l
by a 1rarefaction wave and simultaneously is connected to q
r
by a 2shock
wave. The state q
m
must lie on an integral curve of r
1
passing through q
l
, so by (13.32) we
must have
u
m
= u
l
+2(
gh
l
−
gh
m
). (13.57)
It must also lie on the Hugoniot locus of 2shocks passing through q
r
, so by (13.19) it must
satisfy
u
m
= u
r
+(h
m
−h
r
)
g
2
1
h
m
+
1
h
r
. (13.58)
We can easily eliminate u
m
fromthese two equations and obtain a single nonlinear equation
13.10 The General Riemann Solver for Shallow Water Equations 281
(a)
−1 −0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
−4
−3
−2
−1
0
1
2
3
4
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
l
q
r
(b)
1.6 1.7 1.8 1.9 2 2.1 2.2
1.1
1.2
1.3
1.4
1.5
1.6
1.7
h = depth
h
u
=
m
o
m
e
n
t
u
m
S
1
(q
l
)
S
2
(q
r
)
R
1
(q
l
)
R
2
(q
r
)
Fig. 13.17. (a) The Hugoniot loci from Figure 13.10 together with the integral curves. (b) Closeup
of the region where the curves intersect. S
1
: Entropyviolating 1shocks; R
1
: 1rarefactions; S
2
:
2shocks; R
2
: unphysical 2rarefactions.
to solve for h
m
. The structure of the rarefaction wave connecting q
l
to q
m
can then be
determined using the theory of Section 13.8.5.
Note that the intermediate state q
m
resulting from this procedure will be slightly different
from that obtained in either Figure 13.10 or Figure 13.15, since the Hugoniot loci are
different from the integral curves. This is illustrated in Figure 13.17, where the curves
from Figures 13.10 and 13.15 are plotted together. Figure 13.17(b) shows a closeup near
the points of intersection of these curves. The correct solution to the dambreak Riemann
problem has the intermediate state at the point where the two solid lines cross.
Note that both sets of curves are tangent to the eigenvector r
1
(q
l
) at q
l
and to r
2
(q
r
)
at q
r
. Moreover, it can be shown that the Hugoniot locus and the integral curve through
a given point have the same curvature at that point, and so the curves are really quite
similar near that point. (See, e.g., Lax [263].) How rapidly the curves diverge from one
another typically depends on how nonlinear the system is. For a linear system, of course,
the integral curves and Hugoniot loci are identical, each being straight lines in the directions
of the constant eigenvectors. Even for nonlinear systems the Hugoniot loci may be identical
to the integral curves, though this is not the usual situation. See Exercise 13.12 for one
example, and Temple [447] for some general discussion of such systems, which are often
called Templeclass systems.
13.10 The General Riemann Solver for Shallow Water Equations
For the dambreak problem we know that the 1wave is a rarefaction while the 2wave is
a shock, leading to the system of equations (13.57) and (13.58) to solve for h
m
and u
m
.
For general values of q
l
and q
r
we might have any combination of shocks and rarefactions
in the two families, depending on the speciﬁc data. To ﬁnd the state q
m
in general we can
deﬁne two functions φ
l
and φ
r
by
φ
l
(h) =
u
l
+2(
√
gh
l
−
√
gh) if h < h
l
,
u
l
−(h −h
l
)
g
2
1
h
+
1
h
l
if h > h
l
,
282 13 Nonlinear Systems of Conservation Laws
and
φ
r
(h) =
u
r
−2(
√
gh
r
−
√
gh) if h < h
r
,
u
r
+(h −h
r
)
g
2
1
h
+
1
h
r
if h > h
r
.
For a given state h, the function φ
l
(h) returns the value of u such that (h, hu) can be
connected to q
l
by a physically correct 1wave, while φ
r
(h) returns the value such that
(h, hu) can be connected to q
r
by a physicallycorrect 2wave. We want to determine h
m
so that φ
l
(h
m
) = φ
r
(h
m
). This can be accomplished by applying a nonlinear root ﬁnder to
the function φ(h) ≡ φ
l
(h) −φ
r
(h).
13.11 Shock Collision Problems
In a scalar equation, such a Burgers equation, when two shock waves collide, they simply
merge into a single shock wave with a larger jump. For a system of equations, the result of a
shock collision is not so simple, even if the two shocks are in the same characteristic family.
The result will include a stronger shock in this same family, but the collision will typically
also introduce waves in the other families. For example, consider initial data for the shallow
water equations consisting of the three states shown in Figure 13.18(a). These three states
all lie on the Hugoniot locus S
2
(q
2
), so there is a 2shock connecting q
1
to q
2
and a slower
2shock connecting q
2
to q
3
. (Note that the shock speed s = [[hu]]/[[h]] is given by the slope
of the line joining the two points.) If we solve the shallow water equations with data
q(x, 0) =
q
1
if x < x
1
,
q
2
if x
1
≤ x ≤ x
2
,
q
3
if x > x
2
(13.59)
for some initial shock locations x
1
< x
2
, then the solution consists of the these two shocks,
which eventually collide at some point x
c
. At the time t
c
when they collide, the state q
2
0 1 2 3 4 5 6 7
−1
0
1
2
3
4
5
6
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
1
q
2
q
3
S
2
(q
2
)
0 1 2 3 4 5 6 7
−1
0
1
2
3
4
5
6
h = depth
h
u
=
m
o
m
e
n
t
u
m
q
1
q
2
q
3
q
4
S
2
(q
3
)
R
1
(q
1
)
(a) (b)
Fig. 13.18. States arising in the collision of two 2shocks for the shallow water equations. (a) Initial
states q
1
and q
3
are each connected to q
2
by a 2shock. (b) After collision, solving the Riemann
problem between q
3
and q
1
gives a new state q
4
and a reﬂected 1wave.
13.12 Linear Degeneracy and Contact Discontinuities 283
q
1
q
2
q
3
q
4
Fig. 13.19. Collision of two 2shocks giving rise to a 1rarefaction and a 2shock, as seen in the x–t
plane.
disappears and the solution has the form
q(x, t
c
) =
q
1
if x < x
c
,
q
3
if x > x
c
.
(13.60)
To determine the solution beyond this time, note that this has the form of Riemann
problem data with left state q
1
and right state q
3
. The Riemann solution is not a single
2shock, because q
1
will not lie on the Hugoniot locus S
2
(q
3
). Instead, a 1wave must be
introduced to connect q
1
to a new state q
4
that lies on this Hugoniot locus, as illustrated
in Figure 13.18(b). We see that the 1wave must be a rarefaction wave, since h
4
<h
1
and
h
4
is determined by the intersection of the integral curve R
1
(q
1
) with the Hugoniot locus
S
2
(q
3
). (Note that q
2
does lie on the Hugoniot locus S
2
(q
3
), since q
3
lies on the Hugoniot
locus S
2
(q
2
).)
A view of this collision in the x–t plane is seen in Figure 13.19. To view a numerical
solution of this collision, see [claw/book/chap13/collide].
13.12 Linear Degeneracy and Contact Discontinuities
The shallow water equations are a system of two equations for which both characteristic
ﬁelds are genuinely nonlinear, as deﬁned in Section 13.8.4. Asmooth simple wave in one of
these ﬁelds will always distort via compression or expansion as characteristics converge or
diverge. For the Riemann problem, each wave will be either a single shock or a rarefaction
wave. Genuine nonlinearity of the pth ﬁeld requires that the eigenvalue λ
p
be monotonically
varying as we move along an integral curve of r
p
, and hence that ∇λ
p
(q) · r
p
(q) be nonzero
everywhere.
We now consider the opposite extreme, a ﬁeld in which ∇λ
p
(q) · r
p
(q) is identically zero
for all q, so that λ
p
is constant along each integral curve of r
p
(but may take different values
on different integral curves). Such a ﬁeld is called linearly degenerate, since simple waves
in which the variation of q is only in this ﬁeld behave like solutions to linear hyperbolic
equations. Since λ
p
is constant throughout the wave, it simply translates with this constant
speed without distorting. If the initial data is a jump discontinuity, with q
l
and q
r
both lying
on a single integral curve of this ﬁeld, then the solution will consist of this discontinuity
propagating at the constant speed λ
p
associated with this integral curve. Hence the Hugoniot
locus for this ﬁeld agrees with the integral curve. Such a discontinuity is not a shock
284 13 Nonlinear Systems of Conservation Laws
wave, however, since the characteristic speed λ
p
(q
l
) =λ
p
(q
r
) on each side agrees with the
propagation speed of the wave. Characteristics are parallel to the wave in the x–t plane
rather than impinging on it. Waves of this form are generally called contact discontinuities,
for reasons that will become apparent after considering the simple example in the next
section.
13.12.1 Shallow Water Equations with a Passive Tracer
Again consider the shallow water equations, but now suppose we introduce some dye into
the water in order to track its motion. Let φ(x, t ) represent the concentration of this passive
tracer, measured in units of mass or molarity per unit volume, so that it is a color variable
as described in Chapter 9. Then values of φ move with the ﬂuid velocity u and are constant
along particle paths, and φ satisﬁes the color equation (9.12),
φ
t
+uφ
x
= 0. (13.61)
Since φ measures a passive tracer that is assumed to have no inﬂuence on the ﬂuid dynamics,
it simply satisﬁes this linear advection equation with the variable coefﬁcient u(x, t ), which
can be obtained by ﬁrst solving the shallow water equations. However, to illustrate linearly
degenerate ﬁelds we can couple this equation into the shallow water equations and obtain
an augmented system of three conservation laws.
We ﬁrst rewrite (13.61) as a conservation law by instead considering the conserved
quantity hφW, where h is the depth of the water and W is the width of the channel modeled
in our onedimensional equations. This is needed solely for dimensional reasons, and we
can take W = 1 in the appropriate length units and consider hφ as the conserved quantity,
measuring mass or molarity per unit length. This is conserved in one dimension with the
ﬂux uhφ, so hφ satisﬁes the conservation law
(hφ)
t
+(uhφ)
x
= 0. (13.62)
Note that differentiating this out gives
h
t
φ +hφ
t
+(hu)
x
φ +(hu)φ
x
= 0,
and using h
t
+(hu)
x
= 0 allows us to relate this to the color equation (13.61). Numerically
one canworkdirectlywith(13.61) rather than(13.62) since the wavepropagationalgorithms
do not require that all equations be in conservation form, and there are often advantages to
doing so (see Section 16.5).
For our present purposes, however, we wish to investigate the mathematical structure of
the resulting system of conservation laws. Augmenting the shallow water equations with
(13.62) gives the system q
t
+ f (q)
x
= 0 with
q =
h
hu
hφ
=
q
1
q
2
q
3
, f (q) =
hu
hu
2
+
1
2
gh
2
uhφ
=
q
2
(q
2
)/q
1
+
1
2
g(q
1
)
2
q
2
q
3
/q
1
. (13.63)
13.12 Linear Degeneracy and Contact Discontinuities 285
The Jacobian is now
f
(q) =
0 1 0
−(q
1
)
2
/(q
1
)
2
+ gq
1
2q
2
/q
1
0
−q
2
q
3
/(q
1
)
2
q
3
/q
1
q
2
/q
1
=
0 1 0
−u
2
+ gh 2u 0
−uφ φ u
. (13.64)
This is a block lowertriangular matrix, and the eigenvalues are given by those of the
two blocks. The upper 2 ×2 block is simply the Jacobian matrix (13.8) for the shallow
water equations, and has eigenvalues u ±
√
gh. The lower 1 ×1 block yields the additional
eigenvalue u. The eigenvectors are also easy to compute from those of (13.8), and we ﬁnd
that
λ
1
= u −
√
gh, λ
2
= u, λ
3
= u +
√
gh,
r
1
=
1
u −
√
gh
φ
, r
2
=
0
0
1
, r
3
=
1
u +
√
gh
φ
.
(13.65)
The fact that the scalar φ is essentially decoupled fromthe shallowwater equations is clearly
apparent. Fields 1 and 3 correspond to the nonlinear waves in the shallow water equations
and involve φ only because the conserved quantity hφ has a jump discontinuity where there
is a jump in h. The tracer concentration φ is continuous across these waves. Field 2 carries
a jump in φ alone, since the ﬁrst two components of r
2
are 0. The speed of the 2wave,
λ
2
= u, depends on the shallow water behavior, just as we expect.
If we considered very small variations in h and u, we could linearize this systemand obtain
a form of the acoustics equations coupled with the advection equation for φ. This linear
system has already been considered in Section 3.10 and shows the same basic structure.
For the nonlinear system, ﬁelds 1 and 3 are still genuinely nonlinear, as in the standard
shallow water equations, but ﬁeld 2 is linearly degenerate, since it corresponds to the linear
advection equation. This is easily veriﬁed by computing
∇λ
2
=
−u/h
1/h
0
and observing that ∇λ
2
· r
2
≡ 0. (Recall that ∇λ
2
means the gradient of u = (hu)/h =
q
2
/q
1
with respect to q.)
Any variation in φ will simply be advected with velocity u. In general the shape of φ may
distort, since u(x, t ) may vary in the solution to the shallow water equations. However, if
we consider a simple wave in Field 2, then variations in q can occur only along an integral
curve of r
2
. This vector always points in the φdirection in the threedimensional state
space, and integral curves are straight lines in this direction with no variation in h or hu.
So in particular u is constant along any integral curve of r
2
, and simple waves consist of
arbitrary variations in φ being carried along in water of constant depth moving at constant
speed u. These are, of course, special solutions of the augmented shallow water equations.
286 13 Nonlinear Systems of Conservation Laws
13.12.2 The Riemann Problem and Contact Discontinuities
Now consider the Riemann problem for the augmented shallow water system (13.63), with
piecewise constant data having an arbitrary jump between states q
l
and q
r
(which allows
arbitrary jumps in h, u, and φ). It is clear how to solve this Riemann problem. Since φ does
not affect h or u, the procedure of Section 13.9 can be used to determine the 1wave and
3wave. Each is a shock or rarefaction wave, as in the standard shallow water equations,
and there is no variation in φ across either of these waves. The 1wave is moving into the
ﬂuid on the left, in which φ ≡ φ
l
while the 3wave is moving into the ﬂuid on the right,
in which φ ≡ φ
r
. Between these two waves the velocity u
m
is constant (obtained as in
Section 13.9), and a 2wave is now introduced with velocity λ
2
= u
m
. Across this wave,
h = h
m
and u = u
m
are constant while φ jumps from φ
l
to φ
r
. This wave has a simple
physical interpretation: it marks the boundary between water that was initially to the left of
the interface and water that was initially to the right. This is clear because φ satisﬁes the
color equation and hence is constant on particle paths.
This 2wave is called a contact discontinuity because it marks the point at which the
two distinct ﬂuids (e.g., with different colors) are in contact with one another. Figure 13.20
−2 −1 0 1 2
1
1.5
2
2.5
3
Height
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
Velocity
−2 −1 0 1 2
1
2
3
4
Vertically integrated pressure
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
Particle paths in x–t plane
Fig. 13.20. Structure of the similarity solution of the dambreak Riemann problem for the augmented
shallow water equations with u
l
= u
r
= 0. The depth h, velocity u, and vertically integrated pressure
are displayed as functions of x/t . The value of φ is indicated by coloring the water darker where
φ = φ
l
. The structure inthe x–t plane is alsoshown, andparticle paths are indicatedfor a set of particles
with the spacing between particles inversely proportional to the depth. The contact discontinuity is
now indicated along with the rarefaction and shock.
Exercises 287
shows one example for the dambreak problem of Example 13.4. This looks exactly like
Figure 13.5 except that we have now also indicated the variation in φ by coloring the water
that was initially behind the dam(i.e., in the region x < 0) darker. The contact discontinuity
is indicated in the plot of particle paths, and it is clear that this wave separates water initially
behind the dam from water initially downstream.
Since the characteristic velocity λ
2
= u agrees with the particle velocity, we can also
interpret this plot of particle paths as a plot of the 2characteristics for the augmented
system. These characteristics cross the 1wave and 3wave and are parallel to the 2wave,
as expected because this ﬁeld is linearly degenerate.
The Euler equations of gas dynamics, discussed in the next chapter, also have a linearly
degenerate ﬁeld corresponding to contact discontinuities. For general initial data the Rie
mann solution may contain a jump in density across the surface where the two initial gases
are in contact.
Exercises
13.1. (a) Consider an integral curve of r
1
for the shallow water equations, as illustrated
in Figure 13.13(a), for example. Show that the slope tangent to this curve in
the q
1
–q
2
plane at any point is equal to λ
1
at that point. (q
1
= h and q
2
= hu.)
(b) Consider the Hugoniot locus for 1shocks for the shallow water equations, as
illustrated in Figure 13.9(a), for example. Showthat if q
l
and q
r
are two points
lying on this curve (and hence connected by a 1shock) then the slope of the
secant line connecting these points is equal to the shock speed s.
13.2. The graphs of Figure 13.15 show the h–hu plane. The curves look somewhat dif
ferent if we instead plot them in the h–u plane.
(a) Redraw Figure 13.15(a) in the h–u plane.
(b) Draw a similar ﬁgure for h
l
= h
r
= 1 and −u
l
= u
r
= 1.9.
(c) Draw a similar ﬁgure for h
l
= h
r
= 1 and −u
l
= u
r
= 2.1. In this case the
Riemann solution contains a region in which h = 0: dry land between the two
outgoing rarefaction waves.
13.3. Repeat the computations of Example 13.9 to determine the form of 2rarefactions
in the shallow water equations and show that this ﬁeld is genuinely nonlinear.
13.4. For the shallow water equations, show that when a 1shock collides with a 2shock
the result is a new pair of shocks. Exhibit the typical solution in the phase plane
and the x–t plane.
13.5. In the shallow water equations, is it possible for two 2rarefactions to collide with
each other?
13.6. For the shallow water equations, the total energy can be used as an entropy function
in the mathematical sense. This function and the associated entropy ﬂux are given
by
η(q) =
1
2
hu
2
+
1
2
gh
2
,
ψ(q) =
1
2
hu
3
+ gh
2
u.
(13.66)
Verify this by showing the following.
288 13 Nonlinear Systems of Conservation Laws
(a) η(q) is convex: Show that the Hessian matrix η
(q) is positive deﬁnite.
(b) η(q)
t
+ ψ(q)
x
= 0 for smooth solutions: Verify that (11.47) holds, ψ
(q) =
η
(q) f
(q).
13.7. Consider the psystem (described in Section 2.13),
v
t
−u
x
= 0,
u
t
+ p(v)
x
= 0,
where p(v) is a given function of v.
(a) Compute the eigenvalues of the Jacobian matrix, and show that the system is
hyperbolic provided p
(v) < 0.
(b) Use the Rankine–Hugoniot condition to show that a shock connecting q =
(v, u) to some ﬁxed state q
∗
= (v
∗
, u
∗
) must satisfy
u = u
∗
±
−
p(v) − p(v
∗
)
v −v
∗
(v −v
∗
). (13.67)
(c) What is the propagation speed for such a shock? How does this relate to the
eigenvalues of the Jacobian matrix computed in part (a)?
(d) Plot the Hugoniot loci for the point q
∗
= (1, 1) over the range −3 ≤ v ≤ 5
for each of the following choices of p(v). (Note that these are not physically
reasonable models for pressure as a function of speciﬁc volume!)
(i) p(v) = −e
v
,
(ii) p(v) = −(2v +0.1e
v
),
(iii) p(v) = −2v.
(e) Determine the twoshock solution to the Riemann problem for the psystem
with p(v) = −e
v
and data
q
l
= (1, 1), q
r
= (3, 4).
Do this in two ways:
(i) Plot the relevant Hugoniot loci, and estimate where they intersect.
(ii) Set up and solve the proper scalar nonlinear equation for v
m
. You might
use the Matlab command fzero or write your own Newton solver.
(f) Does the Riemann solution found in the previous part satisfy the Lax entropy
condition? Sketch the structure of the solution in the x–t plane, showing also
some sample 1characteristics and 2characteristics.
(g) For the given left state q
l
= (1, 1), in what region of the phase plane must the
right state q
r
lie in order for the twoshock Riemann solution to satisfy the
Lax entropy condition?
13.8. Consider the psystem of Exercise 13.7, and take p(v) = −e
v
.
(a) Follow the procedure of Section 13.8.1 to show that along any integral curve
of r
1
the relation
u = u
∗
−2
e
v
∗
/2
−e
v/2
Exercises 289
must hold, where (v
∗
, u
∗
) is a particular point on the integral curve. Conclude
that
w
1
(q) = u −2e
v/2
is a 1Riemann invariant for this system.
(b) Follow the procedure of Section 13.8.5 to show that through a centered rar
efaction wave
˜ u(ξ) = A −2ξ,
where
A = u
l
−2e
v
l
/2
= u
r
−2e
v
r
/2
,
and determine the form of ˜ v(ξ).
(c) Show that this ﬁeld is genuinely nonlinear for all q.
(d) Determine the 2Riemann invariants and the form of a 2rarefaction.
(e) Suppose arbitrary states q
l
and q
r
are speciﬁed and we wish to construct a
Riemann solution consisting of two “rarefaction waves” (which might not
be physically realizable). Determine the point q
m
= (v
m
, u
m
) where the two
relevant integral curves intersect.
(f) What conditions must be satisﬁed on q
l
and q
r
for this to be the physically
correct solution to the Riemann problem?
13.9. For the general psystem of Exercise 13.7, determine the condition on the function
p(v) that must be satisﬁed in order for both ﬁelds to be genuinely nonlinear for all
q.
13.10. Consider the equations (2.97) modeling a onedimensional slice of a nonlinear
elastic solid. Suppose the stress–strain relation σ() has the shape indicated in
Figure 2.3(a). Is the system genuinely nonlinear in this case?
13.11. The variablecoefﬁcient scalar advection equation q
t
+ (u(x)q)
x
= 0 studied in
Section 9.4 can be viewed as a hyperbolic system of two equations,
q
t
+(uq)
x
= 0,
u
t
= 0,
(13.68)
where we now view u(x, t ) ≡ u(x) as a second component of the system.
(a) Determine the eigenvalues and eigenvectors of the Jacobian matrix for this
system.
(b) Showthat both ﬁelds are linearly degenerate, and that in each ﬁeld the integral
curves and Hugoniot loci coincide. Plot the integral curves of each ﬁeld in the
q–u plane.
(c) Indicate the structure of a general Riemann solution in the q–u plane for the
case u
l
, u
r
> 0. Relate this to Figure 9.1.
(d) Note that this system fails to be strictly hyperbolic along u = 0. Can the
Riemann problem be solved if u
l
< 0 and u
r
> 0? If u
l
> 0 and u
r
< 0? (See
Section 16.4.2 for more discussion of such problems.)
290 13 Nonlinear Systems of Conservation Laws
13.12. Consider the system
v
t
+[vg(v, φ)]
x
= 0,
φ
t
+[φg(v, φ)]
x
= 0,
(13.69)
where g(v, φ) is a given function. Systems of this form arise in twophase ﬂow. As
a simple example, take g(v, φ) = φ
2
and assume φ > 0.
(a) Determine the eigenvalues and eigenvectors for this system and show that the
ﬁrst ﬁeld is linearly degenerate while the second ﬁeld is genuinely nonlinear.
(b) Showthat the Hugoniot locus of any point q
∗
consists of a pair of straight lines,
and that each line is also the integral curve of the corresponding eigenvector.
(c) Obtain the general solution to the Riemann problem consisting of one shock
and one contact discontinuity. Showthat this solution satisﬁes the Lax Entropy
Condition 11.1 if and only if φ
l
≥ φ
r
.
14
Gas Dynamics and the Euler Equations
A brief introduction to gas dynamics was given in Section 2.6, where the equations for
conservation of mass and momentum were stated. In this chapter we will consider the
energy equation and the equation of state in more detail, along with a few other quantities
of physical (and mathematical) signiﬁcance, such as the entropy. We will also look at some
special cases, including isentropic and isothermal ﬂows, where systems of two equations
are obtained. These provide simpliﬁed examples that can be used to illustrate the nonlinear
theory.
The derivations here will be very brief, with an emphasis on the main ideas without a
detailed description of the physics. More thorough introductions may be found in several
books on hyperbolic equations, such as [92], [156], [420], [486], or on gas dynamics, such
as [58], [70], [297], [405], [474].
Recall that ρ is the density, u the velocity, E the total energy, and p the pressure of the
gas. In Section 2.6 the continuity equation
ρ
t
+(ρu)
x
= 0 (14.1)
was derived from the more fundamental integral form, obtained by integrating the density
over a test section [x
1
, x
2
] and using the mass ﬂux ρu at each end. More generally, for any
quantity z that is advected with the ﬂow there will be a contribution to the ﬂux for z of the
form zu. Thus, the momentum equation has a contribution of the form (ρu)u = ρu
2
, and
the energy equation has a ﬂux contribution Eu.
14.1 Pressure
The velocity u(x, t ) used in gas dynamics is a macroscopic quantity that represents an
average over a huge number of gas molecules in the neighborhood of the point x. The
advective momentum ﬂux ρu
2
mentioned above is a macroscopic ﬂux, the same as what
would be obtained if all nearby gas molecules were moving at this same speed. In reality
they are not, however, and this microscopic variation leads to an additional microscopic
contribution to the momentum ﬂux, which is given by the pressure. To understand this,
consider a gas that is “at rest”, with macroscopic velocity u = 0. The individual molecules
are still moving, however, at least if the temperature is above absolute zero. One way
to calculate the pressure at a point x
1
is to think of inserting an imaginary wall in our
291
292 14 Gas Dynamics and the Euler Equations
onedimensional tube of gas at this point and calculate the force (per unit area) exerted
on each side of this wall by the gas. These forces will normally be of equal magnitude
and opposite in sign, and arise from the molecules on each side colliding with the wall and
bouncing off. Of course, if the wall is not really there, then the molecules don’t bounce off it.
Instead, molecules that approach x
1
fromx < x
1
with positive momentummove into the test
section [x
1
, x
2
] and by doing so will increase the momentumin this section, and hence make
a positive contribution to the ﬂux of momentum past x
1
. Likewise molecules that approach
x
1
from x >x
1
must have negative momentum, so as they pass the point they are removing
negative momentum from the test section, which also makes a positive contribution to the
momentum ﬂux past this point. Note that the two contributions to momentum ﬂux due to
molecules moving rightwards and leftwards do not cancel out, but rather add together to
give a net positive ﬂux of momentum. The momentum in the section [x
1
, x
2
] is thus always
increasing due to the ﬂux at the left boundary, resulting simply from the random movement
of molecules near x
1
. This seems rather paradoxical, but note that if the pressure is constant
over the test section then there will be an equal ﬂux of momentum at x
2
, out of the section,
so that the total momentum in the section remains constant (and equal to zero, since u = 0).
Note that if the pressure differs between x
1
and x
2
, then there will be a net nonzero ﬂux of
momentum into this section, and hence an apparent macroscopic acceleration of the gas.
(Individual molecules are not actually accelerated, however – it’s just that the distribution
of velocities observed in the test section is changing.)
In general the pressure gives the microscopic momentum ﬂux that must be added to the
advective ﬂux ρu
2
to obtain the total momentum ﬂux,
momentum ﬂux = ρu
2
+ p, (14.2)
leading to the integral conservation law
d
dt
x
2
x
1
ρ(x, t )u(x, t ) dx = −[ρu
2
+ p]
x
2
x
1
. (14.3)
The differential form of the momentum equation is
(ρu)
t
+(ρu
2
+ p)
x
= 0. (14.4)
There may also be external forces acting on the gas, such as gravity, that do cause the
acceleration of individual molecules. In this case the external force must be integrated over
[x
1
, x
2
] and this contribution added to (14.3). This leads to the addition of a source term on
the righthand side of (14.4); see Section 2.5 and Chapter 17.
14.2 Energy
The total energy E is often decomposed as
E = ρe +
1
2
ρu
2
. (14.5)
The term
1
2
ρu
2
is the kinetic energy, while ρe is the internal energy. The variable e, internal
energy per unit mass, is called the speciﬁc internal energy. (In general, “speciﬁc” means
14.4 Polytropic Ideal Gas 293
“per unit mass”). Internal energy includes translational, rotational, and vibrational energy
and possibly other forms of energy in more complicated situations. In the Euler equations
we assume that the gas is in local chemical and thermodynamic equilibrium and that the
internal energy is a known function of pressure and density:
e = e( p, ρ). (14.6)
This is the equation of state for the gas, which depends on the particular gas under study.
The total energy advects with the ﬂow, leading to the macroscopic energy ﬂux term Eu.
In addition, the microscopic momentumﬂux measured by p leads to a ﬂux in kinetic energy
that is given by pu. In the absence of outside forces, the conservation law for total energy
thus takes the differential form
E
t
+[(E + p)u]
x
= 0. (14.7)
If outside forces act on the gas, then a source term must be included, since the total energy
will be modiﬁed by work done on the gas.
14.3 The Euler Equations
Putting these equations together gives the system of Euler equations
ρ
ρu
E
t
+
ρu
ρu
2
+ p
(E + p)u
x
= 0. (14.8)
These are a simpliﬁcation of the more realistic Navier–Stokes equations, which also include
effects of ﬂuid viscosity and heat conduction. The terms dropped involve secondorder
derivatives that would make the system parabolic rather than hyperbolic, and cause them
to have smooth solutions for all time. However, when the viscosity and heat conductivity
are very small, the vanishingviscosity hyperbolic equations are a good approximation.
The resulting discontinuous shock waves are good approximations to what is observed in
reality – very thin regions over which the solution is rapidly varying. (In some cases viscous
effects may be nonnegligible. For example, viscous boundary layers may have a substantial
effect on the overall solution; see Section 21.8.4.)
To obtain a closed system of equations, we still need to specify the equation of state
relating the internal energy to pressure and density.
14.4 Polytropic Ideal Gas
For an ideal gas, internal energy is a function of temperature alone, e = e(T). The temper
ature T is related to p and ρ by the ideal gas law,
p = RρT (14.9)
where R is a constant obtained by dividing the universal gas constant R by the molecular
weight of the gas. To good approximation, the internal energy is simply proportional to the
294 14 Gas Dynamics and the Euler Equations
temperature,
e = c
v
T, (14.10)
where c
v
is a constant known as the speciﬁc heat at constant volume. Such gases are called
polytropic. If energy is added to a ﬁxed volume of a polytropic gas, then the change in
energy and change in temperature are related via
de = c
v
dT. (14.11)
On the other hand, if the gas is allowed to expand at constant pressure, not all of the
energy goes into increasing the internal energy. The work done in expanding the volume
1/ρ by d(1/ρ) is p d(1/ρ), and we obtain another relation
de + p d(1/ρ) = c
p
dT (14.12)
or
d(e + p/ρ) = c
p
dT, (14.13)
where c
p
is the speciﬁc heat at constant pressure. The quantity
h = e + p/ρ (14.14)
is called the (speciﬁc) enthalpy of the gas. For a polytropic gas, c
p
is constant, so that (14.13)
yields
h = c
p
T, (14.15)
and the enthalpy is simply proportional to the temperature. Note that by the ideal gas law,
c
p
−c
v
= R. (14.16)
The equation of state for a polytropic gas turns out to depend only on the ratio of speciﬁc
heats, usually denoted by
γ = c
p
/c
v
. (14.17)
This parameter is also often called the adiabatic exponent.
Internal energy in a molecule is typically split up between various degrees of freedom
(translational, rotational, vibrational, etc.). How many degrees of freedom exist depends on
the nature of the gas. The general principle of equipartition of energy says that the average
energy in each of these is the same. Each degree of freedom contributes an average energy
of
1
2
kT per molecule, where k is Boltzmann’s constant. This gives a total contribution of
α
2
kT per molecule if there are α degrees of freedom. Multiplying this by n, the number of
molecules per unit mass (which depends on the gas), gives
e =
α
2
nkT. (14.18)
14.5 Entropy 295
The product nk is precisely the gas constant R, so comparing this with (14.10) gives
c
v
=
α
2
R. (14.19)
From (14.16) we obtain
c
p
=
1 +
α
2
R, (14.20)
and so
γ = c
p
/c
v
=
α +2
α
. (14.21)
Note that T = p/Rρ, so that
e = c
v
T =
c
v
R
p
ρ
=
p
(γ −1)ρ
(14.22)
by (14.16) and (14.17). Using this in (14.5) gives the common form of the equation of state
for an ideal polytropic gas:
E =
p
γ −1
+
1
2
ρu
2
. (14.23)
An ideal gas with this equation of state is also sometimes called a gammalaw gas.
For a monatomic gas the only degrees of freedom are the three translational degrees, so
α = 3 and γ = 5/3. For a diatomic gas there are also two rotational degrees of freedomand
α = 5, so that γ = 7/5 = 1.4. Under ordinary circumstances air is composed primarily of
N
2
and O
2
, and so γ ≈ 1.4.
14.5 Entropy
The fundamental thermodynamic quantity is the entropy. Roughly speaking, this measures
the disorder in the system, and indicates the degree to which the internal energy is available
for doing useful work. The greater the entropy, the less available the energy.
The speciﬁc entropy s (entropy per unit mass) is given by
s = c
v
log ( p/ρ
γ
) +constant. (14.24)
This can be solved for p to give
p = κe
s/c
v
ρ
γ
, (14.25)
where κ is a constant.
We can manipulate the Euler equations to derive the relation
s
t
+us
x
= 0, (14.26)
which says that entropy is constant along particle paths in regions of smooth ﬂow. In fact,
(14.26) can be derived from fundamental principles, and this equation, together with the
296 14 Gas Dynamics and the Euler Equations
conservation of mass and momentum equations, gives an alternative formulation of the
Euler equations for smooth ﬂows (though not in conservation form):
ρ
t
+(ρu)
x
= 0,
(ρu)
t
+(ρu
2
+ p)
x
= 0, (14.27)
s
t
+us
x
= 0.
The equation of state in these variables gives p as a function of ρ and s, e.g. (14.25) for a
polytropic gas.
From our standpoint the most important property of entropy is that in smooth ﬂow it
remains constant on each particle path, whereas if a particle crosses a shock, then the
entropy may jump, but only to a higher value. This results from the fact that the viscous
processes (molecular collisions) in the thin physical shock proﬁle cause the entropy to
increase. This gives the physical entropy condition for shocks. (The term “ﬂuid particle” is
used to mean an inﬁnitesimal volume of ﬂuid that nonetheless contains a huge number of
molecules.)
Note that along a particle path in smooth ﬂow, since s is constant, we ﬁnd by (14.25) that
p = ˆ κρ
γ
, (14.28)
where ˆ κ = κe
s/c
v
is a constant that depends only on the initial entropy of the particle. This
explicit relation between density and pressure along particle paths is sometimes useful. Of
course, if the initial entropy varies in space, then ˆ κ will be different along different particle
paths.
Note that it appears we can combine the ﬁrst and third equations of (14.27) to obtain a
conservation law for the entropy per unit volume, S = ρs,
S
t
+(uS)
x
= 0. (14.29)
This equation does hold for smooth solutions, but it does not follow from an integral
conservation law that holds more generally, and in fact entropy is not conserved across
shocks. Hence the apparent system of conservation laws obtained by replacing the third
equation of (14.27) by (14.29) is not equivalent to the conservative Euler equations (14.8)
for weak solutions, and would result in physically incorrect shock speeds.
14.5.1 Isentropic Flow
If we consider very small smooth perturbations around some background state (as in acous
tics), then no shocks will form over reasonable time periods, and so we can use these
nonconservative equations (14.27) and obtain the same results as with the conservative
Euler equations. Moreover, since s simply advects with the ﬂow, if s is initially uniform
throughout the gas, then s will remain constant and we do not need to bother solving the third
equation in (14.27). This justiﬁes the use of the isentropic equations for small disturbances,
which were presented in Section 2.3. Taking s = constant in (14.25) gives the equation of
14.5 Entropy 297
state (14.28), as was introduced earlier in (2.35). The isentropic equations again are
ρ
ρu
t
+
ρu
ρu
2
+ ˆ κρ
γ
x
= 0. (14.30)
Recall that the sound speed c is given by
c =
γ p/ρ. (14.31)
This was derived fromthe linearizedequations usingthe ideal gas equationof state presented
above. With a more general equation of state we can still study acoustics by linearizing for
small perturbations. Assuming the entropy is constant then results in the more general
expression for the sound speed,
c =
∂p
∂ρ
s=const
. (14.32)
The sound speed is computed in general from the equation of state p = p(ρ, s) by taking
the partial derivative with respect to ρ. This corresponds to the fact that within an acoustic
wave the density and pressure vary, but the entropy does not, and the “stiffness” of the gas
(i.e., its response to compression in the form of increased pressure) dictates the velocity
with which an acoustic wave propagates.
Note that the isentropic equations are still nonlinear, and so in general we expect shocks
to form if we take arbitrary data. In particular, if we look at a Riemann problem with
discontinuous data, then we may have shocks in the solution immediately. What is the
physical meaning of these shocks, in view of the fact that across a real gasdynamic shock
we know the entropy cannot remain constant?
In reducing the Euler equations to the isentropic equations, we have dropped the conser
vationofenergy equation. If we study only ﬂows for which the entropy is truly constant (no
shocks), then this equation will be automatically satisﬁed. However, if we use the isentropic
equations for a problem with shocks, then conservation of energy will not hold across
the shock. Mathematically such weak solutions of the isentropic equations make perfectly
good sense, but they no longer model reality properly, since they do not model conservation
of energy. (However, if the shocks are weak enough, then very little entropy is produced
physically and the “isentropic” shock may be a good approximation to reality.)
Another way to view this is by the following thought experiment. We could, in principle,
create a physical shock wave across which there is no increase in entropy if we could ﬁnd
a way to reduce the entropy of each gas particle just after it passes through the shock. In
principle we could accomplish this by doing some work on each ﬂuid particle to eliminate
the “disorder” created by the trauma of passing through the shock. Doing so would require
an input of energy right at the shock. Hence across this hypothetical isentropic shock there
must be a jump in the energy of the gas, reﬂecting the outside work that has been done on it.
Moreover, across an isentropic shock we see that the energy must jump to a higher value.
This can be used as an admissibility criterion for shocks in the weak formulation of the
isentropic equations. A shock is the correct vanishingviscosity solution to the isentropic
equations only if the energy increases across the shock. The energy can thus be used as
298 14 Gas Dynamics and the Euler Equations
an “entropy function” for the isentropic system of equations, in the sense introduced in
Chapter 11 (though that terminology is particularly confusing here).
14.6 Isothermal Flow
Taking γ = 1 in the isentropic equations (14.30) gives a particularly simple set of equations.
By (14.21), the case γ = 1 is not physically realizable but can be viewed as a limiting case
as α →∞, i.e., for very complex molecules with many degrees of freedom. Note that such
gases also have large heat capacities c
v
and c
p
, meaning that it requires a substantial input of
energy to change the temperature very much. In the limit γ →1 the gas becomes isothermal,
with constant temperature.
One can also obtain the isothermal ﬂowequations by considering an ordinary gas in a tube
that is immersed in a bath at a constant temperature
¯
T. If we assume that this bath maintains
a constant temperature within the gas, then we again obtain isothermal ﬂow within the gas.
In isothermal ﬂow, the ideal gas law (14.9) reduces to
p = a
2
ρ, (14.33)
where a
2
≡ R
¯
T is a constant and a is the sound speed (which is constant in isothermal ﬂow).
Note that maintaining this constant temperature requires heat ﬂux through the wall of the
tube (to take away heat generated at a shock or supply heat to a rarefaction), and so energy
is no longer conserved in the tube. But mass and momentum are still conserved, and these
equations, together with the equation of state (14.33), lead to the isothermal equations,
ρ
ρu
t
+
ρu
ρu
2
+a
2
ρ
x
= 0. (14.34)
Isothermal ﬂowis alsoanappropriate model for some astrophysical problems, particularly
when modeling shock waves traveling through lowdensity interstellar space. In many cases
the temperature increase caused by a shock wave leads to a radiative loss of energy via
electromagnetic waves (at the speed of light) and very little of this energy is reabsorbed by
the gas nearby.
In practice the temperature of a gas will never stay exactly constant, but it may relax
towards a constant temperature very quickly as energy ﬂows in or out of the gas via radiation
or other mechanisms. A better physical model can be obtained by considering the full Euler
equations with a source termthat models the ﬂowof heat into or out of the gas. Adiscussion
of this relaxation system can be found in Section 17.17.3.
The isothermal equations are a system of two conservation laws for which the Hugoniot
loci and integral curves are easy to compute, similarly to what was done in Chapter 13 for
the shallow water equations. These are worked out for isothermal ﬂow in [281].
14.7 The Euler Equations in Primitive Variables
For smooth solutions it is possible to rewrite the Euler equations in various nonconservative
forms that are sometimes easier to work with or more revealing than the conservative form
14.7 The Euler Equations in Primitive Variables 299
(14.8). One example is the system (14.27), which shows that entropy is constant along
streamlines for smooth solutions.
Another form that is more comprehensible physically is obtained by working in the
primitive variables ρ, u, and p instead of the conserved variables, since the density, velocity
and pressure are more intuitively meaningful. (Indeed, when we plot solutions to the the
Euler equations it is generally these variables that are plotted, even if the calculation was
done in terms of the conserved variables.)
From the mass and momentum conservation equations it is easy to derive the equations
ρ
t
+uρ
x
+ρu
x
= 0 (14.35)
for the density and
u
t
+uu
x
+(1/ρ) p
x
= 0 (14.36)
for the velocity. With more manipulations one can also derive the equation
p
t
+γ pu
x
+up
x
= 0 (14.37)
for a polytropic gas. These three equations yield the quasilinear hyperbolic system
ρ
u
p
t
+
u ρ 0
0 u 1/ρ
0 γ p u
ρ
u
p
x
= 0. (14.38)
This matrix has a considerably simpler form than the Jacobian matrix f
(q) obtained from
the conservative equations (14.8), which is given in (14.43) below. The eigenvalues and
eigenvectors of the coefﬁcient matrix in (14.38) are easily computed to be
λ
1
= u −c, λ
2
= u, λ
3
= u +c,
r
1
=
−ρ/c
1
−ρc
, r
2
=
1
0
0
, r
3
=
ρ/c
1
ρc
,
(14.39)
where c is the sound speed of the polytropic gas,
c =
γ p
ρ
. (14.40)
We see a familiar pattern in these eigenvalues: information can advect at the ﬂuid velocity
or move as acoustic waves at speeds ±c relative to the gas. The ratio
M = u/c (14.41)
is called the Mach number. The ﬂow is transonic at any point where M passes through 1.
Note that linearizing these equations about a state (ρ
0
, u
0
, p
0
) gives a result that is easily
related to the acoustic equations derived in Section 2.7, and the eigenvectors (14.39) have
been normalized in a manner analogous to that chosen in (2.58). (Other normalizations can
300 14 Gas Dynamics and the Euler Equations
be used instead. In particular, multiplying r
1
and r
3
by c and r
2
by ρ would give a form
where the physical units agree with those of the vector (ρ, u, p).)
From the above expressions we see that the Euler equations are hyperbolic provided ρ
and p are positive. Moreover we can compute the gradients of the eigenvalues and ﬁnd
that the ﬁrst and third characteristic ﬁeld are genuinely nonlinear while the second ﬁeld is
linearly degenerate:
∇λ
1
=
−∂c/∂ρ
1
−∂c/∂p
=
c/2ρ
1
−c/2p
=⇒ ∇λ
1
· r
1
=
1
2
(γ +1),
∇λ
2
=
0
1
0
=⇒ ∇λ
2
· r
2
= 0,
∇λ
3
=
∂c/∂ρ
1
∂c/∂p
=
−c/2ρ
1
c/2p
=⇒ ∇λ
3
· r
3
=
1
2
(γ +1).
(14.42)
Simple waves in the second characteristic ﬁeld consist of variations in density that are
advecting with constant speed u, since u and p must be constant in such a wave. Such waves
are often called entropy waves because the entropy satisﬁes the advection equation (14.26)
and varies along with the density if p is constant. For the Riemann problem, the second
ﬁeld corresponds to contact discontinuities as described in Section 13.12, across which the
two initial gases are in contact.
Simple waves in the ﬁrst or third family will deform, since λ
1
and λ
3
vary along the
integral curves of these families, sharpening into shocks or spreading out as rarefactions.
14.8 The Riemann Problem for the Euler Equations
To discuss the Riemann problem, we must return to the conservative form of the equations,
which are valid across shock waves. If we compute the Jacobian matrix f
(q) from (14.8),
with the polytropic equation of state (14.23), we obtain
f
(q) =
0 1 0
1
2
(γ −3)u
2
(3 −γ )u γ −1
1
2
(γ −1)u
3
−uH H −(γ −1)u
2
γ u
, (14.43)
where
H =
E + p
ρ
= h +
1
2
u
2
(14.44)
is the total speciﬁc enthalpy. The eigenvalues are again
λ
1
= u −c, λ
2
= u, λ
3
= u +c, (14.45)
14.9 Contact Discontinuities 301
as for the coefﬁcient matrix resulting from the primitive equations. They agree because the
two forms are equivalent and should yield the same characteristic speeds. The eigenvectors
will appear different, of course, in these different variables. We have
r
1
=
1
u −c
H −uc
, r
2
=
1
u
1
2
u
2
, r
3
=
1
u +c
H +uc
. (14.46)
Note that in these variables
∇λ
2
(q) =
−u/ρ
1/ρ
0
, (14.47)
and so we again ﬁnd that ∇λ
2
· r
2
≡ 0 and the second ﬁeld is linearly degenerate.
14.9 Contact Discontinuities
We can have neither rarefaction waves nor shocks in the 2characteristic ﬁeld. Instead we
have contact discontinuities, which are linear discontinuities that propagate with speed
equal to the characteristic speed λ
2
on each side.
Note that because λ
2
= u is constant on the integral curves of r
2
, and because r
2
depends
only on u, the vector r
2
is itself constant on these curves, and hence the integral curves are
straight lines in phase space. Moreover, these integral curves also form the Hugoniot loci
for contact discontinuities. Along these curves u and p are constant; only ρ varies.
It may seem strange that this discontinuity can sustain a jump in density – it seems that
the denser gas should try to expand into the thinner gas. But that’s because our intuition
tends to equate higher density with higher pressure. It is only a pressure difference that can
provide the force for expansion, and here the pressures are equal.
We can achieve two different densities at the same pressure by taking gases at two different
temperatures. In fact, from (14.9) it is clear that there must be a jump in temperature if there
is a jump in density but not in pressure. There must also be a jump in entropy by (14.24).
This explains why contact discontinuities do not appear in solutions to the isothermal or
isentropic equations considered previously. In the reduction of the Euler equations to one
of these systems of only two equations, it is this linearly degenerate characteristic ﬁeld that
disappears.
Also, in the shallow water equations, where the pressure is related to the depth h by
(13.3), it is not possible to have a jump in depth without also having a jump in pressure.
Hence we see contact discontinuities only if we introduce another passive tracer advected
with the ﬂuid, as we did in Section 13.12.
Note that in all these hyperbolic systems we are ignoring diffusive effects, such as molec
ular diffusion of a tracer or diffusion of heat in a gas. These effects would smear out contact
discontinuities in reality. We are assuming the diffusion coefﬁcients are sufﬁciently small
that these effects are negligible over the time scales of interest.
302 14 Gas Dynamics and the Euler Equations
14.10 Riemann Invariants
Recall that for each family, the Riemann invariants are functions of q that are constant along
any integral curve of this family and hence are constant through any simple wave in this
family. Knowing these functions is very helpful in constructing solutions to the Riemann
problem.
Since u and p are both constant across a contact discontinuity, these functions of q are
both Riemann invariants of the 2family.
The entropy s satisﬁes the advection equation (14.26) and hence is constant along particle
paths. It follows that s is constant through any rarefaction wave or other simple wave in the
1family or 3family, and hence entropy is a Riemann invariant for these families. There’s
also a second set of Riemann invariants for each of these families. All of the Riemann
invariants for a polytropic ideal gas are summarized below:
1Riemann invariants: s, u +
2c
γ −1
,
2Riemann invariants: u, p,
3Riemann invariants: s, u −
2c
γ −1
.
(14.48)
14.11 Solution to the Riemann Problem
The solution to a Riemann problem typically has a contact discontinuity and two nonlinear
waves, each of which may be either a shock or a rarefaction wave, depending on q
l
and q
r
.
The structure of a typical Riemann solution is shown in Figure 14.1 (see also the examples in
Section 14.13). The ﬁrst and third characteristic ﬁelds for the Euler equations are genuinely
nonlinear and have behavior similar to the two characteristic ﬁelds in the isothermal or
isentropic equations, and also similar to what we have seen for the two ﬁelds in the shallow
water equations inChapter 13. The contact discontinuityis alsosometimes calledthe entropy
wave, since it carries a jump in entropy. The ﬁrst and third wave families are called acoustic
waves, since in the smalldisturbance limit these reduce to acoustics equations.
ρ
l
u
l
p
l
ρ
∗
l
u
∗
p
∗
ρ
∗
r
u
∗
p
∗
ρ
r
u
r
p
r
Rarefaction wave Shock Contact
Fig. 14.1. Typical solution to the Riemann problem for the Euler equations.
14.11 Solution to the Riemann Problem 303
Because u and p are constant across the contact discontinuity, it is often easier to work
in the primitive variables (ρ, u, p) rather than (ρ, ρu, E), although of course the jump
conditions must be determined using the conserved variables. The resulting Hugoniot locus
and integral curves can be transformed into (ρ, u, p) space.
If the Riemann data is (ρ
l
, u
l
, p
l
) and (ρ
r
, u
r
, p
r
), then the two new constant states that
appear in the Riemann solution will be denoted by q
∗
l
= (ρ
∗
l
, u
∗
, p
∗
) and q
∗
r
= (ρ
∗
r
, u
∗
, p
∗
).
(See Figure 14.1.) Note that across the 2wave we know there is a jump only in density.
Solution of the Riemann problem proceeds in principle just as in the previous chapters.
Given the states q
l
and q
r
in the phase space, we need to determine the two intermediate
states in such a way that q
l
and q
∗
l
are connected by a 1wave, q
∗
l
and q
∗
r
are connected by a
2wave, and ﬁnally q
∗
r
and q
r
are connected by a 3wave. We need to consider three families
of curves in the threedimensional state space and ﬁnd the appropriate intersections.
This seems difﬁcult, but we can take advantage of the fact that we know the 2wave will
be a contact discontinuity across which u and p are constant to make the problem much
simpler. Instead of considering the full threedimensional (ρ, u, p) phase space, consider
the p–u plane, and project the integral curves and Hugoniot loci for the 1waves and
3waves onto this plane. In particular, project the locus of all states that can be connected
to q
l
by a 1wave (entropy satisfying shocks or rarefactions) onto this plane, and also the
locus of all states that can be connected to q
r
by a 3wave. This gives Figure 14.2.
We see in this example that we can go fromq
l
(or actually, the projection of q
l
) to q
∗
by a
1rarefaction and fromq
∗
to q
r
by a 3shock. The problemwith this construction, of course,
is that these curves are really curves in threespace, and the mere fact that their projections
intersect does not mean the original curves intersect. However, the curve R
1
(q
l
) must go
through some state q
∗
l
= (ρ
∗
l
, u
∗
, p
∗
) for some ρ
∗
l
(so that its projection onto the u–p plane
is (u
∗
, p
∗
)). Similarly, the curve S
3
(q
r
) must pass through some state q
∗
r
= (ρ
∗
r
, u
∗
, p
∗
).
But these two states differ only in ρ, and hence can be connected by a 2wave (contact
discontinuity). We have thus achieved our objective. Note that this technique depends on
the fact that any jump in ρ is allowed across the contact discontinuity.
Based on the given state q
l
, we can ﬁnd a function u = φ
l
( p) that describes how u varies
as we adjust p in a state ( p, u) that can be connected to q
l
by a 1shock or 1rarefaction. For
0 0.5 1 1.5 2 2.5 3 3.5 4
−4
−3
−2
−1
0
1
2
3
4
p = pressure
u
=
v
e
l
o
c
i
t
y
(p
l
, u
l
) (p
r
, u
r
)
(p
∗
, u
∗
)
Fig. 14.2. Projection of shock and rarefaction curves onto the twodimensional p–u plane, and de
termination of ( p
∗
, u
∗
), for Sod’s Riemann problem discussed in Section 14.13.
304 14 Gas Dynamics and the Euler Equations
p < p
l
this function is deﬁned by the integral curve of r
1
(projected to the p–u plane), since
such states can be connected to q
l
by a 1rarefaction. For p > p
l
this function is deﬁned by
the Hugoniot locus, since these states can be connected by a shock. Similarly, for a given
state q
r
we can ﬁnd a function u = φ
r
( p) that describes how u varies as we adjust p in a
state ( p, u) that can be connected to q
r
by a 3shock or 3rarefaction.
To solve the Riemann problem we need only solve for a pressure p
∗
for which φ
l
( p
∗
) =
φ
r
( p
∗
), which is a scalar nonlinear equation for p
∗
. In general this must be solved by an
iterative method. Once p
∗
is known, u
∗
, ρ
∗
l
, and ρ
∗
r
are easily determined. Godunov ﬁrst
proposed a numerical method based on the solution of Riemann problems and presented
one such iterative method in his paper [157] (also described in §12.15 of [369]). Chorin [67]
describes an improvement of this method, and many other variants have been developed
more recently.
We now brieﬂy summarize how the functions φ
l
( p) and φ
r
( p) are determined. First
consider the case of 1rarefactions through q
l
. Since the entropy s is a 1Riemann invariant,
we know that p/ρ
γ
is constant through any rarefaction wave. This allows us to determine
how ρ varies with p through a 1rarefaction:
ρ = ( p/p
l
)
1/γ
ρ
l
. (14.49)
We also know that the other 1Riemann invariant from (14.48) is constant through any
rarefaction wave, so
u +
2
γ −1
γ p
ρ
= u
l
+
2
γ −1
γ p
l
ρ
l
. (14.50)
We can use (14.49) to eliminate ρ on the left hand side and obtain
u +
2
γ −1
γ p
ρ
l
p
l
p
1/γ
= u
l
+
2
γ −1
γ p
l
ρ
l
or
u +
2
γ −1
γ p
l
ρ
l
p
p
l
(γ −1)/γ
= u
l
+
2
γ −1
γ p
l
ρ
l
.
Rearranging this and using c
l
=
√
γ p
l
/ρ
l
to denote the speed of sound in the left state, we
can solve this for u and obtain
u = u
l
+
2 c
l
γ −1
1 −( p/p
l
)
(γ −1)/(2γ )
≡ φ
l
( p) for p ≤ p
l
. (14.51)
This deﬁnes the function φ
l
( p) for p ≤ p
l
.
To determine this function for p > p
l
we need to use the Rankine–Hugoniot conditions
instead of the Riemann invariants. We omit the detailed manipulations (see [420], for
example) and just present the ﬁnal formula, in which β = (γ +1)/(γ −1):
u = u
l
+
2 c
l
√
2γ (γ −1)
1 − p/p
l
√
1 +βp/p
l
≡ φ
l
( p) for p ≥ p
l
. (14.52)
14.12 The Structure of Rarefaction Waves 305
For each point ( p, u) on the Hugoniot locus, there is a unique density ρ associated with it,
given by
ρ =
1 +βp/p
l
p/p
l
+β
ρ
l
. (14.53)
Similarly, the function φ
r
( p) can be determined for a given state q
r
by the same procedure.
We obtain
u = u
r
−
2 c
r
γ −1
1 −( p/p
r
)
(γ −1)/(2γ )
≡ φ
r
( p) for p ≤ p
r
, (14.54)
and
u = u
r
−
2 c
r
√
2γ (γ −1)
1 − p/p
r
√
1 +βp/p
r
≡ φ
r
( p) for p ≥ p
r
. (14.55)
The corresponding density for points on this 3locus is given by
ρ =
1 +βp/p
r
p/p
r
+β
ρ
r
. (14.56)
It is these functions φ
l
( p) and φ
r
( p) that are plotted in Figure 14.2 (for the particular
case of the Sod’s Riemann problem described in the Section 14.13). An iterative procedure
can be used to determine the intersection ( p
∗
, u
∗
).
Note that the formulas (14.55) and (14.56) are useful in setting initial data for numerical
tests if we wish to specify data that corresponds to a single shock wave (a 3shock in this
case). We can choose the right state and the pressure p
l
as we please, and then determine
u
l
and ρ
l
using these formulas.
14.12 The Structure of Rarefaction Waves
In Section 14.11 we saw how to determine the Riemann solution for the Euler equations
(with the polytropic equation of state) in the sense of ﬁnding the intermediate states q
∗
l
and q
∗
r
. To fully specify the Riemann solution we must also determine the structure of any
rarefaction waves, i.e., determine ρ, u, and p as functions of ξ = x/t .
Suppose there is a 1rarefaction connecting q
l
to a state q
∗
l
. Then at each point in the
rarefaction, ξ = λ
1
(q) = u −c, and hence the sound speed c is given by
c = u −ξ. (14.57)
We can use this expression to eliminate c =
√
γ p/ρ from the equality (14.50) to obtain
u +
2
γ −1
(u −ξ) = u
l
+
2
γ −1
c
l
. (14.58)
We can solve this for u as a function of ξ:
u(ξ) =
(γ −1)u
l
+2(c
l
+ξ)
γ +1
. (14.59)
306 14 Gas Dynamics and the Euler Equations
From (14.57) and (14.59) we now know how c varies with ξ:
c(ξ) = u(ξ) −ξ. (14.60)
Next we can use the fact that p/ρ
γ
is constant to obtain the relation between c and ρ in the
rarefaction:
c
2
= γ p/ρ
= γ ( p/ρ
γ
)ρ
γ −1
= γ
p
l
/ρ
γ
l
ρ
γ −1
. (14.61)
Using (14.60), this allows us to determine how ρ varies with ξ:
ρ(ξ) =
ρ
γ
l
[u(ξ) −ξ]
2
γ p
l
1/(γ −1)
. (14.62)
Finally, again using the constancy of p/ρ
γ
, we obtain
p(ξ) =
p
l
/ρ
γ
l
[ρ(ξ)]
γ
. (14.63)
The same procedure can be used for 3rarefactions, obtaining
u(ξ) =
(γ −1)u
r
−2(c
r
−ξ)
γ +1
,
ρ(ξ) =
ρ
γ
r
[ξ −u(ξ)]
2
γ p
r
1/(γ −1)
,
p(ξ) =
p
r
/ρ
γ
r
[ρ(ξ)]
γ
.
(14.64)
Having developed the formulas for the exact Riemann solution, we should note that in
practical computations all the details of this structure are generally not needed. In practice
methods based on Riemann solutions often use approximate Riemann solvers, as discussed
in Section 15.3.
14.13 Shock Tubes and Riemann Problems
An experimental shock tube is ﬁlled with two different gases (or the same gas at different
pressures and perhaps densities), separated by a membrane at x =0. Initially the gas is at
rest, so u = 0 everywhere. At time t = 0 the membrane is ruptured. The problem is a
special case of the Riemann problem (special in that u
l
= u
r
= 0), and in this case it can
be shown that the solution consists of a shock moving into the gas at lower pressure and a
rarefaction wave that expands into the gas at higher pressure. The interface between the two
gases moves at speed u
∗
, and so this interface is exactly the contact discontinuity. This is
very similar to the dambreak Riemann problem for the shallow water equations described
in Section 13.2.
Figure 14.3 shows particle paths in the x–t plane for one example with ρ
l
= p
l
= 3 and
ρ
r
= p
r
= 1. This particular problem is called the Sod problem because Sod [421] used it
14.13 Shock Tubes and Riemann Problems 307
−2 −1 0 1 2
1
1.5
2
2.5
3
Density
−2 −1 0 1 2
0
0.1
0.2
0.3
0.4
0.5
Velocity
−2 −1 0 1 2
1
1.5
2
2.5
3
Pressure
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
Particle paths in x–t plane
Fig. 14.3. Solution to the Sod shocktube problem for the Euler equations.
as a test in an inﬂuential early comparison of different numerical methods. At any ﬁxed t
the points are spaced proportional to 1/ρ (the speciﬁc volume), so wider spacing indicates
lower density. Note that there is a jump in density across the contact discontinuity while
the velocity is the same on both sides, and equal to u
∗
, so particles never cross this contact
surface. Note also the decrease in density as particles go through the rarefaction wave and
the compression across the shock.
By (14.9), the temperature is proportional to p/ρ. In the Sod problem the temperature is
initially uniform, but in the solution there must be a jump in temperature across the contact
discontinuity where ρ jumps but p is constant. Although the two gases begin at the same
temperature, the gas to the left is cooled by expansion through the rarefaction wave while
the gas to the right heats up as it crosses the shock.
When the initial velocity is zero everywhere, the Riemann solution typically consists of
one shock and one rarefaction wave, along with a contact discontinuity. This is clear from
the structure in the p–u plane shown in Figure 14.2. If the initial velocities are nonzero, then
it is possible to obtain solutions that consist of two shocks or two rarefaction waves rather
than one of each, depending on the data. This is analogous to what was seen in Chapter 13
for the shallow water equations.
Figure 14.4 shows one other example of a Riemann problem for adiabatic gas dynamics,
in which the solution contains two shock waves. In this case the Riemann data is
ρ
l
= 1, u
l
= 3, p
l
= 1
and
ρ
r
= 2, u
r
= 1, p
r
= 1.
308 14 Gas Dynamics and the Euler Equations
−2 −1 0 1 2
1
1.5
2
2.5
3
3.5
4
4.5
Density
−2 −1 0 1 2
1
1.5
2
2.5
3
Velocity
−2 −1 0 1 2
1
1.5
2
2.5
3
3.5
Pressure
−2 −1 0 1 2
0
0.2
0.4
0.6
0.8
1
Particle paths in x–t plane
Fig. 14.4. Solution to a Riemann problemfor the Euler equations where the gas to the left has a higher
velocity and the Riemann solution consists of two shock waves.
In this case the colliding gases lead to an increase in the density and pressure in the interme
diate states relative to the initial states. Note that again the contact discontinuity separates
particle paths arising from the two initial states.
14.14 Multiﬂuid Problems
In our discussion above, we have assumed that the Riemann problem consists of the same
gas on either side of the initial discontinuity, with only a jump in the state of the gas.
Many practical problems involve the interaction of more than one gas. As a starting point
for developing algorithms for this multiﬂuid or multicomponent situation, we might study
a Riemann problem in which two different gases are in contact at x =0 initially. In the
simplest case these might be two different ideal gammalaw gases with different values
of γ , e.g., a shocktube problem with the membrane initially separating air (γ
l
≈ 1.4) from
a monatomic gas such as argon (γ
r
= 5/3).
In this case the Riemann solution still has the same structure discussed in this chapter and
seen in Figure 14.1, with the two gases always in contact at the contact discontinuity. But
now the shock or rarefaction wave that is moving into each gas must satisfy the appropriate
jump conditions or integral relations for that particular gas. The Riemann problem can still
be solved by the procedure outlined in Section 14.11, but the function φ
l
( p) must be deﬁned
using γ
l
while φ
r
( p) is deﬁned using γ
r
. Setting φ
l
( p) = φ
r
( p) and solving for p gives the
intermediate pressure p
∗
. Even in this more general case, the pressure and velocity must be
continuous across the contact discontinuity, and only the density has a jump.
14.15 Other Equations of State and Incompressible Flow 309
To apply a numerical method in the multiﬂuid case we must keep track of the constituent
gases so that we know what value of γ to use in each grid cell. This is further complicated
by the fact that numerically the sharp interface between the two gases will be smeared
due to numerical diffusion, and some cells will contain a mixture of gases. Approaches to
handling this with shockcapturing ﬁnite volume methods are discussed in Section 16.6.
An alternative is to use a fronttracking or movingmesh method to insure that the ﬂuid
interface is also a grid interface, e.g., [131].
14.15 Other Equations of State and Incompressible Flow
We have considered the Riemann problem only for the simplest idealgas equation of state
(14.23). This is valid for many problems, including aerodynamic problems at subsonic
or modest supersonic speeds. In some situations it may be necessary to consider realgas
effects, and a more complicated equation of state must be used, either a more complicated
analytic expression or perhaps an “equation of state” that is only speciﬁed by tabulated
values obtained from experiments with the gas or material of interest. The use of more
general equations of state can complicate the Riemann solver. See [81], [91], [144], [149],
[150], [208], [326], [328], [330], [396] for some discussions of more general Riemann
problems.
As an example, consider what happens to a gas if we compress it to the point where
the average intermolecular distance begins to approach the size of the molecules. Then the
idealgas equation of state will no longer be valid, since it is based on a model in which each
gas molecule is viewed as a single point and the gas can be compressed indeﬁnitely. Instead
we must take into account the fact that the molecules themselves take up some space. This
leads to the covolume equation of state
p =
RT
v −b
. (14.65)
This is written in terms of the speciﬁc volume v = 1/ρ. For b = 0 this agrees with the
idealgas equation of state (14.9), and b > 0 now represents the volume taken up by the
molecules themselves.
Additional corrections must be made to this equation of state as v approaches b. When
the molecules are very close together the intermolecular attractive forces (van der Waals
forces) must be considered, which tend to reduce the pressure. This leads to the van der
Waals equation of state for dense polytropic gases,
p =
RT
v −b
−
a
v
2
, (14.66)
along with the energy equation
e = e(T, v) = c
v
T −a/v. (14.67)
See, for example, [191], [192], [413]. In extreme cases, the gas undergoes a phase change
and becomes a liquid. Phasechange problems can lead to loss of hyperbolicity as described
in Section 16.3.2.
310 14 Gas Dynamics and the Euler Equations
The Euler equations of compressible ﬂow can also be used to simulate ﬂuid dynamics in
liquids, although in most applications liquids are essentially incompressible and acoustic
waves have little effect onthe ﬂuidmotion. Anexceptionis inthe studyof violent phenomena
such as underwater explosions or cavitation, or certain other problems involving liquid–
gas interfaces. For such problems the compressible equations can be used with a suitable
equation of state for the liquid. See [65], [88], [138], [212], [370], [449] for some examples.
In some applications acoustic waves in liquids are of interest in their own right, e.g.,
underwater acoustics, or ultrasoundtransmissioninbiological tissue. Inthese cases the linear
acoustic equations can often be used by assuming the liquid is stationary on the time scale
of interest in the acoustics problem. Explicit hyperbolic solvers are appropriate in this case.
For most problems involving the dynamics of liquids, the incompressible Navier–Stokes
equations are used instead. Viscous terms are included, since viscosity generally cannot be
ignored in liquids. In these equations the pressure is typically determined by the constraint
that the divergence of the velocity ﬁeld must vanish everywhere (∇ · u = 0), since the ﬂuid
is incompressible. This is a global constraint that must typically be imposed numerically by
solving an elliptic boundaryvalue problemover the spatial domain each time step. Note that
this couples all points in the domain and allows information to travel at inﬁnite speed, as must
occur in an incompressible ﬂuid. Applying a force to the ﬂuid at one point will generally
cause motion everywhere instantaneously. In reality, information cannot travel at inﬁnite
speed, and this motion is in fact accomplished by acoustic waves rapidly bouncing back
and forth through the domain at a much higher velocity than the observed ﬂuid motion. See
Exercise 3.7 for a similar effect in low Mach number compressible ﬂow, and Example 22.3
for a related example in solid mechanics.
In a liquid, these acoustic waves could be explicitly modeled using the compressible
Navier–Stokes equations with appropriate equations of state. However, this is generally
very inefﬁcient, since we would need to take extremely small time steps in order to properly
resolve these waves. The incompressible equations correctly model the ﬂuid dynamics of
interest by capturing the effect of the acoustic waves without explicitly modeling their
propagation. Highresolution hyperbolic solvers are often used as a component in these
methods for the convective terms, e.g., [9], [23], [53], [56], [266], [329]. These algorithms
must then be coupled with implicit solvers for the viscous terms and elliptic solvers in lieu
of an equation of state for the pressure. The study of incompressible Navier–Stokes and
numerical methods for these equations is a very extensive topic that will not be pursued
further here.
The incompressible equations are also useful for gas dynamics at very lowMach numbers,
where again the acoustic waves have little effect on the ﬂuid dynamics and the gas density
is often nearly constant. Problems in atmospheric ﬂow and lowspeed aerodynamics often
have this character, for example. Challenging numerical problems arise in simulating low
Mach number ﬂow in situations where compressible effects are present but very weak.
Ideally one would like to use robust methods that are efﬁcient in the zero Mach number
limit (incompressible ﬂow) but behave like highresolution compressibleﬂow algorithms
as the Mach number increases. See [10], [173], [399], [404], [242], [386], [119] for some
discussions of this problem and possible approaches.
15
Finite Volume Methods for Nonlinear Systems
15.1 Godunov’s Method
Godunov’s method has already been introduced in the context of linear systems in Chapter 4
and for scalar nonlinear problems in Chapter 12. The method is easily generalized to
nonlinear systems if we can solve the nonlinear Riemann problemat each cell interface, and
this gives the natural generalization of the ﬁrstorder upwind method to general systems of
conservation laws.
Recall that Q
n
i
represents an approximation to the cell average of q(x, t
n
) over cell C
i
,
Q
n
i
≈
1
x
x
i +1/2
x
i −1/2
q(x, t
n
) dx,
and the idea is to use the piecewise constant function deﬁned by these cell values as initial
data ˜ q
n
(x, t
n
) for the conservation law. Solving over time t with this data gives a function
˜ q
n
(x, t
n+1
), which is then averaged over each cell to obtain
Q
n+1
i
=
1
x
x
i +1/2
x
i −1/2
˜ q
n
(x, t
n+1
) dx. (15.1)
If the time step t is sufﬁciently small, then the exact solution ˜ q
n
(x, t ) can be determined
by piecing together the solutions to the Riemann problem arising from each cell interface,
as indicated in Figure 15.1(a).
Recall fromSection4.11that we donot needtoperformthe integrationin(15.1) explicitly,
which might be difﬁcult, since ˜ q
n
(x, t
n+1
) may be very complicated as a function of x.
Instead, we can use the fact that ˜ q
n
(x
i −1/2
, t ) is constant in time along each cell interface,
so that the integral (4.5) can be computed exactly. Hence the cell average is updated by the
formula
Q
n+1
i
= Q
n
i
−
t
x
F
n
i +1/2
− F
n
i −1/2
, (15.2)
with
F
n
i −1/2
= F
Q
n
i −1
, Q
n
i
= f
q
∨

Q
n
i −1
, Q
n
i
. (15.3)
As usual, q
∨

(q
l
, q
r
) denotes the solution to the Riemann problem between states q
l
and q
r
,
evaluated along x/t = 0.
311
312 15 Finite Volume Methods for Nonlinear Systems
(a) (b)
Fig. 15.1. Solving the Riemann problems at each interface for Godunov’s method. (a) With Courant
number less than 1/2 there is no interaction of waves. (b) With Courant number less than 1 the
interacting waves do not reach the cell interfaces, so the ﬂuxes are still constant in time.
In Figure 15.1(a) the time step is taken to be small enough that there is no interaction
of waves from neighboring Riemann problems. This would be necessary if we wanted to
construct the solution at ˜ q
n
(x, t
n+1
) in order to explicitly calculate the cell averages (15.1).
However, in order to use the ﬂux formula (15.3) it is only necessary that the edge value
˜ q
n
(x
i −1/2
, t ) remain constant in time over the entire time step, which allows a time step
roughly twice as large, as indicated in Figure 15.1(b). If s
max
represents the largest wave
speed that is encountered, then on a uniform grid with the cell interfaces distance x apart,
we must require
s
max
t
x
≤ 1 (15.4)
in order to insure that the formula (15.3) is valid. Note that this is precisely the CFL
condition required for stability of this threepoint method, as discussed in Section 4.4. In
general s
max
t /x is called the Courant number. Figure 15.1(a) shows a case for Courant
number less than 1/2; Figure 15.1(b), for Courant number close to 1. Note that for a linear
system of equations, s
max
= max
p
λ
p
, and this agrees with the previous deﬁnition of the
Courant number in Chapter 4.
To implement Godunov’s method we do not generally need to determine the full structure
of the Riemann solution at each interface, only the value Q
∨

i −1/2
= q
∨

(Q
n
i −1
, Q
n
i
) at the cell
interface. Normally we only need to determine the intermediate states where the relevant
Hugoniot loci and/or integral curves intersect, and Q
∨

i −1/2
will equal one of these states.
In particular we usually do not need to determine the structure of the solution within
rarefaction waves at all. The only exception to this is if one of the rarefactions is transonic,
so that the value of Q
∨

i −1/2
falls within the rarefaction fan rather than being one of the
intermediate states. Even in this case we only need to evaluate one value from the fan, the
value corresponding to ξ = x/t = 0 in the theory of Section 13.8.5, since this is the value
that propagates with speed 0 and gives Q
∨

i −1/2
.
15.2 Convergence of Godunov’s Method 313
Godunov’s method can again be implemented in the wave propagation form
Q
n+1
i
= Q
n
i
−
t
x
A
+
Q
i −1/2
+A
−
Q
i +1/2
(15.5)
if we deﬁne the ﬂuctuations by
A
−
Q
i −1/2
= f
Q
∨

i −1/2
− f (Q
i −1
),
A
+
Q
i −1/2
= f (Q
i
) − f
Q
∨

i −1/2
.
(15.6)
The fact that so little information from the Riemann solution is used in Godunov’s
method suggests that one may be able to approximate the Riemann solution and still obtain
reasonable solutions. This is often done in practice, and some approaches are discussed in
Section15.3. InSection15.4we will see howtoextendGodunov’s methodtohighresolution
methods.
15.2 Convergence of Godunov’s Method
The Lax–Wendroff theorem of Section 12.10 applies to conservative methods for nonlinear
systems of conservation laws as well as to scalar equations. Hence if a sequence of numerical
approximations converges in the appropriate sense to a function q(x, t ) as the grid is reﬁned,
then the limit function q(x, t ) must be a weak solution of the conservation law. This is a
powerful and useful result, since it gives us conﬁdence that if we compute a reasonable
looking solution on a ﬁne grid, then it is probably close to some weak solution. In particular,
we expect that shocks will satisfy the right jump conditions and be propagating at the correct
speeds. This would probably not be true if we used a nonconservative method – a reasonable
looking solution might be completely wrong, as we have observed in Section 12.9.
Of course we also need some additional entropy conditions on the numerical method to
conclude that the discontinuities seenare physicallycorrect. As we have seeninSection12.2,
it is quite possible that a conservative method will converge to entropyviolating weak
solutions if we don’t pay attention to this point. However, if we have an entropy function for
the system, as described in Section 11.14, and if the Riemann solutions we use in Godunov’s
method all satisfy the entropy condition (11.51), then the limiting solution produced by
Godunov’s method will also satisfy the entropy condition, as discussed in Section 12.11.
In particular, for the Euler equations of gas dynamics the physical entropy provides an
entropy function. Hence any limiting weak solution obtained via Godunov’s method will
be physically correct.
The limitation of the Lax–Wendroff theoremis that it doesn’t guarantee that convergence
will occur; it only states that if a sequence converges, then the limit is a weak solution. Show
ing that convergence occurs requires some form of stability. We have seen in Section 12.12
that TVstability is one appropriate form for nonlinear problems. For scalar equations
Godunov’s method is total variation diminishing (TVD), and we could also develop high
resolution methods that can be shown to be TVD, and hence stable and convergent.
Unfortunately, for nonlinear systems of equations this notion cannot easily be extended.
In general the true solution is not TVDin any reasonable sense, and so we cannot expect the
numerical solution to be. This is explored in more detail in Section 15.8. Even for classical
314 15 Finite Volume Methods for Nonlinear Systems
problems such as the shallow water equations or Euler equations, there is no proof that
Godunov’s method converges in general. In spite of the lack of rigorous results, this method
and highresolution variants are generally successful in practice and extensively used.
15.3 Approximate Riemann Solvers
To apply Godunov’s method on a system of equations we need only determine q
∨

(q
l
, q
r
),
the state along x/t = 0 based on the Riemann data q
l
and q
r
. We do not need the entire
structure of the Riemann problem. However, to compute q
∨

we must typically determine
something about the full wave structure and wave speeds in order to determine where q
∨

lies in state space. Typically q
∨

is one of the intermediate states in the Riemann solution
obtained in the process of connecting q
l
to q
r
by a sequence of shocks or rarefactions, and
hence is one of the intersections of Hugoniot loci and/or integral curves. In the special
case of a transonic rarefaction, the value of q
∨

will lie along the integral curve somewhere
between these intersections, and additional work will be required to ﬁnd it.
The process of solving the Riemann problem is thus often quite expensive, even though
in the end we use very little information from this solution in deﬁning the ﬂux. We will see
later that in order to extend the highresolution methods of Chapter 6 to nonlinear systems
of conservation laws, we must use more information, since all of the waves and wave speeds
are used to deﬁne secondorder corrections. Even so, it is often true that it is not necessary
to compute the exact solution to the Riemann problem in order to obtain good results.
A wide variety of approximate Riemann solvers have been proposed that can be applied
much more cheaply than the exact Riemann solver and yet give results that in many cases
are equally good when used in the Godunov or highresolution methods. In this section we
will consider a few possibilities. For other surveys of approximate Riemann solvers, see for
example [156], [245], [450].
Note that speeding up the Riemann solver can have a major impact on the efﬁciency of
Godunovtype methods, since we must solve a Riemann problem at every cell interface
in each time step. This will be of particular concern in more than one space dimension,
where the amount of work grows rapidly. On a modest 100 ×100 grid in two dimensions,
for example, one must solve roughly 20,000 Riemann problems in every time step to
implement the simplest twodimensional generalization of Godunov’s method. Methods
based on solving Riemann problems are notoriously expensive relative to other methods.
The expense may pay off for problems with discontinuous solutions, if it allows good results
to be obtained with far fewer grid points than other methods would require, but it is crucial
that the Riemann solutions be computed or approximated as efﬁciently as possible.
For given data Q
i −1
and Q
i
, an approximate Riemann solution might deﬁne a function
ˆ
Q
i −1/2
(x/t ) that approximates the true similarity solution to the Riemann problem with
data Q
i −1
and Q
i
. This function will typically consist of some set of M
w
waves W
p
i −1/2
propagating at some speeds s
p
i −1/2
, with
Q
i
− Q
i −1
=
M
w
p=1
W
p
i −1/2
. (15.7)
These waves and speeds will also be needed in deﬁning highresolution methods based on
the approximate Riemann solver in Section 15.4.
15.3 Approximate Riemann Solvers 315
To generalize Godunov’s method using this function, we might take one of two different
approaches:
1. Deﬁne the numerical ﬂux by
F
i −1/2
= f
ˆ
Q
∨

i −1/2
,
where
ˆ
Q
∨

i −1/2
=
ˆ
Q
i −1/2
(0) = Q
i −1
+
p:s
p
i −1/2
<0
W
p
i −1/2
(15.8)
is the value along the cell interface. Then we proceed as in Section 15.1 and set
A
−
Q
i −1/2
= f
ˆ
Q
∨

i −1/2
− f (Q
i −1
),
A
+
Q
i −1/2
= f (Q
i
) − f
ˆ
Q
∨

i −1/2
,
(15.9)
in order to use the updating formula (15.5). Note that this amounts to evaluating the true
ﬂux function at an approximation to Q
∨

i −1/2
.
2. Use the waves and speeds from the approximate Riemann solution to deﬁne
A
−
Q
i −1/2
=
M
w
p=1
s
p
i −1/2
−
W
p
i −1/2
,
A
+
Q
i −1/2
=
M
w
p=1
s
p
i −1/2
+
W
p
i −1/2
,
(15.10)
and again use the updating formula (15.5). Note that this amounts to implementing the
REAAlgorithm4.1 with the approximate Riemann solution in place of the true Riemann
solutions, averaging these solutions over the grid cells to obtain Q
n+1
.
If the allshock Riemann solution is used (e.g., Section 13.7.1), then these two approaches
yield the same result. This follows from the fact that the Rankine–Hugoniot condition is
then satisﬁed across each wave W
p
i −1/2
. In general this will not be true if an approximate
Riemann solution is used. In fact, the second approach may not even be conservative unless
special care is taken in deﬁning the approximate solution. (The ﬁrst approach is always
conservative, since it is based on an interface ﬂux.)
15.3.1 Linearized Riemann Solvers
One very natural approach to deﬁning an approximate Riemann solution is to replace the
nonlinear problem q
t
+ f (q)
x
= 0 by some linearized problem deﬁned locally at each cell
interface,
ˆ q
t
+
ˆ
A
i −1/2
ˆ q
x
= 0. (15.11)
The matrix
ˆ
A
i −1/2
is chosen to be some approximation to f
(q) valid in a neighborhood of
the data Q
i −1
and Q
i
. The matrix
ˆ
A
i −1/2
should satisfy the following conditions:
ˆ
A
i −1/2
is diagonalizable with real eigenvalues, (15.12)
316 15 Finite Volume Methods for Nonlinear Systems
so that (15.11) is hyperbolic, and
ˆ
A
i −1/2
→f
( ¯ q) as Q
i −1
, Q
i
→ ¯ q, (15.13)
so that the method is consistent with the original conservation law. The approximate
Riemann solution then consists of m waves proportional to the eigenvectors ˆ r
p
i −1/2
of
ˆ
A
i −1/2
,
propagating with speeds s
p
i −1/2
=
ˆ
λ
p
i −1/2
given by the eigenvalues. Since this is a linear prob
lem, the Riemann problem can generally be solved more easily than the original nonlinear
problem, and often there are simple closedformexpressions for the eigenvectors and hence
for the solution, which is obtained by solving the linear system
Q
i
− Q
i −1
=
m
p=1
α
p
i −1/2
ˆ r
p
i −1/2
(15.14)
for the coefﬁcients α
p
i −1/2
and then setting W
p
i −1/2
= α
p
i −1/2
ˆ r
p
i −1/2
.
We might take, for example,
ˆ
A
i −1/2
= f
ˆ
Q
i −1/2
, (15.15)
where
ˆ
Q
i −1/2
is some average of Q
i −1
and Q
i
. In particular, the Roe linearization described
in the next section has this formfor the Euler or shallowwater equations, with a very special
average. This special averaging leads to some additional nice properties, but for problems
where a Roe linearization is not available it is often possible to simply use
ˆ
Q
i −1/2
=
(Q
i −1
+ Q
i
)/2. Note that for any choice of
ˆ
A
i −1/2
satisfying (15.12) and (15.13), we can
obtain a consistent and conservative method if we use the formulas (15.8) and (15.9). The
formulas (15.10) will not give a conservative method unless
ˆ
A
i −1/2
satisﬁes an additional
condition described in the next section, since (15.10) leads to a conservative method only
if the condition
f (Q
i
) − f (Q
i −1
) =
M
w
p=1
s
p
i −1/2
W
p
i −1/2
(15.16)
is satisﬁed. This may not hold in general. (See Section 15.5 for an alternative approach to
obtaining conservative ﬂuctuations by directly splitting the ﬂux difference.)
Another obvious linearization is to take
ˆ
A
i −1/2
=
1
2
f
(Q
i −1
) + f
(Q
i
)
, (15.17)
or some other average of the Jacobian matrix between the two states. But note that in general
this matrix could fail to satisfy condition (15.12) even if f
(Q
i −1
) and f
(Q
i
) have real
eigenvalues.
Using a linearized problem can be easily motivated and justiﬁed at most cell interfaces.
The solution to a conservation lawtypically consists of at most a fewisolated shock waves or
contact discontinuities separated by regions where the solution is smooth. In these regions,
the variation in Q fromone grid cell to the next has Q
i
−Q
i −1
=O(x) and the Jacobian
matrix is nearly constant, f
(Q
i −1
) ≈ f
(Q
i
). Zooming in on the region of state space near
15.3 Approximate Riemann Solvers 317
(a)
−1 0 1 2 3 4 5 6 7 8
−2
−1
0
1
2
3
4
5
6
7
h = depth
h
u
=
m
o
m
e
n
t
u
m
Q
i
Q
ˆ q
m
(b)
−1 0 1 2 3 4 5 6 7 8
−2
−1
0
1
2
3
4
5
6
7
h = depth
h
u
=
m
o
m
e
n
t
u
m
i−1
Q
i
Q
i−1
Fig. 15.2. States Q
i −1
and Q
i
are connected by a 2shock in the shallow water equations, and lie
on the same curved Hugoniot locus. The straight lines are in the directions of the eigenvectors of
an averaged Jacobian matrix of the form (15.15). (a) Using the average
ˆ
Q
i −1/2
= (Q
i −1
+ Q
i
)/2.
(b) Using the Roe average.
these points, we would ﬁnd that the Hugoniot loci and integral curves needed to ﬁnd the
exact Riemann solution are nearly straight lines pointing in the directions of the eigenvectors
of these matrices. Deﬁning
ˆ
A
i −1/2
as any reasonable approximation to these matrices will
yield essentially the same eigenvectors and a Riemann solution that agrees very well with the
true solution. This is made more precise in Section 15.6, where we consider the truncation
error of methods based on approximate Riemann solutions.
It is only near shocks that we expect Q
i −1
and Q
i
to be far apart in state space, in which
case it is harder to justify the use of a Riemann solver that is linearized about one particular
point such as (Q
i −1
+Q
i
)/2. The true nonlinear structure in state space will look very differ
ent from the eigenstructure of any one Jacobian matrix. For example, Figure 15.2(a) shows
two states Q
i −1
and Q
i
that should be connected by a single 2shock in the shallow water
equations, since Q
i
lies on the 2Hugoniot locus of Q
i −1
. If instead the linearized Riemann
problem is solved using (15.15) with
ˆ
Q
i −1/2
=(Q
i −1
+Q
i
)/2, the state ˆ q
m
indicated in the
ﬁgure is obtained, with a spurious 1wave.
15.3.2 Roe Linearization
It is important to notice that even near a shock wave the Riemann problems arising at
cell interfaces will typically have a large jump in at most one wave family, say W
p
, with
W
j
=O(x) for all other waves j = p. Most of the time a shock in one family is
propagating through smooth ﬂow in the other families. It is only at isolated instants in time
when two shock waves collide that we expect to observe Riemann problems whose solutions
contain more than one strong wave.
For this reason, the situation illustrated in Figure 15.2 is the most important to consider,
along with the case where all waves are weak. This suggests the following property that we
would like a linearized matrix
ˆ
A
i −1/2
to possess:
318 15 Finite Volume Methods for Nonlinear Systems
If Q
i −1
and Q
i
are connected by a single wave W
p
= Q
i
− Q
i −1
in the true Riemann
solution, then W
p
should also be an eigenvector of
ˆ
A
i −1/2
.
If this holds, then the “approximate” Riemann solution will also consist of this single wave
and will agree with the exact solution. This condition is easy to rewrite in a more useful
form using the Rankine–Hugoniot condition (11.21). If Q
i −1
and Q
i
are connected by a
single wave (shock or contact discontinuity), then
f (Q
i
) − f (Q
i −1
) = s(Q
i
− Q
i −1
),
where s is the wave speed. If this is also to be a solution to the linearized Riemann problem,
then we must have
ˆ
A
i −1/2
(Q
i
− Q
i −1
) = s(Q
i
− Q
i −1
).
Combining these, we obtain the condition
ˆ
A
i −1/2
(Q
i
− Q
i −1
) = f (Q
i
) − f (Q
i −1
). (15.18)
In fact this is a useful condition to impose on
ˆ
A
i −1/2
in general, for any Q
i −1
and Q
i
.
It guarantees that (15.10) yields a conservative method, and in fact agrees with what is
obtained by (15.9). This can be conﬁrmed by recalling that (15.10) will be conservative
provided that (6.57) is satisﬁed,
A
−
Q
i −1/2
+A
+
Q
i −1/2
= f (Q
i
) − f (Q
i −1
), (15.19)
which is satisﬁed for the approximate Riemann solver if and only if the condition (15.18)
holds.
Another nice feature of (15.18) is that it states that the matrix
ˆ
A, which approximates the
Jacobian matrix ∂ f /∂q, should at least have the correct behavior in the one direction where
we know the change in f that results from a change in q.
The problem now is to obtain an approximate Jacobian that will satisfy (15.18) along
with (15.12) and (15.13). One way to obtain a matrix satisfying (15.18) is by integrating
the Jacobian matrix over a suitable path in state space between Q
i −1
and Q
i
. Consider the
straightline path parameterized by
q(ξ) = Q
i −1
+(Q
i
− Q
i −1
)ξ (15.20)
for 0 ≤ ξ ≤ 1. Then f (Q
i
) − f (Q
i −1
) can be written as the line integral
f (Q
i
) − f (Q
i −1
) =
1
0
d f (q(ξ))
dξ
dξ
=
1
0
d f (q(ξ))
dq
q
(ξ) dξ
=
1
0
f
(q(ξ)) dξ
(Q
i
− Q
i −1
), (15.21)
15.3 Approximate Riemann Solvers 319
since q
(ξ) = Q
i
− Q
i −1
is constant and can be pulled out of the integral. This shows that
we can deﬁne
ˆ
A
i −1/2
as the average
ˆ
A
i −1/2
=
1
0
f
(q(ξ)) dξ. (15.22)
This average always satisﬁes (15.18) and (15.13), but in general there is no guarantee that
(15.12) will be satisﬁed, even if the original problem is hyperbolic at each point q. An
additional problem with attempting to use (15.22) is that it is generally not possible to
evaluate this integral in closed form for most nonlinear problems of interest. So it cannot be
used as the basis for a practical algorithm that is more efﬁcient than using the true Riemann
solver.
Roe [375] made a signiﬁcant breakthrough by discovering a way to surmount this difﬁ
cultyfor the Euler equations (for a polytropic ideal gas) bya more clever choice of integration
path. Moreover, the resulting
ˆ
A
i −1/2
is of the form (15.15) and hence satisﬁes (15.12). His
approach can also be applied to other interesting systems, and will be demonstrated for the
shallow water equations in the next section. See Section 15.3.4 for the Euler equations.
Roe introduced a parameter vector z(q), a change of variables that leads to integrals that
are easy to evaluate. We assume this mapping is invertible so that we also know q(z). Using
this mapping, we can also view f as a function of z, and will write f (z) as shorthand for
f (q(z)).
Rather than integrating on the path (15.20), we will integrate along the path
z(ξ) = Z
i −1
+(Z
i
− Z
i −1
)ξ, (15.23)
where Z
j
= z(Q
j
) for j = i −1, i . Then z
(ξ) = Z
i
− Z
i −1
is independent of ξ, and so
f (Q
i
) − f (Q
i −1
) =
1
0
d f (z(ξ))
dξ
dξ
=
1
0
d f (z(ξ))
dz
z
(ξ) dξ
=
1
0
d f (z(ξ))
dz
dξ
(Z
i
− Z
i −1
). (15.24)
We hope that this integral will be easy to evaluate. But even if it is, this does not yet give us
what we need, since the righthand side involves Z
i
−Z
i −1
rather than Q
i
−Q
i −1
. However,
we can relate these using another path integral,
Q
i
− Q
i −1
=
1
0
dq(z(ξ))
dξ
dξ
=
1
0
dq(z(ξ))
dz
z
(ξ) dξ
=
1
0
dq(z(ξ))
dz
dξ
(Z
i
− Z
i −1
). (15.25)
320 15 Finite Volume Methods for Nonlinear Systems
The goal is now to ﬁnd a parameter vector z(q) for which both the integral in (15.24) and
the integral in (15.25) are easy to evaluate. Then we will have
f (Q
i
) − f (Q
i −1
) =
ˆ
C
i −1/2
(Z
i
− Z
i −1
),
Q
i
− Q
i −1
=
ˆ
B
i −1/2
(Z
i
− Z
i −1
),
(15.26)
where
ˆ
C
i −1/2
and
ˆ
B
i −1/2
are these integrals. From these we can obtain the desired relation
(15.18) by using
ˆ
A
i −1/2
=
ˆ
C
i −1/2
ˆ
B
−1
i −1/2
. (15.27)
Harten and Lax (see [187]) showed that an integration procedure of this form can always
be used to deﬁne a matrix
ˆ
A satisfying (15.12) provided that the systemhas a convex entropy
function η(q) as described in Section 11.14. The choice z(q) = η
(q) then works, where
η
(q) is the gradient of η with respect to q. It is shown in [187] that the resulting matrix
ˆ
A
HLL
is then similar to a symmetric matrix and hence has real eigenvalues.
To make the integrals easy to evaluate, however, we generally wish to choose z in such a
way that both ∂q/∂z and ∂ f /∂z have components that are polynomials in the components
of z. Then they will be polynomials in ξ along the path (15.23) and hence easy to integrate.
15.3.3 Roe Solver for the Shallow Water Equations
As an example, we derive the Roe matrix for the shallow water equations. In [281] the
isothermal equations, which have similar structure, are used as an example.
For the shallow water equations (see Chapter 13) we have
q =
h
hu
=
q
1
q
2
, f (q) =
hu
hu
2
+
1
2
gh
2
=
q
2
(q
2
)
2
/q
1
+
1
2
g(q
1
)
2
and
f
(q) =
0 1
−(q
2
/q
1
)
2
+ gq
1
2q
2
/q
1
=
0 1
−u
2
+ gh 2u
.
As a parameter vector we choose
z = h
−1/2
q, so that
z
1
z
2
=
√
h
√
hu
. (15.28)
This is analogous to the parameter vector introduced by Roe for the Euler equations (see
Section 15.3.4), in which case z = ρ
−1/2
q. Note that the matrix f
(q) involves the quotient
q
2
/q
1
, and hence integrating along the path (15.20) would require integrating rational
functions of ξ. The beauty of this choice of variables z is that the matrices we must integrate
in (15.24) and (15.25) involve only polynomials in ξ. We ﬁnd that
q(z) =
(z
1
)
2
z
1
z
2
=⇒
∂q
∂z
=
2z
1
0
z
2
z
1
(15.29)
15.3 Approximate Riemann Solvers 321
and
f (z) =
¸
z
1
z
2
(z
2
)
2
+
1
2
g(z
1
)
4
=⇒
∂ f
∂z
=
¸
z
2
z
1
2g(z
1
)
3
2z
2
. (15.30)
We now set
z
p
= Z
p
i −1
+
Z
p
i
− Z
p
i −1
ξ for p = 1, 2
and integrate each element of these matrices from ξ = 0 to ξ = 1. All elements are linear
in ξ except the (2,1) element of ∂ f /∂z, which is cubic.
Integrating the linear terms z
p
(ξ) yields
1
0
z
p
(ξ) dξ =
1
2
Z
p
i −1
+ Z
p
i
≡
¯
Z
p
,
simply the average between the endpoints. For the cubic term we obtain
1
0
(z
1
(ξ))
3
dξ =
1
4
Z
1
i
4
−
Z
1
i −1
4
Z
1
i
− Z
1
i −1
=
1
2
Z
1
i −1
+ Z
1
i
·
1
2
¸
Z
1
i −1
2
+
Z
1
i
2
¸
=
¯
Z
1
¯
h, (15.31)
where
¯
h =
1
2
(h
i −1
+h
i
). (15.32)
Hence we obtain
ˆ
B
i −1/2
=
¸
2
¯
Z
1
0
¯
Z
2
¯
Z
1
,
ˆ
C
i −1/2
=
¸
¯
Z
2
¯
Z
1
2g
¯
Z
1
¯
h 2
¯
Z
2
(15.33)
and so
ˆ
A
i −1/2
=
ˆ
C
i −1/2
ˆ
B
−1
i −1/2
=
¸
0 1
−(
¯
Z
2
/
¯
Z
1
)
2
+ g
¯
h 2
¯
Z
2
/
¯
Z
1
=
¸
0 1
−ˆ u
2
+ g
¯
h 2ˆ u
. (15.34)
Here
¯
h is the arithmetic average of h
i −1
and h
i
given in (15.32), but ˆ u is a different sort of
average of the velocities, the Roe average:
ˆ u =
¯
Z
2
¯
Z
1
=
√
h
i −1
u
i −1
+
√
h
i
u
i
√
h
i −1
+
√
h
i
. (15.35)
Note that the matrix
ˆ
A
i −1/2
in (15.34) is simply the Jacobian matrix f
( ˆ q) evaluated at the
special state ˆ q = (
¯
h,
¯
h ˆ u). In particular, if Q
i −1
= Q
i
then
ˆ
A
i −1/2
reduces to f
(Q
i
).
The eigenvalues and eigenvectors of
ˆ
A
i −1/2
are known from (13.9) and (13.10):
ˆ
λ
1
= ˆ u − ˆ c,
ˆ
λ
2
= ˆ u + ˆ c, (15.36)
322 15 Finite Volume Methods for Nonlinear Systems
and
ˆ r
1
=
1
ˆ u − ˆ c
, ˆ r
2
=
1
ˆ u + ˆ c
, (15.37)
where ˆ c =
g
¯
h. To use the approximate Riemann solver we decompose Q
i
− Q
i −1
as in
(15.14),
Q
i
− Q
i −1
= α
1
i −1/2
ˆ r
1
+α
2
i −1/2
ˆ r
2
≡ W
1
i −1/2
+W
2
i −1/2
. (15.38)
The coefﬁcients α
p
i −1/2
are computed by solving this linear system, which can be done
explicitly by inverting the matrix
ˆ
R of right eigenvectors to obtain
ˆ
L =
ˆ
R
−1
=
1
2ˆ c
ˆ u + ˆ c −1
−( ˆ u − ˆ c) 1
.
Multiplying this by the vector δ ≡ Q
i
− Q
i −1
gives the vector of αcoefﬁcients, and hence
α
1
i −1/2
=
( ˆ u + ˆ c)δ
1
−δ
2
2ˆ c
,
α
2
i −1/2
=
−( ˆ u − ˆ c)δ
1
+δ
2
2ˆ c
,
(15.39)
The ﬂuctuations (15.10) are then used in Godunov’s method, with the speeds s given by the
eigenvalues λ of (15.36).
Alternatively, we could compute the numerical ﬂux F
i −1/2
by
F
i −1/2
= f (Q
i −1
) +
ˆ
A
−
i −1/2
(Q
i
− Q
i −1
)
or by
F
i −1/2
= f (Q
i
) −
ˆ
A
+
i −1/2
(Q
i
− Q
i −1
).
Averaging these two expressions gives a third version, which is symmetric in Q
i −1
and Q
i
,
F
i −1/2
=
1
2
[ f (Q
i −1
) + f (Q
i
)] −
1
2
ˆ
A
i −1/2
(Q
i
− Q
i −1
). (15.40)
This form is often called Roe’s method (see Section 4.14) and has the form of the unstable
centered ﬂux plus a viscous correction term.
15.3.4 Roe Solver for the Euler Equations
For the Euler equations with the equation of state (14.23), Roe [375] proposed the parameter
vector z = ρ
−1/2
q, leading to the averages
ˆ u =
√
ρ
i −1
u
i −1
+
√
ρ
i
u
i
√
ρ
i −1
+
√
ρ
i
(15.41)
15.3 Approximate Riemann Solvers 323
for the velocity,
ˆ
H =
√
ρ
i −1
H
i −1
+
√
ρ
i
H
i
√
ρ
i −1
+
√
ρ
i
=
(E
i −1
+ p
i −1
)/
√
ρ
i −1
+(E
i
+ p
i
)/
√
ρ
i
√
ρ
i −1
+
√
ρ
i
(15.42)
for the total speciﬁc enthalpy, and
ˆ c =
(γ −1)
ˆ
H −
1
2
ˆ u
2
(15.43)
for the sound speed. The eigenvalues and eigenvectors of the Roe matrix are then obtained
by evaluating (14.45) and (14.46) at this averaged state. The coefﬁcients α
p
i −1/2
in the wave
decomposition
δ ≡ Q
i
− Q
i −1
= α
1
ˆ r
1
+α
2
ˆ r
2
+α
3
ˆ r
3
can be obtained by inverting the matrix of right eigenvectors, which leads to the following
formulas:
α
2
= (γ −1)
(
ˆ
H − ˆ u
2
)δ
1
+ ˆ uδ
2
−δ
3
ˆ c
2
,
α
3
=
δ
2
+(ˆ c − ˆ u)δ
1
− ˆ cα
2
2ˆ c
,
α
1
= δ
1
−α
2
−α
3
.
(15.44)
For other equations of state and more complicated gas dynamics problems it may also be
possible to derive Roe solvers; see for example [91], [149], [172], [208], [451].
15.3.5 Sonic Entropy Fixes
One disadvantage of using a linearized Riemann solver is that the resulting approximate
Riemann solution consists only of discontinuities, with no rarefaction waves. This can
lead to a violation of the entropy condition, as has been observed previously for scalar
conservation laws in Section 12.3.
In fact, it is worth noting that in the scalar case the Roe condition (15.18) can be satisﬁed
by choosing the scalar
ˆ
A
i −1/2
as
ˆ
A
i −1/2
=
f (Q
i
) − f (Q
i −1
)
Q
i
− Q
i −1
, (15.45)
which is simply the shock speed resulting from the scalar Rankine–Hugoniot condition.
Hence using the Roe linearization in the scalar case and solving the resulting advection
equation with velocity (15.45) is equivalent to always using the shockwave solution to the
scalar problem, as discussed in Section 12.2. In this scalar case (15.40) reduces to the ﬂux
for Murman’s method, (12.12) with a
i −1/2
given by (12.14).
Recall that in the scalar case, the use of an entropyviolating Riemann solution leads to
difﬁculties only in the case of a transonic rarefaction wave, in which f
(q
l
) < 0 < f
(q
r
).
324 15 Finite Volume Methods for Nonlinear Systems
This is also typically true when we use Roe’s approximate Riemann solution for a system
of conservation laws. It is only for sonic rarefactions, those for which λ
p
<0 to the left of
the wave while λ
p
>0 to the right of the wave, that entropy violation is a problem. In the
case of a sonic rarefaction wave, it is necessary to modify the approximate Riemann solver
in order to obtain entropysatisfying solutions.
For the shallow water equations, a system of two equations, there is a single intermediate
state
ˆ
Q
m
in the approximate Riemann solution between Q
i −1
and Q
i
. We can compute the
characteristic speeds in each state as
λ
1
i −1
= u
i −1
−
gh
i −1
, λ
1
m
= u
m
−
g
ˆ
h
m
,
λ
2
m
= ˆ u
m
+
g
ˆ
h
m
, λ
2
i
= u
i
+
gh
i
.
(15.46)
If λ
1
i −1
< 0 < λ
1
m
, then we should suspect that the 1wave is actually a transonic rarefaction
and make some adjustment to the ﬂux, i.e., to A
−
Q
i −1/2
and A
+
Q
i −1/2
, in this case.
Similarly, if λ
2
m
< 0 < λ
2
i
, then we should ﬁx the ﬂux to incorporate a 2rarefaction. Note
that at most one of these situations can hold, since λ
1
m
< λ
2
m
.
For sufﬁciently simple systems, such as the shallow water equations, it may be easy
to evaluate the true intermediate state Q
∨

i −1/2
that lies along the interface in the Riemann
solution at x
i −1/2
, once we suspect it lies on a transonic rarefaction wave in a particular