reportgodunov method and related schemes for nonlinear hyperbolic problems

195
Godunov Method and Related Schemes for Nonlinear Hyperbolic Problems L. Quartapelle, Editor Dipartimento di Ingegneria Aerospaziale Politecnico di Milano V ia La Masa 34, 20158 Milano, Italy January 9, 2013

Upload: bernardofavini6840

Post on 03-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 1/195

Godunov Method and Related Schemes

for Nonlinear Hyperbolic Problems

L. Quartapelle, Editor

Dipartimento di Ingegneria Aerospaziale

Politecnico di Milano

Via La Masa 34, 20158 Milano, Italy

January 9, 2013

Page 2: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 2/195

.

2

Page 3: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 3/195

Contents

1 Introduction (V. Lucifredi) 11

2 Traffic equation: a scalar example (S. Bianchi and A. Savorani) 13

2.1 The equation of the traffic model . . . . . . . . . . . . . . . . . . 13

2.2 Rankine–Hugoniot condition and entropy condition . . . . . . . . 14

2.3 Riemann problem and jump solutions . . . . . . . . . . . . . . . 16

2.4 Rarefaction solutions . . . . . . . . . . . . . . . . . . . . . . . . 16

2.5 General solution of the Riemann problem . . . . . . . . . . . . . 18

2.6 Program of exact Riemann solver for traffic equation . . . . . . . 20

3 Weak solutions (M. Tagliabue and M. Valentini) 23

3.1 Conservation law equation in weak form . . . . . . . . . . . . . . 23

3.2 Weak equations in discrete form . . . . . . . . . . . . . . . . . . 24

3.3 Rankine–Hugoniot jump condition (F. Villa) . . . . . . . . . . . . 25

3.4 Principles of Godunov method . . . . . . . . . . . . . . . . . . . 29

4 P-system for the isothermal ideal gas (V. Ronchi) 33

4.1 The fluidynamic model . . . . . . . . . . . . . . . . . . . . . . . 33

4.2 Governing equations . . . . . . . . . . . . . . . . . . . . . . . . 34

4.3 Eigenvalue problem . . . . . . . . . . . . . . . . . . . . . . . . . 35

4.4 Genuine nonlinearity . . . . . . . . . . . . . . . . . . . . . . . . 37

5 Simple solutions (S. Scala and C. Truscello) 41

5.1 Shock wave solutions: Hugoniot locus . . . . . . . . . . . . . . . 41

5.2 Lax entropy condition for a system . . . . . . . . . . . . . . . . . 42

5.3 Riemann invariants . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.4 Rarefaction waves: integral curves . . . . . . . . . . . . . . . . . 46

5.5 Shock wave reflection . . . . . . . . . . . . . . . . . . . . . . . . 50

6 Riemann problem for the isothermal ideal gas (F. Villa) 53

6.1 Riemann problem . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6.1.1 Explicit analytical rarefaction–rarefaction solution . . . . 54

6.1.2 Analytical shock–shock solution . . . . . . . . . . . . . . 55

6.2 Transitions between different types of solution . . . . . . . . . . . 55

6.3 Limiting relative velocities . . . . . . . . . . . . . . . . . . . . . 56

6.4 A new parametrization for the shock . . . . . . . . . . . . . . . . 59

6.5 Program of Riemann solver as a system of two equations . . . . . 61

Page 4: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 4/195

7 Godunov method for the isothermal ideal gas 67

7.1 Finite volumes and cell average . . . . . . . . . . . . . . . . . . . 677.2 Variable update and interface flux . . . . . . . . . . . . . . . . . 68

7.3 Godunov numerical flux . . . . . . . . . . . . . . . . . . . . . . 68

7.4 Program of the Godunov flux for the isothermal gas . . . . . . . . 70

8 Roe linearization (L. Alimonti and D. De Santis) 75

8.1 Conservative linearization . . . . . . . . . . . . . . . . . . . . . 75

8.2 Linearization in Jacobian form . . . . . . . . . . . . . . . . . . . 76

8.3 Linearization for the isothermal ideal gas . . . . . . . . . . . . . 77

8.4 Numerical method for Roe vertical flux . . . . . . . . . . . . . . 80

8.5 Entropy fix for a scalar equation . . . . . . . . . . . . . . . . . . 838.6 Program for computing the Roe numerical flux . . . . . . . . . . 90

9 Lax–Wendroff scheme and conservation form

(G-L. Cucchi and P. Scioscia) 93

9.1 The scheme for linear advection . . . . . . . . . . . . . . . . . . 93

9.2 The scheme for a conservation law . . . . . . . . . . . . . . . . . 95

9.3 The scheme for nonlinear systems of conservation laws . . . . . . 98

9.4 Isothermal ideal gas system with linearization . . . . . . . . . . . 99

9.5 Boundary conditions in the conservative LW scheme . . . . . . . 102

9.6 Program of the Lax–Wendroff numerical flux . . . . . . . . . . . 106

16 High Resolution Methods (Randall J. LeVeque) 108

16.1 Artificial viscosity . . . . . . . . . . . . . . . . . . . . . . . . . . 108

16.2 Flux-limiter methods . . . . . . . . . . . . . . . . . . . . . . . . 111

16.2.1 Linear systems . . . . . . . . . . . . . . . . . . . . . . . 117

16.2.2 Nonlinear systems . . . . . . . . . . . . . . . . . . . . . 118

16.3 Slope-limiter methods . . . . . . . . . . . . . . . . . . . . . . . . 119

16.3.1 Linear systems . . . . . . . . . . . . . . . . . . . . . . . 123

16.3.2 Nonlinear scalar equation . . . . . . . . . . . . . . . . . 124

16.3.3 Nonlinear systems . . . . . . . . . . . . . . . . . . . . . 126

16.4 Program of the numerical flux for the high resolution method . . . 128

11 Conclusion 132

A P-system and its Riemann problem 136

A.1 The P-system and its eigenstructure . . . . . . . . . . . . . . . . 136

A.2 Riemann invariants . . . . . . . . . . . . . . . . . . . . . . . . . 139

A.3 Rarefaction waves . . . . . . . . . . . . . . . . . . . . . . . . . . 141

A.4 Vacuum formation . . . . . . . . . . . . . . . . . . . . . . . . . 144

4

Page 5: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 5/195

A.5 Shock waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

A.6 The Riemann problem as a two-equation system . . . . . . . . . . 149A.7 Existence and uniqueness theorem . . . . . . . . . . . . . . . . . 150

A.8 Roe linearization (A. Guardone and L. Vigevano) . . . . . . . . . 151

B. Boundary conditions in nonlinear hyperbolic systems 156

B.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

B.2 Conservative, characteristic and physical variables . . . . . . . . . 157

B.3 The boundary values for a scalar unknown . . . . . . . . . . . . . 160

B.4 Steps of the boundary procedure for a system . . . . . . . . . . . 160

C. Algorithms 166C.1 Main Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166

C.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

C.3 Exact solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

.

5

Page 6: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 6/195

.

Page 7: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 7/195

 L’università sviluppa tutte le doti,

compresa la stupidità.

Anton Cechov

 Il saggio sa di essere stupido, è lo

stupido invece che crede di esseresaggio.

William Shakespeare

Occorre un saggio per riconoscere un

saggio.

Focilide

Page 8: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 8/195

.

 Non c’è libro tanto cattivo che in qualche sua parte non

 possa giovare.

Plinio il Vecchio

Sii padrone dell’argomento, le parole verranno.Catone il Censore

 Il vero problema dello scrivere non è tanto sapere ciò che

dobbiamo mettere nella pagina, ma ciò che da questa

dobbiamo togliere.

Gustave Flaubert

.

Page 9: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 9/195

Abstract

This report describes numerical methods and techniques for solving hyperbolic

problems in one dimension. The solution of nonlinear hyperbolic equations

can be discontinuous and is very difficult to be determined in a discrete set-

ting. Very specialized methods have been developed in the last decades to deal

with possibly discontinuous solutions to conservation laws and systems, as, for

instance, methods based on exact or approximate Riemann solvers, following

the seminal ideas of Godunov. In the present work we introduce the basic

mathematical concepts and numerical tools for solving this kind of problems.

The classical examples of the equation for the traffic flow and the system of 

gasdynamic equations for an isothermal ideal gas are considered. We describe

how low order discretization schemes, such as Godunov and Roe methods, can

be combined with the second order Lax–Wendroff discretization to build con-

servative high resolution methods. These schemes have been implemented and

tested successfully against a few simple representative examples including the

reflection of a shock wave by a fixed wall. In an appendix, the issue of ex-

istence and uniqueness for solution to the Riemann problem of the P-system

is also addressed. An original way of formulating the Riemann problem as a

system of two equations is proposed which suggests a guideline for proving

existence and uniqueness of solution in the convex case with arbitrary (large)

data by exploiting the very nature of the nonlinearity of the Riemann problem

and of its symmetric doubled-faced character.

Page 10: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 10/195

.

.

Page 11: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 11/195

1 Introduction

Transonic and supersonic flow simulation is a challenge that has a hell-like taste;

however, it has also a great appeal to theaeronautical andaerospace research. Some

examples of this kind of flows are: transonic streams around airliners, external jet

streams behind nozzles, flows around helicopters or spacecrafts re-entering into

the atmosphere. Other flows with features similar or identical to aeronautical jets

are encountered in astrophysical observations, and can be simulatated by means of 

the same numerical tools developed for gasdynamics, as described, for instance,

in Saas-Fee summer school [10].

In this report, we focus on equations associated with conservation laws and

on their numerical solution, especially in the presence of discontinuities. Becauseof this, local approximation methods based upon Taylor series result in a failure.

Several alternative methods have been developed in the recent years and they

proved to be valuable design tools in aerospace engineering. These new methods

are characterized by a certain degree of complexity, which is far greater than

in methods used to solve viscous probems, typically the incompressible Navier–

Stokes equations. So it can beuseful toprovide anelementary descriptiongathering

up a great part of the fundamental elements that allow to solve discontinuous flow

problems.

The crucial points are, on the one hand, the nonlinearity of conservation laws

and, on the other hand, the nature of being a system of the gasdynamic equations.

So, from a didactic viewpoint, it can be sufficient to describe the problem by

examinating first the traffic scalar equation and only subsequently the system of 

gasdynamic equations for an isothermal ideal gas.

The mathematical problems dealt with in this report are only one-dimensional

(1D) to make easier the approach to this difficult topic. The very important and

interesting case of the multidimensional equations is intentionally neglected in this

work and is left fora further study. Boundary conditions areinstead discussed in the

following, becauseof theirfundamental importance in theactualnumericalsolution

of real problems. In particular, an appendix contains a detailed description of a

new procedure proposed by Alberto Guardone to determine the boundary values

including the correct number of boundary data in nonlinear hyperbolic systems.The structure of this report parallels that followed in the insightfull Numer-

ical Methods for Conservation Laws by Randall LeVeque [8], which highlights

the basic elements of the mathemathical theory and then introduces the numerical

methods. The first topic discussed in the present work is the scalar example of the

traffic equation and its numerical approximation by means of Godunov’s method.

Subsequently, the gasdynamic equations for the isothermal ideal gas, which is a

particular example of the P-System category, is considered and its approximation

by the same type of method is developed. The last part is centered on a different

11

Page 12: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 12/195

sort of numerical methods, used to solve nonlinear hyperbolic problems: Roe’s

linearization, Lax–Wendroff conservation schemes and high resolution methods.In the end, a conclusion section summarizes all the results achieved. A couple of 

appendices are included, dealing with a new theorem of the existence and unique-

ness for the P-System, and with the aforementioned Guardone’s procedure for the

boundary values. The list of the programs implemented in Fortran 90 are also

given.

12

Page 13: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 13/195

2 Traffic equation: a scalar example

This section introduces a simple scalar model of conservation law – the traffic

equation – which provides an example for the behaviour of solutions to nonlinear

hyperbolic equations. Many of the difficulties faced in the numerical solution of 

hyperbolic systems are present already in the scalar case. Therefore, the traffic

equation is particularly convenient to analyze and understand the very nature of 

these difficulties working in the most simple mathematical setting [8, see Chapter

4]. Furthermore, the scalar problem helps one to develop some physical intuition

that will be applied later to the more complicated case of the hyperbolic system of 

two equations for an isothermal gas.

We will first introduce the equation governing the traffic flow together with itsinitial condition. For simple initial data consisting in a jump in the car density

between two uniform states we provide the elemental solutions which are a rar-

efaction fan and a propagating jump. An initial-value problem of this kind, with

the initial data consisting of two constant states separated by a single discontinuity,

is called a Riemann problem. The general solution of the Riemann problem for the

traffic flow equation is given and some representative sample solutions are shown.

2.1 The equation of the traffic model

The traffic flow problem is a particular example of scalar conservation law. It

can help to introduce the mathematical ideas needed for the more complicate case

of gas dynamic equations, because the large-scale behaviour of cars along a lane

has some similarities with the dynamics of a gas inside a straight tube. Consider

the flow of cars on a highway and denote with ρ the density (vehicles per unit

length) and with u the velocity of this continuum distribution. We take ρ in the

range 0 ≤ ρ ≤ ρ jam, where ρ jam is the max density (cars bumper to bumper).

The number of cars must be conserved, so density and velocity are related by the

continuity equation

∂t ρ + ∂ x (ρu) = 0. (2.1)

We assume that the velocity is a given function of the density, namely,

u = u(ρ), 0 ≤ ρ ≤ ρ jam (2.2)

Such a relationship allows to represent the typical behaviour of drivers on a high-

way: they tune the car speed according to the local car density. For instance, when

the highway is empty, the car velocity reaches its maximum value umax, but in

heavy traffic cars slow down, in other words, the velocity decreases as the density

increases.

13

Page 14: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 14/195

To define a unique traffic flow model, a definite function for the velocity must

be chosen. A sufficiently realistic model is obtained by assuming the simple linearrelation:

u(ρ) ≡ umax

1 − ρ

ρ jam

, 0 ≤ ρ ≤ ρ jam (2.3)

where it must be noticed the bounded domain of variation for the unknown variable

ρ, see the plot (a) in figure 2.1. Thus, the velocity decrease from umax to zero as

the density increases from zero to ρ jam.

Thefluxofcars f  depends onthecar density according to thestandarddefinition

 f (ρ)

≡ρ u(ρ), 0

≤ρ

≤ρ jam (2.4)

The graph of the flux function is drawn as plot (b) of figure 2.1. The representation

with the vertical axis for the independent variable ρ and the horizontal one for

the function f (ρ) is adopted since it allows to interpret the straight lines in this

diagram as the characteristic lines of the space-time plane. In fact the slope in the

first diagram represents a velocity and their positive or negative slopes corresponds

to propagation to the left or to the right in the second diagram.

In terms of the flux function, the conservation law (2.1) can be also rewritten

as

∂t ρ + ∂ x f (ρ) = 0 (2.5)

and for differentiable solutions ρ( x, t ), it is equivalent to the form

∂t ρ + f ′(ρ)∂ x ρ = 0 (2.6)

that is called quasilinear , a nomenclature employed usually for systems.

2.2 Rankine–Hugoniot condition and entropy condition

The solution of the conservation law (2.5) should be a function ρ = ρ( x , t ) such

that, once replaced with its derivatives into the equation, the equation is identically

satisfied. In reality, solutionsaccordingto this definitioncan exist but thenonlinear

character of the conservation law implies the solution can become so steep locally

and can lose the differentiability at some point after a finite time. In this case

the possibility of a differentiable solution breaks down and we cannot anymore to

speak of a solution to the hyperbolic partial differential equation in the classical

sense. However, the idea of solution can be extended mathematically to allow

for solutions containing discontinuities. This will be explained in the next section

where the idea of weak solutions will be introduced. An important consequence

of the concept of weak solutions is that the discontinuity possibly embedded in

the solution must propagate with a speed which depends on the values ρℓ and ρr 

14

Page 15: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 15/195

0 50 100 1500

100

200

0 2000 4000 6000 80000

125

−100 0 100

 

( a ) ( b ) ( c )

ρρρ

ρ jam

12

ρ jam

umaxumax u(ρ)  f max f (ρ)

−umax a(ρ)

Figure2.1: (a) linear relation u(ρ), (b) flux f (ρ) = ρu(ρ), (c) characteristic speed

a(ρ)

at the two sides of the moving discontinuity. In fact, the speed s is given by the

Rankine–Hugoniot relation

s=

f (ρℓ) − f (ρr )

ρℓ − ρr 

(2.7)

which is deduced from the definition of weak solutions.

Unfortunately, with the new definitions of weak solutions it turns out that

any initial value problem for a nonlinear conservation law admits infinitely many

(weak) solutions. In other words, to include also discontinuous solutions the space

of solutions has been enlarged so much that the final space of all weak solutions

is so enormously large that the uniqueness of the solution is fully lost. However,

the uniqueness among the infinitely many possible weak solution is recovered by

including a supplementary condition, called entropy condition. This condition

selects the only physically admissible solution which can be the limit for zero

viscosity of the (unique) solution to the conservation law including a dissipative

term, namely a tem involving the second spatial derivative of the unknown. For

instance

∂t ρ + ∂ x f (ρ) = κ∂2 x u (2.8)

where κ > 0 is a diffusion coefficient.

For a conservation law with a convex flux, i.e., a flux with convexity always

positive or always negative, the entropy condition reads

 f ′(ρℓ) > s > f ′(ρr ). (2.9)

15

Page 16: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 16/195

In particular, for the flux of the traffic model it is easy to see that condition (2.9)

reduces toρℓ < ρr . (2.10)

If theentropycondition is verified, a jump (discontinuity)will propagatewith speed

s given by Rankine–Hugoniot condition (2.7), otherwise the jump must evolve in

a different pattern and will give rise to a continuous solution, that will be described

below.

2.3 Riemann problem and jump solutions

Consider an initial condition consisting in a discontinuity of the variable ρ located

at x = 0, as follows:

ρ( x, 0) =

ρℓ x < 0

ρr  x > 0(2.11)

The initial value problem of equation (2.5) supplemented by the inital condition

(2.11) is called a Riemann problem.

If the inital values of density are such that 0 ≤ ρℓ < ρr  ≤ ρ jam, the entropy

condition (2.10) for the traffic equation is verified and we find a discontinuous

solution consisting in a jump which propagates with velocity s given by (2.7).

Therefore the weak solution of this Riemann problem will be

ρ( x, t ) =

ρℓ x < st 

ρr  x > st (2.12)

More generally, if the initial jump would be located at x = x0, the solution of the

corresponding Riemann problem would be

ρ( x, t ) =

ρℓ x < x0 + st 

ρr  x > x0 + st 

2.4 Rarefaction solutions

Consider now the opposite situation for initial values of ρ, with 0 ≤ ρr  < ρℓ ≤ρ jam. In this case theentropy condition(2.10) is not verifiedanda jump propagating

at speed s would be an entropy-violating weak solution, to be discarded. There-

fore we search for a continuous solution by a different method and the (classical)

solution so obtained will be found to represent a rarefaction wave. Since there is

no reference lenght in the statement of the Riemann problem, we can search for

16

Page 17: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 17/195

a solution ρ( x, t ) which depends on the two independent variables x and t  only

throught a single variable which is combination of x and t  of the form

ξ  = x

t , (2.13)

which is called similarity variable. The unknown of the traffic equation will

become a new function of only one variable, as follows

σ(ξ) = σ ( x/t ) = ρ( x, t ). (2.14)

By substituting σ(ξ) in the traffic equation (2.6), it becomes ∂t σ  + ∂ x f (σ ) = 0.

By evaluating the time and space derivative by means of the chain rule, the traffic

equation assumes the form

−  x

t 2σ ′ + 1

t  f ′( σ ) σ  ′ = 0

where all primes denote differentiation with respect to its own argument of each

function. It must be noted that the search of a similarity solution has transformed

a partial differential equation into an ordinary differential one. After simplifying

a common factor, the equation reduces to

[ f ′(σ ) − ξ ] σ ′ = 0

The equation σ ′ = 0 gives σ  = constant but this solution is useless since it cannot

satisfy the two inital values, except for the trivial situation ρℓ − ρr . Therefore, we

obtain the equation

 f ′(σ(ξ)) = ξ  (2.15)

Remarkably enough, the equation for the new unknown σ  = σ(ξ) has become a

simple functional, i.e., not differential, relationship. In fact the determination of 

the solution requires only to invert the function f ′(σ ), which is known and for the

traffic model at hand is the straight line shownin plot (c) of figure 2.1. Analytically,

we have the explicit

 f ′

σ(ξ) = umax

1 − 2σ(ξ)

ρ jam

= ξ 

that can be solved with respect to the new unknown σ(ξ) to give

σ(ξ) = ρ jam

2

1 − ξ 

umax

(2.16)

We have now to impose the inital condition of the Riemann problem. This means,

for the left value ρℓ it must be f ′(ρℓ) = ξ ℓ and for the right value it must be

17

Page 18: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 18/195

 f ′(ρr )

=ξ r : in other words, the account of the initial value means that a well

defined interval of values for the similarity variable ξ  is selected. It must beemphasized that the variable ξ  must increase going from ξ ℓ to ξ r , and this means

that the rarefaction solution is possible only ξ ℓ < ξ r . In the opposite case, the

solution will be a propagating jump.

Having so determined the actual range of the similiar solution with the defini-

tions ξ ℓ ≡ f ′(ρℓ) and ξ r  ≡ f ′(ρr ), the complete solution of the equation for the

unknown σ  is

σ(ξ) =

ρℓ ξ < ξ ℓ

12

ρ jam

1 − ξ 

umax ξ ℓ < ξ < ξ r 

ρr  ξ r  < ξ The solution for the unknown σ  can be finally translated in the language of the

originary unknown ρ of the car density in space and in time, which assumes the

form

ρ( x , t ) =

ρℓ x < f ′(ρℓ) t 

12

ρ jam

1 − x

umax t 

f ′(ρℓ) t  < x < f ′(ρr ) t 

ρr  f ′(ρr ) t  < x

(2.17)

This solution represents a rarefaction wave.

2.5 General solution of the Riemann problem

Consider now a Riemann problem for the traffic equation with the initial jump

located at a generic point x = x0, as follows

ρ( x, 0) =

ρℓ x < x0

ρr  x > x0

The general solution of this Riemann problem will comprise either a propagating

 jump or a rarefaction fan, emanating from x = x0, according to the ordering of 

the two initial values of density. Thus the solution will be given by the followingfunction

ρ( x, t ) =

ρ jump( x, t ) for ρℓ < ρr 

ρfan( x , t ) for ρℓ > ρr 

By exploiting the solutions obtained explicitly in the previous sections and by

shifting the initial discontinuity to theposition x = x0, weobtain the final complete

18

Page 19: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 19/195

solution

ρ( x, t ) =

ρℓ x < x0 + st 

ρr  x > x0 + st for ρℓ < ρr 

ρℓ x < x0 + aℓ t 12

ρ jam

1 − x

umax t 

x0 + aℓ t  < x < x0 + ar  t 

ρr  x0 + ar  t  < x

for ρℓ > ρr 

where aℓ = f ′(ρℓ) and ar  = f ′(ρr ). For completeness, the program in Fortran

90 implementing these relations for use in a Godunov method based on the exactRiemann solver of the traffic equation is provided below.

19

Page 20: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 20/195

2.6 Program of exact Riemann solver for traffic equation

SUBROUTINE exact_traffic (xx, x_0, rho_l, rho_r, t, rho)

! Exact solution rho(x,t) of the Riemann problem

! for traffic equation:

!

! d_t rho + d_x f(rho) = 0

!

!

! | rho_l for x < x_0

! rho(x,0) = <

! | rho_r for x > x_0

!

!

! where f(rho) = vel_max rho (1 - rho/rho_jam)

! with 0 < rho < rho_jam

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: xx

REAL(KIND=8), INTENT(IN) :: x_0, rho_l, rho_r, t

REAL(KIND=8), DIMENSION(:), INTENT(OUT) :: rho

REAL(KIND=8) :: s, al, ar

REAL(KIND=8), PARAMETERS :: vel_max = 1.0, rho_jam = 1.0

IF (t <= 0) THEN

WHERE (xx < x_0)

rho = rho_l

ELSEWHERE

rho = rho_r

END WHERE

RETURN

ENDIF

IF (rho_l == rho_r) THEN; rho = rho_l; RETURN; ENDIF

IF (rho_l < rho_r) THEN ! propagating jump

20

Page 21: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 21/195

s = vel_max * (1 - (rho_l + rho_r)/rho_jam)

WHERE (xx < x_0 + s*t)

rho = rho_l

ELSEWHERE

rho = rho_r

END WHERE

ELSE ! rarefaction wave

al = char_speed(rho_l)

ar = char_speed(rho_r)

WHERE (xx < x_0 + al*t)

rho = rho_l

ELSEWHERE (xx > x_0 + ar*t)

rho = rho_r

ELSEWHERE ! inside the rarefaction fan

rho = (rho_jam/2) * (1 - (xx - x_0)/(vel_max * t))

END WHERE

ENDIF

CONTAINS

FUNCTION char_speed(rho) RESULT(s)

IMPLICIT NONE

REAL(KIND=8), INTENT(IN) :: rhoREAL(KIND=8) :: s

IF (rho < 0 .OR. rho > rho_jam) THEN

WRITE(*,*) ’car density rho outside the permitted range’

WRITE(*,*) ’in FUNCTION char_speed. STOP.’

WRITE(*,*) ’rho = ’, rho

STOP

ENDIF

21

Page 22: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 22/195

s = vel_max * (1 - 2*rho/rho_jam)

END FUNCTION char_speed

END SUBROUTINE exact_traffic

22

Page 23: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 23/195

3 Weak solutions

Godunov method is a first-order numerical scheme that can be used to compute

weak solutions to hyperbolic problems, a class of time-dependent partial differen-

tial equation systems. To simplify the exposition, we first describe the method in

connection with a scalar conservation law, taking the example of the traffic equa-

tion described in the previous section. The basic relations will be extended to a

system as an anticipation of the general discussion of Godunov for the isothermal

gas equations that will be given in 7.

3.1 Conservation law equation in weak form

The complete mathematical problem for the traffic flow on a highway consists

in the traffic equation described in section 2 together with some suitable initial

condition, defining a Cauchy initial-value problem for the unknown car density

ρ( x , t ) of the type

∂t ρ + ∂ x f (ρ) = 0

ρ( x , 0) = ρ0( x), −∞ < x < ∞(3.1)

where f (ρ) is the flux function previously considered and ρ0( x ) is an initial dis-

tribution of the car density.By means of the chain rule, equation (3.1) can be rewritten in the quasilinear

form

∂t ρ + f ′(ρ)∂ x ρ = 0 (3.2)

where the derivative f ′(ρ) is an advection velocity dependent on theunknown. For

smooth (i.e., differentiable) solutions the two equations (3.1) and (3.2) are entirely

equivalent. On the contrary, if ρ has a jump, the second term of (3.2) will contain

the product of a discontinuous function f ′(ρ) with the derivative of discontinuous

function [1]. While the latter in itself can be given a meaning in the sense of 

the theory of distributions, the product of the discontinuous factor with the Dirac

“function” located at the point of the jump is not well defined. This means thatthe equation in the quasilinear form (3.2) is meaningful only within the class of 

continuous functions.

It is important to make clear that the difficulty caused by discontinuous solu-

tion is not related to the lack of smoothness of the initial condition. In fact, for

nonlinear equations, even infinitely smooth initial data can lead to discontinuous

solutions which can develop after some finite time. In other words, the initial data

are not the responsable for the break down of the continuous solutions: the true re-

sponsable is the nonlinearty of the hyperbolic equation. To include the possibility

23

Page 24: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 24/195

of discontinuous solution we are therefore obliged to introduce a new definition of 

solution and this require to consider an integral form of the conservation law (3.1).The integral form of equation (3.1) requires multiplicating each term of the

equation by a smooth, compact support function φ ( x, t ) ∈ C 1c , where C 1c denotes

the space of continuously differentiable functions with compact support, to give ∞0

 ∞−∞

φ ( x, t )

∂t ρ + ∂ x f (ρ)

dx dt = 0 (3.3)

After integrating by parts, both in time and in space, the integral relation above

becomes

 ∞0

 ∞−∞

ρ ∂t φ ( x, t ) + f (ρ)∂ x φ ( x, t )

dx dt = − ∞

−∞ φ( x , 0)ρ0( x) d x (3.4)

A function ρ( x, t ) which satisfies this integral relationship for any φ( x , t ) ∈ C 1c is

called to be a weak solution to the Cauchy problem (3.1).

3.2 Weak equations in discrete form

Since we are interested in finding a numerical approximation of theweak solutions,

thenext step is to devise a discretization of theequation (3.4). A possibility consists

in choosing φ ( x, t ) in the following particular form

φ( x, t ) = [ H ( x −  x1) − H ( x −  x2)] [ H (t  − t 1) − H (t  − t 2)] (3.5)

where H ( x) denotes the well known unit-step Heaviside function:

 H ( x) =

0 x < 0

1 x > 0

The test function φ( x , t ) represents a brick-shaped function, whose support is a

finite rectangular region of the space-time domain. The derivatives of the φ ( x, t )

with respect to its two variables are calculated as

∂ x φ( x , t ) = [δ( x −  x1) − δ( x −  x2)][ H (t  − t 1) − H (t  − t 2)]∂t φ( x , t ) = [δ(t − t 1) − δ(t  − t 2)][ H ( x −  x1) − H ( x −  x2)]

δ( x ) being the Dirac delta (function).

We can now insert the function φ and its derivatives into the weak statement

(3.4). The first term of the equation, after performing the time integration, yields ∞−∞

 ∞0

[∂t φ( x, t )] ρ dx dt = x2

 x1

[ρ( x , t 1) − ρ( x , t 2)] d x

24

Page 25: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 25/195

since Dirac delta is a sampling function and the spatial Heaviside factor reduces

the x integration to the interval [ x1, x2]. Similar operations are done on the secondterm of equation (3.4), with the roles of space and time variables interchanged, to

give  ∞−∞

 ∞0

[∂ x φ ( x, t )] f (ρ) dx dt = t 2

t 1

 f (ρ( x1, t )) − f (ρ( x2, t ))

dt 

By exploiting these two results in the weak equation (3.4) and since t 1 > 0, so that

there is no contribution by the initial condition, we obtain

 x2

 x1[ρ( x, t 1) − ρ( x , t 2)] d x +  

t 2

t 1

 f (ρ( x1, t )) − f (ρ( x2, t ))

dt  = 0

or, equivalently, in the form x2

 x1

ρ( x, t 2) d x = x2

 x1

ρ( x, t 1) d x − t 2

t 1

 f (ρ( x2, t )) − f (ρ( x1, t ))

dt  (3.6)

which shows explicitly that the increase of the number of cars within the segment

[ x1, x2] of highway in the time interval from t 1 to t 2 is due to the net flux of cars

entering the two extremes in the same interval. Notice that at the left end x1 the

flux contribution is with the positive sign, since the cars go inside the highway

segment [ x1, x2], while at the right end x2 the sign is negative since the cars are

going out the considered highway segment.

3.3 Rankine–Hugoniot jump condition

Theweak formulation (3.4) of the conservation law or its discrete counterpart (3.6)

allows one to define solutions even in the presence of one or more discontinuities.

Of course, continuous (i.e., classical) solutions are also weak solutions, but the

converse is false. It is therefore legitimate to ask what the new definition of 

weak solutions introduces in addition to the standard definition of solutions in the

classical sense. The point is that thedefinition of weak solution implies a constrainton the way the discontinuities can propagate. More precisely, for given values ρℓ

and ρr  of the unknown variable across the discontinuity, there is a uniquely defined

velocity s of propagation for that discontinuity. The speed s depends also on the

considered conservation law throught the analytic form of the flux, namely the

function f (ρ) in the traffic equation we are considering. The relation expressing

the aformentioned constraint is given by

s · (ρr  − ρℓ) = f (ρr ) − f (ρℓ) (3.7)

25

Page 26: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 26/195

and is called Rankine–Hugoniot jump condition. Being a scalar relation, the prop-

agation speed s of the density jump in the traffic flow can be expressed explicitlyas follows

s = f (ρr ) − f (ρℓ)

ρr  − ρℓ

(3.8)

We now demonstrate that Rankine–Hugoniot condition is a consequence of the

weak formulation of the conservation law.

Let us consider a small domain D of the space-time half planeR×R+, namely,

 D ⊂ R × R+, and suppose that a weak solution ρ( x, t ) to the traffic equation is

discontinuous inside D. For simplicity, we assume that D is small enough that

there is only one line of discontinuity inside D and that the line is accurately

described as a segment S of a straight line crossing the domain D.Since ρ( x, t ) is a weak solution in the space-time half plane, the integral equa-

tion (3.4) can be written also over the small domain D and becomes  D

[(∂t φ) ρ + (∂ x φ) f (ρ)] dx dt = 0

where φ( x , t ) is any function ∈ C 1c and where the integral at the initial time is zero

since D does not intersect the x axis.

The discontinuity allows to divide the domain in two parts that will be denoted

by Dℓ and Dr , and in each of them the solution ρ( x, t ) is a classical solution: these

two solutions will be indicated by ρℓ( x, t ) and ρr ( x , t ), respectively. Thus, theintegral of the equation above can be split in two contributions, as follows, 

 Dℓ

[(∂t φ) uℓ + (∂ x φ) f (uℓ)] dx dt + 

 Dr 

[(∂t φ) ur  + (∂ x φ) f (ur )] dx dt = 0

In order to simplify the interpretation of the mathematical expressions, we change

the time variable t  to become a second spatial coordinate y defined by

t  → y ≡ ct 

where c is some velocity, so that y has the physical dimension of a length. Thechoice of the velocity c is completely arbitrary and, just to fix the idea, we can take

c to be the value of our typical strolling velocity, when we are relaxed. With the

new variable, the unknown car density function is changed as follows ρ( x , t ) →ρ( x , y), tolerating the slight abuse of mathematical notation. Then the traffic

equation for the new unknown ρ( x, y) can be written as follows:

c ∂ y ρ + ∂ x f (ρ) = 0 =⇒ ∂

∂ x

f (ρ)

c

+ ∂ρ

∂ y= 0

26

Page 27: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 27/195

Therefore, after introducing the gradient operator in the plane ( x , y)

∇ ≡

∂ x,

∂ y

and the two-component vector

R ≡ ( f /c, ρ)

the transformed traffic equation assumes the compact form

∇ · R = 0

in all points ( x , y) of the upper half plane (∀ x, y > 0). Therefore, any classical

solution ρ( x, y) satisfies this equation with R = ( f (ρ)/c, ρ).

According to the new purely spatial representation, the integral weak equation

will be rewritten as  Dℓ

( ∇ φ) · Rℓ d D + 

 Dr 

( ∇ φ) · Rr  d D = 0

where d D = dx dy, and Rℓ = ( f (ρℓ)/c, ρℓ) and Rr  = ( f (ρr )/c, ρr ). From the

elementary differential identity ∇ ·

(φ R)

=( ∇ 

φ)

·R

∇ ·R, for a classical

solution ρ( x, t ) we have ∇ · (φ R) = ( ∇ φ) · R. But ρℓ( x, t ) in Rℓ and ρr ( x, t )in Rr  are classical solutions in their respective domains Dℓ and Dr , so that the

integral equation is equivalent to  Dℓ

∇ · (φ Rℓ) d D + 

 Dr 

∇ · (φ Rr ) d D = 0

namely, by virtue of the divergence theorem,

 ∂ Dℓ

φ  N ℓ · Rℓ dl + ∂ Dr 

φ  N r  · Rr  dl = 0

where dl is the length element of the boundaries ∂ Dℓ and ∂ Dr  and  N  is the

outwardly directed unit vector.

The test function φ ∈ C 1c is now chosen such that φ|∂ D = 0. It follows that

the line integrals in the weak equation reduce only to the segment S of intersection

beetwen the domain D and the discontinuity of the solution, to give S ∩ Dℓ

φ  N ℓ · Rℓ dl + 

S ∩ Dr 

φ  N r  · Rr  dl = 0

27

Page 28: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 28/195

However on the discontinuity segment S  it is

 N r 

= −  N ℓ so that the last equation

is equivalent to  S 

φ  N ℓ · Rℓ − Rr 

dl = 0

By the complete arbitrarity of the function φ on S , the integral can vanish only

provided N ℓ · Rℓ − Rr 

= 0

This is equivalent to

 N  x

f (ρℓ)

c− f (ρr )

c

+ N  y(ρℓ − ρr ) = 0

But −cN  x / N  y is the speed associated with the slope of the segment S , so the last

relation can be rewritten as

s · (ρℓ − ρr ) = f (ρℓ) − f (ρr )

or equivalently

s = f (ρℓ) − f (ρr )

ρℓ − ρr 

which completes the proof.

Let us now consider a system of hyperbolic equations for a vector unknown u,

with two or more components, and flux vector f (u), and let us suppose there is an

initial discontinuity of this vector variable between the two states, uℓ and ur . If 

this discontinuity could move in space unaltered, its speed s would be obliged to

satisfy the vector counterpart of Rankine–Hugoniot condition, namely the relation

s · (ur  − uℓ) = f (ur ) − f (uℓ)

which can be established by applying the previous argument to the vector conser-

vation law, namely, to the hyperbolic system:

∂t u + ∂ x f (u) = 0

However, for initial data uℓ and ur  specified arbitrarily, the Rankine–Hugoniot

(vector) relation cannot be satisfied since the direction of ur  − uℓ is in general

different from that of f (ur ) − f (uℓ), the flux f (u) being an independent function.

As a consequence, in general the initial jump of the vector variable of a system

cannot propagate rigidly with some velocity and must instead disintegrate in two

or more distinct waves, each propagating in some definite manner. In fact, for a

hyperbolic system the (vector) Rankine–Hugoniot condition can be satisfied only

for a restricted set of left and right states uℓ and ur . In other words, only when uℓ

and ur  fulfill some definite constraint, the jump ur  − uℓ can propagate in space

unaltered.

28

Page 29: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 29/195

3.4 Principles of Godunov method

The integral or weak form (3.6) of the traffic equation has been formulated with

referenceto therectangle [ x1, x2]×[t 1, t 2]ofthespace-time plane. Thisform canbe

used to build a discretized version of the conservation law assuming that the entire

highway is represented by a finite set of points x j , with j = . . . , −1, 0, 1, 2, . . . ,

to fix the ideas, and that the distribution of cars only at the discrete time levels

t n+1, with t n+1 = t n + t , is sought for. In other words, we assume to introduce

discretizationboth in space and in time, and consider the values of the car density at

thediscretepointsofsucha space-time grid. Actually, ratherthan consideringpoint

values of the solution it is more appropriate to introduce a different interpretation

of the discrete quantity Rn

 jthat approximates the value of ρ( x j , t n) of the exact

solution.

Let us suppose to divide the spatial domain into subintervals, called grid cells,

defined by

C  j =  x j− 12

< x < x j+ 12

(3.9)

with end points x j+ 12

= ( x j +  x j+1)/2 located in the middle of two consecutive

grid points. The length of each cell is

|C  j | =  x j = x j+ 12−  x j− 1

2(3.10)

and each mid points x j+

1

2

represents the interface between two consecutive cells

C  j and C  j+1.

Let ρn( x, t ) be a solution which depends on the continuous variables x and

t  ≥ t n but has been obtained from a given discrete initial condition at time t  = t n .

From ρn( x , t ) we can define its cell average

 R j (t ) ≡ 1

|C  j | x j+½         

¾          

 x j−½         

¾          

ρn( x, t ) d x (3.11)

over thecell C  j and at time t  ≥ t n provided that t −t n is suitably small. In particular,

the cell average at the initial discrete time level t n will be denoted by

 Rn j ≡ 1

|C  j | 

x j+½         

¾          

 x j−½         

¾          

ρn( x, t n) d x (3.12)

Let us assume that the discrete set of values Rn j has been calculated at time t  = t n .

They provide a piecewise constant representation of the solution, i.e., they give an

approximation consisting of cell averages for the solution. Our aim is to determine

the discrete set of values Rn+1 j at a later time t n+1 = t n + t .

The idea of Godunov method is to consider the various initial value problems

associated with the different jumps at all the interfaces and solve these Riemann

29

Page 30: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 30/195

problems exactly. This amounts to find the kind of wave emanating from each

interface. For the traffic equation, the solutions are provided by the Riemannsolver described in section 2.5. By patching these local solutions together, we can

build a solution that has been denoted by ρn( x, t ), which si defined for any x and

for t  ≥ t n . Note the superscript n to remind that this solution depends on the set

of the “initial” data { Rn j , ∀ j}. More precisely, this solution will exist over the time

interval allowing a juxtaposition of the local Riemann solutions, which is limited

by the request that interactions can occur only between contacting cells. This

introduces a limit on the maximum allowable time step t  for a given distribution

of the “initial” data Rn j , expressed by the following condition

t  max∀ j

| f ′( Rn j )|

|C  j | < 1 (3.13)

known as CFL condition after Courant, Friedrichs and Lewy. Provided this con-

dition is satisfied, we can consider the weak equation (3.6) and particularize it to

the space-time rectangle x j− 1

2, x j+ 1

2

× [t n, t n+1], to give

 x j+½         

¾          

 x j−½         

¾          

ρn( x, t n+1) d x = x j+½         

¾          

 x j−½         

¾          

ρn( x , t n) d x + t n+1

t n

 f 

ρn x j− 1

2, t 

dt 

−  t n+1

t n  f 

ρ

n x j+ 12 , t 

dt 

(3.14)

This relation is identically satisfied since in the considered strip [t n ≤ t  ≤ t n+1]the function ρn( x, t ) is an exact weak solution. Moreover, it respects the entropy

condition since only entropic solutions to the Riemann problems are emloyed.

This equation is remakable in that it involves integrals only on the boundary of 

the space-time rectangle x j− 1

2, x j+ 1

2

×[t n, t n+1]. According to the interpretation

in (3.12) the term  x j+½         

¾          

 x j−½         

¾          

ρn( x, t n) d x is the cell average, multiplied by |C  j |, at the

initial time. In the same spirit, the first integral can be taken to give the cell average

on the same cell but at the new time, according to the definition

 Rn+1 j ≡ 1

|C  j | x j+½         

¾          

 x j−½         

¾          

ρn( x, t n+1) d x (3.15)

Moreover, the other two terms of equation (3.14) are integrals over a time integral

t  but with constant integrand since the solution of the Riemann problem at each

interface is a similarity solution and hence assumes the same value on any ray

issuing from the interface point. The rays involved in the two integrals are vertical

and thus it is convenient to introduce the following special notation to denote the

30

Page 31: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 31/195

value for ξ 

=0 of the solution of the interface Riemann problem, i.e., along the

vertical ray:

ρ∨|( R j , R j+1) = ρRiemann(0, R j , R j+1) (3.16)

where ρRiemann(ξ, R j , R j+1) is the solution of the Riemann poblem with inital

data R j and R j+1. The time integrals can therefore be evaluated most simply as

follows t n+1

t n

 f 

ρn x j+ 1

2, t 

dt  = t n+1

t n

 f 

ρ∨|( R j , R j+1)

dt  = f 

ρ∨|( R j , R j+1)

(3.17)

We can therefore introduce a numerical flux for the interface located at x = x j+ 12

F ∨|

 j+ 12

= F ∨|( R j , R j+1) ≡ f 

ρ∨|( R j , R j+1)

(3.18)

in terms of which the discrete weak equation (3.14) assumes the remarably simple

form

 Rn+1 j = Rn

 j − t 

|C  j |

F ∨| n

 j+ 12

− F ∨| n

 j− 12

(3.19)

This is the celebrated method introduced by Godunov [5] to solve the Euler equa-

tions, particularized here to the very simple case of a scalar conservation law. It

is the basis for the numerical methods called Finite Volumes for solving nonlinear

hyperbolic systems, to be described in the next sections.

As a matter of fact, it is more convenient to implement the method in a different

form, by accounting for the contribution of the flux at each interface to the two

neighbouring cells, as follows. One considers the cycle over the interfaces and

initialize the new cell averages Rn+1 j ← Rn

 j . The flux contribution F ∨| n

 j+ 12

to the

averages of the conserved quantity in the two cells j and j +1 is taken into account

by the double update instructions

 Rn+1 j ← Rn+1

 j − t 

|C  j | F ∨| n

 j+ 12

and Rn+1 j+1 ← Rn+1

 j+1 + t 

|C  j+1| F ∨| n

 j+ 12

(3.20)

In this way a single evaluation of the flux at each interface is guaranteed algorith-

mically.

The scheme can be extended to hyperbolic systems. For the moment being, as

an anticipation, it is sufficient to highlight that thevector counterpart of thediscrete

weak equations (3.14) for the system ∂t w + ∂ x f (w) = 0 assumes the form x j+½         

¾          

 x j−½         

¾          

wn( x, t n+1) d x = x j+½         

¾          

 x j−½         

¾          

wn( x , t n) d x + t n+1

t n

f wn x j− 1

2, t 

dt 

− t n+1

t n

f wn x j+ 1

2, t 

dt 

(3.21)

31

Page 32: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 32/195

and can be recast as the following update of the vector counterpart of the Godunov

method

Wn+1 j = Wn

 j − t 

|C  j |F∨| n

 j+ 12

− F∨| n j− 1

2

(3.22)

Here

F∨| j+ 1

2

= F∨|(W j , W j+1) ≡ f w∨|(W j , W j+1)

(3.23)

with w∨|(W j , W j+1) = wRiemann(0, W j , W j+1) is the solution for ξ  = 0 of the

Riemann problem with data W j and W j+1 at the interface x = x j+ 12. Thus,

most of the difficulty of a finite volume method based on Godunov ideas lies in

the solution of the Riemann problem for the considered hyperbolic system. Of 

course the scheme can (and will) be implemented in the form of the cycle over theinterfaces, after the initialization Wn+1

 j ← Wn j

Wn+1 j ← Wn+1

 j − t 

|C  j | F∨| n j+ 1

2

and Wn+1 j+1 ← Wn+1

 j+1 + t 

|C  j+1| F∨| n j+ 1

2

(3.24)

An even more convenient manner of implementing the Godunov method (as any

other conservative scheme) is to introduce the total flux contribution R j to any

cell, through the simple accumulation, after the initialization R j = 0,

R j ←

R j −

F∨| n

 j+ 12

and R j+1 ←

R j+1 +

F∨| n

 j+ 12

(3.25)

The cell-cumulated total flux is indicated as R j since for steady-state solutions

it is proportionol to the cell residual. In the complete algorithm, the quantity

R j must include the contribution of all cell interfaces together with those due to

the flux evaluated on the boundary, not discussed here. After the final total flux

R j has been accumulated for all cells, the update step for the cell averages W j

of the conservative variables is most simply achieved by considering the global

array W  = {W j , j = 1, 2, . . . , J } of all cell averages and the analogous array

R = {R j , j = 1, 2, . . . , J } of all cell-cumulated fluxes (residuals). In terms of 

these global arrays, the update step for the conservation-law system will read

W n+1 = W 

n + t R

|C| (3.26)

where C = {C  j , j = 1, 2, . . . , J } is the global vector of all cells of the grid.

32

Page 33: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 33/195

4 P-system for the isothermal ideal gas

After the preliminar discussions about the scalar conservation law for the traffic

flow given in sections 2 and 3, we address the case of a system of hyperbolic

equations. The mathematical model considered here is that of the gasdynamic

equations governing the flow of a gas in a straight tube which is held at a uniform

temperature. In the present section we first introduce the physical model of the

isothermal ideal gas, and we provide the conservation law equations governing

the one-dimensional motion of this special compressible fluid. The nonlinear

hyperbolic system is then written in quasilinear form and the eigenvalue problem

associated to it is solved. The concept of genuine nonlineary is finally introduced

to show that the wave modes of the isothermal ideal gas system indeed satisfiessuch a mathematical property which is basic for the solution of Riemann problems

and for the development of Godunov method and related numerical schemes.

4.1 The fluidynamic model

Let us consider a gas flowing in a straight tube and assume that its temperature

is held uniform along its entire length by a suitable continuous regulation of heat

transfer through the tube walls. This assumption is difficult to be achieved in prac-

tice. However, this idealization is not in contradiction with any physical principle

andcanbe thereforeaccepted to obtaina mathematical model of compressible flow

in one dimension which is simpler than the standard system of Euler equations of 

gasdynamics. Restricting to an isothermal flow allows one to ignore the energy

balance equation so that the system of governing equations reduces to the mass

conservation and momentum balance principles. On the other hand, the thermo-

dynamic behaviour of the fluid is completely described by a single equation of 

state for the pressure of the simple form P = P(ρ). Due to the occurrence of such

a pressure function of one variable, hyperbolic nonlinear systems with only two

components are conventionally denoted as P-system.

In the particular physical model we are interested in, the fluid is assumed

furthermore to be an ideal gas described by the celebrated equation of state of 

Gay-Lussac:P(ρ) = PT (ρ) = RT ρ (4.1)

where R is the universal constant of the considered gas and T  is its temperature,

assumed here to be fixed. It follows that this equation of state can also be written

more simply as

P(ρ) = a2ρ (4.2)

33

Page 34: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 34/195

after having introduced the isothermal speed of sound a according to the definition

a2 ≡

∂ P

∂ρ

= RT  = constant (4.3)

In the light of our present knowledge of thermodynamics, the concept of a speed

of sound at a constant temperature may appear somewhat artificial and physi-

cally implausible. However this gas model corresponds exactly to Isaac Newton’s

ideas1 when he conceived the propagation of acoustic waves as an isothermal

phenomenon—should not we call it Newton gas?

Another interesting example of P-system is the flow of a nearly incompressible

fluid in a tube when the transient phenomenon called water hammer  (in italian

“colpo d’ariete”) occurs. This very important highly unsteady hydrodynamic phe-

nomenon can be studied in a rigorous mathematical form only if placed in the

context of the Riemann problems, for a detailed discussion see [11].

4.2 Governing equations

The conservation laws for the fluid dynamic model considered here are the mass

conservation equation and the balance law for the momentum. Under the assump-

tion of one-dimensional flow, the two equations read

∂t ρ + ∂ x (ρu) = 0

∂t (ρu) + ∂ x

ρu2 + a2ρ

= 0(4.4)

where u is the velocity of the gas, t  the time and x the spatial coordinate. This is

a hyperbolic system of nonlinear equations written in the conservative form.

By adopting the conservative variables mass density ρ and momentum density

m ≡ ρu as unknowns, the governing equations read

∂t ρ + ∂ x m = 0

∂t m + ∂ x

a2

ρ + m2

/ρ = 0

(4.5)

To write the system compactly, we introduce the vector unknow w and the associ-

ated flux vector f , defined as follows,

w ≡

ρ

m

and f (w) ≡

f ρ (w)

 f m (w)

=

m

m2/ρ + a2ρ

(4.6)

1The interested reader can benefit from the scholar interpretation of Newton’s Principia by

Chandrasekhar [2, pp. 586 and 591].

34

Page 35: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 35/195

so that the system of conservation laws becomes

∂t w + ∂ x f (w) = 0 (4.7)

For the purpose of the present study, it is convenient to write the system above also

in the so-called quasilinear form. This requires to introduce the Jacobian matrix:

A(w) = ∂f (w)

∂w=

0 1

a2 − m2

ρ2

2m

ρ

(4.8)

which allows to write the considered hyperbolic system in quasilinear form

∂t w + A(w) ∂ x w = 0 (4.9)

4.3 Eigenvalue problem

As explained before, because one of the objects of this report is to solve Riemann

problems for P-systems or related systems of two nonlinear hyperbolic equations,

it is necessary to consider solutions consisting of rarefaction waves. Such a de-

nomination indicates solutions which dependon thespace and time variables x and

t  in a very special way, namely only through the single variable ξ 

≡x /t , which

is denoted as the similarity variable. Under this hypothesis, the vector unknownw( x , t ) becomes a function of ξ  and must therefore be replaced by the following

new unknown W:

w( x, t ) = W x

= W(ξ ) =

 R(ξ )

 M (ξ )

where the capitals letters should be used to distinguish the function unknowns

dependent on a single variable—the similarity variable ξ —from those dependent

on the two variables, x and t . However, to have more easily readable expressions,

the unknown of the ODE system for the similarity problem is denoted by the samesymbol w used for the unknown of the original PDE system. In other words, the

relation above will be rewritten as follows

w( x, t ) = w x

= w(ξ ) =

ρ(ξ)

m(ξ )

(4.10)

although this represents a slight abuse of mathematical notation. With the adopted

notation, the time and space derivatives of a solution of similarity typecan beeasily

35

Page 36: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 36/195

evaluated by the chain rule, to give,

∂t w( x , t ) = d w(ξ )

d ξ ∂t ξ  = −  x

t 2w′ x

= −ξ 

t w′(ξ ) (4.11)

∂ x w( x , t ) = d w(ξ )

d ξ ∂ x ξ  = 1

t w′ x

= 1

t w′(ξ ) (4.12)

For similarity solutions, the quasilinear system becomes

−ξ w′ + A(w) w′ = 0 ←→ A(w) − ξ I

w′ = 0 (4.13)

andthereforetheoriginalpartial differential systemhasbeen reduced to anordinary

differential one, consisting of two coupled scalar equations. The new system isa first-order nonlinear system with a zero right-hand side. It admits the simple

solution w′ = 0, which implies w(ξ ) = constant: however, this solution cannot

represent a wave and is therefore useless for our purposes.

Other solutions can exist only when the matrixA(w) − ξ I

is singular, since

only in this case the system (4.13) can be satisfied by a w(ξ ) different from a

constant vector. We are therefore led to consider the eigenvalueproblem associated

with matrix A(w), which amounts to solve the determinantal equation detA(w) −

λ(w) I = 0, namely,

−λ 1

a2 − m2

ρ2

2m

ρ− λ

= 0 (4.14)

This equation yields the characteristic equation

λ2 − 2m

ρλ + m2

ρ2− a2 = 0 (4.15)

which is a second order equation; the solutions are provided by the quadratic

formula, to give the eigenvalues of A(w),

λ1,2(w)

=m

ρ ∓a (4.16)

where the two eigenvalues λ1 and λ2 are written in increasing order. Once the

identification of the similarity variable ξ  with the eigenvalue λ(w) is recalled, this

relation implies

ξ  = m

ρ∓ a (4.17)

which represents an algebraic (i.e., not differential) relationship between the two

components ρ and m of the similarity solution w = (r ho, m) and the independent

variable ξ .

36

Page 37: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 37/195

The (right) eigenvectors corresponding to the eigenvalues are found by replac-

ing the eigenvalues λ1,2(w) = m/ρ ∓ a in matrixA(w) − λ(w) I

and writing

the (now singular) system:

m

ρ∓ a

1

a2 − m2

ρ2

m

ρ± a

R1,2

M1,2

= 0 (4.18)

where R1 and M1 are the components of the first eigenvector r1, while R2 and

M2 of the second r2. The two rows of the system are linearly dependent, so it is

sufficient to consider only one equation, for example the first one:

m

ρ∓ a

R1,2 +M1,2 = 0 (4.19)

The solution of (4.19) defines uniquely only the ratio between the two components

of each eigenvector, while the eigenvector length remains arbitrary. To obtain an

eigenvector, an arbitrary real value can be specified for one of its components: for

example, if the first component is fixed R1,2 = 1, the second one results to be

M1,2 = m

ρ∓ a. With this choice, the two eigenvectors will be

r1(w) = 1

m

ρ− a

and r2(w) = 1

m

ρ+ a

(4.20)

4.4 Genuine nonlinearity

To establish the nonlinear character of a hyperbolic system of nonlinear equations

is much more complicated than for a scalar conservation law, where it is sufficient

to examine the flux function. For a system, its actual nonlinear character depends

on the nature of the eigenvalues and of the corresponding eigenvectors. More

precisely, it is first necessary to consider the vector field of the gradient of the

eigenvalueasa functionof thevariables of thesystem. For thesystem of isothermalideal gas the gradient of an eigenvalue is calculated as

∇λ(w) = ∂λ(w)

∂ρρ + ∂λ(w)

∂mm (4.21)

where ρ and m represent theunit vectors in theplane (w) [it is actuallya half-plane]

of the variables. Evaluating the partial derivatives we obtain

∇λ1,2(w) = − m

ρ2ρ + 1

ρm (4.22)

37

Page 38: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 38/195

In general there are as many gradient fields of this kind as the number of different

eigenvalues. For the considered hyperbolic system the two gradient fields ∇λ1(w)and ∇λ2(w) are actually coincident.

The definition of nonlinearity for a system of hyperbolic equations involves the

vector field of the eigenvectors. In fact, the definition is centered on the following

scalar product between the vector field of the eigenvectors r = r1,2(w) and the

gradient fields ∇λ1,2(w), namely,

ri (w) ·∇λi (w) i = 1, 2 (4.23)

The value of this scalar product depends on the point w and when it is zero at w

the two vectors fields are orthogonal at that point.According to Lax definition, the wave associated to the i th eigenvalue is said

genuinely nonlinear  whenever

ri (w) ·∇λi (w) = 0 ∀ρ, m (4.24)

while it is said linearly degenerate whenever

ri (w) ·∇λi (w) = 0 ∀ρ, m (4.25)

In otherwords, thegenuinenonlinearityof aneigenvalueimplies that thetwovector

fields∇

λi (w) and ri (w) are nowhere orthogonal, while the linear degeneracymeans that they are orthogonal everywhere. We can collect these definitions in the

following scheme

ri (w) ·∇λi (w) = 0 ∀ρ , m ⇐⇒ genuine nonlinearity

ri (w) ·∇λi (w) = 0 ∀ρ, m ⇐⇒ linear degeneracy

(4.26)

The expression linearly degenerate is confusing because the attribute “degener-

ate” is employed normally to denote a multiple eigenvalue, namley, when two or

more eigenvalues are coincident, whereas here we are considering a nondegen-

erate eigenvalue. In the case of a single (i.e. not multiple) eigenvalue, “linearlydegenerate” means simply that the eigenvalue is linear . The nomenclature of “lin-

ear degeneracy” comes from a very important theorem due to Boillat (1972), see

Godlewski and Raviart [4, p. 85], that states that every degenerate (i.e. multiple)

eigenvalue of a hyperbolic system is also necessarily linear. In other words, the

degeneracy implies linearity.

Coming to the case of the isothermal gas system of interest here, a direct

calculation gives

r1,2(w) ·∇λ1,2(w) = ∓a

ρ(4.27)

38

Page 39: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 39/195

Therefore, both waves of the isothermal gas system are genuinely nonlinear. As a

consequence, in thephysical process of theflow along theisothermal tube, the idealgas can develop both rarefaction waves as well as shock wave solutions, which are

the simple solutions that will be described in the next section.

It is important to observe that for genuinely nonlinear eigenvalues, the non-

vanishing of the scalar product ri (w) ·∇λi (w) can be exploited to normalize the

eigenvectors in a unique way. For instance, since ∓a/ρ is always different from

zero, the eigenvectors rnorm1,2 (w) can be divided by ∓a/ρ and we obtain the two

scaled eigenvectors:

rnorm1 (w) = −ρ

a

ρ − m

a

and rnorm2 (w) = ρ

a

ρ + m

a

(4.28)

which are normalized in the sense that

rnorm1,2 (w) ·∇λ1,2(w) = 1 (4.29)

39

Page 40: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 40/195

.

40

Page 41: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 41/195

5 Simple solutions

In this section we concentrate on simple (weak) solutions to the equations for the

isothermal ideal gas. We first consider the weak solution which represents shock 

wave propagating with a constant velocity between two uniform states of the fluid.

Then we describe the rarefaction wave by integrating the ordinary differential

system of equations that has been introduced in the previous section 4. These

elementary solutions allows to formulate theRiemann problem for this gasdynamic

model as well as to write the basic nonlinear equation for this problem. The section

ends with thedetermination of theanalytical solution of a special Riemann problem

consisting in a singleshockwave that is reflectedby a stationary wall. This solution

will be used to check the performance of a procedure for satisfying the boundarycondition that has been proposed by Alberto Guardone and that will be described

in appendix B.

5.1 Shock wave solutions: Hugoniot locus

Following LeVeque’s analysis [8, chapter 7], if a discontinuity propagates with

speed s across the states w and w, the Rankine–Hugoniot condition must hold

s · (w − w) = f (w) − f (w). (5.1)

For the isothermal gas equations described in section 4, the vector relation abovegives a system of 2 equations in 2 + 1 = 3 unknowns: the two components of w

and the scalar value s. The solution consists of one parameter families of solutions

whose description is given in terms of a parameter that can be chosen arbitrarily.

Reminding the definition of the vector unknown w and flux f given in (4.6) for

the considered gas model, the Rankine–Hugoniot conditions (5.1) become

s(ρ − ρ) = m − m,

s(m − m) = m2

ρ+ a2ρ − m2

ˆρ

− a2ρ.(5.2)

This gives a system of two nonlinear equations in the three unknowns s, ρ and

m. One possible choice for the parameter is to take the first unknown ρ itself to

parametrize the curve.

Theidea is toeliminate thevariables inorder toobtainonerelationship between

the other two variables ρ and m. The first equation of the system (5.2) gives

s = m − mρ − ρ (5.3)

41

Page 42: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 42/195

and, by substituting it into the second equation, we obtain

m2

ρ− m2

ρ+ a2(ρ − ρ) = (m − m)2

ρ − ρ . (5.4)

This reduces to a second order equation in the unknown m, with coefficients de-

pendent on ρ, of the form

m2 − 2mρ

ρm + m2ρ2

ρ2− a2(ρ − ρ)2 ρ

ρ= 0. (5.5)

The quadratic solution formula gives

m1,2(ρ) = m

ρρ ∓ a(ρ − ρ)

 ρ

ρ, (5.6)

and the substitution of m(ρ) into relation (5.3) for the shock speed s

s1,2(ρ) = m

ρ∓ a

 ρ

ρ, (5.7)

where the two solutions s1 and s2 have been taken in increasing order. More

precisely, making explicit the dependence on the pivotal state w, the complete

solution of the Rankine–Hugoniot conditions is written as

m1,2(ρ, w) = m

ρρ ∓ a(ρ − ρ)

 ρ

ρ,

s1,2(ρ, w) = m

ρ∓ a

 ρ

ρ.

(5.8)

The functions m1(ρ, w) and m2(ρ, w) represent two curves that are called the

 Hugoniot loci while s1(ρ, w) and s2(ρ, w) represent the velocity of the corre-

sponding discontinuities propagating between the uniform states w = (ρ, m) and

w

=(ρ, m).

5.2 Lax entropy condition for a system

Theshocksolutionjust obtainedis correct forany valueof ρ, namelyfor bothρ > ρ

and ρ < ρ. This means that, in any case, a discontinuous solution propagating

between theuniformstate w = (ρ, m) andthestate (ρ, m1(ρ, w)) or (ρ, m2(ρ, w))

is a weak solution to the conservation law equations for the isothermal gas. On the

other hand, this solution cannot be acceptedunless it has been verified to satisfy the

entropy condition. As we know, this condition is essential in selecting amongst the

42

Page 43: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 43/195

infinitely many weak solutions to the nonliner hyperbolic system the only one that

can be obtained as the limit of a viscous solution for a vanisingly small viscosity.In the present context, the selection mechanism is capable of dropping out half 

of the possible weak solutions and it selects the piece of the Hugoniot locus not

contradicting the irreversibilty.

According to Lax, the version of the entropy condition for a system must be

expressed with reference to a given eigenvalue and considering a discontinuity

moving with a known speed s. If the discontinuity propagates between a left state

w L and a right state w R , this shock is admissible only if 

λk (w L ) > s > λk (w R) (5.9)

where λk (w) is one of the eigenvalue of the hyperbolic system. Consider for

instance the wave that can be connected with the left state wℓ of the Riemann

problem, that is the first discontinuous solution satisfying the Rankine–Hugoniot

condition. This solution is given by m = m1(ρ, wℓ) and s = s1(ρ, wℓ). We take

this solution since it is related to the first eigenvalue of the problem which must

be considered for the left wave. Then, Lax entropy condition for a possible shock 

wave on the left reads

λ1(wℓ) > s1(ρ, wℓ) > λ1(w1(ρ, wℓ)) (5.10)

where w1(ρ, wℓ)=

(ρ , m1(ρ, wℓ)). Reminding the expression of the first eigen-

value and bysubstituting the first solution in (5.8) with w = wℓ into this expression

we findmℓ

ρℓ

− a >mℓ

ρℓ

− a

 ρ

ρℓ

>m1(ρ , wℓ)

ρ− a

The letf part of this inequality reduces to: ρ

ρℓ

> 1 =⇒ ρ > ρℓ

Thesecondpart, upon substitution of m1(ρ, wℓ) from (5.8) with w = wℓ, becomes

mℓ

ρℓ

− a

 ρ

ρℓ

>mℓ

ρℓ

− a

1 − ρℓ

ρ

 ρ

ρℓ

− a

that can be simplified to give  ρℓ

ρ< 1

which leads to the same condition ρ > ρℓ provided by the left inequality. Thus,

due to the entropy condition the admissible shock waves associated with the first

nonlinear field in the isothermal ideal gas has the final state that is compressed.

43

Page 44: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 44/195

For the second nonlinear wave and always with reference to the left state wℓ,

the entropy condition reads

λ2(wℓ) > s2(ρ, wℓ) > λ2(w2(ρ, wℓ)) (5.11)

An analogous calculationshows thatbothinequalities require thatρ < ρℓ: thus, the

shock wave connecting the state w = (ρ, m2(ρ, wℓ)) with wℓ has the compressed

(post-shoc) fluid in latter and the lower density (pre-shock) fluid in the former.

This shock wave is however useless for the solution of the Riemann problem since

the left state wℓ must be connected with states associated only with the first  wave.

Coming now to the right state wr  of the Riemann problem and to the states that

can be connected with it by the second wave, the Lax condition reads

λ2(w2(ρ, wr )) > s2(ρ, wr ) > λ2(wr ) (5.12)

By the same reasoning we deduce the condition ρ > ρr . Thus, the states that can

be connected with wr  by the second wave are shock waves with the compressed

fluid in the final state, exactly as found for the final states connecting the left state

wℓ by means of the first nonlinear wave.

5.3 Riemann invariants

A function i

=i (w) is defined to be a Riemann invariant for the mode p when it

satisfiesr p(w) ·∇i (w) = 0. (5.13)

For a hyperbolic system with m equations there are m − 1 Riemann invariants for

each mode. In the case of the P-system m = 2 and therefore there is only one

Riemann invariant for each mode.

Let us determine the Riemann invariants of the P-system for the isothermal

gas. Consider the first mode with normalized eigenvector r1(w), see section 4.4,

r1(w) =

−ρ

a

ρ −m

a

(5.14)

The Riemann invariant i = i (w) = i (ρ, m) is defined as the solution to the

equation

−ρ

a

∂i

∂ρ+

ρ − m

a

∂i

∂m= 0 (5.15)

which reduces immediately to

− ∂i

∂ρ+

a − m

ρ

∂i

∂m= 0 (5.16)

44

Page 45: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 45/195

This is a first-order partialdifferentialequation, linear butwithvariablecoefficients.

To determine its solution let us consider the change of the independent variable

m → u = m/ρ

and the corresponding change of the unknown

i (ρ, m) → I (ρ, u) ≡ i ( ρ,ρu)

i (ρ, m) ≡ I (ρ, m/ρ)

The partial derivatives of the Riemann invariant with the original independent

variables ρ and m can be expressed in terms of those with respect to the new

variables:∂i

∂ρ= ∂ I 

∂ρ− m

ρ2

∂ I 

∂uand

∂i

∂m= 1

ρ

∂ I 

∂u

The substitution into the equation for i yields, after simplifying two terms, the

partial differential equation for the new unknown I (ρ, u)

−ρ

a

∂ I 

∂ρ+ ∂ I 

∂u= 0 (5.17)

The form of this equation suggests to look for the Riemann invariant I (ρ, u) as

the sum of two functions of only one variable, as follows

 I (ρ, u) = A(ρ) + B(u). (5.18)

Then the equation becomes

−ρ

a A′(ρ) + B′(u) = 0 (5.19)

where the prime denotes differentiation with respect to the independent variable of 

any function of a single variable. The first term of the equation is a function only

of variable ρ whereas the second is a function only of u. Thus the equation can

be satisfied only provided the two terms are equal to one and the same constant,

but with opposite signs, as is typical when a PDE is solved by the technique of the

separation of variables. As a consequence, the two functions A(ρ) and B(u) must

satisfy the two independent first order ordinary differential equation

 A′(ρ) = K a

ρand B′(u) = K  (5.20)

where K  is a separation constant. Theintegrationof thetwoequations is immediate

and gives

 A(ρ) = C + K a ln ρ and B(u) = D + K u

45

Page 46: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 46/195

where C  and D are integration constants. Therefore the solution is found to be

 I (ρ, u) = H  + K (a ln ρ + u)

with H  = C +  D is a single constant. The constant H  is better taken into account

replaced by another constant ρ0 which permits the argument of the logarithm to

be dimensionless

 I (ρ, u) = K 

a ln

ρ

ρ0

+ u

(5.21)

The Riemann invariant as a function of the original variables reads

i (ρ, m) = K 

a lnρ

ρ0+

m

ρ

(5.22)

The Riemann invariant associated with the second mode can be obtained in the

same way.

5.4 Rarefaction waves: integral curves

For a hyperbolic system with p equations, at each point w there are p curves

tangent at w to the vector fields rk (w), with k  = 1, 2, . . . , p, of the eigenvectors.

These curves are called integral curves of the hyperbolic system. If wk (q) is a

parametrization of the integral curve associated with the k -th eigenvalue, then thetangent vector is proportional to rk (wk (q)), so

d wk 

dq= α(q) rk (wk ) (5.23)

where α(q) is an arbitrary function representing a scalar factor that fixes the

parametrization of the curve. The integral curves are very important in the so-

lution of the hyperbolic system since they are strictly related to the solutions of 

similarity type.

In order to prove this, let us recall the results obtained in section 4.3 for the

quasilinear system∂t w + A(w) ∂ x w = 0

and look for solution of similarity type w = w(ξ ), where ξ  = x/t . As already

remarked in section 4, it would be notationally more appropriate to denote the

unknown of the similarity problem by a letter different from w, for instance by

the capital letter W, to avoid confusion with originary unknown w( x , t ) which

is a function of two variables. However, as before the simpler lower case letter

46

Page 47: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 47/195

w is retained, although at the price a slight abuse of mathematical notation. For

similarity solutions, this system was shown to lead to the following system

A(w) − ξ I

d w

d ξ = 0 (5.24)

of ordinary differential equations for the unknown w = w(ξ ), where I denotes the

2×2 identity matrix. Nontrivial (i.e., nonconstant) solution to this systemrequired

to solve the eigenvalue problem for matrix A(w). For the isothermal gas equations

the two eigenvalues, written in increasing order, and the associated eigenvectors

were found to be

λ1,2(w) = m

ρ∓ a and r1,2(w) =

1

m

ρ∓ a

(5.25)

Thus, equation (5.24) says that d w/d ξ  must be proportional to some eigenvector

rk (w) of A(w) and that the independent (similarity) variable must be the corre-

sponding eigenvalue λk (w). Therefore, nontrivial rarefaction solutions will be

solution to the following ordinary differential problem

d wk 

d ξ  =β(ξ) rk (wk )

ξ  = m

ρ∓ a

(5.26)

where β(ξ) is a function which depends on the parametrization. To avoid a too

cumbersome notation, let wk  be indicated by w, so that the previous system sim-

plifies to

d w

d ξ = β(ξ) rk (w)

ξ  = m

ρ∓ a

(5.27)

The function β(ξ) is actuallyfixedby theeigenvaluerelationand canbedetermined

by observing that the eigenvalue relation can be written in general as

ξ  = λk (w(ξ)).

This relation can be differentiated by means of the chain rule to give

1 = ∂λk (w)

∂w1

d w1

d ξ + ∂λk (w)

∂w2

d w2

d ξ + · · · = ∇λk (w) · d w

d ξ 

47

Page 48: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 48/195

and, on account of the first equation of (5.27),

1 = β(ξ)∇λk (w(ξ)) · rk (w(ξ))

so that, thanks to the genuine nonlinearity of the waves, we can obtain

β(ξ) = 1

∇λk (w(ξ)) · rk (w(ξ)).

Using this result, the ordinary differential system becomes

d w

d ξ  =rk (w)

∇λk (w) · rk (w) =rnorm

k  (w) (5.28)

where rnormk  (w) is the normalized eigenvector that for the isothermal gas has been

calculated in section 4.4:

rnorm1,2 (w) =

∓ρ

a

ρ ∓ m

a

(5.29)

For this gasdynamic model the ODE system (5.28) assumes the form

d ρd ξ 

= ∓ρa

dm

d ξ = ρ ∓ m

a

(5.30)

and it is supplemented by an initial condition that must be of the form

ρ(ξ ∓) = ρm(ξ ∓) = m

(5.31)

where

ξ ∓ = m

ρ∓ a. (5.32)

It must be stressed that, differently from most initial value problems of mathemat-

ical physics, here the initial value of the independent variable cannot be chosen at

will, but is fixed by the presence of the relation for the eigenvalue.

The solution of the first equation of the system is quite simple and is

ρ(ξ) = Ae±ξ /a

48

Page 49: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 49/195

where A is a constant which is determined by imposing the first initial condition

of (5.31), to give

ρ(ξ ∓) = Ae∓ξ ∓/a = ρ =⇒ A = ρ e±ξ ∓/a

Substituting this value in the solution we obtain

ρ(ξ) = ρ e∓(ξ −ξ ∓)/a (5.33)

This result can be replaced in the right hand side of the second equation of (5.31),

which becomesdm

d ξ ± m

a= ρ e∓(ξ −ξ ∓)/a (5.34)

This equation is a linear, nonhomogeneous, first order ODE and its solution can

be sought for as the sum of the general solution of the homogeneous equation and

a particular solution to the complete equation, as follows

m(ξ ) = mhomo(ξ ) + mpart(ξ )

with an obvious meaning of the two components. The particular solution is sougth

for in the form mpart(ξ ) = K ξ e∓ξ/a with the value of the constant K  obtained by

substituting mpart(ξ ) into equation (5.34) to give K  = ρ e±ξ ∓/a so that

mpart(ξ ) = ρ ξ e∓(ξ 

−ξ 

∓)/a

The solution to the homogeneous equation is easily found to be mhomo(ξ ) =Ce∓ξ /a with the constant C  to be determined by imposing on the general solu-

tion

m(ξ ) = Ce∓ξ/a + ρ ξ e∓(ξ −ξ ∓)/a

the initial condition m(ξ ∓) = m. One finds C  = ±aρ e±ξ ∓/a , so that

m1,2(ξ ) = ρ(ξ  ± a) e∓(ξ −ξ ∓)/a

The complete solution of system (5.30) is therefore written by making explicit the

dependence on the initial state w

ρ(ξ, w) = ρ e∓(ξ −ξ ∓)/a

m1,2(ξ, w) = ρ(ξ  ± a) e∓(ξ −ξ ∓)/a

(5.35)

The specification of this result to the left wave gives

ρ(ξ, wℓ) = ρℓ e−(ξ −ξ ℓ)/a

m1(ξ, wℓ) = ρℓ(ξ  + a) e−(ξ −ξ ℓ)/a(5.36)

49

Page 50: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 50/195

where ξ ℓ

=mℓ/ρℓ

−a. This solution hold only for ξ > ξ ℓ, since the similarity

variable must increase starting from the left state wℓ moving to right.From this solution it is possible to eliminate ξ  and solve for m as a function of 

ρ. This give an explicit expression for the integral curves in the phase plane. If 

we solve for ξ  the first equation of (5.35) and use the expression found for ξ  in the

second, we obtain the integral curve

m1(ρ, wℓ) =

mℓ

ρℓ

− a lnρ

ρℓ

ρ for ρ < ρℓ (5.37)

which is now parametrized by the density variable.

Coming to the right wave, we can denote the similarity variable as η to distin-

guish this solution from the left wave. Choosing the second sign in the expressions

of (5.35) since the right wave involves the second eigenvalue, we obtain the right

rarefaction wave

ρ(η, wr ) = ρr  e(η−ηr )/a

m2(η, wr ) = ρr (η − a) e(η−ηr )/a(5.38)

where ηr  = mr /ρr  + a, and where η < ηr , since the similarity variable must

decrease moving from the right state wr  toward the left. The representation of the

integral curve of the right rarefaction wave, using ρ as parameter, is

m2(ρ, wr ) =

mr 

ρr 

+ a ln ρρr 

ρ for ρ < ρr  (5.39)

5.5 Shock wave reflection

To assess the performance of the boundary condition procedure described in ap-

pendix B, it is useful to devise a test problem that can be solved exactly. To this

aim, we choose a problem consisting in a shock wave propagating in a quiescent

gas toward a fixed wall where it is reflected in the opposite direction. In this sec-

tion we define the initial data of the Riemann problem so that its solution contains

only one shock-wave and determine the post-shock conditions of the fluid after thereflection by the rigid wall.

We recall the eigenvalues and eigenvectors of the isothermal gas equations

λ1,2(w) = m

ρ∓ a and r1,2(w) =

1

m/ρ ∓ a

(5.40)

As calculated before, shock wave solutions will be given the following relations

50

Page 51: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 51/195

for the Hugoniot locus and the shock-wave speed:

m1,2(ρ, w) = m

ρρ ∓ a(ρ − ρ)

 ρ

ρ(5.41)

s1,2(ρ, w) = m

ρ∓ a

 ρ

ρ(5.42)

Consider the data of a Riemann problem when the fluid is at rest on the right of 

the initial discontinuity: between wℓ = (ρℓ, mℓ) and wr  = ww = (ρw, mw = 0).

In order that this discontinuity may produce only a shock propagating to the right

in the fluid at rest, the value of momentum mℓ behind the shock must be given

by the momentum function above for the second eigenvalue, with the pivot staterepresented by the right state, i.e., ρ = ρw and m = mw = 0. Thus, by the first

equation of (5.8) we are led to the condition

mℓ = m2(ρℓ, ρw, 0) = a(ρℓ − ρw)

 ρℓ

ρw(5.43)

or equivalently, in dimensionless form,

mℓ

aρℓ

=  ρℓ

ρw

− ρw

ρℓ

(5.44)

The value of mℓ depends on the two initial densities. Thus, the solution of the

Riemann problem with left data (ρℓ, m2(ρℓ, ρw, 0)) and right data (ρw, 0), with

ρℓ > ρw, consists of a single shock wave propagating to the right with speed

sincid = s2(ρℓ, ρw, 0) = a

 ρℓ

ρw(5.45)

This shock wave reaches the rigid wall and is there reflected to propagate in the

opposite direction. Just after the reflection the left state of the fluid (ρℓ, mℓ)

becomes the state in front of a shock propagating to the left. Thus the solution

above of the Hugoniot locus can be used with the pivot state being now the leftstate, i.e., ρ = ρℓ and m = mℓ, and the first solution with the minus side must be

considered. But the fluid behind the reflected wave is at rest due to the velocity

boundary condition on the fixed wall. Therefore, indicating by ρ⋆w the fluid density

behind the reflected wave, we must have m1(ρ⋆w, wℓ) = m⋆

w = 0; in other words,

by the first equation of system (5.8) we have the condition:

m1(ρ⋆w, wℓ) = mℓ

ρℓ

ρ⋆w − a(ρ⋆

w − ρℓ)

 ρ⋆

w

ρℓ

= 0 (5.46)

51

Page 52: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 52/195

After division by aρℓ this equation reduces to

mℓ

aρℓ

=

1 − ρℓ

ρ⋆w

 ρ⋆

w

ρℓ

ρ⋆w

ρℓ

− 

ρℓ

ρ⋆w

(5.47)

and, in view of the expression for mℓ established before,

 ρℓ

ρw

− 

ρw

ρℓ

ρ⋆w

ρℓ

− 

ρℓ

ρ⋆w

(5.48)

Introducing the unknown x

=ρ⋆

w/ρℓ and thedensity ratio r 

=ρw/ρℓ, the equation

becomes

1√ r 

− √ r  = √ 

 x − 1√  x

=⇒ (1 − r )√ 

 x = √ r ( x − 1) (5.49)

Squaring the relation gives the quadratic equation

 x2 −

r  + 1

x + 1 = 0 (5.50)

whose solutions are x1 = r  and x2 = 1/r . The first solution x1 = r  gives ρ⋆w = ρℓ

and is a spurious solution introduced by the squaring, that is to be discarded. Thesecond solution x2 = 1/r  gives insted the density behind the reflected shock wave

ρ⋆w = ρ2

ℓ /ρw > ρℓ, which corresponds to a gas compression, as required.

By the second equation of system (5.8) the reflected wavepropagates at a speed

srefl = s1(ρ⋆w, wℓ) = mℓ

ρℓ

− a

 ρ⋆

w

ρℓ

(5.51)

Substituting the value mℓ just established and ρ⋆w = ρ2

ℓ /ρw we obtain, in dimen-

sionless form,srefl

a =  ρℓ

ρw− ρw

ρℓ− ρℓ

ρw= − ρw

ρℓ(5.52)

The absolute value of this quantity is < 1 but we must observe that relection is

described in the reference of the wall in which the velocity of the fluid entering the

shock front sums with that of the moving front of the reflected shock.

52

Page 53: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 53/195

6 Riemann problem for the isothermal ideal gas

In section 4 we have studied the mathematical structure of the P-system associated

with the hyperbolic equations of an isothermal ideal gas. The elementary solutions

issuing from a given pivotalstate w = (ρ, m) forthis system havebeen calculated in

section 5. Both the shock waves and the rarefaction waves have been parametrized

chosing the density variable ρ as parameter, to give the solution for the momentum

variable in the form m = m(ρ, w). The solution corresponding to a rarefaction

wave was determined as a similarity solution and was therefore parametrized also

by thesimilarityvariable, to give the twofunctions ρ = ρ(ξ, w) and m = m(ξ, w).

In this section we combine the shock and rarefaction solutions to formulate the

Riemann problem for the isothermal gas equations and write down the nonlinearequation which provides its solution. Then we explain a method for establishing

a priori, before finding the actual solution of the Riemann problem, which kind of 

waves are obtained for given data. For completeness of the analysis, an alternative

parametrization of the shock wave is also introduced which extends the natural

parametrization of the rarefaction wave in terms of the similarity variable: the

adoption of such a uniform parametrization allows to recast the Riemann problem

as a system of  two nonlinear equations instead of only one, as in the standard

approach. The possible advantages of this choice are discussed in appendix A

with reference to the situation of the general P-system.

6.1 Riemann problem

In section 5 it has been described how the generic state (ρ, m) of the solution is

connected with initial state w by one wave that can be either an integral curve or a

Hugoniot locus. The choice between these two families of solutions is established

by the entropy condition. In case of the Riemann problem we have left and right

states denoted by wℓ and wr , respectively. Therefore, we must consider the two

solutions connected to these two initial states. Since the eigenvalues have been

taken in increasing order, the momentum of the two solutions can be expressed by

means of the following functions:

m1(ρ, wℓ) =

mic1 (ρ, wℓ), ρ < ρℓ

mHl1 (ρ, wℓ), ρ > ρℓ

and m2(ρ, wr ) =

mic2 (ρ, wr ), ρ < ρr 

mHl2 (ρ, wr ), ρ > ρr 

(6.1)

where the subscripts 1 and 2 refer to the first and second eigenvalue, respectively.

It must be noted that the letter ρ used indistinctly for parametrizing both the left

and right waves ought to be indicated by two different variables.

By introducing the explicit expressions of the analytical solution calculated in

53

Page 54: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 54/195

section 5, for the left state we have

m1(ρ, wℓ) =

mℓρ

ρℓ

− aρ lnρ

ρℓ

, ρ < ρℓ

mℓ

ρ

ρℓ

− a(ρ − ρℓ)

 ρ

ρℓ

, ρ > ρℓ

(6.2)

while for the right state:

m2(ρ, wr ) =

mr 

ρ

ρr 

+ aρ lnρ

ρr 

, ρ < ρr 

mr 

ρ

ρr 

+ a(ρ − ρr ) ρ

ρr 

, ρ > ρr 

(6.3)

TheRiemann problem consists in finding thepoint (ρ, m) of intersection of the two

functions above and therefore boils down to the solution of the following equation

m1(ρ, wℓ) = m2(ρ, wr ) (6.4)

where the solution ρ gives the density of the intermediate state. This equation is

in general nonlinear and for its resolution an iterative method is generally needed.

The solution of the Riemann problem consists in two waves, a left wave which

can be either a shock or a rarefaction, and a right wave which can be similarly

either a shock or a rarefaction. Therefore, the complete solution consists in a

combination of either two shocks, or one shock together with one rarefaction, or

two rarefactions. The kind of waves of the solution depends on the initial data wℓand wr  of the left and the right states of the Riemann problem and is discovered

after the nonlinear equation above has been solved. However, it is also possible to

determine the kind of waves of the Riemann solution before solving this nonlinear

equation starting by some considerations about the states wℓ and wr  of the initial

condition.

6.1.1 Explicit analytical rarefaction–rarefaction solution

The particularly simple form of the pressure relation of the isothermal gas allows

oneto determine therarefaction–rarefactionsolution to theRiemann problem byan

exact analytical formula. When both waves emerging from the initial discontinuityare rarefaction waves the density of the intermediate state between them is the

solution of the equation mic1 (ρ, wℓ) = mic

2 (ρ, wr ) which reads in explicit form,

after simplifying the common factor ρ > 0,

mℓ

ρℓ

− a lnρ

ρℓ

= mr 

ρr 

+ a lnρ

ρr 

(6.5)

Solving for ρ, the density ρ = ρi of the intermediate is obtained

ρi = √ ρℓ ρr  e

uℓ−ur 

2a . (6.6)

54

Page 55: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 55/195

6.1.2 Analytical shock–shock solution

Also the shock–shock solution of the Riemann problem for the isothermal gas can

be obtained in closed analytical form. When both waves issuing from the initial

discontinuity are shock waves the density of the intermediate state between them

is the solution of the equation mHl1 (ρ, wℓ) = mHl

2 (ρ, wr ) which reads in explicit

form

mℓ

ρ

ρℓ

− a(ρ − ρℓ)

 ρ

ρℓ

= mr 

ρ

ρr 

+ a(ρ − ρr )

 ρ

ρr 

(6.7)

Bysimplealgebra, weobtaintheequationforthedensity ρ = ρi of the intermediate

state

a ρ

ρℓ + ρρr 

− a ρℓ

ρ + ρr 

ρ = uℓ − ur  (6.8)

which reduces to the following quadratic equation1√ ρℓ

+ 1√ ρr 

 z2 + 1

a

mr 

ρr 

− mℓ

ρℓ

 z − √ 

ρℓ + √ ρr 

= 0, (6.9)

for the unknown z = √ ρ.

6.2 Transitions between different types of solution

As suggested by Landau and Lifshitz [7], the relative velocity of the Riemannproblem data, namely the value ur  − uℓ, provides the discriminant value to reveal

the kind of waves originating from initial discontinuity of the Riemann problem.

This relative velocity is an invariant data for Galilean transformation between

inertial frames of reference. This means that the relative velocity ν = ur −uℓ does

not depend on the inertial frame in which the fluid velocity are measured. Let us

now give an intuitive explanation why the value of ν is suitable for discovering the

kind of waves occurring in the solution of a given Riemann problem.

According to the ordinary physical interpretation of the 1D Riemann problem,

wecan imagine a flow ina tube, with the state onthe left ofa discontinuity indicated

by wℓ and the state on the right by wr . We suppose the fluid in the right side ispulling to right at velocity ur  > 0 and, at the same time, the fluid on left is pulling,

in the opposite direction, to left at another velocity uℓ < 0. If the value of the

relative velocity of the Riemann problem data defined by

ν ≡ ur  − uℓ (6.10)

is sufficiently high, it is intuitive that two rarefaction fans will form between the

two fluids, emerging from the intial discontinuity. Then, it is expected that there

55

Page 56: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 56/195

will be a limiting value of the relative velocity over which the solution has the

generation of two rarefaction fans, that will be indicated by ν2 f .On the other side, we can suppose a different specification of the initial veloc-

ities in which the fluid on the right is pushing to left at ur  < 0 and contemporarily

the fluid on left is pushing to right at uℓ > 0. For a sufficiently high negative ν the

initial discontinuity will generate two shock waves. The limiting relative velocity

for producing a two shock solution will be denoted by ν2s . For a relative velocity

falling inside the interval ν2s < ν < ν2 f , the solution of the Riemann problem

will consist of one rarefaction and one shock.

Our target is now to find the analytic expressions of  ν2s and ν2 f  in terms of 

the data wℓ and wr . For that purposes it is convenient to find preliminarly the

behaviour of the velocity along the shock and rarefaction solutions connected tothe left and right states. More precisely, we define

ui (ρ, wℓ) ≡ mi (ρ, wℓ)

ρ, i = 1, 2, (6.11)

and similarly for the right wave. From equations (6.2) it follows immediately that

the velocity along the left wave is

u1(ρ, wℓ) =

uℓ − a lnρ

ρℓ

, ρ < ρℓ

uℓ − a ρ

ρℓ − ρℓ

ρ

ρ > ρℓ

(6.12)

where uℓ ≡ mℓ/ρℓ, and from (6.3) along the right wave is

u2(ρ, wr ) =

ur  + a lnρ

ρr 

, ρ < ρr 

ur  + a

 ρ

ρr 

− 

ρr 

ρ

ρ > ρr 

(6.13)

where ur  ≡ mr /ρr . In the light of the consideration above, the Riemann problem

can be recast in terms of the velocity as follows:

u1(ρ, wℓ) = u2(ρ, wr ) (6.14)

which is still a single nonlinear equation in the unknown ρ.

6.3 Limiting relative velocities

To determine the limiting relative velocity ν2s (ρℓ, ρr ) < 0 of a given Riemann

problem let us consider the set of solutions consisting of two shocks. Let us intro-

duce the following function of the velocity difference of the two states connected

56

Page 57: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 57/195

with wℓ and wr , as a function of the fluid density ρ,

u(ρ, wℓ, wr ) ≡ u2(ρ, wr ) − u1(ρ, wℓ) (6.15)

By equations (6.12) and (6.13), when the two states are connected with wℓ and wr 

by a shock wave this difference is found to be

usw-sw(ρ, wℓ, wr ) = ur  − uℓ + a

 ρ

ρr 

ρ

ρℓ

− 

ρr 

ρ− 

ρℓ

ρ

. (6.16)

By inspection, this function is seen to be monotonically increasing Therefore,

the limiting value of ν for obtaining a solution with two shocks and marking the

transition to solutions with one rarefaction wave will correspond to the maximum

valueof the independentvariable ρ. This value, dueto thedoubleconstraint ρ > ρℓ

and ρ > ρr  for a solution consisting of two shock waves, will be the greater value

between ρℓ and ρr . We then define ρmax = max(ρℓ, ρr ) and ρmin = min(ρℓ, ρr ),

andsubstitute ρ = ρmax in theexpression(6.16)of therelativevelocity. Inany case,

twotermswithin parenthesesvanish. Moreover, wehave usw-sw(ρmax, wℓ, wr ) =0 so that we find the limiting value

ν2s (ρℓ, ρr ) ≡ −a

 ρmax

ρmin

− 

ρmin

ρmax

(6.17)

which can be written also as follows

ν2s (ρℓ, ρr ) = −a(ρmax − ρmin)√ ρmax ρmin

= −a|ρℓ − ρr |√ 

ρℓ ρr 

(6.18)

When the solution consists of two rarefaction waves, equations (6.12) and

(6.13) select the functions satisfying ρ < ρℓ and ρ < ρr  in accordance with the

entropy condition. Consequently, the velocity difference urar-rar(ρ , wℓ, wr ) for

a two-rarefaction solution is given by

urar-rar(ρ, wℓ, wr ) = ur  − r ℓ + a lnρ2

ρℓρr 

(6.19)

and this function is manifestly a monotonically increasing function of ρ. There-fore the minimum value of the function for solution with two rarefaction waves

and marking the transition to solutions with one shock wave is obtained for the

minimum value of ρ, compatible with the double constraint ρ < ρℓ and ρ < ρr .

Therefore this sought for value of density must be the minimum between ρℓ and

ρr . Since urar-rar(ρmin, wℓ, wr ) = 0, it follows that the limiting relative velocity

for a two-rarefaction solution of the Riemann problem is

ν2 f (ρℓ, ρr ) ≡ a lnρmax

ρmin

= a

ln

ρℓ

ρr 

(6.20)

57

Page 58: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 58/195

For ur 

−uℓ < ν2 f (ρℓ, ρr ) the solution of the Riemann problem comprises one

shock wave and a rarefaction wave, while for greater values both waves are expan-sion waves.

We havedefinedthetwo relativevelocities that divide thethreekindsof solution

of the Riemann problem for the isothermal ideal gas:

ν < ν2s (ρℓ, ρr ) −→ two shocks zone

ν2s (ρℓ, ρr ) < ν < ν2 f (ρℓ, ρr ) −→ shock-rarefaction zone

ν2 f (ρℓ, ρr ) < ν −→ two rarefactions zone

Limiting values of ν exist also for P-system different from the isothermal ideal

gas considered here. The expressions valid for the general case will depend onthe form of the pressure function P = P(ρ). They are derived in appendix A,

where the possibility of solutions with very strong rarefaction waves with a region

of vacuum between their receding tails will also be analyzed.

To conclude this section on the isothermal ideal gas, it could be worthwile to

describe how the change of type of the solution depends on the value ρ of the

solution itself of the Riemann problem as ρ runs the interval [ρmin, ρmax]. From

what we have found in the previous two sections, for ρ < ρmin the solution consist

of two rarefaction waves, for ρmin < ρ < ρmax one wave is a rarefaction and the

other is a shock, while for ρ > ρmax the two waves are both shocks. In particular,

the intermediate case can occur with either ρℓ < ρr  or ρr  < ρℓ. In the first case,by equations (6.12) and (6.13) the mixed-wave solution of the Riemann problem

is defined by the equation

uℓ − a

 ρ

ρℓ

− 

ρℓ

ρ

= ur  + a ln

ρ

ρr 

Since ρℓ = ρmin and ρr  = ρmax this equation for ρ can be recast as the following

relation involving the relative velocity

ur  − uℓ = −a

 ρ

ρmin

− 

ρmin

ρ

− a ln

ρ

ρmax

In the second case, with ρr  < ρℓ, the mixed-wave solution is given by the equation

uℓ − a lnρ

ρℓ

= ur  + a

 ρ

ρr 

− 

ρr 

ρ

Now ρℓ = ρmax and ρr  = ρmin and therefore the previous equation for ρ can be

recast in the following form involving the relative velocity

ur  − uℓ = −a lnρ

ρmax

− a

 ρ

ρmin

− 

ρmin

ρ

which is coincident with the relation obtained in the first case.

58

Page 59: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 59/195

6.4 A new parametrization for the shock

Different mathematical descriptions of the shock waves, solution to the Rankine–

Hugoniot conditions, are possible by changing the parameter for representing final

states. We propose the use of an alternative parametrer with the physical dimen-

sions of velocity so as to be in accord with the the similarity variable x/t  = ξ  used

to represent rarefaction waves, as done in section 5.4. This choice is considered

also by Bressan [1].

The origin of this parameter for the shock states is chosen so that a vanishingly

small shock wave at w = w corresponds to ξ  = ξ , where ξ  = m/ρ − a =mℓ/ρℓ − a, for the first eigenvalue when w = wℓ, or ξ  = m/ρ + a = mr /ρr  + a,

for the second eigenvalue whenˆw

=wr . This choice guarantees the continuity

at w = w of the parameter ξ  between the shock and rarefaction solutions. As a

matter of facts, we assume the continuity at w = w with the rarefaction solution

also of the derivative. Of course, the continuity of derivative implies to fix also

range of the parameter values for the shock to be in the opposite “direction” with

respect to the range allowed to the similarity variable for the rarefaction wave.

This means that the range for the shock will be ξ < λ1(wℓ) for the left wave

and ξ > λ2(wr ) for the right wave. Finally, among the many pssible parameters

respecting the continuity conditions, a very simple choice consists in assuming a

linear dependence on the density variable.

Focussing on the shock wave associated with a pivotal state corresponding

to the left state w = wℓ, the density depends on the adopted parameter in thefollowing way

ρ1(ξ, wℓ) = ρℓ

1 − (ξ  − ξ ℓ)/a

, (6.21)

which gives ρ = ρℓ for ξ  = ξ ℓ ≡ λ1(wℓ) = mℓ/ρℓ − a, as required. We will

call this parametrization, proposed here for the first time, canonical in that it is

the most natural one for extending the integral curves associated to the rarefaction

waves in the discontinuous realm of the shock wave solutions.

According to the proposed canonical parametrization, the complete solution

can be obtained by the direct substitution of ρ1(ξ, wℓ) in the expressions of (5.8)

ρsw1 (ξ, wℓ) = ρℓ1 − (ξ  − ξ ℓ)/a

msw

1 (ξ, wℓ) = mℓ

1 − (ξ  − ξ ℓ)/a

+ ρℓ(ξ  − ξ ℓ) 

1 − (ξ  − ξ ℓ)/a

ssw1 (ξ, wℓ) = mℓ

ρℓ

− a 

1 − (ξ  − ξ ℓ)/a

(6.22)

defined in the interval ξ < mℓ/ρℓ − a.

To parametrize the states of the shock wave that can be connected to the right

state wr  we introduce a different symbol η so that the shock solution will assume

59

Page 60: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 60/195

the following form

ρsw2 (ξ, wr ) = ρr 

1 + (η − ηr )/a

msw

2 (ξ, wr ) = mr 

1 + (η − ηr )/a

+ ρr (η − ηr ) 

1 + (η − ηr )/a

ssw2 (η, wr ) = mr 

ρr 

+ a 

1 + (η − ηr )/a

(6.23)

where ηr  ≡ λ2(wr ) = mr /ρr  + a, for η > mr /ρr  + a.

We can therefore combine the rarefaction and shock solutions in a single func-

tion of the same variable. For the left wave the function of the density will be

ρ1(ξ, wℓ) =

ρℓ e−(ξ −ξ ℓ)/a ξ > ξ ℓ

ρℓ

1 − (ξ  − ξ ℓ)/a

ξ < ξ ℓ

and that for the momentum

m1(ξ, wℓ) =

ρℓ(ξ  + a) e−(ξ −ξ ℓ)/a ξ > ξ ℓ

mℓ

1 − (ξ  − ξ ℓ)/a

+ρℓ(ξ  − ξ ℓ)

 1 − (ξ  − ξ ℓ)/a

ξ < ξ ℓ

The analogous expressions for the functions pertaining to the right wave are, forthe density

ρ2(η, wr ) =

ρr  e(η−ηr )/a η < ηr 

ρr 

1 + (η − ηr )/a

η > ηr 

and that for the momentum

m2(η, wr ) =

ρr (η − a) e(η−ηr )/a η < ηr 

mr 1 + (η − ηr )/a

+ρr (η − ηr ) 

1 + (η − ηr )/a

η > ηr 

The Riemann problem can therefore be formulated as the following systemρ1(ξ, wℓ) = ρ2(η, wr ),

m1(ξ, wℓ) = m2(η, wr ),(6.24)

of two nonlinear equations in the two unknowns ξ  and η.

60

Page 61: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 61/195

6.5 Program of Riemann solver as a system of two equations

For completeness we provide the computer program implementing the method

based on two nonlinear equations for the solution of the Riemann problem for the

isothermal gas system.

MODULE two_eqs_riemann_solver

! Conservation law equations for the isothermal

! version of the polytropic ideal gas in one dimension:

!

!

! w1 = rho f1(w) = m

!! w2 = m f2(w) = (mˆ2)/rho + (aˆ2)*rho

!

!

! aˆ2 = R*T = fixed constant

!

USE isothermal_pig

IMPLICIT NONE

CONTAINS

!=======

SUBROUTINE two_eqs_riemann_solver_isot_pig &

(w_L, w_R, w_I, rel_err, iterations)

!===============================================================

!

! Solution of the Riemann Problem for the

! Isothermal version of the Polytropic Ideal Gas

!

! Iterative solution by Newton method in incremental form

! for the SYSTEM of 2 EQUATIONS

!! phi_LR(csi, eta) = 0

!

! psi_LR(csi, eta) = 0

!

! where

!

! phi_LR(csi, eta) <=== rho(csi; L) - rho(eta; R)

!

! psi_LR(csi, eta) <=== mom(csi; L) - mom(eta; R)

!

61

Page 62: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 62/195

!----------------------------------------------------------------

!! INPUT

!

! w_L : left state (density, momentum)

! w_R : right state (density, momentum)

!

!

! OPTIONAL

!

! rel_err : relative error (of depth) to stop the

! iterations [default = 1.0d-7]

!

! iterations : maximum number of iterations! [default = 100]

!

!----------------------------------------------------------------

!

! OUTPUT

!

! w_I : intermediate state between waves

!

!

! OPTIONAL

!

! iterations : number of actually computed iterations

!

!=================================================================

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w_L, w_R

REAL(KIND=8), DIMENSION(:), INTENT(OUT) :: w_I

REAL(KIND=8), OPTIONAL, INTENT(IN) :: rel_err

INTEGER, OPTIONAL, INTENT(INOUT) :: iterations

REAL(KIND=8), DIMENSION(2,2) :: AA

REAL(KIND=8), DIMENSION(2) :: w1, w2

REAL(KIND=8) :: lambda_L, lambda_R, det, dr, dm, &

csi, eta, d_csi, d_eta

INTEGER :: max_It_Int = 100 ! default

REAL(KIND=8) :: rel_err_Int = 1.0d-07 ! default

INTEGER :: it

!------------------------------------------------------------------

62

Page 63: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 63/195

IF (PRESENT(iterations)) max_It_Int = iterations

IF (PRESENT(rel_err)) rel_err_Int = rel_err

lambda_L = w_L(2)/w_L(1) - a

lambda_R = w_R(2)/w_R(1) + a

! initial guess for the curve parameters

csi = lambda_L; d_csi = csi

eta = lambda_R; d_eta = eta

! solve the Riemann problem by Newton iteration

WRITE(*,*)

WRITE(*,*) ’Riemann solver start’

DO it = 1, max_It_Int

! convergence check

IF ((d_csi**2 + d_eta**2)/(csi**2 + eta**2) < rel_err_Int) THEN

CALL loci (1, csi, w_L, w_I)

IF (PRESENT(iterations)) iterations = it

WRITE(*,*)

WRITE(*,*) ’Successful convergence in Newton iteration!’

RETURN

ENDIF

CALL loci (1, csi, w_L, w1, AA(:,1))

CALL loci (2, eta, w_R, w2, AA(:,2)); AA(:,2) = - AA(:,2)

det = AA(1,1) * AA(2,2) - AA(1,2) * AA(2,1)

IF (ABS(det) < 1.0d-13) THEN

WRITE(*,*)

WRITE(*,*) ’it = ’, it

WRITE(*,*) ’det = ’, det

WRITE(*,*) ’Singular 2x2 matrix in program’

WRITE(*,*) ’two_eqs_riemann_exact_solver_isot_pig. STOP.’

STOP

63

Page 64: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 64/195

ENDIF

dr = w1(1) - w2(1)

dm = w1(2) - w2(2)

d_csi = - (AA(2,2) * dr - AA(1,2) * dm)/det

d_eta = - (AA(1,1) * dm - AA(2,1) * dr)/det

csi = csi + d_csi

eta = eta + d_eta

ENDDO

WRITE(*,*) ’Riemann solver fails to converge’

WRITE(*,*) ’in two_eqs_riemann_solver_isot_pig.’

END SUBROUTINE two_eqs_riemann_solver_isot_pig

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

SUBROUTINE loci (i_12, csi, w_, w, Dw)

! Isothermal polytropic ideal gas in one dimension

! Evaluation of the bifurcating functions and their derivatives

! defining the states w = (rho, m) that can be connected with

! a given pivotal state w_ = (rho_, m_) for a given value of

! the parameter variable csi along the curve.

!

! The variable csi has the physical dimensions of a velocity.

! For the rarefaction wave, csi is the standard similarity

! variable while for the shock wave it is a curve parameter

! assuring the continuity at the pivotal point of the functions

! and of their derivative along the curve.

IMPLICIT NONE

INTEGER, INTENT(IN) :: i_12

REAL (KIND=8), INTENT(IN) :: csi

REAL (KIND=8), DIMENSION(:), INTENT(IN) :: w_ 

REAL (KIND=8), DIMENSION(:), INTENT(OUT) :: w

REAL (KIND=8), DIMENSION(:), OPTIONAL :: Dw

REAL (KIND=8) :: s, rho_, m_, &

csi_, c_c, s_c_ca, ops, t

64

Page 65: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 65/195

s = (-1)**i_12 ! s = -1 for i == 1 first eigenvalue! s = 1 for i == 2 second eigenvalue

rho_ = w_(1); m_ = w_(2)

csi_ = m_/rho_ + s * a

c_c = csi - csi_ 

s_c_ca = s * c_c/a

IF (s * c_c > 0) THEN ! shock wave

ops = 1 + s_c_cat = SQRT(ops)

w(1) = rho_ * ops

w(2) = m_ * ops + rho_ * c_c * t

IF (PRESENT(Dw)) THEN

Dw(1) = s * rho_/a

Dw(2) = s * m _/a + rho_ * (1 + s * 1.5d0 * c _c/a) / t

ENDIF

ELSE ! rarefaction wave

t = EXP(s_c_ca)

w(1) = rho_ * t

w(2) = w(1) * (csi - s*a)

IF (PRESENT(Dw)) THEN

Dw(1) = s * w(1)/a

Dw(2) = Dw(1) * csi

ENDIF

ENDIF

END SUBROUTINE loci

END MODULE two_eqs_riemann_solver

65

Page 66: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 66/195

Page 67: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 67/195

7 Godunov method for the isothermal ideal gas

In section 3.4 the basic elements of Godunov method have been anticipated in the

scalar case with reference to the conservation law of the traffic flow. This was

done only for pedagogical reasons, but Godunov proposed his method originally

for solving the gasdynamic equations [5]. Godunov’s idea was to build a discrete

numerical scheme which could tane into account the nonlinear interactions exactly

in full respect of conservation. To achieve this goal, he abandoned to follow the

characteristic backward in time and suggested to solve Riemann problems forward

in time. Since solutions of Riemann problems are themselves exact solutions to

the conservation laws, a conservative scheme can be derived. Fundamental to the

development of the Godunov method is the idea of solving the conservation lawsover finite volumes and at the same time allowing for an essentially discontinuous

distribution of the variables over these volumes. In this way the presence of shock 

waves or other discontinuities in the solution is admitted in the scheme from the

beginning andcontinuous or discontinuous solution are dealt with in the same way.

7.1 Finite volumes and cell average

Always considering equations in onedimension, let us suppose to divide the spatial

domain into subintervals, called grid cells, defined by

C  j =  x j− 12

< x < x j+ 12

(7.1)

with end points x j+ 12

= ( x j +  x j+1)/2 located in the middle of two consecutive

grid points. The length of each cell is

|C  j | =  x j = x j+ 12−  x j− 1

2(7.2)

and each mid points x j+ 12

represents the interface between two consecutive cells

C  j and C  j+1. In two- or three-dimensional problems the cells are also called finite

volumes.

In Godunov method the numerical solution Wn

 j provide a piecewise constantrepresentation over the cells of the solution at time t n . In other words, Wn

 j is the

cell average of the variable w over the cell x j− 12

< x < x j+ 12. This piecewise

constant representation of the solution at time t  = t n is used as initial data for the

hyperbolic system which is now solved for t  > t n . The equations are now solved

exactly over a short time interval by solving the Riemann problems defined at all

interfaces. The Riemann solutions can be pieced together at least up to a final

time t n+1 when the waves from two Riemann problems of adjacent cells begin to

interact. In this way, one obtain a solution wn( x, t ), for any x and for time in the

67

Page 68: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 68/195

interval t n < t  < t n+

1. This solution is the exact weak solution to the initial value

problem with piecewise constant initial data and can be exploited to obtain the newnumerical solution Wn+1

 j by a cell averaging process

Wn+1 j = 1

|C  j | x j+½         

¾          

 x j−½         

¾          

wn( x , t n+1) d x (7.3)

where the time t n+1 in the integrand must be noticed. Thus a piecewise constant

representation of the unknown at the final time t n+1 has been determined.

7.2 Variable update and interface flux

In practice the solution algorithm does not require the evaluation of the complicate

integrals for the new cell averages since Wn+1 j can be determined in a different

manner which exploits the integral form of the conservation laws. In fact, wn( x, t )

in the time interval t n < t  < t n+1 is an exact weak solution so that we have x j+½         

¾          

 x j−½         

¾          

wn( x , t n+1) d x = x j+½         

¾          

 x j−½         

¾          

wn( x, t n) d x + t n+1

t n

f wn x j− 1

2, t 

dt 

− t n+1

t n

wn

 x j+ 1

2, t 

dt 

(7.4)

By dividing this relation by |C  j | and reminding that the integral of wn( x , t n) gives

the initial cell averages Wn j , the equation above reduces to

Wn+1 j = Wn

 j − t 

|C  j |FWn

 j , Wn j+1

− FWn

 j−1, Wn j

(7.5)

where we have introduced the numerical flux

F

Wn

 j , Wn j+1

= 1

 t n+1

t n

wn

 x j+ 1

2, t 

dt  (7.6)

The time integral is trivial since wn( x j+ 12

, t ) is constantover the time interval. This

follows from the fact that the solution of the Riemann problem at the interface x j+ 12

is a similarity solution, constant along each ray x −  x j+ 1

2

/t  = constant.

7.3 Godunov numerical flux

Let us assume that the Riemann problem for the considered hyperbolic system,

with left and right sates W j and W j+1 has been solved so that the function

68

Page 69: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 69/195

Page 70: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 70/195

7.4 Program of the Godunov flux for the isothermal gas

We provide the computer program implementing the Godunov method for the

P-System of the isothermal gas.

SUBROUTINE god_num_flux (xx, ww, FF_G)

! ORDERED GRID

! Given the vector xx of nodal points and the vector ww

! of the cell average of the conservative variables,

! the program calculates the Godunov vertical flux

! for the Euler equations of gasdynamics for a

! polytropic ideal gas

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: xx

REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: ww

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: FF_G

REAL(KIND=8), DIMENSION(SIZE(ww,1)) :: wl, wr, wi, ws, &

lambda_l, lambda_r, lambda_i

REAL(KIND=8) :: vi, ui, vl, ul, vr, ur, ss ! ss shock speed

INTEGER :: i, j

j = SIZE(xx); ! ONLY TO AVOID WARNING IN COMPILATION

DO i = 1 , SIZE(FF_G, 2 ); j = i

! Special situations in which the solution

! of the Riemann problem can be avoided

wl = ww(:, j)

lambda_l = eigenvalue(wl)

IF (lambda_l(1) > 0) THEN

FF_G(:, i) = flux(wl)

CYCLE

ENDIF

70

Page 71: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 71/195

wr = ww(:, j+1)

lambda_r = eigenvalue(wr)

IF (lambda_r(2) < 0) THEN

FF_G(:, i) = flux(wr)

CYCLE

ENDIF

! Solution of the Riemann problem

CALL exact_Riemann (wl, wr, wi)

! Examine the three waves, starting from left.

vl = 1/wl(1); ul = wl(2)/wl(1)

vi = 1/wi(1); ui = wi(2)/wi(1)

! Is the first wave a shock wave or a rarefaction fan?

IF (vi < vl) THEN ! The first wave is a shock wave

! Compute the shock speed

ss = (vl*ui - vi*ul)/(vl - vi)

IF (ss > 0) THEN ! The shock propagates to the right:

! the vertical state is wl.

FF_G(:, i) = flux(wl)

CYCLE

ENDIF

ELSE ! The first wave is a rarefaction fan.

IF (lambda_l(1) >= 0) THEN

! The rarefaction wave propagates all to the right:

! The vertical state is wl

FF_G(:, i) = flux(wl)

71

Page 72: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 72/195

CYCLE

ELSE ! Is the left rarefaction fan transonic?

lambda_i = eigenvalue(wi)

IF (lambda_i(1) > 0) THEN ! Yes, it is transonic.

! Sonic values of the similar solution at xi = 0:

CALL transonic_rarefaction (1, wl, ws)

FF_G(:, i) = flux(ws)

CYCLE

ENDIF

ENDIF

! The first wave is a NONtransonic rarefaction

ENDIF

! The first wave propagates to the left and it is

! either a shock wave or a (nontransonic) rarefaction

! Examine the second wave.

vr = 1/wr(1); ur = wr(2)/wr(1)

! Is the second wave a shock wave or a rarefaction fan?

IF (vi < vr) THEN ! The second wave is a shock wave.

! Compute the shock speed

ss = (vr*ui - vi*ur)/(vr - vi)

IF (ss > 0) THEN ! The shock propagates to the right:

! The vertical state is wi.

FF_G(:, i) = flux(wi)

CYCLE

ENDIF

72

Page 73: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 73/195

ELSE ! The second wave is a rarefaction fan.

lambda_i = eigenvalue(wi)

IF (lambda_i(2) >= 0) THEN

! The rarefaction wave propagates all to the right:

! The vertical state is wi

FF_G(:, i) = flux(wi)

CYCLE

ELSE ! Is the right rarefaction fan transonic?

IF (lambda_r(2) > 0) THEN ! Yes, it is transonic.

! Sonic values of the similar solution at xi = 0:

CALL transonic_rarefaction (2, wr, ws)

FF_G(:, i) = flux(ws)

CYCLE

ENDIF

ENDIF

! The second wave is a NONtransonic rarefaction

! which propagates all to the left

ENDIF

! The second wave propagates to the left and it is

! a nontransonic rarefaction fan or a shock wave:

! therefore, in both cases the vertical state is wr

FF_G(:, i) = flux(wr)

! Process now the next interface

ENDDO

END SUBROUTINE god_num_flux

73

Page 74: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 74/195

.

74

Page 75: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 75/195

Page 76: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 76/195

is satisfied, for some s. By taking into account condition i) the last relation, we

obtainA(wℓ, wr )(wr  − wℓ) = s(wr  − wℓ), (8.3)

showing that wr  − wℓ must be an eigenvector of  A with eigenvalue s and so

the solution to the approximate linear Riemann problem also consists of a single

“jump” wr  − wℓ propagating with speed s.

Condition ii) assures that thelinearizedproblem is still hyperbolic and solvable.

Finally, condition iii) guarantees that smooth solutions are representedcorrectly, in

the sense that the solutions to the approximate problem correspond to those of the

original exact one. By summarizing the three conditions, Roe method represents

a conservative and consistent linearization of the hyperbolic system.

The problem now, for any given pair of states wℓ and wr , is to determine the

linearizing matrix A, namely its p × p elements ai j (wℓ, wr ), for i, j = 1, . . . , p,

under the Roe’s conditions above. For a system with p equations, condition i)

represents p algebraic relations, whileconditions ii) and iii) are merely qualitative.

Therefore we have to solve a system of p equations in p2 unknowns, which implies

that the solution is a ( p2 − p)-parameter family of solutions. For exampe, in P-

system p = 2 and there is a two-parameter family of solutions.

The approximate Riemann problem associated with Roe method is linear and

its solution consists only of propagating discontinuities, with no rarefaction waves.

This circumstance does not introduce any difficulty in a Godunov method, with

the only exception of solutions to the Riemann problem characterized by the oc-currence of a transonic rarefaction. In this case the numerical flux provided by the

approximate Riemann solution leads to a violation of the entropy condition and it

is therefore necessary to introduce an entropy fix.

8.2 Linearization in Jacobian form

A very simple way of satisfying the quantitative condition i) together with the

qualitative condition ii) is to take A coincident with the Jacobian matrix A(w) =∂f (w)/∂w of the original hyperbolic system, evaluated at a suitable intermediate

state w, which will be determinate by the following condition

A(w(wℓ, wr ))(wr  − wℓ) = f (wr ) − f (wℓ). (8.4)

where the notation w = w(wℓ, wr ) emphasizes the dependence of the unknown

intermediate state on the states at the interface. If the linearizing matrix is chosen

in Jacobian form, the unknown becomes the state vector w and therefore one has

apparently a system with an equal number of equations and unknowns, see below.

It must be noticed that the nonlinearity of the hyperbolic system prevents a simple

choice like 12

(wℓ+wr ) tobea solution. Forsubsequent reference, it is convenient to

76

Page 77: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 77/195

state the Roe conditions for the particular case of a solution sought for in Jacobian

form:

i) A(w)(wr  − wℓ) = f (wr ) − f (wℓ) (conservation)

ii) A(w) (hyperbolicity, automatically satisfied)

iii) w(wℓ, wr ) → w as wℓ and wr  → w (consistency).

8.3 Linearization for the isothermal ideal gas

In this section we determine the linearization of the 2

×2 system for an isothermal

gas, following the ideas just explained. First of all we remind here the definition(4.6) of the unkonw vector and of the flux vector of the isothermal gas

w =

ρ

m

and f (w) =

m

m2/ρ + a2ρ

(8.5)

from which the Jacobian matrix of the isothermal gas (4.8), is easily derived

A(w) =

0 1

a2

−m2

ρ2

2m

ρ

, (8.6)

The Jacobian matrix in the intermediate state w is simply

A(w) =

0 1

a2 − m2

ρ2

2m

ρ

, (8.7)

where ρ and m are the two components of the unknown intermediate state w. The

linearization in Jacobian form of the considered system amounts to determine the

intermediate state

˜w such that the first condition i) of Roe’s linearization

A(w)(wr  − wℓ) = f (wr ) − f (wℓ) (8.8)

is satisfied. This condition leads to a system of two equations in the two unknowns

ρ and m, namely

mr  − mℓ = mr  − mℓ

−(ρr  − ρℓ)m2

ρ2+ 2(mr  − mℓ)

m

ρ= m2

ρr 

− m2ℓ

ρℓ

.(8.9)

77

Page 78: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 78/195

The first equation is identically satisfied and therefore we have a single equation

in the two components of the vector w. Thus we have a one-parameter family of solutions, which is determined as follows.

First we note that if we rewrite the second equation of (8.9) in terms of speed

u = m/ρ, we obtain the following quadratic equation in u:

(ρr  − ρℓ) u2 − 2(mr  − mℓ) u + m2r 

ρr 

− m2ℓ

ρℓ

= 0 (8.10)

When ρr  = ρℓ this equation reduces to a the linear equation

2(mr  − mℓ) u = 1

ρℓ=

r m2r  − m2

ℓ (8.11)

whose solution is u = (mℓ + mr )/(2ρℓ=r ) = (uℓ + ur )/2.

By assuming that ρr  = ρℓ, we obtain

u2 − 2(mr  − mℓ)

ρr  − ρℓ

u + m2r /ρr  − m2

ℓ/ρℓ

ρr  − ρℓ

= 0.

The formula for the quadratic equation gives

u1,2 = mr  − mℓ

ρr  − ρℓ

± 1

ρr  − ρℓ

 (mr  − mℓ)2 − (ρr  − ρℓ)

m2

ρr 

− m2ℓ

ρℓ

The discriminant of this equation is = (ρℓmr −ρr mℓ)2ρℓρr 

and is a perfect square,

so that there are two real distinct solutions

u1,2 = mr  − mℓ

ρr  − ρℓ

± ρℓmr  − ρr mℓ

(ρr  − ρℓ)√ 

ρℓρr 

=√ 

ρℓρr (mr  − mℓ) ± (ρℓmr  − ρr mℓ)

(ρr  − ρℓ)√ 

ρℓρr 

.

(8.12)

Using the following elementary identity ρr  − ρℓ = √ ρr  − √ 

ρℓ

√ ρr  + √ 

ρℓ

,

we obtain

u1,2 =√ 

ρℓ mr √ ρr 

±√ 

ρℓ ∓√ 

ρr  mℓ√ ρr 

±√ 

ρℓ √ ρr  − √ ρℓ

√ ρr  + √ ρℓ

√ ρr ρℓ

=√ 

ρℓ mr  ∓ √ ρr  mℓ

√ ρr  ± √ 

ρℓ

√ 

ρr  − √ ρℓ

√ ρr  + √ 

ρℓ

√ ρr ρℓ

The expressions within the parentheses can be simplified with either of the two

possible signs and this yields the two solutions:

u1 =mℓ√ 

ρℓ+ mr √ 

ρr √ ρℓ + √ 

ρr 

and u2 =mℓ√ 

ρℓ− mr √ 

ρr √ ρℓ − √ 

ρr 

. (8.13)

78

Page 79: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 79/195

Page 80: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 80/195

Page 81: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 81/195

and v is the vector of the new variables, called characteristic variables,

v ≡ R−1w = Lw, (8.24)

where R is the matrix of right eigenvectors and L = R−1 is the matrix of left

eigenvectors.

Consider now a Riemann problem with initial data wℓ and wr . We can decom-

pose the jumpwr −wℓ of the initalconditiononto thebasis of the right eigenvectors

rk  of the linearized problem

wr  − wℓ = p

k =1

vk  rk  = Rv, (8.25)

where vk , k  = 1, . . . , p, represent the characteristic components of the con-

sidered jump. Here we have used the fact that matrix multiplication of a vector

is a linear combination of the column vectors of the matrix with the vector com-

ponents being the coefficients of the linear combination (see Trefethen). Since

LR = R−1R = I, the inverse of the relation above is

v = L[wr  − wℓ]. (8.26)

From [8, Chap. 6, p. 58], the similarity solution of the linear Riemann problem can

be expressed either in the form

w(ξ ) = wℓ + k | λk  < ξ 

vk  rk ,

or, equivalently, as

w(ξ ) = wr  −

k | λk  > ξ 

vk  rk 

where ξ  ≡ x/t  is the similarity variable and where we the notation w is used to

remind that this solution pertains to a linearized hyperbolic system. The vertical

state corresponds to ξ  = 0 and therefore we have

w∨| = w(0) = wℓ + k | λk  < 0

vk  rk  (8.27)

or alternatively

w∨| = w(0) = wr  −

k | λk  > 0

vk  rk 

We are now able to compute the numerical flux, by exploiting either of the two

alternative expressions above in the relations (8.20), to give

F∨|(wℓ, wr ) = f (wℓ) + A

k | λk  < 0

vk  rk  = f (wℓ) +

k | λk  < 0

vk λk  rk  (8.28)

81

Page 82: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 82/195

or, equivalently,

F∨|(wℓ, wr ) = f (wr ) − A

k | λk  > 0

vk  rk  = f (wr ) −

k | λk  > 0

vk  λk  rk . (8.29)

where we have used the fact that rk  is an eigenvector of A with eigenvalue λk .

If we introduce the following operator

λ− =  N (λ) =

λ if  λ < 0

0 if  λ > 0(8.30)

that selects the negative part of its argument, equation (8.28) becomes

F∨|(wℓ, wr ) = f (wℓ) + p

k =1

vk λ−k  rk  . (8.31)

Alternatively, we could introduce the operator for the positive part

λ+ = P (λ) =

λ if  λ > 0

0 if  λ < 0(8.32)

so that relation (8.29) becomes

F∨|(wℓ, wr ) = f (wr ) − p

k =1

vk λ+k  rk  . (8.33)

It is also possible to write the equation for vertical flux in a symmetric form by

averaging the two forms above, and we obtain

F∨|(wℓ, wr ) = 1

2[f (wℓ) + f (wr )] + 1

2

p

=1

vk λ−k  rk  −

 p

=1

vk λ+k  rk 

= 1

2[f (wℓ) + f (wr )] + 1

2

 pk =1

vk 

λ−

k  − λ+k 

rk  .

(8.34)

But the difference of the two quantities dependent on the eigenvalues is simply the

absolute value of the true eigenvalue, λ−k  − λ+

k  = |λk |, so the expression of the

numerical flux of the Roe method is

F∨|(wℓ, wr ) = 1

2[f (wℓ) + f (wr )] − 1

2

 pk =1

vk  |λk | rk  . (8.35)

82

Page 83: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 83/195

It is classical to use also another form of the Roe numerical flux in terms of the

variation of the conservation variables wr  − wℓ = w = R v, which givesRv = R

Lw, from which

F∨|(wℓ, wr ) = 1

2[f (wℓ) + f (wr )] − 1

2

A (wr  − wℓ) (8.36)

whereA = R

L.

Let us now particularize the Roe mumerical flux to the isothermal gas system

with only two components. In this case, the expression of the vertical flux is given

by the alternative expressions

F∨|(wℓ, wr ) = f (wℓ) + v1 λ−1 r1 + v2 λ−

2 r2,

F∨|(wℓ, wr ) = f (wr ) − v1 λ+1 r1 − v2 λ+

2 r2,

or, equivalently, by the symmetric version

F∨|(wℓ, wr ) = 1

2[f (wℓ) + f (wr )] − 1

2

v1 |λ1| r1 + v2 |λ2| r2

. (8.37)

8.5 Entropy fix for a scalar equation

One disadvantage of Roe linearization is that the resulting approximate Riemannsolution consists only of discontinuities, with no rarefaction waves and this may

lead to a violation of the entropy condition.

In the scalar case, an entropy-violating Riemann solution leads to difficulties

only when the rarefaction wave is transonic (or sonic, for brevity), i.e., when

 f ′(uℓ) < 0 < f ′(ur ) where f  = f (u) is the flux of the considered conservation

law for the variable u. For a system of conservation laws, like the general P-system

of our particular case of the isothermal gas equations, the difficulty is encountered

only when one of the two travelling waves is a transonic rarefaction.

In the case of sonic rarefaction wave, it is necessary to modify the approximate

Riemann solver in order to obtain entropy satisfying solutions. We discuss hereone possible approach to overcome the difficulty, which consists of replacing the

transonic rarefaction wave with two distinct jumps which propagate with speed s1

and s2, to be defined. In this way, the vertical state can be approximated by the

intermediate state ui occurring between the two jumps. This modification of the

Riemann solutionshould be done in a way that does not jeopardize theconservation

of the physical quantity.

It is useful to consider the effect of this entropy fix in the scalar case and we

examine the particular case of the traffic equation discussed in section 2, which is

83

Page 84: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 84/195

repeated here for convenience

∂t ρ + ∂ x f (ρ) = 0. (8.38)

Applying the condition i) of the Roe’s linearization (see section 8.1) we obtain that

the initial jump propagates with a speed given by

a = a(ρℓ, ρr ) = f (ρr ) − f (ρℓ)

ρr  − ρℓ

. (8.39)

Note that in the scalar case the linear approximation provides a propagation speed

˜a

= ˜a(ρℓ, ρr ) of the jump coincident with that of Rankine–Hugoniot condition.

Thus the linearization gives theexact solution, but only when theentropy conditionis satisfied, i.e., only when the discontinuous solution is entropic. On the contrary,

if the entropic solution is a rarefaction fan and it is transonic, the solution of the

linearized Riemann problem must be modified. A possibility consists in replacing

the single jump by two jumps, propagating with velocity s1 and s2, that can be

determined by the following argument. Consider a Riemann problem where the

two states ρℓ and ρr  cause a rarefaction wave and represent the initial condition in

the ( f (ρ), ρ) plane. Now wecan draw thetwotangent lineswith slope f ′(ρℓ) = aℓ

and f ′(ρr ) = ar , and these values are the propagating speed of the two artificial

 jumps, namely,

s1 = aℓ and s2 = ar .Therefore, in case of a transonic rarefaction, namely when aℓ < 0 and ar  > 0, the

linearized flux˜ f (ρ; ρℓ, ρr ) = f (ρℓ) + a (ρ − ρℓ), (8.40)

will be replaced by the entropy-fixed flux

˜ f e.f.(ρ; ρℓ, ρr ) =

 f (ρℓ) + aℓ(ρ − ρℓ) if ρℓ < ρ < ρi

 f (ρr ) + ar (ρ − ρr ) if ρi < ρ < ρr 

where the value ρi corresponds to intersection point of the two straight lines andis therefore obtained solving the equation

 f (ρℓ) + aℓ(ρi − ρℓ) = f (ρr ) + ar (ρi − ρr ).

A direct calculation gives

ρi = f (ρℓ) − f (ρr ) + ar  ρr  − aℓ ρℓ

ar  − aℓ

(8.41)

84

Page 85: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 85/195

or, in terms of only speed values,

ρi = (ar  − a) ρr  + (a − aℓ) ρℓ

ar  − aℓ

. (8.42)

The value ρi represents an approximation of the exact sonic value ρs which is the

root of the equation f ′(ρs ) = 0 and which would be used to evaluate the vertical

flux in the absence of linearization.

Linearized flux

f(η)

      ρ

ρℓ

ρr

ρi

r

Figure 8.2: Construction for the entropy fix

Therefore, the modified solution to the linearized Riemann problem including

the entropy fix reads

ρe.f.( x, t ) =

ρℓ x < aℓ t 

ρi aℓ t  < x < ar  t 

ρr  x > ar  t 

(8.43)

a correction to be applied only when aℓ < 0 and ar  > 0. The entropy-fixedvertical

85

Page 86: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 86/195

flux resulting from this modification will be, using ρi expressed by relation (8.42):

F ∨|(ρℓ, ρr ) = ˜ f e.f.(ρi ; ρℓ, ρr ) = f (ρℓ) + aℓ(ρi − ρℓ)

= f (ρℓ) + ar  − aar  − aℓ

aℓ(ρr  − ρℓ)

(8.44)

when aℓ < 0 and ar  > 0. Equivalently, we have the expression based on the right

part of the fixed function

F ∨|(ρℓ, ρr ) = f (ρr ) + aℓ − a

ar 

−aℓ

ar (ρr  − ρℓ). (8.45)

By averaging the two expressions we obtain the symmetric expression

F ∨| e.f.(ρℓ, ρr ) = 1

2[ f (ρℓ) + f (ρr )] − 1

2

(aℓ + ar ) a − 2aℓar 

ar  − aℓ

(ρr  − ρℓ) (8.46)

always under the assumption aℓ < 0 and ar  > 0. Otherwise, for nontransonic

rarefactions the flux of the linearized flux given in (8.40) must be used to construct

the numerical flux at the vertical state F ∨|(ρℓ, ρr ) whenever aℓ > 0 or ar  < 0.

Flux (8.40) describes a jump propagating with speed a, which can be either an

entropic or a nonentropic jump, but the transonic rarefaction case is excluded by

the assumed condition aℓ > 0 or ar  < 0. Thus the entropy fixed version of thespeed absolute value will be defined by

|a| e.f. =

|a| aℓ > 0 or ar  < 0

(aℓ + ar ) a − 2aℓar 

ar  − aℓaℓ < 0 and ar  > 0

(8.47)

This expression halds whenever the subscript ℓ denotes a true left position and r  a

true right position. By contrast, if the two spatial states correspond to the opposite

spatial direction, the definition of the entropy-fixed speed absolute value becomes

|a| e.f. =

|a| ar  > 0 or aℓ < 0

(aℓ + ar ) a − 2aℓar 

aℓ − ar 

ar  < 0 and aℓ > 0(8.48)

The entropy fixed version of the symmetric expression of the numerical flux will

be, in any case,

F ∨| e.f.(ρℓ, ρr ) = 1

2[ f (ρℓ) + f (ρr )] − 1

2|a| e.f.(ρr  − ρℓ) (8.49)

86

Page 87: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 87/195

Page 88: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 88/195

arbitrary boundary points

− X  and X  and at time t  is

C tot[− X , X ] =

 X 

− X 

ρ( x, t ) d x

= aℓt 

− X 

ρℓ d x + ar t 

aℓ

a−1( x /t ) d x + X 

ar t 

ρr  d x

= ρℓ[aℓt + X ] + t 

 ar 

aℓ

a−1(ξ ) d ξ  + ρr [ X  − ar t ],

where a change of variable has been used in the integral over the rarefaction wave.

But, thanks to the relation a(ρ)=

ξ and also d ξ /d ρ=

a′(ρ), the indefinite integral

can be evaluated by changing first the integration variable ξ  → ρ, as follows: a−1(ξ ) d ξ  =

 a−1(a(ρ)) a′(ρ) d ρ =

 ρa′(ρ) d ρ

and then using the integration by parts, to give a−1(ξ ) d ξ  = ρa(ρ) −

 a(ρ) d ρ = ρa(ρ) −

 f ′(ρ) d ρ = ρa(ρ) − f (ρ).

Evaluating the definite integral, we obtain

C tot[− X , X ] = ρℓ[aℓt + X ] + t 

ρr  ar  − f (ρr ) − ρℓ aℓ + f (ρℓ)+ ρr [ X  − ar t ]

= (ρℓ + ρr ) X  + [ f (ρℓ) − f (ρr )] t .

Thesameresultcan beobtainedmoreeasily also byconsidering thenonentropic

 jump propagating with speed a = [ f (ρr )− f (ρℓ)]/(ρr −ρℓ). In fact, this solution

is in any case a weak solution and guarantees the exact conservation of cars. In

termsof this nonphysical weak solution, thetotalnumberofcars containedbetween

twoarbitrary boundary points− X and X and at time t can be calculated as follows,

see figure 8.3,

C tot[− X , X ] =  X 

− X 

ρ( x , t ) d x =  ˜at 

− X 

ρℓ d x +  X 

at 

ρr  d x.

Since in the Riemann problem the left and right states are uniform, we can carry

ρℓ and ρr  out from each integral. Finally we have

C tot[− X , X ] = ρℓ[at  + X ] + ρr [ X  − at ]

= (ρℓ + ρr ) X  + (ρℓ − ρr ) at 

= (ρℓ + ρr ) X  + [ f (ρℓ) − f (ρr )] t .

88

Page 89: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 89/195

Consider now the entropy-fixed solution (8.41) containing a uniform intermediate

state between the left and right states. The total number of cars contained in thesame interval considered above is

C tot, entropy fixed[− X , X ] =

 X 

− X 

ρe.f.( x, t ) d x

= a

ℓt 

− X 

ρℓ d x + ar t 

aℓt 

ρi d x + X 

ar t 

ρr  d x

= ρℓ[aℓt + X ] + ρi [ar  − aℓ] t  + ρr [ X  − ar t ]

=(ρℓ

+ρr ) X 

+ [ρℓaℓ

−ρr ar 

]t 

+ρi

[ar 

−aℓ

]t ,

and using relation (8.41) for ρi we obtain

C tot, entropy fixed[− X , X ] = (ρℓ + ρr ) X + [ f (ρℓ) − f (ρr )] t 

which is coincident with the previous results. Thus, the entropy fix that has been

introduced is conservative and it does not loose or create cars on the highway.

Finally, figure 8.4 shows solutions of the Riemann problem for the traffic equa-

tion in the case of a sonic rarefaction wave. The exact solution is compared with

two numerical solutions provided by the approximate Riemann solver with lin-

earization, without the entropy fix and including the entropy fix. The improvementachieved by the entropy fix is substantial. Note that the residual error present in the

entropy-fixed solution in the transonic zone is similar to the error of the Godunov

method and is of order  x .

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10.7

0.8

0.9

1

1.1

1.2

1.3

1.4

x

      ρ

 

exact

fixed

no−fixed

Figure 8.4: Comparison of solutions with and without entropy fix

89

Page 90: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 90/195

8.6 Program for computing the Roe numerical flux

We provide the computer program implementing the Roe method for the P-System

of the isothermal gas.

SUBROUTINE Roe_num_flux (xx, ww, FF_R) ! WITH entropy fix

! including ENTROPY FIX

! ORDERED GRID

! Given the vector xx of nodal points and the vector ww

! of the cell average of the conservative variables,

! the program calculates the Roe vertical flux for the! equations of the P-System of the isothermal ideal gas

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: xx

REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: ww

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: FF_R

LOGICAL, PARAMETER :: ENTROPY_FIX = .TRUE.

REAL(KIND=8), DIMENSION(SIZE(ww,1), SIZE(ww,2)) :: ff

REAL(KIND=8), DIMENSION(SIZE(ww,1), SIZE(ww,1)) :: R, L, &

ABS_A_ef, ABS_lambda_ef

REAL(KIND=8), DIMENSION(SIZE(ww,1)) :: lambda, A_lambda_ef, &

lambda_l, lambda_r, &

lambda_i, dv, wi

REAL(KIND=8) :: N_l, P_l, P_r, N_r

INTEGER :: i, j, p

j = SIZE(xx); ! ONLY TO AVOID WARNING IN COMPILATION

ABS_lambda_ef = 0 ! The off diagonal elements are never modified

ff = flux(ww) ! Store the nodal fluxes to avoid a double

! evaluation of the flux at the grid nodes

DO i = 1 , SIZE(FF_R, 2 ); j = i

90

Page 91: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 91/195

Page 92: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 92/195

Page 93: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 93/195

Page 94: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 94/195

On the other hand, from the governing equation we obtain

∂t u = −a ∂ x u

∂2t  u = ∂t (−a ∂ x u) = −a ∂ x (∂t u) = a2 ∂2

 x u

By introducing the definitions

un( x) ≡ u( x, t n)

un+1( x) ≡ u( x, t n + t )

equation (9.2) is equivalent to

un+1 = un − at ∂ x un + 1

2a2(t )2 ∂2

 x un + O

(t )3

namely

un+1 − un

t = −a ∂ x un + 1

2a2t  ∂2

 x un + O

(t )3

(9.3)

Theleft-handside of equation (9.3) is anapproximation of time derivative, while its

right-hand side is equal to the second term of the original advection equation plus

a corrective term. Thus the idea of using the Taylor series leads to the occurrence a

new term that was not in the advection equation and that would have been occurredif the time derivative would had been approximated by means of an Euler method.

Now we introduce the spatial discretization for the semi-discrete equation (9.3)

and indicate by U n j value of the fully discrete solution at point x j of a uniform grid

and at time t n . The first spatial derivative is approximated by means of a centered

approximation, to give

∂ x u ≈ U  j+1 − U  j−1

2 x(9.4)

and similarly the second spatial derivative is discretized using again a centered

approximation

∂2 x u ≈ (∂ x u) j+½        

¾        

− (∂ x u) j−½        

¾        

 x=

U  j+1−U  j x

− U  j−U  j−1

 x

 x

= U  j−1 − 2U  j + U  j+1

( x)2

(9.5)

Notice that to have a discrete representation of the second derivative spatial points

in the middle of each cell of the grid have been used, as shown in Figure 9.1.

94

Page 95: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 95/195

Figure 9.1: Segment of a uniform 1D grid

Thus Lax–Wendroff scheme for the linear advection equation in one dimension,

based on finite differences, is

U n+1 j − U n j

t  = −a

U n j+1 − U n j−1

2 x +

1

2

a2t 

( x )2 U n j

−1

−2U n j

+U n j

+1 (9.6)

This scheme has a second order accuracy both in space and in time.

9.2 The scheme for a conservation law

Now we analyze the version of Lax–Wendroff scheme for the following conserva-

tion law in 1D

∂t u + ∂ x f (u) = 0 (9.7)

Similarly to the procedure for the advection equation (9.1), we consider the same

Taylor expansion of the solution u( x, t n+

t ) in the time-step t around the value

at time t n, given by equation (9.2). The governing equationyields ∂t u = −∂ x f (u),

immediately, which can be used to evaluate the second-order time derivative

∂2t  u = ∂t 

−∂ x f (u) = −∂ x

∂t  f (u)

= −∂ x

d f (u)

du∂t u

Thus, the two time derivatives of the unknown are given by

∂t u = −∂ x f (u)

∂2t  u

=∂ x f ′(u)∂ x f (u)

where f ′(u) = d f (u)/du. By introducing the definitions

un( x) ≡ u( x, t n)

un+1( x) ≡ u( x, t n + t )

as before, the time-discretized conservation law (9.2) can be rewritten as

un+1 = un − ∂ x f (un) t  + 1

2∂ x

 f ′(un) ∂ x f (un)

(t )2 + O

(t )3

95

Page 96: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 96/195

Page 97: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 97/195

Page 98: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 98/195

In this form, the correct treatment of the two special half-sized cells at the extremes

of the integration interval is obtainedautomatically, since  x1 =  x /2and  x J  = x/2.

By virtue of the weak form of the conservation law, a discretization in con-

servation form guarantes that a only weak solutions are obtained (eventually) and

therefore also that the shocks propagate at the correct speed. On the other hand,

for a solution provided by a scheme in conservation form it is impossible to guar-

antee anything about the satisfaction of the entropy condition. In other words,

nonentropic weak solutions can be produced by the conservative scheme.

All these considerations are contained in a rigorous form in a theorem due to

Lax and Wendroff, which is however mathematically too much sophisticated for

our analysis. The interesed reader is referred to LeVeque [8, Theorem 12.1, p.130–133]. For the present purposes it suffices to recall that the technical difficulty

with this fundamental theorem lies in the fact that there are always infinitely many

solutions to any Cauchy problem for a nonlinear hyperbolic equation, for whatso-

ever data. As a consequence, it is not possible to speak of the convergence of the

discrete to an exact weak solution in the same manner as it is done for other initial

value problems with unique solutions. What the Lax–Wendroff theorem states is

that if a converging subsuccession can be picked out the limit is a weak solution.

In other words, the theorem cannot guarantee the convergence to a weak solution.

Moreover, the Lax–Wendroff theorem does not say anything about the satifaction

of the entropy condition. To this aim it is necessary to extend the theorem in thesense that one must characterize the scheme also in its ability of respecting the en-

tropy condition at a discrete level. We refer the interested rader to the dissertation

of Marica Pelanti [12].

9.3 The scheme for nonlinear systems of conservation laws

In case of a nonlinear system of conservation laws, the Lax–Wendroff scheme is

obtained as a straightforward extension of equation (9.11) for a scalar conservation

law. Let u denote thevector unknown of a system of conservation laws with f as the

flux vector, and let Un

 j

represent be the point value of the fully discrete equations.

The vector counterpart of the scheme (9.11) for a scalar conservation law will be

Un+1 j − Un

 j

t = −

f (Un j+1) − f (Un

 j−1)

2 x

+ 1

2

( x)2

AUn

 j+ 12

f (Un

 j+1) − f (Un j )− A

Un

 j− 12

f (Un

 j ) − f (Un j−1)

(9.18)

98

Page 99: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 99/195

where A(u)

=∂f (u)/∂u represents the Jacobian matrix of the hyperbolic system.

By introducing the Lax–Wendroff numerical flux for the system

FLW j+ 1

2

≡ FLWU j , U j+1

≡ 1

2

f (U j ) + f (U j+1)

− 1

2

 xAU j+ 1

2

f (U j+1) − f (U j )

(9.19)

it is a simple matter to verify that the Lax–Wendroff scheme (9.18) can be recast

in the following conservative or conservation form

Un+1

 j =Un

 j −t 

 xFLW

 j+12 −

FLW

 j−12 (9.20)

As in the scalar case, the scheme is implemented by considering the cycle over

the interfaces and by taking into account the contribution of each flux to the two

neighbouring cell, after the initialization Un+1 j ← Un

 j ,

Un+1 j ← Un+1

 j − t 

 xF

LW, n

 j+ 12

and Un+1 j+1 ← Un+1

 j+1 + t 

 xF

LW, n

 j+ 12

(9.21)

For system of conservatin laws the Lax–Wendroff scheme meets the same diffi-

culties with assuring the convergence and the respect of the entropy conditions

discussed for the scalar case.

9.4 Isothermal ideal gas system with linearization

We want now to particularize the Lax–Wendroff scheme (9.20) in conservation

form to the nonlinear hyperbolic system of the isothermal ideal gas. The equations

of this physical model have been introduced in section 4 and for matching the

notation of the present section with that adopted there we remind the definition of 

the unknown and of the flux vector

w = ρ

m

and f (w) = m

m2

ρ+ a2ρ

where a is the isothermal sound speed, with its associated Jacobian matrix

A(w) = ∂f (w)

∂w=

0 1

a2 − m2

ρ2

2m

ρ

99

Page 100: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 100/195

Page 101: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 101/195

0 1 2

0.5

0.6

 

x

   r     h   o

.

.

0 1 2

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

 

x

   m

− .

.

.

.

.

.

.

.

.

.

Figure 9.2: Conservative Lax-Wendroff for isothermal gas

101

Page 102: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 102/195

In accordance with Lax–Wendroff theorem, the shock fronts propagate with the

correct velocity, as it mustbefor any weaksolutionprovidedbya schemeinconser-vation form. On the other hand, strong oscillations are produced behind the fronts

by the second order scheme. This is a manifestation of a Gibbs phenomenon and

reflects Godunov theorem [8, Theorem 15.6, p. 170] that a motonicity preserving

scheme must be at most first order accurate.

For the purpose of using this scheme in connection with a low order scheme

of Godunow type in a high resolution method, as it will be discussed in the next

section, we must consider also the possibility of evaluating the Jacobian in a differ-

ent form. In fact, as described in section 8, it is necessary to build a conservative

linearization in order to obtain a numerical flux capable of yielding a valid approxi-

mate solutionto theRiemann problem. In particular, according to Roelinearizationthe Jacobian of the linearized problem for the left state wℓ = W j and the right state

wr  = W j+1 can be defined as A j+ 12

= Aw(W j , W j+1)

, where the intermediate

state w(W j , W j+1) is defined by Roe average. The Lax–Wendroff scheme for the

linearized problem would read

Wn+1 j − Wn

 j

t = −

f (Wn j+1) − f (Wn

 j−1)

2 x

+ 1

2

( x)2An j+ 1

2 f (Wn j+1) − f (Wn

 j )− An j− 1

2 f (Wn j ) − f (Wn

 j−1)(9.26)

Also this scheme can be written in conservation form

Wn+1 j = Wn

 j − t 

 x

F

LW, n

 j+ 12

− FLW, n

 j− 12

(9.27)

with the Lax–Wendroff numerical flux, inlcuding Roe linearization, defined by

F LW j+ 1

2

≡ 1

2

f (W j ) + f (W j+1)

− 1

2

 xA j+ 1

2

f (W j+1) − f (W j )

(9.28)

Again, the scheme is implemented in the usual way by considering the cycle over

the interfaces and by taking into account the contribution of each flux to the twoneighbouring cells, after the initialization Wn+1

 j ← Wn j ,

Wn+1 j ← Wn+1

 j − t 

 xF

LW, n

 j+ 12

and Wn+1 j+1 ← Wn+1

 j+1 + t 

 xF

LW, n

 j+ 12

(9.29)

9.5 Boundary conditions in the conservative LW scheme

Imposing the boundary conditions in the Lax–Wendroff scheme written in con-

servation form is a rather subtle matter. This is due to the nonlinear character of 

102

Page 103: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 103/195

the hyperbolic problem and to the presence of the second spatial derivative in the

numerical scheme. Since the fully discrete equations are in conservative form,the update of the cell averages is based on evaluating the numerical fluxes at all

interfaces, which are inside thecomputational domain, by definition. However, the

presence af a boundary requires also to consider the flux of the conserved quantity

through the extremes of the integration interval. Therefore, the Lax–Wendroff nu-

merical fluxesat the internal interfaces as well as theflux evaluated on theboundary

provide their own contribution to the cell averages. In particular, the first and last

cells, which contain the end points, must be analyzed with a special attention for

two reasons: they involve the two fluxes through the interval ends and at the same

time the second-order correction term of the Lax–Wendroff scheme cannot be ac-

counted directly since the two end poinst of the interval are without the three-pointstencil needed to evaluate the second spatial derivative, discretely.

Another difference which must be considered is that, even for the most simple

situation of a uniform grid, the size of the first and last cells is half of that of 

all other internal cells, and this difference must be included when updating the

cell averages of the extremes cells. To discuss all these aspect we consider for

simplicity the case of a scalar conservation law for a variable u and examine the

treatment necessary at the left extreme x = x0 of the integration interval. The

extension of the results to nonlinear hyperbolic systems will be considered at the

end of the section, while the treatment required at the right end point can be easily

deduced from the analysis presented here.Consider first the numerical flux (9.14) associated with the first internal grid

point x = x1 = x0 +  x , namely

F LW½        

¾        

= 1

2[ f (U 0) + f (U 1)] − 1

2

 x f ′

U ½        ¾        

[ f (U 1) − f (U 0)] (9.30)

which will provide the partial contribution to the cell average of the first cell of 

half size equal to  x/2 according to

U 0 ← U 0 − t 

 x/2F LW

½        

¾        

← U 0 − t  x

[ f (U 0) + f (U 1)] + (t )2

( x)2f ′U ½        

¾        

[ f (U 1) − f (U 0)](9.31)

The second term contributing to the average quantity of the first cell si due to the

flux F 0 evaluated at the left end point andtime integrated over the temporal interval

t , to give

U 0 ← U 0 + t 

 x/2F 0 (9.32)

where F 0 is calculated from the boundary value u of the unknown variable by

means of the relation F 0 = f (u). The quantity u is defined in terms of either

103

Page 104: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 104/195

Page 105: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 105/195

Page 106: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 106/195

Page 107: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 107/195

Np = SIZE(xx)

F_SO(:, 1) = - rat * MATMUL(AA(ww(:,1)), ff(:,2) - ff(:,1)) / 2

F_SO(:, 2) = rat * MATMUL(AA(ww(:,Np)), ff(:,Np) - ff(:,Np-1)) / 2

END SUBROUTINE LWc_num_flux verbatim

107

Page 108: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 108/195

16 High Resolution Methods (Randall J. LeVeque)

In2 the previous chapter, we observed that monotone methods for scalar conserva-

tion laws are TVD andsatisfy a discrete entropy condition. Hence they converge in

nonoscillatory manner to the unique entropy solution. However, monotone meth-

ods are at most first order accurate, giving poor accuracy in smooth regions of the

flow. Moreover, shocks tend to be heavily smeared and poorly resolved on the

grid. These effects are due to the large amount of numerical dissipation in mono-

tone methods. Some dissipation is obviously needed to give nonoscillatory shocks

and to ensure that we converge to the vanishing viscosity solution, but monotone

methods go overboard in this direction.

In this chapter wewill studysome “highresolution”methods. This term appliesto methods that are at least second order accurate on smooth solutions and yet give

well resolved, nonoscillatory discontinuities. We will first consider the scalar

problem, where we can impose the constraint that the method be total variation

diminishing. This insures that we obtain nonoscillatory shocks and convergence

in the sense of Theorem 15.2 (p. 164). These scalar methods will later be extended

to systems of equations using an approximate decomposition of the system into

characteristic fields.

The main idea behind any high resolution method is to attempt to use a high

order method, but to modify the method and increase the amount of numerical

dissipation in the neighborhood of a discontinuity.

16.1 Artificial viscosity

The most obviuos way to do this is to simply take a high order method, say Lax–

Wendroff, and add an additional “artificial viscosity” term to the hyperbolic equa-

tion, perhaps modeling the addition of a diffusive term proportional to ∂2 x u. This

term must have a coefficient that vanishes as k , h → 0, so that it remains consis-

tent with the hyperbolic equation. Moreover, we want this coefficient to vanish

sufficiently quickly that the order of accuracy of the high order method on smooth

solutions is unaffected.

Since additional viscosity is typically needed only near discontinuities, wemight also want the coefficient to depend on the behaviour of the solution, be-

ing larger near discontinuities than in smooth regions. We will introduce this

complication shortly, but first consider the effect of adding a viscous term that is

independent of the solution.

2This chapter is a literal reproduction of chapter 16 of Randall J. LeVeque’s Numerical Methods

 for Hyperbolic Problems, Birkhäuser, Basel, 1992, except for only some very minor notational

changes. The figures referred to in these pages are the same as the originals.

108

Page 109: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 109/195

As an example, consider the advection equation ∂t u

+a ∂ x u

=0 and suppose

we modify the standard Lax–Wendroff method from Table 10.1 as follows:

U n+1 j = U n j − ν

2(U n j+1 − U n j−1) + 1

2ν2(U n j−1 − 2U n j + U n j+1)

+ k Q(U n j−1 − 2U n j + U n j+1)

(16.1)

where ν = ak / h is the Courant number and Q is the newly-introduced artificial

viscosity. Clearly the truncation error L( x, t ) for this method can be written in

terms of the truncation error LLW( x, t ) of the Lax–Wendroff method as

 L( x, t )

=LLW( x , t )

−Q

[u( x

−h, t )

−2u( x , t )

+u( x

+h, t )

]= LLW( x , t ) − Qh 2 ∂2 x u( x, t ) + O(h4)

= O(k 2) as k  → 0

since LLW( x, t ) = O(k 2) and h2 = O(k 2) as k  → 0. The method remains second

order accurate for any choice of Q = constant.

The modified equation for (16.1) is similarly related to the modified equation

(11.7) for Lax–Wendroff. The method (16.1) produces a third order accurate

approximation to the solution of the PDE

∂t u + a ∂ x u = h2

Q ∂2

 x u +1

6h2

a(ν2

− 1) ∂3

 x u. (16.2)

The dispersive term that causes oscillations in Lax–Wendroff now has competi-

tion from a dissipative term, and one might hope that for Q sufficiently high the

method would be nonoscillatory. Unfortunately, this is not the case. The method

(16.1) with constant Q is still a linear method, and is second order accurate, and

so the following theorem due to Godunov shows that it cannot be monotonicity

preserving.

Theorem 16.1 (Godunov). A linear, monotonicity preserving method is at 

most first order accurate.

Proof. We will show tha any linear, monotonicity preserving method ismonotone and then the result follows from Theorem 15.6 (p. 170).

Let U n be any grid function and let V n j = U n j for j = J  while V n J  > U n J .

Then we need to show that V n+1 j ≥ U n+1

 j for all j , which implies that the method

is monotone.

Let W n be the monotone Riemann data defined by

W n j =

U n J  j < J 

V n J  j ≥ J (16.3)

109

Page 110: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 110/195

Page 111: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 111/195

For this reason, the high resolution methods developed more recently are based

on very different approaches, in which the nonoscillatory requirement can be im-posed more directly. It is generally possible to rewrite the resulting method as a

high order method plus some artificial viscosity, but the resulting viscosity coeffi-

cient is typically very complicated and not at all intuitive.

There are now a wide variety of approaches that can be taken, and very often

there are close connections between the methods developed by quite different

means. We will concentrate on just two classes of methods that are quite popular:

flux-limiter methods and slope-limiter methods. More comprehensive reviews

of many high resolution methods are given by Colella and Woodward [98] and

Zalesak [102].

16.2 Flux-limiter methods

In this approach, we begin by choosing a high order flux F  H (U ; j + 12

) (e.g.,

the Lax–Wendroff flux) that works well in smooth regions, and a low order flux

F  L (U ; j + 12

) (typically some monotone method) that behaves well near disconti-

nuities. We then attempt to hybridize these two into a single flux F  in such a way

that F  reduces to F  H  in smooth regions and to F  L near discontinuities. The main

idea is outlined here, although for nonlinear problems the actual hybridization may

be more complicated.

We can view the high order flux as consisting of the low order flux plus acorrection:

F  H (U ; j + 12

) = F  L (U ; j + 12

) + F  H (U ; j + 12

) − F  L (U ; j + 12

)

. (16.9)

In a flux-limiter method, the magnitude of this correction is limited depending on

the data, so the flux becomes

F (U ; j + 12

) = F  L (U ; j + 12

) + (U ; j + 12

)

F  H (U ; j + 12

) − F  L (U ; j + 12

)

,

(16.10)

where (U ; j + 12

) is the limiter. If the data U  is smooth near U  j then (U ; j + 12

)

should be near 1 while in the vicinity of a discontinuity we want (U ; j + 12 ) to benear zero. (In practice, allowing a wider range of values for often works better.)

Note that we can rewrite (16.10) as

F (U ; j + 12

) = F  H (U ; j + 12

)

− 1 − (U ; j + 12

)

F  H (U ; j + 12

) − F  L (U ; j + 12

) (16.11)

and comparison with (16.8) gives the equivalent artificial viscosity for this type of 

method.

111

Page 112: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 112/195

Page 113: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 113/195

where φ(θ) is some given function.

Note that this measure of smoothness breaks down near extreme points of U ,where the denominator may be close to zero and θ  j+ 1

2arbitrarily large, or negative,

even if the solution is smooth. As we will see, maintaining second order accuracy

at extreme points is impossible with TVD methods. For the time being, we will

be content with second order accuracy away from these points, and the following

theorem gives conditions on φ which guarantee this.

Theorem 16.2. The flux limiter method with flux (16.14) (where φ j+ 12

is given

by (16.16)) is consistent with the advection equation provided  φ(θ) is a bounded 

 function. It is second order accurate (on smooth solutions with ∂ x u bounded away

 from zero) provided φ(1)

=1 with φ Lipschitz continuous at θ 

=1.

Exercise 16.1. Prove this theorem.

To see what conditions are required to give a TVD method, we use (16.14) to

obtain the following method (dropping the superscript on U n for clarity):

U n+1 j = U  j − k 

h

a(U  j − U  j−1) + 1

2a(1 − ν)

(U  j+1 − U  j ) φ j+ 1

2− (U  j − U  j−1) φ j− 1

2

= U  j −

ν − 1

2ν(1 − ν) φ j− 1

2

(U  j − U  j−1) − 1

2ν(1 − ν) φ j− 1

2(U  j+1 − U  j ).

(16.17)

If we consider a general method of the form

U n+1 j = U  j − C  j−1(U  j − U  j−1) + D j (U  j+1 − U  j ), (16.18)

then the following theorem of Harten [27] can be used to give constraints on the

φ j+ 12

Theorem 16.2 (Harten). In order for the method (16.18) to be TVD, the

 following conditions on the coefficients are sufficient:

C  j−1 ≥ 0 ∀ j

 D j ≥ 0 ∀ j

C  j + D j ≤ 1 ∀ j

(16.19)

Proof. The resulting method can be shown to be TVD by computing

U n+1 j+1 − U n+1

 j = (1 − C  j − D j )(U  j+1 − U  j ) + D j+1(U  j+2 − U  j+1)

+ C  j−1(U  j − U  j−1).

We now sumU n+1

 j+1 − U n+1 j

over j and use the nonnegativity of each coefficient

as in previous arguments of this type to show that T V (U n+1) ≤ T V (U n).

113

Page 114: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 114/195

Exercise 16.2. Complete this proof.

The form (16.19) suggests that we try taking

C  j−1 = ν

1 − 1

2(1 − ν) φ j− 1

2

 D j = −1

2ν(1 − ν) φ j+ 1

2.

Unfortunately, there is no hope of satisfying the condition (16.19) using this, since

 D j < 0 when φ j+ 12

is near 1.

At the expense of extending the stencil for defining C  j , we can also obtain

(16.17) by taking

C  j−1 = ν + 1

2(1 − ν)ν

(U  j+1 − U  j ) φ j+ 1

2− (U  j − U  j−1) φ j− 1

2

U  j − U  j−1

,

 D j = 0.

The conditions (16.19) are then satisfied provided

0 ≤ C  j−1 ≤ 1. (16.20)

Using (16.15) and (16.16), we can rewrite the expression for C  j−1

as

C  j−1 = ν

1 + 1

2(1 − ν)

φ(θ  j+ 1

2)

θ  j+ 12

− φ (θ  j− 12

)

. (16.21)

The condition (16.20) is satisfied provided the CFL condition |ν| ≤ 1 holds along

with the bound

φ (θ  j+ 12

)

θ  j+ 12

− φ(θ  j− 12

)

≤ 2 for all θ  j+ 1

2, θ  j− 1

2. (16.22)

If θ  j+ 12

≤ 0 then the slopes at neighboring points have opposite signs. The data

then has an extreme point near U  j and U  j+1 and the local variation will certainly

increase if the value at this extreme point is accentuated. For this reason, it is safest

to take φ(θ) = 0 for θ  ≤ 0 and use the unpwind method alone. Note that this is

unsatisfying since, if the data is smooth near the extreme point, we would really

like to take φ near 1 so that the high order method is being used. However, the

total variation will generally increase if we do this. Osher and Chakravarthy [60]

prove that TVD methods must in fact degenerate to first order accuracy at extreme

points.

114

Page 115: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 115/195

More recently, it has been shown by Shu [75] that a slight modification of these

methods, in which the variation is allowed to increase by O(k ) in each time step,caneliminate this difficulty. Themethods areno longer TVD but are total variation

stable since over a finite time domain uniform bounds on the total variation can be

derived. If we have

T V (U n+1) ≤ (1 + αk ) T V (U n), (16.23)

where α is independent of U n , then

T V (U n) ≤ (1 + αk )n T V (U 0) ≤ eαT T V (u0), (16.24)

for nk  ≤ T  and hence the method is total variation stable.For simplicity here, we will only consider TVD methods and assume that

φ(θ) = 0 for θ  ≤ 0. (16.25)

Then (16.22) will be satisfied provided

0 ≤ φ(θ)

θ ≤ 2 and 0 ≤ φ(θ) ≤ 2 (16.26)

for all θ .

This region is shown in Figure16.1. To obtain secondorder accuracy, the func-tion φ must pass smoothly through the point φ(1) = 1. Sweby found, moreover,

that it is best to take φ to be a convex combination of the φ for Lax–Wendroff 

(which is simply φ = 1) and the φ for Beam–Warming (which is easily seen to

be φ(θ) = θ ). Other choices apparently give much compression, and smooth data

such as a sine wave tends to turn into a square wave as time evolves. Imposing

this additional restriction gives the “second order TVD” region of Sweby which is

also shown in Figure 16.1.

Example 16.1. If we define φ(θ) by the upper boundary of the second order

TVD region shown in Figure 16.1, i.e.,

φ(θ) = max(0, min(1, 2θ ), min(θ , 2)), (16.27)

then we obtain the so-called “superbee” limiter of Roe [67].

A smoother limiter function, used by van Leer [89], is given by

φ(θ) = |θ | + θ 

1 + |θ | (16.28)

These limiters are shown in Figure 16.2.

115

Page 116: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 116/195

Sweby [83] gives several other examples and presents some numericalcompar-

isons. More extensive comparisons for the linear advection equation are presentedin Zalesak [102].

Sweby also discusses the manner in which this approach is extended to non-

linear scalar conservation laws. The basic idea is to replace ν = ak / h by a “local

ν” defined at each interface by

ν j+ 12

= k 

h

 f (U  j+1) − f (U  j )

U  j+1 − U  j. (16.29)

The resulting formulas are somewhat complicated and will not be presented here.

They are similar to thenonlinear generalization of the slope-limiter methods which

will be presented below.Generalization to nonuniform wave speeds. In the above description we

assumed a > 0. Obviously, a similar method can be defined when a < 0 by

again viewing Lax–Wendroff as a modification of the upwind method, which is

now one-sided in the opposite direction. It is worth noting that we can unify these

methods into a single formula. This is useful in generalizing to linear systems

and nonlinear problems, where both positive and negative wave speed can exist

simultaneously.

Recall that the upwind method for a linear system can be written in the form

(13.15), which in the scalar case reduces to

F  L (U ; j + 12

) = 12

a(U  j + U  j+1) − 12|a|(U  j+1 − U  j ) (16.30)

and is now valid for a of either sign. Also notice that the Lax–Wendroff flux can

be written as

F  H (U ; j + 12

) = 1

2a(U  j + U  j+1) − 1

2νa(U  j+1 − U  j ). (16.31)

This can be viewed as a modification of F  L in (16.30) and introducing a limiter as

in (16.10) gives the high resolution flux

F (U ; j + 12

) = F  L (U ; j + 12

) + 1

2[sgn(ν) − ν] a(U  j+1 − U  j ) φ j

+12

. (16.32)

Note that we have used the fact that |a| = sgn(a) a = sgn(ν) a, since ν = ak / h

and k , h > 0. The flux limiter φ j+ 12

is again of the form φ j+ 12

= φ (θ  j+ 12

), but

now take θ  j+ 12

to be a ratio of consecutive slopes in the upwind direction, which

depends on sgn(ν), as follows

θ  j+ 12

= (U ; j + 12

) =

U  j − U  j−1

U  j+1 − U  jfor ν > 0

U  j+2 − U  j+1

U  j+1 − U  jfor ν < 0.

116

Page 117: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 117/195

Page 118: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 118/195

16.2.2 Nonlinear systems

For nonlinear systems of hyperbolic equations a similar form of the numerical flux

is possible, based on the linearization provided by Roe’s matrix. For completeness

we give the details of this generalization although the resulting method is similar

to the slope-limiter method presented below. The natural way to generalize this

methodto a nonlinear systemis to linearize the equations in a neighborhoodofeach

cell interface x j+ 12

and apply the method the previous section to some linearized

system3

∂t u + A j+ 12

∂ x u = 0.

Following our discussion of Roe’s approximate Riemann solution (Section 14.2),

we take A j+ 12

= A(U j , U j+1), where A(U j , U j+1) is some Roe matrix satisfying

condition (14.19). We denote the eigenvalues and eigenvectors of A j+ 12

by λ p, j+ 12

and r p, j+ 12

respectively, so that

A j+ 12

r p, j+ 12

= λ p, j+ 12

r p, j+ 12

for p = 1, 2, . . . , m.

Recall that the flux function for Godunov’s method with Roe’s approximate Rie-

mann solver is given by (14.22), which we rewrite as

F L (U

;j

+12

)

=

1

2f (U j )

+f (U j+1)−

1

2A j

+12 (U j+1

−U j ),

whereA j+ 1

2

= R j+ 1

2

 j+ 12

R−1

 j+ 12

, while the Lax–Wendroff flux for the nonlin-

ear system is

F H (U; j + 12

) = 1

2

f (U j ) + f (U j+1)

− k 

2hA2

 j+ 12

(U j+1 − U j ).

The difference between these is

F H (U; j + 12

) − F L (U; j + 12

) = 1

2

A j+ 1

2

− k 

2hA2

 j+ 12

(U j+1 − U j )

=1

2

m p=1

sgn

ν p, j+ 12

− ν p, j+ 12

λ p, j+ 1

2α p, j+ 1

2r p, j+ 1

2

where α p, j+ 12

is the coefficient of r p, j+ 12

in an eigenvector expansion of the dif-

ference U j+1 − U j ,

U j+1 − U j =m

 p=1

α p, j+ 12

r p, j+ 12

.

3To have simpler expressions, the time superscript n has been drop from the Jacobian matrix of 

the more appropriate linearized system ∂t u + An j+ 1

2

∂ x u = 0.

118

Page 119: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 119/195

Thus, the flux of the high-resolution method for the linearized system has the form

F(U; j + 12

) = F L (U; j + 12

)

+ 1

2

m p=1

sgn

ν p, j+ 12

− ν p, j+ 12

λ p, j+ 1

 p, j+ 12

φ (θ  p, j+ 12

) r p, j+ 12

,

where

θ  p, j+ 12

=α p, j ′ p+ 1

2

α p, j+ 12

with j ′ p =

 j − 1 if  ν p, j+ 1

2> 0

 j + 1 if  ν p, j+ 12

< 0.

A simple method for evaluating the vector α j ′p+12 of the upwinded characteristic

variations is given by the relation

α p, j ′ p+ 12

= 12

α p, j− 1

2+ α p, j+ 3

2

+ 12

α p, j− 1

2− α p, j+ 3

2

sgn

ν p, j+ 12

.

In practice, this relation is difficult to be implemented since it requires the char-

acteristic variations α j− 12

and α j+ 32

which are evaluated by means of different

linearizations at the interfaces at x j− 12

and x j+ 32, and not that at x j+ 1

2. To have an

algorithm processing each interface independently from any other, we canevaluate

the two characteristic variations approximately by employing the local lineariza-

tion at x j

+1

2

, as follows:

α j− 12

= R−1

 j+ 12

(U j − U j−1) and α j+ 32

= R−1

 j+ 12

(U j+2 − U j+1),

and then use the previous formula to generate an approximate upwinded charac-

teristic variation.

16.3 Slope-limiter methods

The secondapproachwewill study ismoregeometric in nature. The basic idea is to

generalize Godunov’s method by replacing the piecewise constant representation

of the solution by some more accurate representation, say piecewise linear (anddiscontinuous).

Recall that Godunov’s method can be viewed as consiting of the following

three steps (although it is not typically implemented this way):

Algorithm 16.1

1. Given data {U n j }, construct a function un( x , t n). (Piecewise constant in

Godunov’s method.)

2. Solve the conservation law exactly with this data to obtain un( x, t n+1).

119

Page 120: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 120/195

3. Compute cell averages of the resulting solution to obtain U n+1 j .

To generalize this procedure, we replace Step 1 by a more accurate reconstruction,

taking for example the piecewise linear function

un( x , t n) = U n j + σ n j ( x −  x j ) on the cell [ x j− 12

, x j+ 12]. (16.41)

Here σ n j is a slope on the j th cell which is based on the data U n. For a system

of equations, σ n j ∈ Rm is a vector of slopes for each component of u. Note that

taking σ n j = 0 for all j and n recovers Godunov’s method.

The cell average of un( x, t n) from (16.41) over [ x j− 12

, x j+ 12] is equal to U n j for

any choice of σ n j . Since Steps 2 and 3 are also conservative, the overall method is

conservative for any choice of σ n j .For nonlinear problems we will generally not be able to perform Step 2 exactly.

Theconstruction of theexactsolution un( x , t ) basedon solving Riemann problems

no longer works when un( x, t n) is piecewise linear. However, it is possible to

approximate the solution in a suitable way, as will be discussed below.

The most interesting question is how do we choose the slopes σ n j ? We will see

below that for the linear advection equation with a > 0, if we make the natural

choice

σ n j = U n j+1 − U n j

h(16.42)

and solve the advection equation exactly in Step 2, then the method reduces tothe Lax–Wendroff method. This shows that it is possible to obtain second order

accuracy by this approach.

The oscillations which arise with Lax–Wendroff can be interpreted geomet-

rically as being caused by poor choice of slopes, leading to a piecewise linear

reconstruction un( x, t n) with a much larger total variation than the given data U n .

See Figure 16.3a for an example. We can rectify this by applying a slope limiter

to (16.42), which reduces the value of this sope near discontinuities or extreme

points, and is typically designed to ensure that:

T V (u

n

( · , t n)) ≤ T V (U 

n

). (16.43)

The reconstruction shown in Figure 16.3b, for example, has this property. Since

Steps 2 and 3 of Algorithm 16.1 are TVD, imposing (16.43) results in a method

that is TVD overall, proving the following result.

Theorem 16.4. If the condition (16.43) is satisfied in Step 1 of Algorithm

16.1, then the method is TVD for scalar conservation laws.

Methods of this type were first introduced by van Leer in a series of papers [88]

through [92] where he develops the MUSCL Scheme (standing for “Monotonicity

120

Page 121: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 121/195

Upstream-centeredScheme for ConservationLaws”). A varietyof similar methods

have since been proposed, e.g., [9], [26].The reconstruction of Step 1 can be replaced by more accurate approximations

as well. One can attempt to obtain greater accuracy by using quadratic, as in the

piecewise parabolic method (PPM) of Colella and Woodward [10] or even higer

order reconstructions as in the ENO (essentially nonoscillatory) methods [29],

[34]. (See Chapter 17.)

Again, we will begin by considering the linear advection equation, and then

generalize to nonlinear equations. For the linear equation we can perform Step 2

of Algorithm 16.1 exactly and obtain formulas that are easily reinterpreted as flux-

limiter methods. This shows the close connection between the two approaches

and also gives a more geometric interpretation of the TVD constraints discussedabove.

For the advection equation, the exact solution un( x, t n+1) is simply

un( x, t n+1) = un( x − ak , t n) (16.44)

and so computing the cell average in Step 3 of Algorithm 16.1 amounts to inte-

grating the piecewise linear function defined by (16.41) over the interval [ x j− 12−

ak , x j+ 12− ak ]. It is straight forward to calculate that (for a > 0)

U n+1

 j =U n

 j −ν(U n

 j −U n

 j−1)−

1

2ν(1

−ν)(hσ n

 j −hσ n

 j−1). (16.45)

If σ n j = 0 this reduces to the upwind method, while for σ n j given by (16.42) it

reduces to the Lax–Wendroff, in the form (16.12).

Note that the numerical flux for (16.45) is

F (U ; j + 12

) = aU  j + 1

2a(1 − ν)hσ  j (16.46)

which has exactly the same form as the flux-limiter method (16.13) if we set

σ  j

=U  j+1 − U  j

h

φ j

+12

. (16.47)

In this context the “flux-limiter” φ j+ 12

can be reinterpreted as a “slope-limiter”.

More generally, for a of either sign we have

U n+1 j = U n j − ν

U n ja

− U n ja−1

− 1

2ν[sgn(ν) − ν]hσ n ja

− hσ n ja−1

(16.48)

where

 ja =

 j if  a > 0

 j + 1 if  a < 0.(16.49)

121

Page 122: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 122/195

The corresponding flux function is

F (U ; j + 12

) = aU  ja+ 1

2a[sgn(ν) − ν] hσ  ja

. (16.50)

The first term here is simply the upwind flux and again we have a direct correspon-

dence between this formula and the flux-limiter formula (16.32).

Exercise 16.3. Verify (16.45) and (16.48).

In studying flux-limiter methods, we derived algebraic condition that φ j+ 12

must satisfy to give a TVD method. Using piecewise linear interpretation, we can

derive similar conditions geometrically using the requirement (16.43).

One simple choice of slopes satisfying (16.43) is the so-called minmod slope,

σ  j = 1

hminmod(U  j+1 − U  j , U  j − U  j−1) (16.51)

where the minmod function is defined by

minmod(a, b) =

a if  |a| < |b| and ab > 0

b if  |b| < |a| and ab > 0

0 if  ab ≤ 0

=1

2[sgn(a)

+sgn(b)

]min(

|a

|,

|b

|).

(16.52)

Figure 13.3b shows the minmod slopes for one set of data.

We canrewrite theminmodslope-limiter methodas a flux-limitermethod using

(16.47) if we set

φ(θ) =

0 if  θ  ≤ 0

θ  if 0 ≤ θ  ≤ 1

1 if  θ  ≥ 1

= max(0, min(1,θ)).

(16.53)

Recall that θ  j+ 12

= (U  j − U  j−1)/(U  j+1 − U  j ), for a > 0 and so (16.47) withφ j+ 1

2= φ (θ  j+ 1

2) and given by (16.53) reduces to (16.15). This limiter function

lies along the lower boundary of Sweby’s “second order TVD region” of Figure

16.1b.

Note that again φ(θ) = 0 for θ  ≤ 0, which now corresponds to the fact that we

set the slope σ  j to zero at extreme points of U , where the slopes (U  j+1 − U  j )/ h

and (U  j − U  j−1)/ h have opposite signs. Geometrically, this is clearly required

by (16.43) since any other choice will give a reconstruction un( x , t n) with total

variation greater than T V (U n).

122

Page 123: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 123/195

Although the minmod limiter (16.51) is a simple choice that clearly satisfies

(16.43), it is more restrictive than necessary and somewhat larger slopes can oftenbe taken without violating (16.43), and with greater resolution. Moreover, it is

possible toviolate (16.43) and stillobtain a TVD method, since Step3 ofAlgorithm

16.1 tends to reduce the total variation, and may eliminate overshoots caused in

the previous steps.

A variety of other slope limiters have been developed. In particular, any of 

the flux limiters discussed above can be converted into slope limiters via (16.47).

Conversely, a geometrically motivated slope limiter can often be converted into

a flux limiter function φ(θ). (In fact, van Leer’s limiter (16.28) was initially

introduced as a slope limiter in [89].

16.3.1 Linear systems

For a linear system of equations, we can diagonalize the system and apply the

algorithm derived above to each decoupled scalar problem. Using the notation

of Section 16.2.1, we let Vn j = R−1Un

 j have components V n p, j so that Un j =m

 p=1 V n p, j r p. We also set

 j p =

 j if  λ p > 0

 j + 1 if  λ p < 0(16.54)

generalizing ja defined in (16.49). Then the method (16.48) for each V n p takes the

form (mitting the superscript n to simplify the formulas)

V n+1 p, j = V  p, j − ν p

V  p, j p − V  p, j p−1

+ 1

2ν p

sgn(ν p) − ν p

hβ p, j p

− hβ p, j p−1

(16.55)

where ν p = k λ p/ h and β p, j is the slope for V  p in the j th cell. For example we

may take

β p, j

=

1

h

minmod(V  p, j

+1

−V  p, j , V  p, j

−V  p, j

−1)

= 1

hminmod

α p, j+ 1

2, α p, j− 1

2

.

(16.56)

123

Page 124: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 124/195

Multiplying (16.55) by r p and summing over p gives

Un+1 j =

m p=1

V n+1 p, j r p

= Un j − k 

h

m p=1

V  p, j p λ p r p − V  p, j p−1 λ p r p

+ 1

2

m p=1

λ p

sgn(ν p) − ν p

hσ  p, j p

− hσ  p, j p−1

,

(16.57)

where σ  p, j is the slope vector for the pth family,

σ  p, j = β p, j r p ∈ Rm . (16.58)

Recalling that the upwind flux F L (U, j + 12

) in (16.58) can also be written as

F L (U, j + 12

) =m

 p=1

V  p, j p λ p r p, (16.59)

we see that the flux of the high resolution method (16.57) has the form

F(U; j +12 ) = F L (U, j +

12 ) +

1

2

m p=1

λ psgn(ν p) − ν p

h σ  p, j p , (16.60)

where theoccurrence of the subscript j p in the slope σ , defined by (16.37), must be

noticed. Note that this is identical with the flux (16.40) for the flux-limiter method

on a linear system if we identify

σ  p, j p = φ

θ  p, j+ 12

α p, j+ 12

hr p, (16.61)

generalizing (16.47).

Exercise 16.4. Verify that (16.61) holds when σ  p, j

is given by (16.58) and 

(16.56), θ  p, j+ 12

is given by (16.37), and φ is the minmod limiter (16.53).

16.3.2 Nonlinear scalar equation

In attempting to apply Algorithm 16.1 to a nonlinear problem, the principle dif-

ficulty is in Step 2, since we typically cannot compute the exact solution to the

nonlinear equation with piecewise constant initial data. However, thereare various

ways to obtain approximate solutions which are sufficiently accurate that second

order accuracy can be maintained.

124

Page 125: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 125/195

I will describe one such approach based on approximating the nonlinear flux

function by a linear function in the neighborhood of each cell interface, and solvingthe resulting linear equation exactly with the piecewise constant data. This type of 

approximation has already been introduced in the discussion of Roe’s approximate

Riemann solver in Chapter 14. The use of this approximation in the context of high

resolution slope-limiter methods for nonlinear scalar problems is studied in [26].

Here I will present the main idea in a simplified form, under the assumption

that the data si monotone (say nonincreasing) and that f ′(u) does not change sign

over the range of the data (say f ′(U n j ) > 0). A similar approach can be used near

extreme points of U n j and sonic points, but more care is required and the formulas

are more complicated (see [26] for details). Moreover, we will impose the time

step restrictionk 

hmax | f ′(U n j )| ≤ 1

2(16.62)

although this can alsobe relaxed to the usual CFL limit of 1 with somemodification

of the method.

With the above assumptions on the data, we can define a piecewise linear

function ˆ f (u) by interpolation between the values (U n j , f (U n j )), as in Figure 16.4.

We now define un( x , t ) by solving the conservation law

∂t u + ∂ xˆ f (u) = 0 (16.63)

for t n ≤ t  ≤ t n+1, with the piecewise linear data (16.41). The evolution of un( x, t )

is indicated in Figure 16.5.

The flux is still nonlinear, but the nonlinearity has been concentrated at the

points U n j . Jumps form immediately at each points x j , but because of the time step

(16.62), these jumps do not reach the cell boundary during the time step. Hence

we can easily compute the numerical flux

F (U n; j + 12

) = t n+1

t n

ˆ f 

un( x j+ 12

, t )

dt . (16.64)

At each cell boundary x j+ 12 , the solution values lie between U n j and U 

n j+1 for

t n ≤ t  ≤ t n+1 and hence

ˆ f 

un( x j+ 12

, t ) = f (U n j ) + un( x j+ 1

2, t ) − U n j

an

 j+ 12

, (16.65)

where

an j+ 1

2

=  f (U n j+1) − f (U n j )

U n j+1 − U n j. (16.66)

125

Page 126: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 126/195

The conservation law ∂t 

ˆu

+∂ x

ˆ f (

ˆu)

=0 reduces to the advection equation ∂t 

ˆu

+an j+ 1

2∂ x u = 0 near x j+ 1

2and so

un( x j+ 12

, t ) = un x j+ 1

2− (t  − t n) an

 j+ 12

, t n

= U n j +

h

2− (t  − t n) an

 j+ 12

σ n j .

Finally, using again (16.65), we compute the numerical flux (16.64) to be

F (U n; j + 12

) = 1

k  t n+1

t n  f (U n j ) + h

2− (t  − t n) an

 j+ 12 σ n j an

 j+ 12 dt 

= f (U n j ) + 1

2an

 j+ 12

1 − k 

han

 j+ 12

h σ n j .

(16.67)

For the linear advection equation this reduces to (16.46). For σ n j ≡ 0 this reduces

to the upwind flux f (U n j ). With this choice of slopes (16.42), it reduces to

F (U n; j + 12

) = 1

2

 f (U n j ) + f (U n j+1)

− k 

2h

 f (U n j+1) − f (U n j )

2U n j+1 − U n j

, (16.68)

which is a form of the Lax–Wendroff method for scalar nonlinear problems. Also

notice the similarity of (16.67) to the flux-limiter formula (16.14). With the corre-

spondence (16.47), (16.67) is clearly a generalization of (16.14) to the nonlinear

case. (Note that k an j+ 1

2

/ h is precisely νn j+ 1

2

defined through (16.29).)

To obtain a high resolution TVD method of this form, we can again choose the

slope σ  j as in the linear case, for example using the minmod slope (16.51), so that

the total variation bound (16.43) is satisfied.

Notice that, although we do not solve our original conservation law exactly

in Step 2 of Algorithm 16.1, we do obtain un as the exact solution to a modified

conservation law, and hence un is total variation diminishing. By using a slope

limiter that enforces (16.43), we obtain an overall method for the nonlinear scalar

problem that is TVD.

16.3.3 Nonlinear systems

The natural way to generalize this method to a nonlinear system of equations is to

linearize the equations in a neighborhood of each cell interface x j+ 12

and apply the

method of Sections 16.3.1 to some linearized system

∂t u + A j+ 12

∂ x u = 0. (16.69)

126

Page 127: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 127/195

This is what we did in the scalar case, when the linearization was given by

(16.66). We have already seen how to generalize (16.66) to a system of equa-tions in our discussion of Roe’s approximate Riemann solution (Section 14.2). We

take A j+ 12

= A(U j , U j+1), where A(U j , U j+1) is some Roe matrix satisfying

condition (14.19). We denote the eigenvalues and eigenvectors of A j+ 12

by λ p, j+ 12

and r p, j+ 12

respectively, so that

A j+ 12

r p, j+ 12

= λ p, j+ 12

r p, j+ 12

for p = 1, 2, . . . , m.

Recall that the flux function for Godunov’s method with Roe’s approximate Rie-

mann solver is given by (14.22), which we rewrite as

F L (U; j + 12

) = f (U j ) +m

 p=1

λ− p, j+ 1

2

α p, j+ 12

r p, j+ 12

, (16.70)

where λ− p, j+ 1

2

= min(λ p, j+ 12

, 0) and α p, j+ 12

is the coefficient of  r p, j+ 12

in an

eigenvector expansion of U j+1 − U j ,

U j+1 − U j =m

 p=1

α p, j+ 12

r p, j+ 12

. (16.71)

If we set ν p, j+ 12 = k α p, j+ 1

2 / h, then the natural generalization of (16.60) to thenonlinear system is

F(U; j + 12

) = F L (U; j + 12

) + 1

2

m p=1

λ p, j+ 12

sgn

ν p, j+ 12

− ν p, j+ 12

h σ  p, j p ,

(16.72)

where σ  p, j ∈ Rm is some slope vector for the pth family. Here the subscript j p is

defined by

 j p =

 j if  ν p, j+ 12

> 0

 j

+1 if 

ˆν p, j

+1

2

< 0

and therefore depends on the local eigenvalue λ p, j+ 12

of the linearized problem.

Note that combining (16.56) and (16.58) gives the following form for σ  p, j in

the case of a linear system

σ  p, j = 1

hminmod

α p, j+ 1

2, α p, j− 1

2

r p. (16.73)

For our nonlinear method, r p is replaced by r p, j+ 12

which now varies with j .

Moreover, it is only the vectors α p, j+ 12

r p, j+ 12

and α p, j− 12

r p, j− 12

that are actually

127

Page 128: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 128/195

computed in Roe’s method, not the normalized

ˆr p, j

+1

2

and coefficient

ˆα p, j

+1

2separately, and so the natural generalization of (16.73) to the nonlinear case is

given by

σ  p, j = 1

hminmod

α p, j+ 1

2r p, j+ 1

2, α p, j− 1

2r p, j− 1

2

, (16.74)

where theminmodfunction is now applied componentwise to thevector arguments.

Of course the minmod function in (16.74) could be replaced by any other slope

limiter, again applied componentwise. The “high resolution” results presented in

Figure 1.4 were computed by this method with the superbee limiter.

In deriving this method we have ignored the entropy condition. Since we

use Roe’s approximate Riemann solution, which replaces rarefaction waves by

discontinuities, we must in practice apply an entropy fix as described in Section14.2.2. The details will not be presented here.

The flux (16.72) with slope (16.74) gives just one high resolution method for

nonlinear systems of conservation laws. It is not the most sophisticated or best,

but it is a reasonable method and our development of it has illustrated many of the

basic ideas used in many other methods. The reader is encouraged to explore the

wide variety of methods available in the literature.

16.4 Program ofthe numerical flux forthe highresolutionmethod

For completeness we provide the computer program implementing the numericalflux for the high resolution method for the P-System of the isothermal gas.

SUBROUTINE uhr_num_flux (dt, xx, ww, FF_hr, F_SO, limiter)

! ORDERED GRID

! Given the vector xx of nodal points and the vector ww

! of the cell average of the conservative variables,

! the program calculates the vertical flux of the high

! resolution method for the unsteady Euler equations

! of gasdynamics for a polytropic ideal gas

IMPLICIT NONE

REAL(KIND=8), INTENT(IN) :: dt

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: xx

REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: ww

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: FF_hr

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: F_SO ! (:,2)

INTEGER, INTENT(IN) :: limiter

REAL(KIND=8), DIMENSION(SIZE(ww,1), SIZE(ww,2)) :: ff

128

Page 129: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 129/195

REAL(KIND=8), DIMENSION(2,2) :: R, L !, ABS_A

REAL(KIND=8), DIMENSION(2) :: lambda, A_lambda_ef, &

lambda_l, lambda_r, &

lambda_i, &

wi, dv, dvl, dvr

REAL(KIND=8) :: dx, N_l, P_l, P_r, N_r, dv_upw_p, psi

REAL(KIND=8), PARAMETER :: half = 0.5d0, zero = 0

INTEGER :: i, j, p, Np

dx = xx(2) - xx(1)

ff = flux(ww) ! Store the nodal fluxes to avoid a double

! evaluation of the flux at the grid nodes

DO i = 1, S IZE(FF_hr, 2 ); j = i

CALL Roe_linearization (ww(:,j), ww(:,j+1), lambda, L, R)

dv = MATMUL(L, ww(:,j+1) - ww(:,j)) ! variation of the

! characteristic variables

! LeVeque version of Harten and Hyman ENTROPY FIX

! implemented by means of Marica’s symmetric expression

! states and TRUE characteristic speeds

wi = ww(:,j) + R(:,1) * dv(1)

lambda_l = eigenvalue(ww(:,j))

lambda_r = eigenvalue(ww(:,j+1))

lambda_i = eigenvalue(wi)

N_l = MIN(lambda_l(1), 0.0d0); P_l = MAX(lambda_i(1), 0.0d0)

P_r = MAX(lambda_r(2), 0.0d0); N_r = MIN(lambda_i(2), 0.0d0)

A_lambda_ef = ABS(lambda)

IF ( P_l / = N_l) &

A_lambda_ef(1) = ((P_l + N_l)*lambda(1) - 2*P_l*N_l)/(P_l - N_l)

129

Page 130: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 130/195

IF ( P_r / = N_r) &

A_lambda_ef(2) = ((P_r + N_r)*lambda(2) - 2*P_r*N_r)/(P_r - N_r)

! The first and last interface are treated by extrapolating

! outside the computational interval

! A linear extrapolation retains high resolution accuracy

IF (j == 1) THEN ! first left interface:

dvl = MATMUL(L, ww(:,j+1) - ww(:,j)) ! linear extratopation

ELSE

dvl = MATMUL(L, ww(:,j) - ww(:,j-1))

ENDIF

IF (j + 1 == SIZE(xx)) THEN ! last right interface:

dvr = MATMUL(L, ww(:,j+1) - ww(:,j)) ! linear extrapolation

ELSE

dvr = MATMUL(L, ww(:,j+2) - ww(:,j+1))

ENDIF

! centered contribution to the numerical flux in symmetric form

FF_hr(:, i) = (ff(:,j) + ff(:,j+1)) / 2

D O p = 1 , 2

! upwind variation of the

dv_upw_p = (dvl(p) + dvr(p)) / 2 & ! characteristic variables

+ (dvl(p) - dvr(p)) * SIGN(half, lambda(p))

psi = psi_lim(dv(p), dv_upw_p, limiter)

FF_hr(:, i) = FF_hr(:, i) &

+ R(:,p) * ( - A_lambda_ef(p) * dv(p) &

+ (A_lambda_ef(p) - dt*lambda(p)**2/dx) * psi ) / 2

ENDDO

ENDDO ! cycle on the interfaces

! Second Order Surface Contribution to the Numerical Flux

Np = SIZE(xx)

F_SO(:, 1) = - (dt/(2*dx)) * MATMUL(AA(ww(:,1)), ff(:,2) - ff(:,1))

130

Page 131: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 131/195

F_SO(:, 2) = (dt/(2*dx)) * MATMUL(AA(ww(:,Np)), ff(:,Np) - ff(:,Np-1))

END SUBROUTINE uhr_num_flux

131

Page 132: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 132/195

11 Conclusion

This report haspresented some modernnumerical techniques for solving nonlinear

hyperbolic equations and system of equations. This kind of mathematical prob-

lems are encountered in the solution of the fluid dynamic equations expressing

the conservation of mass, momentum and energy when any physical dissipation

mechanism is drop out from the governing equations. Such an amputation reduces

the full compressible Navier–Stokes equations to the Euler equations of gasdy-

namics. At the same time, the nonlinearity present in both mathematical models

of compressible flows can produce a steepening of smooth initial data which can

break down and degenerate to true disocontinuities of the field variables in the

inviscid case. The mathematical difficulties implied by the occurrence of shock waves and/or other discontinuities in the solution require one to introduce special

numerical tools for predicting transonic and supersonic flows.

We have described initially the mathematical concepts associated with the

aforementioned mechanisms in connection with the very simple example of a

scalar conservation law in one dimension: the traffic flow equation. After intro-

ducing the basic idea of weak solutions in the context of a single nonlinear hy-

perbolic equation, we have demonstrated the Rankine–Hugoniot jump condition

which embodies what a weak solution must obey in the presence of a discontinuity.

This has allowed us to give a preliminary presentation of the numerical method

proposed by Godunov to calculate discontinuous solution.

The rest of the work is dedicated to the study of systems of nonlinear hyper-

bolic equations. We have taken a very simple and most convenient example of 

the gasdynamic equations in one dimension for an isothermal ideal gas. First we

have described this mathematical representation of this physical model and have

determined its eigenvalues and eigenvectors to be able to characterize the nonlin-

ear or linear nature of the considered hyperbolic system. Subsequently we have

introduced the idea of Riemann problem and have computed some simple solution

for the two equations of an isthermal ideal gas. They can be either a propagat-

ing discontinuity, called shock wave, or fans of similarity solutions described as

rarefaction waves.

Equipped with these simple solutions, we have formulated the Riemann prob-lem for the considered gas dynamic system and described how it can be solved.

In particular, following Landau and Lifshitz, we have shown how the kind of so-

lution of any Riemann problem can be predicted a priori from its initial data by

calculating a pair or relative velocities which represent the limiting values beween

solutions with left and right waves of different types.

After the exact Riemann solver for the isothermal gas model has been elab-

orated, the Godunov method is introduced. Then there is complete and rather

detailed analysis of how to develop a linearized version of the Riemann solver,

132

Page 133: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 133/195

following the idea of a conservative linearization introduced by Philip Roe. In this

context, the idea of the entropy fix is also discussed and an algorithm for obtainingan entropy fix respectful of conservation has been described in the scalar case.

The discretization of hyperbolic equations due to Lax and Wendroff is also

described. This scheme has a second order accuracy both in time and in space and

it can be formulated in conservation form for nonlinear equations, which is of the

fundamental importance for obtaining weak solutions. The method based on Roe

linearization can be finally combined with the conservative Law–Wendroff scheme

to derive a high resolution method. This rather sophisticated numerical tool has

been implemented successfully, although the details of its formulation have not yet

documented in the present version of the report. The reader interested in the most

recent developments concerning methods based on Godunov method and usingRiemann solver is referred to the monographs of Toro [15] and Guinot [6].

The report contains also two appendices. In the first appendix we have de-

scribed the Riemann problem for the P-system expressed in the conservative vari-

ables and in the Eulerian frame. A formulation of the problem as a system of two

nonlinear equations is presented for the first time which opens an original line of 

attack to demonstrate existence anduniqueness of the solution for large data. In the

second appendix we have presented a general and clever procedure due to Alberto

Guardone for satisfying the boundary conditions in hyperbolic systems.

133

Page 134: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 134/195

References

[1] A. Bressan, Hyperbolic Systems of Conservation Laws, Oxford University

Press, 2000.

[2] S. Chandrasekhar , Newton’s Principia for the Common Reader , Oxford

University Press, Clarendon Press, Oxford, 1995.

[3] M. Calori, A. Di Donato, D. Pavanello and A. Pirrotta,

“Equazioni del traffico (Traffic Flow Equations)”, Student Report, updated

version of 2007.

[4] E. God lewski a nd P.-A. Raviart, Numerical Approximation of Hyper-

bolic Systems of Conservation Laws, Springer-Verlag, New York, 1996.[5] S. K. Godunov, “A difference method for the numerical computation of 

discontinuous solutions of the equations of hydrodynamics,” Mat. Sb., 47,

271–306, 1959.

[6] V. Guinot, Godunov-Type Schemes, An Introduction for Engineers, Else-

vier, Amsterdam, 2003.

[7] L. D. Landau and E. M. Lifshitz, Fluid Mechanics, second ed., Perga-

mon Press, New York, 1987.

[8] R. J. LeVeque, Numerical Methods for Conservation Laws, Birkhäuser,

Basel, 1992.[9] R. J. LeVeque, Finite Volume Methods for Hyperbolic Problems, Cam-

bridge University Press, 2002.

[10] R. J. LeVeque, D. Mihalas, E. Dor − and E. Müller, Computational

 Methods for Astrophysical Fluid Flow, Saas-Fee Advanced Course 27, A.

Gautschy and O. Steiner, Eds., Springer 1998.

[11] M. Luskin and B. Temple, “Theexistence ofa globalweaksolution to the

non-linear waterhammer problem”, Comm. Pure and Applied Math., XXXV,

697–735, 1982.

[12] M. Pelanti, “Condizioni di entropia e positività nei solutori di Riemannapprossimati,” Tesi di laurea, Dipartimento di Ingegneria Aerospaziale, Po-

litecnico di Milano, 1999.

[13] P. L. Roe, “Approximate Riemann solvers, parameter vectors and difference

schemes,” J. Comput. Phys., 43, 357–372, 1981.

[14] L. Quartapelle, L. Castelletti, A. Guardone and G. Quar-

anta, “Solution of the Riemann problem of classical gasdynamics,” J. Com-

 put. Phys., 190, 118–140, 2003.

134

Page 135: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 135/195

[15] E. F. Toro , Riemann Solvers and Numerical Methods for Fluid Dynamics,

Springer-Verlag, New York, second ed., 1999.

[16] S. Wiggins , Introduction to Applied Nonlinear Dynamical System and 

Chaos, Springer, 199?.

[17] R. Young, “The p-system. I: The Riemann problem and II: The vacuum,”

submitted for publication, 2001.

135

Page 136: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 136/195

A P-system and its Riemann problem

In this appendix we discuss the Riemann problem for the P-system which is the

prototypical systemof nonlinear conservation laws in that it represents thesimplest

nontrivial system of two nonlinear hyperbolic equations. Following the work of 

Robin Young [17] we attack the Riemann problem for the P-system in general form

to identify the constitutive assumptions whose understanding is critical to grasp

also other systems of great physical importance.

The equations of the system are formulated according to the standard Eulerian

description and using the conservative variables which are convenient for dealing

with the shock waves. Moreover, an original parametrization of the state along the

shock wave solution is introduced which extends in the most natural way and withthe required continuity theparametric representation of therarefactionwaves in the

opposite direction, as dictated by the entropy condition. This new parametrization

allows one to frame the Riemann problem for the P-system as a system of  two

nonlinear equations, which has a more symmetric appeal than the classical form

characterized by a single equation. For these reasons, this new parametrization

can be termed canonical. The proposed formulation leads to a new line of attack 

to the proof of existence and uniqueness of solution of the Riemann problem for

arbitrary initial data but assuming convexity. The extension of this proof to the

nonconvex case is not attempted here but it is expected to be feasible by a proper

exploitation the Oleinik entropy condition, at least for the particular situation of 

two inflection points.

A.1 The P-system and its eigenstructure

Consider the system of two conservation laws in one dimension

∂t ρ + ∂ x m = 0

∂t m + ∂ x

m2/ρ + P(ρ)

= 0(A.1.1)

for the unknowns mass density ρ and momentum density m, where P(ρ) is a givenpressure function. We assume that function P(ρ) is differentiable and satisfies the

following asymptotic conditions

limρ→0

P(ρ) = 0 and limρ→∞ P(ρ) = ∞ (A.1.2)

The first condition means, in principle, the possibility of a vacuum state with

null pressure while the second rules out infinite compression. Other fundamental

assumptions will be made in the following.

136

Page 137: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 137/195

In particular,when P(ρ)

=a2ρ theP-systemabove reduces to theconservation

laws for an isothermal ideal gas described in section 4.The quasilinear form of the general P-system is

∂t w + A(w)∂ x w = 0 (A.1.3)

where w = (ρ, m) with the Jacobian matrix defined by

A(w) ≡

0 1

P ′(ρ) − m2

ρ2

2m

ρ

(A.1.4)

The eigenvalue problem for the Jacobian A(w) consists in finding the values ξ 

which make to vanish the determinant of matrixA(w) − ξ I

, namely:

−ξ  1

P ′(ρ) − m2

ρ2

2m

ρ− ξ 

= 0 (A.1.5)

[The eigenvalue is denoted by letter ξ  instead of the more common λ for later use

as the similarity variable ξ  = x/t  used for calculating the rarefaction waves.] The

characteristic equation

ξ 2 − 2m

ρξ  + m2

ρ2− P ′(ρ) = 0 (A.1.6)

has solutions

ξ 1,2(w) = m

ρ∓ 

P ′(ρ) (A.1.7)

where the eigenvalues are taken in increasing order. Thus hyperbolicity requires

the pressure function to satisfy

P ′(ρ) > 0 (hyperbolicity) (A.1.8)

a condition which allows to introduce the speed of sound a in the system according

to the definition

a(ρ) ≡ 

d P(ρ)

d ρ(A.1.9)

We notice in passing that alternative representations of the P-system are possible,

but all lead to one and the sameeigenstructure of the physical system. For instance,

137

Page 138: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 138/195

the density could be replaced by the specific volume v

≡1/ρ and in the new

representation (v, m) the quasilinear form of the P-system would be∂t v

∂t m

+ A(v, m)

∂ x v

∂ x m

= 0 (A.1.10)

with the new Jacobian matrix defined by

A(v, m) ≡

0 −v2

m2 + Q′(v) 2vm

(A.1.11)

and the new constitutive relation for pressure given by Q(v)

≡P(ρ)

=P(1/v).

The characteristic equation in this representation would assume the form

ξ 2 − 2vm ξ  + v2

m2 + Q′(v) = 0 (A.1.12)

and the eigenvalues would be

ξ 1,2(v, m) = v

m ∓ 

−Q′(v)

(A.1.13)

Coming back to the representation (ρ, m) = w, let us determine the eigenvectors.

A direct calculation gives

r1,2(w) = 1

m

ρ∓ √ 

P ′(ρ)

(A.1.14)

To find the nonlinearity property of the modes the gradient of the eigenvalues

∇λ(w) = ∂λ(w)

∂ρρ + ∂λ(w)

∂mm (A.1.15)

are needed. By direct differentiation we find

∇λ1,2

(w)= −

m

ρ2 ∓P ′′(ρ)

2√ P ′(ρ) ˆρ

+1

ρ ˆm (A.1.16)

The scalar product of the gradient of the eigenvalue by the corresponding eigen-

vector yields

r1,2(w) ·∇λ1,2(w) = ∓2P ′(ρ) + ρ P ′′(ρ)

2ρ√ 

P ′(ρ)(A.1.17)

It is convenient to introduce the dimensionless function,

Ŵ(ρ) = 1

a(ρ)

d [ρa(ρ)]d ρ

= 1 + ρP ′′(ρ)

2P ′(ρ)

138

Page 139: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 139/195

called fundamental derivative of the considered hyperbolic system. In terms of 

this function is is immediate to verify that the calsa product above becomes

r1,2(w) ·∇λ1,2(w) = ∓Ŵ(ρ)√ 

P ′(ρ)

ρ= ∓Ŵ(ρ) a(ρ)

ρ(A.1.18)

The modes will be genuinely nonlinear provided that

Ŵ(ρ) = 0 ⇐⇒ d 2[ρ P(ρ)]d ρ2

= 0 (convexity) (A.1.19)

In thefollowing wewill assume that this condition issatisfiedand thereforelimitour

attention only to convex P-systems. Moreover, we assume for definiteness that thesign of the second derivative above is positive, namley that P ′′(ρ) > −2P ′(ρ)/ρ,

without any loss of generality.

For completeness we write the matrices of the right eigenvectors

R(w) = ρ

Ŵ(ρ) a(ρ)

−1 1

a(ρ) − m

ρa(ρ) + m

ρ

(A.1.20)

together with that of the left eigenrows:

L(w) = Ŵ(ρ)

−a(ρ) − m

ρ1

a(ρ) − m

ρ1

(A.1.21)

The eigenvectors have been normalized in the standard way of genuinely nonlinear

waves (see below) and the eigenrows have been normalized in the usual way to

ensure the inverse relationships R(w)−1 = L(w) and L(w)−1 = R(w).

A.2 Riemann invariants

A function i = i (w) is said to be a Riemann invariant for the mode p when it

satisfies

r p(w) ·∇i (w) = 0. (A.2.1)

For a hyperbolic system with m equations there are m − 1 Riemann invariants for

each mode.

In the case of the P-system m = 2 and therefore there is only one Riemann

invariant for each mode. Let us determine the Riemann invariant of the P-system

139

Page 140: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 140/195

associated with the first mode with eigenvector r1(w) that will be written in nor-

malized form as

rnorm1 (w) = 1

Ŵ(ρ)

− ρ

a(ρ)

ρ − m

a(ρ)

(A.2.2)

where thesound speed a(ρ) = √ P ′(ρ) hasbeenalready introduced. TheRiemann

invariant i = i (w) is defined as the solution to the equation

− ρ

a(ρ)

∂i

∂ρ+

ρ − m

a(ρ)

∂i

∂m= 0 (A.2.3)

whivh reduces immediately to

− ∂i

∂ρ+

a(ρ) − m

ρ

∂i

∂m= 0 (A.2.4)

This is a first-order partial differential equation, linear with variable coefficients.

To determine its solution let us consider the change of the independent variable

m → u = m/ρ (A.2.5)

and the corresponding change of the unknown

i (ρ, m) → I (ρ, u) ≡ i ( ρ,ρu)

i (ρ, m) ≡ I (ρ, m/ρ)(A.2.6)

The partial derivatives of the original variable of the Riemann invariant can be

expressed in terms of those of the new one:

∂i

∂ρ= ∂ I 

∂ρ− m

ρ2

∂ I 

∂u

∂i

∂m= 1

ρ

∂ I 

∂u

(A.2.7)

and the substitution into the equation for i yields, after simplifying two terms,

− ρ

a(ρ)

∂ I 

∂ρ+ ∂i

∂u= 0 (A.2.8)

The form of this equation suggests to look for the Riemann invariant I (ρ, u) as

the sum of two functions of only one variable, as follows I (ρ, u) = A(ρ) +  B(u).

Then the equation becomes

− ρ

a(ρ) A′(ρ) + B′(u) = 0 (A.2.9)

140

Page 141: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 141/195

where the prime denotes differentiation with respect to the independent variable of 

any function of a single variable. The first term of the equation is a function onlyof variable ρ whereas the second is a function only of u. Thus the equation can

be satisfied only provided the two terms are equal to one and the same constant,

but with opposite signs, as is typical when a PDE is solved by the technique of the

separation of variables. As a consequence, the two functions A(ρ) and B(u) must

satisfy the two independent first order ordinary differental equation

 A′(ρ) = K ρ

a(ρ)and B′(u) = K  (A.2.10)

where K  is the separation constant. The integration of the two equations is mme-

diate and gives

 A(ρ) = K 

 ρ a(

) d 

and B(u) = C + K u (A.2.11)

where the integral is left in indefinite form, which implies the presence of an

arbitrary additive constant in thefirst relation and C  is another integration constant.

Therefore the solution is found to be

 I (ρ, u) = K 

 ρ a(

) d 

+ u

(A.2.12)

the single integration constant being absorbed in that associated with indefinte

integral. The Riemann invariant as a function of the originary variables reads

i (ρ, m) = K 

 ρ a(

) d 

+ m

ρ

(A.2.13)

The Riemann invariant associated with the second mode can be obtained in the

same way.

A.3 Rarefaction waves

The rarefaction wave are similarity solution to the hyperbolic system which de-

pends on x and t only through the intermediate of the similarity variables ξ 

=x/t .

In other words, we search solutions of the type ρ( x , t ) = ρ( x/t ) = ρ(ξ) andm( x , t ) = m( x /t ) = m(ξ ), where the slight abuse of mathematical notation

should not prevent a correct understanding. Once these functions are substituted

in the P-system, a pair of first-order ODEs is obtained for the unknowns ρ = ρ(ξ)

and m = m(ξ ), as follows .

−ξ  1

P ′(ρ) − m2

ρ2

2m

ρ− ξ 

d ρ

d ξ 

dm

d ξ 

= 0 (A.3.1)

141

Page 142: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 142/195

The system being homogeneous, nontrivial solutions can be obtained only going

throught the eigenstructure just determined. By means of the standard procedurealready followed in section 4.3, the nontrivial solutions are characterized by the

hybrid system

d ρ

d ξ = ∓ ρ

Ŵ(ρ)√ 

P ′(ρ)

dm

d ξ = 1

Ŵ(ρ)

ρ ∓ m√ 

P ′(ρ)

ξ  = m

ρ∓ √ 

P ′(ρ)

(A.3.2)

which consists of two differential equations and one algebraic equation, the latterestablishing a relationship beween the independent (similarity) variable and the

two unknowns.

Let us now determine the rarefaction solution issuing from a given state (ρ, m).

The algebraic relation implies that initial condition for this problem must be

ρ(ξ ∓) = ρ and m(ξ ∓) = m (A.3.3)

where the initial valueof the independentvariable ξ  is fixed by theeigenvalue itself 

to be

ˆξ ∓ ≡

m

ρ ∓ P′(

ˆρ) (A.3.4)

In this way, the hybrid differential–algebraic problem is made complete.

To find the solution is convenient to look first at the direct relation between the

twounknowns ρ and m along therarefactionwave, that is, to determinethefunction

m = m(ρ), irrespective of the similarity variable [the function m(ρ) should not

be confused with the previous m(ξ )]. The differential equation governing the

unknown m(ρ) is obtained from the first equation of the hybrid system and the

initial value problem for the new unknown reads

dm

d ρ −

m

ρ = ∓

√ P ′(ρ)

m(ρ) = m(A.3.5)

The equation is a first-order linear equation with variable coefficients and with

a right hand side function only of the independent variable. Let us divide the

equation by ρ = 0,

1

ρ

dm

d ρ− m

ρ2= ∓

√ P ′(ρ)

ρ=⇒ d (m/ρ)

d ρ= ∓

√ P ′(ρ)

ρ(A.3.6)

142

Page 143: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 143/195

The equation for the variable m/ρ is a first order linear equation with constant

coefficients and nonhomogeneous. Its solution is the sum of the general solutionto the homogeneous equation and a particular solution of the nonhomogeneous

complete equation, namely

m(ρ)

ρ= A ∓

 ρ

ρ

 P ′(

)

d  (A.3.7)

where the integration constant A is determined by imposing the initial condition.

The solution satisfying the initial condition is easily found to be

m(ρ,

ˆw)

=mρ

ρ ∓ρ  ρ

ρ P ′(

)

d  (A.3.8)

This rarefaction solution is valid only for ρ < ρ. The complete solution of the

hybrid system is obtained by plugging m(ρ, w) in the eigenvalue equation to give:

ξ(ρ, w) = m

ρ∓ ρ

ρ

 P ′(

)

d  ∓

 P ′(ρ) ρ < ρ (A.3.9)

The range of amdissible values for the similarity variable ξ  is defined by the rule

that ξ  must increase when the rarefaction wave is connected to the left state while

ξ  must decrease when the rarefaction is connected to the right state. Since the

waves associated to the left and right states involve the first and second eigenvalue,respectively, the range of variable ξ  for the left wave will be ξ > λ1(ρℓ, mℓ) =mℓ/ρℓ −√ 

P ′(ρℓ) while that for the right wave will be ξ < λ2(ρr , mr ) = mr /ρr +√ P ′(ρr ).

At this point, the solution process is ended by inverting the function ξ  =ξ(ρ, w), to give eventually the similar solution ρ = ρ(ξ, w) and m = m(ξ, w) =m

ρ(ξ, w), w. The inversion of  ξ  = ξ(ρ, w) will be possible provided this

function is strictly monotonic and this condition is easily checked by computing

its derivative, which is

d ξ 

d ρ = ∓2P ′(ρ) + ρ P ′′(ρ)

2ρ√ P ′(ρ)

ρ <

ˆρ (A.3.10)

Therefore, for convex P-systems this derivative cannot vanish and function ξ  =ξ(ρ, w) is strictly monotonic, and the solution ρ = ρ(ξ, w) can be found. This

solution will be indicated by ρ = ρrarℓ (ξ ) ≡ ρ(ξ, wℓ), with ξ > λ1(wℓ) for the left

wave or by ρ = ρrarr  (ξ ) ≡ ρ(ξ, wr ), with ξ < λ2(wr ) for the right wave.

Due to the previous positivity assumption, the slope of ξ(ρ, w) is negative for

the first eigenvalue and positive for the second. Therefore this function together

with its inverse ρ = ρ(ξ, w) is strictly decreasing for the first eigenvalue and

increasing for the second.

143

Page 144: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 144/195

A.4 Vacuum formation

When the solution of a Riemann problem consists of two rarefaction waves, it may

occur that the fluid separates and that a region void of fluid forms between the

expansion waves. This phenomenon is denoted as vacuum formation. The results

established in the previous section allow one to characterize the conditions for the

vacuum formation for theP-system. In fact, thesolution of theRiemann problem is

defined by the point w = (ρ, m) of intersection of two rarefaction solutions. Thus,

for given initial states wℓ = (ρℓ, mℓ) and wr  = (ρr , mr ), this point is obtained by

solving the equation

mic1 (ρ, wℓ) = mic

2 (ρ, wr ) (A.4.1)

in the unknown ρ. By virtue of previous results we have

mℓρ

ρℓ

− ρ

 ρ

ρℓ

 P ′(

)

d  = mr ρ

ρr 

+ ρ

 ρ

ρr 

 P ′(

)

namely:

mℓ

ρℓ

− mr 

ρr 

= ρ

ρℓ

 P ′(

)

d  +

 ρ

ρr 

 P ′(

)

d  (A.4.2)

The formation of vacuum corresponds to a vanishing density, namely to ρ → 0,

and this will occur provided that

mr 

ρr 

− mℓ

ρℓ

> νvacuum(ρℓ, ρr )) (A.4.3)

where

νvacuum(ρℓ, ρr )) ≡ ρℓ

0

√ P ′(ρ)

ρd ρ +

 ρr 

0

√ P ′(ρ)

ρd ρ (A.4.4)

The condition for vacuum formation is satisfied when the relative velocity ν =ur  − uℓ of the fluid on the right with respect to that on the left is sufficiently

high. When the vacuum is formed, the edges of the two rarefaction waves travel

at velocity

uvac,ℓ = uℓ + ρℓ

0

√ P ′(ρ)

ρd ρ and uvac,r  = ur  −

 ρr 

0

√ P ′(ρ)

ρd ρ (A.4.5)

It is interesting to note the particularity of the P-system for the isothermal ideal

gas with regard to the vacuum formation. For this gas P ′(ρ) = a2 and the integrals

in the relation defining the solution with two rarefaction waves gives a logarithm,

as followsmℓ

ρℓ

− mr 

ρr 

= a ln

ρ2

ρℓρr 

144

Page 145: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 145/195

from which we obtain the density of the rarefaction-rarefaction solution

ρ = √ ρℓρr  e

12a

mℓρℓ

− mr ρr 

It follows that, irrespective of the initial data, ρ can never vanish and no vacuum

region can form in the isothermal ideal gas. Physically speaking, this impossibility

is explained by the continuous heating of the gas which is mantained at a uniform

temperature. This isothermal ideal gas model represents therefore a uniquely

peculiar P-system.

Equation (A.4.2) defines the solution of the Riemann problem when it consists

of tworarefaction waves. This relation can be recast to express the relative velocity

ν

=ur 

−uℓ of the two states of the Riemann problem as a function of the variable

ρ and of the two initial densities. We have in fact

ν(ρ,ρℓ, ρr ) = − ρ

ρℓ

 P ′(

)

d  −

 ρ

ρr 

 P ′(

)

With two rarefaction waves ρ < ρℓ and also ρ < ρr . Therefore, when ρ =ρmin = min(ρℓ, ρr ) this density value corresponds to the limit for a solution with

two rarefactions. This defines the limit value of the relative velocity for a solution

to the Riemann problem with two rarefaction waves (fans), as follows

ν2 f (ρℓ, ρr )

≡  ρmax

ρmin

√ P ′(ρ)

ρ

d ρ (A.4.6)

which is a positivevalue, as found insection 6 in the particular caseof the equations

for the isothermal ideal gas.

After having established the solutions for the rarefaction waves, we pass to

determine the solutions corresponding to shock waves for the general P-system.

A.5 Shock waves

The states w = (ρ, m) that can be connected to a pivotal state w = (ρ, m) through

a propagating shock wave in a P-system are given by the Rankine–Hugoniot jump

conditions

s(ρ − ρ) = m − m

s(m − m) = m2

ρ+ P(ρ) − m2

ρ− P(ρ)

(A.5.1)

where s represents thepropagationvelocityof thediscontinuity. By eliminating the

(unknown) variable s one obtains the following quadratic equation in the unknown

m

m2 − 2ρ

ρm m + ρ2

ρ2m2 − ρ

ρ(ρ − ρ)

P(ρ) − P(ρ)

= 0 (A.5.2)

145

Page 146: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 146/195

The solution formula of the quadratic equation gives

msw1,2(ρ, w) = mρ

ρ∓ 

ρ

ρ

ρ− 1

P(ρ) − P(ρ)

(A.5.3)

Substituting this result in the first equation gives the solution for the speed s, in

the form

s1,2(ρ, w) = m

ρ∓ 

ρ

ρ

P(ρ) − P(ρ)

ρ − ρ

(A.5.4)

The range of the admissible value for the parameter ρ is determined by the entropy

condition. Focussing on the first eigenvalue, Lax version of the entropy condition

for a system reads

λ1(wℓ) > s1(ρ, wℓ) > λ1(w1(ρ, wℓ)) (A.5.5)

where w1(ρ, wℓ) = ρ, msw

1 (ρ, wℓ). By direct calculation, the left part of the

inequality leads to the condition

ρ

P(ρ) − P(ρℓ)

> ρℓ(ρ − ρℓ) P ′(ρℓ)

Then, by virtue of the differentiability of  P(ρ), it must be ρ > ρℓ, at least in a

local sense. On the other hand, the right part of the inequality, by a slightly more

complicated calculation reduces to the condition

ρℓ

P(ρ) − P(ρℓ)

< ρ(ρ − ρℓ) P ′(ρ)

which is satisfied provided ρ > ρℓ, again locally by the differentiability of P(ρ).

Thus, for the first eigenvalue the entropy condition is satisfied (locally) when

ρ > ρℓ. A similar argument shows that for the second eigenvalue the entropy

condition requires ρ > ρr .

We now introduce a new parametrization of the shock solution alternative to

ρ that will be particularly convenient for formulating the Riemann problem with

a uniform treatment of rarefaction and shock branches. The idea is to choosea parameter i) with same physical dimensions of the similarity variable of the

rarefaction wave, and that ii) matches continuously with the rarefaction solution

at the pivotal state and extends the domain of variable ξ  to the half line in the

direction opposite to the rarefaction wave range and iii) has a linear relationship

with ρ.

Let us determine the new parametrization by imposing the three conditions

above. Condition iii) means that

ρsw(ξ ) = a + bξ, with ξ < ξ ∓ (A.5.6)

146

Page 147: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 147/195

for the first eigenvalue and ξ >

ˆξ 

∓for the second, where the coefficients a and b

are to be determined by imposing the continuity condition ii). The continuity atξ  = ξ ∓ of this linear function with the density and of its slope with the slope of 

the rarefaction solution give the two relations

a + m/ρ ∓ 

P ′(ρ)

b = ρ

b = ∓ 2ρ 

P ′(ρ)

2P ′(ρ) + ρ P ′′(ρ)

(A.5.7)

By eliminating b in the first equation, we obtain

a = ±2m 

P ′(ρ) + ρ2 P ′′(ρ)

2P ′(ρ) + ρ P ′′(ρ)(A.5.8)

This parametrization matches continuously and uniformly the two possible waves

at the pivotal state so that is could be termed canonical.

Considering the shock wave connected with the left state w = wℓ and its

associated first eigenvalue, the linear relation will be written as

ρswℓ (ξ ) = aℓ + bℓξ  (A.5.9)

for ξ < λ1(wℓ), with the coefficients being defined by the appropriate version of 

the preceding relations. Therefore, the density of the two possible waves, either a

rarefaction or a shock, that can be connected with the left state, will be given by

the function

ρℓ(ξ ) =

ρrarℓ (ξ ) ξ > λ1(wℓ)

aℓ + bℓξ ξ < λ1(wℓ)(A.5.10)

Similarly, the momentum of the wave connected with the left state is expressed by

the function

m1(ξ )

= mrar

ℓ (ξ ) ξ > λ1(wℓ)

mswℓ (ξ ) ξ < λ1(wℓ)

(A.5.11)

where

mswℓ (ξ ) ≡ msw

1 (aℓ + bℓξ, wℓ) (A.5.12)

with the function msw1 (ρ, wℓ) of the shock wave solution already defined.

The functions for the density and momentum of the right wave will be con-

structed in the same way. However, the variable of the canonical parameterization

must be indicated by a different letter, for instance η, with respect to that used

to parametrize the left wave (ξ ). Thus, according to whether η < λ2(ρr , mr ) or

147

Page 148: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 148/195

η > λ2(wr ), with λ2(wr )

=mr /ρr 

+

√ P ′(ρr ), the wave will be a rarefaction or

a shock. The function for the density along the right wave is expressed as follows

ρr (η) =

ρrarr  (η) η < λ2(wr )

ar  + br η η > λ2(wr )(A.5.13)

while that for the momentum by

mr (η) =

mrarr  (η) η < λ2(wr )

mswr  (η) η > λ2(wr )

(A.5.14)

where, of course,

mswr  (η) ≡ msw

2 (ar  + br η, wr ) (A.5.15)

The relation (A.5.3) for the momentum along the shock-wave solution can be

recast as an expression for velocity, as follows

usw1,2(ρ, w) = u ∓

 1

ρ− 1

ρ

P(ρ) − P(ρ)

where u = m/ρ. If the solution of the Riemann problem consists of two shock 

waves, the density ρ of the intermediate state can be characterized also by the

equality of the velocity along the left and right waves

usw1 (ρ, wℓ) = usw

2 (ρ, wr )

This equation for the two-shock solution can also be recast as follows

ur  − uℓ = − 

1

ρℓ

− 1

ρ

P(ρ) − P(ρℓ)

− 

1

ρr 

− 1

ρ

P(ρ) − P(ρr )

When the solution consists of two shock waves ρ > ρℓ and ρ > ρr , so that the

limiting value of the density such that there are two shocks is given by ρ

=ρmax

=max(ρℓ, ρr ). Substituting this value in theexpressionaboveonly one term survivesand we obtain

ν2s (ρℓ, ρr ) ≡ − 

ρmax − ρmin

ρmin ρmax

P(ρmax) − P(ρmin)

(A.5.16)

which is negative, as requested, and which can be written more clearly as follows

ν2s (ρℓ, ρr ) ≡ − 

|ρr  − ρℓ|ρℓ ρr 

P(ρr ) − P(ρℓ)

(A.5.17)

148

Page 149: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 149/195

By summarizing, the three limiting values of the relative velocity ν

=ur 

−uℓ are

collected here, all together in increasing order,

ν2s (ρℓ, ρr ) = − 

|ρr  − ρℓ|ρℓ ρr 

P(ρr ) − P(ρℓ)

ν2 f (ρℓ, ρr ) = ρmax

ρmin

√ P ′(ρ)

ρd ρ

νvacuum(ρℓ, ρr ) = ρℓ

0

√ P ′(ρ)

ρd ρ +

 ρr 

0

√ P ′(ρ)

ρd ρ

(A.5.18)

A.6 The Riemann problem as a two-equation system

The solution of the Riemann problem is defined by the intersection of the two

curves that represent the states that can be connected with state wℓ = (ρℓ, mℓ)

and state wr  = (ρr , mr ) by waves belonging to the first and second family of 

solutions, respectively. The point of intersection is found by solving the system of 

two equations ρ1(ξ, wℓ) = ρ2(η, wr ),

m1(ξ, wℓ) = m2(η, wr ),(A.6.1)

in the two unknowns ξ  and η. The difference of this formulation of the Riemannproblem with respect to the common one based on a single equation must be

stressed. In the standard approach, one of the two variables of the P-system is

taken as a parameter while the other is used to obtain a single nonlinear equation.

This introduces an artificial dissymmetrization into the Riemann problem. By

contrast, in the proposed formulation, the intersection point giving the solution of 

the problem is characterized within a mathematical frame in which the variables

of the hyperbolic system play equal roles.

The 2 × 2 nonlinear system of the Riemann problem has a particularly simple

structuresince the functionsof both equations are thedifference of twofunctions of 

only one variable. For this reason the 2

×2 system above could be said separable.

Thanks to such a very particular nonlinear structure, the solution of the system by

mean of Newton iterative method would require to evaluate the Jacobian matrix:

 J (ℓ,r )(ξ,η) ≡

d ρ1(ξ, wℓ)

d ξ −d ρ2(η, wr )

d η

dm1(ξ, wℓ)

d ξ −dm2(η, wr )

d η

, (A.6.2)

which involvesonlyordinary derivatives. But, beside this advantage brought about

by the special form of the 2 × 2 nonlinear system for its numerical solution, the

149

Page 150: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 150/195

form itself seems also very appropriate to attack thedemonstration of existence and

uniqueness of the solution to the Riemann problem for convex P-systems underarbitrary (large) initial data.

A.7 Existence and uniqueness theorem

To obtain the theorem of existence and uniqueness of solution to the Riemann

problem for convex P-system a slight modification of the 2 × 2 system above is

necessary, consisting in recasting the second equation in terms of velocity. By

dividing the second equation by the first one we obtain the equivalent system

ρ1(ξ, wℓ) = ρ2(η, wr ),u1(ξ, wℓ) = u2(η, wr ),

(A.7.1)

where uℓ(ξ ) = m1(ξ, wℓ)/ρ1(ξ, wℓ) and similarly on the right. The functions for

the velocity are, for the left wave,

u1(ξ, wℓ) =

uℓ − ρ1(ξ,wℓ)

ρℓ

√ P ′(ρ)

ρd ρ ξ > λ1(wℓ)

uℓ − 

1

ρℓ

− 1

ρ1(ξ, wℓ)

P(ρ1(ξ, wℓ)) − P(ρℓ)

ξ < λ1(wℓ)

(A.7.2)and for the right wave

u2(η, wr ) =

ur  + ρ2(η,wr )

ρr 

√ P ′(ρ)

ρd ρ η < λ2(wr )

ur  + 

1

ρr 

− 1

ρ2(η, wr )

P(ρ2(η, wr )) − P(ρr )

η > λ2(wr )

(A.7.3)

System (A.7.1) can be recast in the notationally simpler form

ρℓ(ξ )=

ρr (η),

uℓ(ξ ) = ur (η), (A.7.4)

having introduced the four functions ρℓ(ξ ) ≡ ρ1(ξ, wℓ), uℓ(ξ ) ≡ u1(ξ, wℓ),

ρr (η) ≡ ρ2(η, wr ) and ur (η) ≡ u2(η, wr ). The four functions appearing in thetwo

sides of the two equations are strictly decreasing or increasing. In fact, using the

notation φր and φց to indicate strictly monotonic increasing and decreasing func-

tions, respectively, thefunctionsρℓ and ρr  havethe followingincreasing/decreasing

character, namely,

ρցℓ and ρր

150

Page 151: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 151/195

On the contrary, the velocity functions uℓ and ur  are always increasing:

uրℓ and uր

By virtue of the strict monotonicity of the function ρ1(ξ, wℓ) and ur (η), they can be

inverted to give teh functions ρ−1ℓ and u−1

r  and the increasing/decreasing character

of the latter is ρ−1

ցand

u−1

րsince the decreasing or increasing character of a function is invariant upon its

inversion. The ρ-u version of the system of the Riemann problem can therefore

be written as follows ξ  = ρ−

1ℓ ◦ ρr (η),

η = u−1r  ◦ uℓ(ξ).

The two composed functions f (η) = ρ−1ℓ ◦ ρr (η) and g(ξ ) = u−1

r  ◦ uℓ(ξ ) have

the following increasing/decreasing character

 f ց and gր

since the composition of a decreasing function with an increasing one is a de-

creasing function and the composition of two increasing functions is increasing.

Therefore the system reads ξ  = f ց(η),

η = gր(ξ).(A.7.5)

At this point, we should attempt to use the main theorem (Lemma 4.3.2) of [16, p.

444–446] to demonstrate existence and uniqueness of the solution of the Riemann

problem for the P-system. We need to estimate the Lipschitz constants µ f  and µg

of the two composed functions f ց = ρ−1ℓ ◦ ρr  and gր = u−1

r  ◦ uℓ and verify that

the contractive property µ f µg < 1 is satisfied as a consequence of the conditions

of hyperbolicity and convexity.

A.8 Roe linearization

This final section is devoted to the Roe linearization of the general P-system con-

sidered so far. The principles of the Roe linearization have been introduced in

Section 8 and, whenever the linearization is sought for in Jacobian form, the pro-

cedure boils down to find an intermediate state w of the P-system such that the

following condition

A(w)(wr  − wℓ) = f (wr ) − f (wℓ) (A.8.1)

151

Page 152: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 152/195

is satisfied. This leads to a system of two equations in the two unknowns

˜ρ and

˜m,

namely,

m = m,−m2

ρ 2+ P ′(ρ)

ρ + 2m

ρm =

m2

ρ+ P

,

(A.8.2)

where (m2/ρ + P) = (m2/ρ) + P , with P = P(ρr ) − P(ρℓ). Obviously,

the first equation is identically satisfied and therefore we have a single equation in

the vector unknown w with two components: thus we have a one-parameter family

of solutions, which is determined as follows.

First let us consider the special case ρ = 0, i.e., ρℓ = ρr  = ρℓ≡r . Then, thesecond equation in (A.8.2) simplifies to

2m

ρm =

m2

ρ+ P

=

m2

ρ

= (m2)

ρℓ≡r 

. (A.8.3)

Taking ρ = ρℓ≡r , themomentumof theintermediatestate is obtained immediately:

m = (m2)

2m= 1

2(mℓ + mr ). (A.8.4)

Considering now the general case ρ=

0, the second equation in (A.8.2)

gives a quadratic equation in the variable m/ρ:

(ρ)

m

ρ

2

− 2(m)m

ρ+

m2

ρ

+ P − P ′(ρ)ρ = 0. (A.8.5)

Notice that, due to presence of the function P ′(ρ), this equation represents actually

the definition of the one-parameter family of solutions, by means of the implicit

function φ(m, ρ) = 0. Anyway, the use of solution formula for the quadratic

equation gives:

= 1ρ

m ± (m)2 − (ρ)

m2

ρ

+ P − P ′(ρ)ρ .

(A.8.6)

This is still an implicit expression for the solution family, due to the occurrence of 

the density ρ of the unknown intermediate state in the last term under the square

root. If ρ is selected as the parameter of the family of solutions, (A.8.6) gives the

explicit expression of the solution family m = m(ρ).

On the other hand, since the solution set is a one-parameter family of solutions,

we can imposeone additionalconditionto obtain a problem with a uniquely defined

152

Page 153: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 153/195

solution. To simplify the right-hand side of (A.8.6) we can select the value

˜ρ so

that the implicit term involving the pressure function is eliminated. This meansthat the value of ρ will be taken as the solution of the supplementary equation

P ′(ρ) = P

ρ. (A.8.7)

Therefore, the solution of the linearization problem is given by the system

P ′(ρ) = P

ρ,

m = ρρ

m ± (m)2 − (ρ)

m2

ρ

.

(A.8.8)

Since the function P(ρ) is strictly convex, the function P ′(ρ) is invertible and the

solution, whenever ρ = 0, is expressed as follows:

ρ = (P ′)−1

,

m = (P ′)−1

1

ρ

m ±

 (m)2 − (ρ)

m2

ρ

.

(A.8.9)

Thus, for the P-system, by fixing a convenient value of the parameter ρ, we have

been able to obtain a unique solution of the intermediate state w in terms of the

variations of the conservation variable w and the variations of m2/ρ and P. We

notice in particular that, in the special case m = 0, we obtain

m = mℓ≡r √ ρℓρr 

(P ′)−1

. (A.8.10)

Surprisingly enough, even though m = 0, the momentum m of the intermediate

state is in general different from mℓ≡r  = mℓ = mr  whenever ρℓ = ρr .

We have now to determine the physical relevant solution between the twosolutions just found. Let us first consider the discriminant in (A.8.9) and substitute

the variations m = mr  − mℓ and ρ = ρr  − ρℓ in it to give

(m)2 − (ρ)m2

ρ

= m2

r  − 2mℓmr  + m2ℓ − (ρr  − ρℓ)

m2

ρr 

− m2ℓ

ρℓ

= (ρℓmr  − ρr mℓ)2

ρℓρr 

.

(A.8.11)

153

Page 154: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 154/195

The denominator is always positive whereas the numerator is only nonnegative.

Therefore, the second equation in (A.8.9) has two real distinct solutions exceptwhen

mℓ

ρℓ

= mr 

ρr 

, (A.8.12)

in which case the root is double. This special situation corresponds to a constant

velocity across the left and right states and the solution is deduced immediately

from (A.8.9), namely,

ρ = ( P ′)−1

,

˜m

=mℓ

ρℓ

(P ′)−1 P

ρ =

mr 

ρr 

( P ′)−1 P

ρ. (A.8.13)

Considering now a positive discriminant, the solution of the second equation

in (A.8.9) assumes the form

m

ρ= 1

ρr  − ρℓ

mr  − mℓ ±

 (ρℓmr  − ρr mℓ)2

ρℓρr 

= 1

ρr  − ρℓ

mr  − mℓ ± ρℓmr  − ρr mℓ√ 

ρℓρr 

.

(A.8.14)

Letusconsiderfirst thesolutionobtainedby takingtheminussign in theexpression.We have

m

ρ= 1

ρr  − ρℓ

mr  − mℓ − ρℓmr  − ρr mℓ√ 

ρℓρr 

= 1

ρr  − ρℓ

√ ρr ρℓ mr  − √ 

ρr ρℓ mℓ − ρℓmr  + ρr mℓ√ ρℓρr 

= 1

ρr 

−ρℓ

√ ρr 

√ ρr  − √ 

ρℓ

mℓ + √ 

ρℓ

√ ρr  − √ 

ρℓ

mr √ 

ρℓρr 

= √ ρr  − √ ρℓ

ρr  − ρℓ

√ ρr  mℓ + √ ρℓ mr √ ρℓρr 

.

(A.8.15)

Noticing that

ρr  − ρℓ = √ ρr  + √ 

ρℓ

√ ρr  − √ 

ρℓ

, (A.8.16)

the solution above reduces to

m

ρ=

mℓ√ ρℓ

+ mr √ ρr √ 

ρℓ + √ ρr 

. (A.8.17)

154

Page 155: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 155/195

Although we are considering the case ρ

=0, we notice that for ρ

→0 this

solution reduces to the one (A.8.4) obtained when ρ = 0. If we now considerthe plus sign in the expression above we have

m

ρ=

mℓ√ ρℓ

− mr √ ρr √ 

ρℓ − √ ρr 

. (A.8.18)

This result is rejected since it leads to an infinite value for the ratio m/ρ when

ρ → 0, if mℓ and mr  are constant.

In conclusion, the uniquely defined solution of Roe linearization problem for

the P-system for a general strictly convex P(ρ), obtained by an appropriate choice

of the parameter

˜ρ, has the form

ρ = ( P ′)−1

,

m =mℓ√ 

ρℓ+ mr √ 

ρr √ ρℓ + √ 

ρr 

( P ′)−1

.

(A.8.19)

We notice that, when dealing with a general pressure function P(ρ), it is necessary

to find the complete intermediate state, i.e., one has to determine both ρ and m.

This is not the case, for example, for a flux function that is homogeneous of degree

one, for which the original Roe’s method was introduced. In this case, as we will

see in the next section, the Jacobian matrix no longer depends on the density, and

hence the Roe matrix is completely defined by specifying the ratio m/ρ alone, i.e.,the fluid velocity u = m/ρ.

The intermediate state found here corresponds to the averaged velocity intro-

duced by Roe (also called Roe-averaged or rho-averaged velocity), namely,

u =√ 

ρℓ uℓ + √ ρr  ur √ 

ρℓ + √ ρr 

.

By substituting the solution w = (ρ, m)T  into the Jacobian matrix A(w) we obtain

the Roe matrix

A = A(w) = A(ρ, m) = 0 1

P ′(ρ) − m2

ρ2

2m

ρ

. (A.8.20)

In terms of the Roe averaged velocity, Roe matrix can be expressed more simply

as

A = A(ρ, u) = 0 1

P ′(ρ) − u2 2u

. (A.8.21)

155

Page 156: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 156/195

B. Boundary conditions in nonlinear

hyperbolic systems

B.1 Introduction

The imposition of boundary conditions is a very critical issue in the numerical so-

lution of nonlinear hyperbolic problems. The first and most fundamental difficulty

is caused by the nonlinearity which implies that the parts of the boundary of the

computational domain where boundary values must be specified are not known

a priori. In fact, even in the scalar case, the inflow and outflow portions of the

boundary depend on the direction of the advection velocity respect to that of the

unit vector normal to the boundary and the velocity on the boundary is part of thesolution. Therefore, in general it is not possible to specify the boundary conditions

of a conservation law equation without knowing the actual boundary values of the

solution.

Another relevant aspect associated with the imposition of the boundary con-

ditions in hyperbolic problems is their completely different mathematical status

with respect to that of the Dirichlet boundary conditions in elliptic or parabolic

problems. Enforcing a Dirichlet condition corresponds to fix the point values of 

the unknown on the boundary. On the contrary, imposing a boundary condition for

a conservation law equation means to take into account the prescribed boundary

values only through the computation of the flux. In other words, in the hyperboliccase the unknown is not required to assume the values specified on the boundary

and the actual values finally assumed by the unknown variable will be only an

approximation of the boundary data.

A third element of complication is encountered in hyperbolic systems. Here the

unknown has two or more components and a different number of boundary values

can be specified on different parts of the boundary. The two extreme situations are

on the one hand the imposition of prescribed values for all the unknowns and on the

other hand no boundary condition at all. In fact, the correct number of boundary

conditions which must be specified at a given boundary point is determined by the

signs of the local eigenvalues of the system written in quasi-linear form. However,

once the right number of boundary conditions is established, one is often still faced

with the additional difficulty that some variables prescribed on the boundary do

not correspond to any of the unknowns of the problem.

This Appendix is devoted to the problem of imposing the boundary conditions

in nonlinear hyperbolic systems in one dimension. A general procedure recently

suggested by Alberto Guardone is presented. It is characterized by the explicit

identification and use of three sets of variables: the conservative unknowns of the

system, the local characteristic variables and the physical variables. The trans-

156

Page 157: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 157/195

formations between the conservative and physical variables is detailed first for the

system of Euler equations of gasdynamics and then for the system of two equationsgoverning the 1D flow of an isothermal ideal gas. The procedure for the treatment

of the boundary conditions consists in four distinct steps, which are formulated

for an arbitrary hyperbolic system. The effectiveness of Guardone’s procedure

is assessed by some numerical comparison for a test problem consisting in the

reflection of a shock-wave by a plane wall. The exact analytical solution of this

problem has been given in section 5.5.

B.2 Conservative, characteristic and physical variables

Let us consider a system of nonlinear hyperbolic equations in one dimension withthe vector unknown

w =

w1

w2...

wm

(B.2.1)

The m components of the unknown are the conservative or conservation variables

of the system.

For the purposes of a numerical solution method, the system of conservation

laws ∂t w

+∂ x f (w)

=0 is also written in the so-called quasi-linear form ∂t w

+A(w)∂ x w = 0, where A(w) = ∂f (w)/∂w is the Jacobian matrix of the flux vector

f (w). In the same context, one considers the eigenvalue problem associated with

this matrix A(w) and, under the condition of strict hyperbolicity, it is standard to

define thematrix R(w) of right eigenvectors andthematrix L(w) of left eigenrows.

It is standard to normalize the eigenrows on the basis of the right eigenvectors, so

that L(w)R(w) = I. By means of these twomatrices,onedefines thecharacteristic

variable v = L(w)w, which has m components,

v=

v1

v2

...vm

(B.2.2)

The inverse transformation from the characteristic variables to the conservative

ones is obtained by multiplying v = L(w)w by R(w) and using the orthonormal-

ization condition to give w = R(w)v. This relation gives the inverse transfor-

mation only implicitly, since matrix R(w) involves the conservation variable w

one is looking for, except when the hyperbolic system is linear. Only in such a

157

Page 158: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 158/195

linear case, the characteristic variables have the important properties of being lin-

ear combinations of the conservative unknowns which are governed by uncoupledadvection equations, each with its own (constant) propagation velocity.

In view of specifying the boundary values, it is convenient to introduce a third

set of variables, which are called physical or primitive variables and that will be

denoted by

p =

 p1

 p2...

 pm

(B.2.3)

For instance, for the Euler equations of gasdynamics, the three conservative vari-ables are

w =w1

w2

w3

=

ρ

m

 E t

(B.2.4)

where ρ is the mass density, m is the momentum density and E t is total energy

density of the gas, while typical physical variables will be

p =

 p1

 p2

 p3

=

ρ

u

P

(B.2.5)

where u is fluid velocity and P is pressure.

The relationship between the conservative variables and the physical ones is a

vector-valued function of the type w = w(p) and its inverse p = p(w). Always

with reference to the Euler equations of gasdynamics, the three equations of the

first transformation read

w1 = ρ = p1

w2 = m = ρu = p1 p2

w3 = E t

= ρet

= ρ

e +12 u

2= ρ

e( P, ρ) + 12

u2

= p1

e( p3, p1) + 1

2p2

2

(B.2.6)

where e = e(P, ρ) is an equation of state of the gas, so that

w(p) =  p1

 p1 p2

 p1

e( p3, p1) + 1

2p2

2

(B.2.7)

158

Page 159: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 159/195

For a polytropic ideal gas e( P, ρ)

=P/ρ/(γ 

−1).

The relations of the inverse transformation p = p(w) will be

 p1 = ρ = w1

 p2 = u = m

ρ= w2

w1

 p3 = P = P(e, ρ) = P

 E t

ρ− 1

2u2, ρ

= P

w3

w1

− w22

2w21

, w1

(B.2.8)

where P = P(e, ρ) is another equation of state of the gas, so that

p(w) =

w1

w2

w1

P

w3

w1− w2

2

2w21

, w1

(B.2.9)

For the polytropic ideal gas P(e, ρ) = (γ  − 1)eρ.

The other interesting example is that of an isothermal ideal gas which can be

obtained by a simple reduction of the polytropic ideal gas. The two conservation

variables are

w =

w1

w2

=

ρm

(B.2.10)

while the physical variables are typically chosen as

p =

 p1

 p2

=

ρ

u

(B.2.11)

The nonlinear transformations between these two sets of variables are given by

w(p) =

p1

 p1 p2

and p(w) =

w1

w2

w1

(B.2.12)

The matrix of the right eigenvectors for the equations of the isothermal gas is

R(w) =

1 1

− a mρ

+ a

(B.2.13)

and the matrix of the left eigenrows is

L(w) = 1

2a

a + m

ρ−1

a − mρ

1

(B.2.14)

159

Page 160: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 160/195

B.3 The boundary values for a scalar unknown

Let us consider the problem of imposing the boundary contitions at the point

 x = xright, which is assumed to be the right end of the integration interval. In a

conservative numerical scheme of Godunov type, based on the updating of cell

averages by the accumulation of flux contributions to the each cell, the boundary

values affect the solution only through the evaluation of the flux on the boundary.

The boundary value of the unknown is either an indepedent external datum, to

be provided from outside the computational domain, or is simply the boundary

value of the solution, known from the previous time step. The choice between

these two possibility depends on the inflow/ouflow nature of the boundary (at the

considere time), at least in the case of a single equation ∂t w+

∂ x f (w)=

0 for a

scalar unknown w. To have a compact notation, let us denote the trace of already

computed solution at time t  as follows

w∂ (t ) ≡ w( x, t )| x= xright= w( xright, t ). (B.3.1)

To refer the available boundary data and the known boundary values of the already

computedsolutionbymeans of oneandthesamemathematical symbol letus define

the function w(t ), defined only on the right boundary, as follows

w(t )

= w∂ (t ) if  a(w( xright, t )) ≥ 0

wext(t ) if  a(w( xright, t )) < 0(B.3.2)

where a(w) = f ′(w) is the advection speed. Thus, the alternative corresponds to

a right end which is an outflow or an inflow boundary. Here the function wext(t )

is assumed to be given and can be in particular a prescribed constant value.

In a finitevolume discretizationof thenonlinear conservation law, theboundary

value w(t ) is taken into account through the evaluation of the flux by means of 

 f  = f (w).

B.4 Steps of the boundary procedure for a system

For a system the situation is much more complicated. In fact, there are more

than one variables defined at any boundary point and therefore some of them

are to be taken from outside, as prescribed boundary conditions, and some other

must be extracted from the boundary trace of the solution itself. As anticipated,

the extreme difficulty of imposing the boundary conditions in hyperbolic systems

comes from such a hybrid nature. Mathematically speaking, the complication is

due to the difficulty in defining the vector quantity to be used to evaluate flux on

the boundary incorporating the correct number of appropriate informations from

160

Page 161: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 161/195

the exterior of the computational domain and the same time the proper elements

of the solution already determined at the considered time.To solve this problem Alberto Guardone suggested a method that is described

in thefollowing. Hismethod can be implemented in twoalternativeways. The first

procedure is based on considering variations of the characteristic variables while

the second relies upon the evaluation of the characteristic variables themselves.

Step 0. Preliminary: Eigenstructure

The preliminary computation is the determination of the eigenstructure of the local

solution on the boundary. This means to compute initially the eigenvalues

λ∂ℓ

≡λℓ(w∂ ) ℓ

=1, 2, . . . m, (B.4.1)

which are assumed to be set in an increasing order. These values are independent

of the variables chosen to formulate the eigenvalue problem, so that they can be

referred to, collectively, as the vector

λ∂ ≡ λ∂1, λ∂

2, . . . , λ∂m

(B.4.2)

Then, to complete the solution eigenstructure on the boundary, the matrices of the

right and left eigenvectors are computed

R(w∂ ) and L(w∂ ) (B.4.3)

normalized so that L(w∂ ) R(w∂ ) = I. We will denote the number of strictlynegative eigenvalues by k , with 0 ≤ k  ≤ m. This number is independent of 

the variables chosen to formulate the eigenvalue problem. In the first form of 

Guardone’s procedure considered here, the value of k  is taken into account only

in an implicit manner through an operator that selects the components of a vector

dependening on the sign of their corresponding eigenvalues, as it will be shown

later.

Step 1. Determination of the characteristic variation

Let us suppose that the value of all of the physical variables p is known outside the

right extreme of the integration interval and let us denote the vector of these data

by

pext ≡

 pext1

 pext2...

 pextm

(B.4.4)

In practice only some of the components of  pext will be needed in any specific

circumstance, but the selection of the proper components that must be actually

taken into account will be achieved automatically, see below.

161

Page 162: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 162/195

Let us introduce the difference between the solution vector w∂ and the value

of conservation variable w(pext) corresponding to the external data pext:

w ≡ w∂ − w(pext) (B.4.5)

The variation of the characteristic variables is defined simply by

v ≡ L(w∂ )w = L(w∂ )w∂ − w(pext)

(B.4.6)

Step 2. Selection of the characteristic boundary variations

Each component of the characteristic variation is now defined according to the sign

of the corresponding eigenvalue. A negative sign means that the characteristic line

enters theright extremeof theintegrationinterval, implying that theboundaryvalueof thecorrespondingcomponentof thecharacteristic variation must bechosen from

the vector v. On the contrary a positive sign means that the characteristic line

is sorting out from the right end of the interval so that the boundary value of the

conservative vector w must be chosen from the vector w∂ of the solution on the

boundary. This corresponds to a zero value for the component of the characteristic

variation. In formula we have

vℓ ≡

vℓ if  λ∂ℓ < 0

0 if  λ∂ℓ ≥ 0

(B.4.7)

for ℓ = 1, 2, . . . , m. The complete “barred” characteristic variation results in

v =

v1

v2...

vm

(B.4.8)

We can formalize this step by introducing an operator acting on a vector y which

selects its components only when the corresponding eigenvalue is strictly negative,

and puts zero otherwise. Explicitly, we define SN λ the operator selecting the part

corresponding to the strictly negative eigenvalues, as follows

SN λ y ≡

 y1 if  λ1 < 0

0 if  λ1 ≥ 0

 y2 if  λ2 < 0

0 if  λ2 ≥ 0...

 ym if  λm < 0

0 if  λm ≥ 0

(B.4.9)

162

Page 163: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 163/195

In terms of this operator, the relation defining the characteristic variation v on

the right extreme of the integration interval can be written in the following form

v = SN λ∂ v = SN λ∂ L(w∂ )w∂ − w(pext)

(B.4.10)

But the characteristic variables are not the unknowns of the nonlinear hyperbolic

problem, thus weneed a last step toreturnbackto theoriginalconservativevariables

of the system.

Step 3. Back transformation to the conservative variables

This step involves the inverse transformation from the characteristic variables to

the conservative ones. We will use the matrix R(w∂ ) to perform the back transfor-

mation of the variations in the form

R(w∂ ) v (B.4.11)

Thefinal expression for thesought for“barred” vector of theconservation variables

on the right boundary is

w = w∂ − R(w∂ ) v

= w∂ − R(w∂ )SN λ∂ L(w∂ )w∂ − w(pext)

(B.4.12)

By means of the w the boundary flux f  = f (w) can be determined and usedeventually for the time advancement of the discretized hyperbolic system.

The treatment of the boundary condition at the left extreme x = xleft is similar

and the final expression for the sought for “barred” vector of the conservation

variables on the left boundary is

w = w∂ − R(w∂ )SP λ∂ L(w∂ )w∂ − w(pext)

(B.4.13)

where one has introduced the operator SP λ∂ that selects the components of the

vector argument when the corresponding eigenvalue is strictly positive and sets

zero otherwise.

163

Page 164: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 164/195

Mon Mar 17 11:57:48 2008

−0.2 0 1 2 2.2

2.843

3

4

4.651

1

x

   u

.

.

Mon Mar 17 11:58:17 2008

−0.2 0 1 2 2.2

−0.3063

0

1

2

3

3.368

2

x

   u

− .

.

Figure B..3: Comparison of density and momentum of the numerical solution with

the exact solution in the shock reflection problem

164

Page 165: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 165/195

.

165

Page 166: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 166/195

C. Algorithms

C.1 Main Program

PROGRAM isot_pig_main

USE numerical_fluxes ! system_order

USE flux_jacobian

USE riemann_isot_pig_solvers

USE riemann_isot_pig_profiles

USE isothermal_pig

USE plot_procedures

IMPLICIT NONE

INTEGER, PARAMETER :: Np = 100, Ni = Np - 1, &

n_max = 1000, &

limiter = 1

REAL (KIND=8), PARAMETER :: CFL = 0.75

REAL (KIND=8), DIMENSION(Np) :: xx, cell_size, rr_e, mm_e

REAL (KIND=8), DIMENSION(system_order, Np) :: ww, RR, ww_e

REAL (KIND=8), DIMENSION(system_order, Ni) :: FF ! Numerical flux

! in 1D FF == PHI

REAL (KIND=8), DIMENSION(system_order) :: w_L, w_R, w_I, F_bar

!-------------------------------

! uu --> vector of the unknown variables

!

! xa --> left extreme of the computational interval

! xb --> right extreme of the computational interval

! The initial discontinuity is at the interval midpoint

! w_L --> left state

! w_R --> right state

166

Page 167: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 167/195

! time_end --> final time of the solution

REAL (KIND=8), DIMENSION(system_order, 2) :: F_SO

! Surface Numerical Flux of

! the Second Order term

REAL (KIND=8) :: xa = 0, xb = 1, dx, &

dt, time_end, time, &

nu_2s, nu_2r

INTEGER :: scheme, n, i, j, jl, jr

CHARACTER (LEN=7), DIMENSION(4) :: &scheme_name = (/’Godunov’, ’Roe_lin’, ’LW_cons’, ’highres’/)

CHARACTER (LEN=3), DIMENSION(4) :: &

scheme_label = (/’God’, ’Roe’, ’LWc’, ’uhr’/)

WRITE (*,*)

WRITE (*,*) ’system order = ’, system_order

WRITE (*,*)

!------------ INITIAL DATA FOR THE RIEMANN PROBLEM ------------------------

time_end = 0.15d0

w_L(1) = 0.6d0; w_R(1) = 0.5d0

w_L(2) = 0.4d0; w_R(2) = 0.2d0

CALL limits_relative_velocity (w_L, w_R, nu_2s, nu_2r)

dx = (xb - xa) / (Np - 1)

! uniform ordered grid

D O j = 1 , N p

xx(j) = xa + (j - 1) * dx

ENDDO

cell_size(1) = dx/2 ! first half-cell

D O j = 2 , N p - 1

cell_size(j) = dx

ENDDO

167

Page 168: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 168/195

cell_size(Np) = dx/2 ! last half-cell

DO scheme = 1, SIZE(scheme_name)

WRITE (*,*); WRITE (*,*) scheme_name(scheme); WRITE (*,*)

time = 0; n = 0

! initial condition of the Riemann problem!-----------------------------------------------------------------

WHERE (xx < (xa + xb)/2)

ww(1,:) = w_L(1)

ww(2,:) = w_L(2)

ELSEWHERE

ww(1,:) = w_R(1)

ww(2,:) = w_R(2)

END WHERE

!-----------------------------------------------------------------

DO WHILE (time < time_end .AND. n < n_max) ! loop on time

dt = CFL * dx / MAXVAL(ABS(eigenvalue(ww)) + 1.0d-8) ! CFL Stability limit

IF (time + dt > time_end) THEN ! to match the final time exactly

dt = time_end - time

ENDIF

time = time + dt; n = n + 1

WRITE (*,*) ’time-step number: ’, n, ’ time: ’, time

SELECT CASE (scheme_name(scheme))

CASE (’Godunov’); CALL god_num_flux (xx, ww, FF)

CASE (’Roe_lin’); CALL Roe_num_flux (xx, ww, FF)

CASE (’LW_cons’); CALL LWc_num_flux (dt, xx, ww, FF, F_SO)

168

Page 169: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 169/195

CASE (’highres’); CALL uhr_num_flux (dt, xx, ww, FF, F_SO, limiter)

END SELECT

R R = 0

! Imposition fo the boundary conditions in weak form

! through the Numerical Flux F_bar at the two

! end points of the interval

CALL left_boundary (time - dt/2, primitive(ww(:,1)), ww(:,1), F_bar)

RR(:,1) = RR(:,1) + F_bar

! Right end of the interval

CALL right_boundary (time - dt/2, primitive(ww(:,Np)), ww(:,Np), F_bar)

RR(:,Np) = RR(:,Np) - F_bar

! Contribution of the Surface Numerical Flux of the Second Order term

IF (scheme_name(scheme) == ’LW_cons’ .OR. scheme_name(scheme) == ’highres’

RR(:,1) = RR(:,1) + F_SO(:,1)

RR(:,Np) = RR(:,Np) + F_SO(:,2)

ENDIF

DO i = 1, Ni; j = i ! i is the interface index

! ===== ! x_i = x (j) + d x/2

jl = j; jr = j + 1

RR(:,jl) = RR(:,jl) - FF(:,i)RR(:,jr) = RR(:,jr) + FF(:,i)

ENDDO

ww = ww + RR * SPREAD(dt/cell_size, 1, system_order)

ENDDO ! loop on time

!------------------------------------------------------------------

169

Page 170: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 170/195

CALL exact_Riemann (w_L, w_R, w_I)! , rel_err, iterations) ! OPTIONAL

CALL exact_Riemann_isot_pig_profiles (w_L, w_I, w_R, (xa+xb)/2, xx, time, &

rr_e, mm_e)

CALL plot_profile_name (xx, ww(1,:), rr_e, scheme_label(scheme)//"_rho")

CALL plot_profile_name (xx, ww(2,:), mm_e, scheme_label(scheme)//"_mom")

CALL plot_profile_name (xx, ww(2,:)/ww(1,:), mm_e/rr_e, &

scheme_label(scheme)//"_vel")

ENDDO ! loop on the schemes

END PROGRAM isot_pig_main

170

Page 171: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 171/195

C.2 Modules

MODULE isothermal_pig

! P(rho) = aˆ2 rho, with a = SQRT(P’(rho))

IMPLICIT NONE

REAL (KIND=8), PARAMETER, PUBLIC :: a = 1.5d0

INTERFACE pressure

MODULE PROCEDURE pressure_s, pressure_v

END INTERFACE pressure

INTERFACE sound_speed

MODULE PROCEDURE sound_speed_s, sound_speed_v

END INTERFACE sound_speed

INTERFACE fundamental_derivative

MODULE PROCEDURE fundamental_derivative_s, fundamental_derivative_v

END INTERFACE fundamental_derivative

PRIVATE :: pressure_s, sound_speed_s, fundamental_derivative_s, &

pressure_v, sound_speed_v, fundamental_derivative_v

CONTAINS

FUNCTION pressure_s(r) RESULT(P)

IMPLICIT NONE

REAL(KIND=8), INTENT(IN) :: r

REAL(KIND=8) :: P

171

Page 172: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 172/195

P = a * * 2 * r

END FUNCTION pressure_s

FUNCTION pressure_v(rr) RESULT(PP)

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr

REAL(KIND=8), DIMENSION(SIZE(rr)) :: PP

PP = a**2 * rr

END FUNCTION pressure_v

!----------------------------------------------------------------

FUNCTION sound_speed_s(r) RESULT(c)

IMPLICIT NONE

REAL(KIND=8), INTENT(IN) :: r

REAL(KIND=8) :: c

c = r ! to avoid warning since for isothermal_pig

! the sound speed is the constant a and does

! not depend on the density r

c = a

END FUNCTION sound_speed_s

FUNCTION sound_speed_v(rr) RESULT(cc)

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr

REAL(KIND=8), DIMENSION(SIZE(rr)) :: cc

cc = rr ! to avoid warning since for isothermal_pig

! the sound speed is the constant a and does

! not depend on the density r

c c = a

END FUNCTION sound_speed_v

172

Page 173: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 173/195

!----------------------------------------------------------------

FUNCTION fundamental_derivative_s(r) RESULT(G)

IMPLICIT NONE

REAL(KIND=8), INTENT(IN) :: r

REAL(KIND=8) :: G

G = r ! to avoid warning since for isothermal_pig

! the fundamental derivative of gasdynamics is

! the constant and does not depend on the density r

G = 2 * a * * 2

END FUNCTION fundamental_derivative_s

FUNCTION fundamental_derivative_v(rr) RESULT(GG)

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: rr

REAL(KIND=8), DIMENSION(SIZE(rr)) :: GG

GG = rr ! to avoid warning since for isothermal_pig

! the fundamental derivative of gasdynamics is

! the constant and does not depend on the density r

GG = 2 * a**2

END FUNCTION fundamental_derivative_v

END MODULE isothermal_pig

173

Page 174: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 174/195

MODULE flux_jacobian

USE isothermal_pig

IMPLICIT NONE

INTERFACE flux

MODULE PROCEDURE flux_v, flux_a

END INTERFACE flux

INTERFACE AA

MODULE PROCEDURE Jac_v, Jac_a

END INTERFACE AA

INTERFACE eigenvalue

MODULE PROCEDURE eigenvalue_v, eigenvalue_a

END INTERFACE eigenvalue

INTERFACE primitive

MODULE PROCEDURE primitive_v, primitive_a

END INTERFACE primitive

INTERFACE conservative

MODULE PROCEDURE conservative_v, conservative_a

END INTERFACE conservative

PRIVATE :: flux_v, flux_a, Jac_v, Jac_a, &

eigenvalue_v, eigenvalue_a, &

primitive_v, conservative_v, &

primitive_a, conservative_a

CONTAINS

!=======

174

Page 175: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 175/195

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FUNCTION flux_v(w) RESULT(f)

! f = f(w)

! Flux function of the nonlinear hyperbolic system

! simple vector version

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w

REAL(KIND=8), DIMENSION(SIZE(w)) :: f

REAL(KIND=8) :: u, P

u = w(2)/w(1)

P = pressure(w(1))

f(1) = w(2)

f(2) = w(2)*u + P

END FUNCTION flux_v

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FUNCTION flux_a(ww) RESULT(ff)

! f = f(w)

! Flux function of the nonlinear hyperbolic system

! array version

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:,:), INTENT(IN) :: ww

REAL(KIND=8), DIMENSION(SIZE(ww,1), SIZE(ww,2)) :: ff

REAL(KIND=8), DIMENSION(SIZE(ww,2)) :: uu, PP

uu = ww(2,:)/ww(1,:)

175

Page 176: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 176/195

PP = pressure(ww(1,:))

ff(1, :) = ww(2,:)

ff(2, :) = w w(2,:) * u u + PP

END FUNCTION flux_a

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FUNCTION Jac_v(w) RESULT(J)

! Jacobiam matrix of the Euler equations of gasdynamics

! Simple version

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w

REAL(KIND=8), DIMENSION(SIZE(w), SIZE(w)) :: J

REAL(KIND=8) :: u, c2

u = w(2)/w(1)

c2 = sound_speed(w(1))**2

J(1,1) = 0; J(1,2) = 1

J(2,1) = c2 - u*u; J(2,2) = 2*u

END FUNCTION Jac_v

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FUNCTION Jac_a(ww) RESULT(JJ)

! Jacobiam matrix of the Euler equations of gasdynamics

! Version extended to arrays

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:, :), INTENT(IN) :: ww

REAL(KIND=8), DIMENSION(SIZE(ww,1), SIZE(ww,1), SIZE(ww,2)) :: JJ

176

Page 177: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 177/195

REAL(KIND=8), DIMENSION(SIZE(ww,2)) :: uu, cc2

uu = ww(2,:)/ww(1,:)

cc2 = sound_speed(ww(1,:))**2

JJ(1,1, :) = 0; JJ(1,2, :) = 1

JJ(2,1, :) = cc2 - uu*uu; JJ(2,2, :) = 2*uu

END FUNCTION Jac_a

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FUNCTION eigenvalue_v(w) RESULT(lambda)

! Nonlinear system of Euler equations of Gasdymnamics

! Simple version

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w

REAL(KIND=8), DIMENSION(SIZE(w)) :: lambda

REAL(KIND=8) :: u, c

u = w(2)/w(1)

c = sound_speed(w(1))

lambda(1) = u - c

lambda(2) = u + c

END FUNCTION eigenvalue_v

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FUNCTION eigenvalue_a(ww) RESULT(lambda)

! Nonlinear system of Euler equations of Gasdymnamics

! Extended array version

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:, :), INTENT(IN) :: ww

177

Page 178: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 178/195

REAL(KIND=8), DIMENSION(SIZE(ww,1), SIZE(ww,2)) :: lambda

REAL(KIND=8), DIMENSION(SIZE(ww,2)) :: uu, cc

uu = ww(2,:)/ww(1,:)

cc = sound_speed(ww(1,:))

lambda(1,:) = uu - cc

lambda(2,:) = uu + cc

END FUNCTION eigenvalue_a

!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

SUBROUTINE eigenstructure (w, lambda, L, R)

! Nonlinear system of Euler equations of Gasdymnamics

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w

REAL(KIND=8), DIMENSION(:), INTENT(OUT) :: lambda

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: L, R

REAL(KIND=8) :: u, c, G ! fundamental derivative

u = w(2)/w(1)

c = sound_speed(w(1))

lambda(1) = u - c

lambda(2) = u + c

G = fundamental_derivative(w(1))

R(1,1) = -1; R(1,2) = 1R(2,1) = c - u; R(2,2) = c + u

R = (w(1)/(G*c)) * R

L(1,1) = -c - u; L(1,2) = 1

L(2,1) = c - u; L(2,2) = 1

L = G/(2*w(1)) * L

END SUBROUTINE eigenstructure

178

Page 179: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 179/195

!---------------------------------------------------------------

FUNCTION conservative_v(primitives) RESULT(w)

! primitive(1) = mass density

! primitive(2) = velocity

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: primitives

REAL(KIND=8), DIMENSION(SIZE(primitives)) :: w

w(1) = primitives(1)w(2) = primitives(1) * primitives(2)

END FUNCTION conservative_v

!---------------------------------------------------------------

FUNCTION primitive_v(conservatives) RESULT(p)

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: conservatives

REAL(KIND=8), DIMENSION(SIZE(conservatives)) :: p

p(1) = conservatives(1)

p(2) = conservatives(2) / conservatives(1)

END FUNCTION primitive_v

!---------------------------------------------------------------

FUNCTION conservative_a(primitives) RESULT(ww)

! primitive(1) = mass density

! primitive(2) = velocity

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:, :), INTENT(IN) :: primitives

REAL(KIND=8), DIMENSION(SIZE(primitives, 1), SIZE(primitives, 2)) :: ww

ww(1, :) = primitives(1, :)

ww(2, :) = primitives(1, :) * primitives(2, :)

END FUNCTION conservative_a

179

Page 180: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 180/195

!---------------------------------------------------------------

FUNCTION primitive_a(conservatives) RESULT(pp)

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:, :), INTENT(IN) :: conservatives

REAL(KIND=8), DIMENSION(SIZE(conservatives, 1), SIZE(conservatives, 2)) :: pp

pp(1, :) = conservatives(1, :)

pp(2, :) = conservatives(2, :) / conservatives(1, :)

END FUNCTION primitive_a

!---------------------------------------------------------------

END MODULE flux_jacobian

180

Page 181: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 181/195

MODULE Riemann_isot_pig_solvers

USE flux_jacobian

! USE isothermal_pig

IMPLICIT NONE

INTERFACE Roe_linearization

MODULE PROCEDURE Roe_linearization_isot_pig_l_LR

MODULE PROCEDURE Roe_linearization_isot_pig_int

END INTERFACE Roe_linearization

INTERFACE exact_Riemann

MODULE PROCEDURE exact_Riemann_isot_pig

END INTERFACE exact_Riemann

INTERFACE limits_relative_velocity

MODULE PROCEDURE limits_relative_velocity_isot_pig

END INTERFACE limits_relative_velocity

INTERFACE transonic_rarefaction

MODULE PROCEDURE transonic_rarefaction_isot_pig

END INTERFACE transonic_rarefaction

PRIVATE :: Roe_linearization_isot_pig_l_LR, Roe_linearization_isot_pig_int, &

exact_Riemann_isot_pig, &

limits_relative_velocity_isot_pig, &

transonic_rarefaction_isot_pig, &

loci_isot_pig

CONTAINS

!=======================================================================

SUBROUTINE Roe_linearization_isot_pig_l_LR (wl, wr, lambda, L, R)

! Solution of the linear Riemann problem for the Roe matrix

! w is the vector of the conservative variables:

! mass density, momentum density and total energy density

IMPLICIT NONE

181

Page 182: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 182/195

REAL(KIND=8), DIMENSION(2), INTENT(IN) :: wl, wr

REAL(KIND=8), DIMENSION(2), INTENT(OUT) :: lambdaREAL(KIND=8), DIMENSION(2,2), INTENT(OUT) :: L, R

REAL(KIND=8) :: ul, ur, sl, sr, u

! Determination of Roe intermediate state

ul = wl(2)/wl(1)

ur = wr(2)/wr(1)

! Roe’s averaging

sl = SQRT(wl(1)); sr = SQRT(wr(1))

u = (ul * sl + ur * sr) / (sl + sr)

! eigenvalues and right/left eigenvectors of Roe matrix

lambda(1) = u - a; lambda(2) = u + a

R(1,1) = 1; R(1,2) = 1

R(2,1) = u - a; R(2,2) = u + a

L(1,1) = a + u; L(1,2) = -1

L(2,1) = a - u; L(2,2) = 1

L = L/(2*a)

END SUBROUTINE Roe_linearization_isot_pig_l_LR

!=======================================================================

SUBROUTINE Roe_linearization_isot_pig_int (wl, wr, lambda, wi)

! Solution of the linear Riemann problem for the Roe matrix

! w is the vector of the conservative variables:

! mass density, momentum density and total energy density

IMPLICIT NONE

REAL(KIND=8), DIMENSION(2), INTENT(IN) :: wl, wr

REAL(KIND=8), DIMENSION(2), INTENT(OUT) :: lambda, wi

REAL(KIND=8), DIMENSION(2,2) :: R, L

REAL(KIND=8), DIMENSION(2) :: dv

REAL(KIND=8) :: ul, ur, sl, sr, u

182

Page 183: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 183/195

! Determination of Roe intermediate state

ul = wl(2)/wl(1)

ur = wr(2)/wr(1)

! Roe’s averaging

sl = SQRT(wl(1)); sr = SQRT(wr(1))

u = (ul * sl + ur * sr) / (sl + sr)

! eigenvalues and right/left eigenvectors of Roe matrix

lambda(1) = u - a; lambda(2) = u + a

R(1,1) = 1; R(1,2) = 1

R(2,1) = u - a; R(2,2) = u + a

L(1,1) = a + u; L(1,2) = -1

L(2,1) = a - u; L(2,2) = 1

L = L/(2*a)

! intermediate states of the solution of the linear Riemann problem

dv = MATMUL(L, wr - wl) ! characteristic variation

wi = wl + dv(1) * R(:,1)

WRITE(*,*) ’dv(1) = ’, dv(1)

END SUBROUTINE Roe_linearization_isot_pig_int

!=======================================================================

SUBROUTINE exact_Riemann_isot_pig (wl, wr, wi, rel_err, iterations) ! OPTIONAL

!=======================================================================

! Solution of the Riemann Problem for the! Isothermal version of the Polytropic Ideal Gas

!

! Iterative Solution by Newton method

!

!

! phi(rho) = 0 where phi(rho) = m_L(rho) - m_R(rho)

!

!-----------------------------------------------------------------------

!

! INPUT

183

Page 184: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 184/195

!

! wl : left state (conservative variables)! wr : right state (conservative variables)

!

! OPTIONAL

!

! rel_err : relative error (of pressure) to stop the iterations

! [default = 1.0d-7]

! iterations : maximum number of iterations

! [default = 100]

!

!-----------------------------------------------------------------------

!

! OUTPUT!

! wi : intermediate state

!

! OPTIONAL

!

! iterations : number of actually computed iterations

!

!-----------------------------------------------------------------------

!

! The program calculates also the relative velocities

! nu_2r and nu_2s that define the limits between

! solutions containing one shock wave and one rarefaction wave

! and thus with two rarefaction waves or two shock waves,

! respectively.

!

!=======================================================================

IMPLICIT NONE

REAL(KIND=8), INTENT(IN), DIMENSION(:) :: wl, wr

REAL(KIND=8), INTENT(OUT), DIMENSION(:) :: wi

REAL(KIND=8), INTENT(IN), OPTIONAL :: rel_err

INTEGER, INTENT(INOUT), OPTIONAL :: iterations

REAL(KIND=8) :: rho, rhol, rhor, D_rho, &

nu_2s, nu_2r, &

m1, m2, Dm1, Dm2

REAL(KIND=8) :: rel_err_Int = 1.0d-07 ! default

INTEGER :: max_it_Int = 100 ! default

INTEGER :: it

!-----------------------------------------------------------------------

184

Page 185: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 185/195

IF (PRESENT(rel_err)) rel_err_Int = rel_err

IF (PRESENT(iterations)) max_it_Int = iterations

rhol = wl(1); rhor = wr(1)

! CALL limits_relative_velocity (wl, wr, nu_2s, nu_2r)

! average for the initial guess

rho = (rhol + rhor)/2

D_rho = rhor - rhol

DO it = 1, max_it_Int

CALL loci_isot_pig (1, wl, rho, m1, Dm1)

CALL loci_isot_pig (2, wr, rho, m2, Dm2)

D_rho = - (m1 - m2)/(Dm1 - Dm2)

rho = rho + D_rho

! convergence check

IF (ABS(D_rho) <= rel_err_Int * rho) THEN

CALL loci_isot_pig (1, wl, rho, m1)

wi(1) = rho; wi(2) = m1

IF (PRESENT(iterations)) iterations = it

WRITE (*,*) ’ iterations = ’, it

RETURN

ENDIF

! WRITE (*,*) ’it =’, it

ENDDO

PRINT*,’ exact_Riemann_isot_pig solver fails to converge’

END SUBROUTINE exact_Riemann_isot_pig

185

Page 186: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 186/195

!================================================================

SUBROUTINE loci_isot_pig (i, w_, rho, m, DmDr)

IMPLICIT NONE

INTEGER, INTENT(IN) :: i ! eigenvalue

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w_ 

REAL(KIND=8), INTENT(IN) :: rho

REAL(KIND=8), INTENT(OUT) :: m

REAL(KIND=8), OPTIONAL, INTENT(OUT) :: DmDr

REAL(KIND=8) :: s, rho_, m_, rat, sqr, lnr

s = (-1)**i

rho_ = w_(1); m_ = w_(2)

rat = rho/rho_ 

IF (rho > rho_) THEN ! Hugoniot locus

sqr = SQRT(rat)

m = m_ * rat + s * a * (rho - rho_) * sqr

IF (PRESENT(DmDr)) DmDr = m_/rho_ + s * a * (sqr + (rho - rho_)/(2*SQRT(rh

ELSE ! Integral curve

lnr = LOG(rat)

m = m_ * rat + s * a * rho * lnr

IF (PRESENT(DmDr)) DmDr = m_/rho_ + s * a * (lnr + 1)

ENDIF

END SUBROUTINE loci_isot_pig

!================================================================

SUBROUTINE limits_relative_velocity_isot_pig (wl, wr, nu_2s, nu_2r)

IMPLICIT NONE

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: wl, wr

REAL(KIND=8), INTENT(OUT) :: nu_2s, nu_2r

186

Page 187: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 187/195

REAL(KIND=8) :: rhol, ul, rhor, ur, &rho_min, rho_MAX

! limits of relative velocity for 2 rarefaction waves and 2 shocks

rhol = wl(1); ul = wl(2)/wl(1)

rhor = wr(1); ur = wr(2)/wr(1)

rho_min = MIN(rhol, rhor)

rho_MAX = MAX(rhol, rhor)

nu_2s = - a * ABS(rhol - rhor) / SQRT(rhol * rhor)

nu_2r = a * ABS(LOG(rhol/rhor))

ul = wl(2)/ wl(1); ur = wr(2)/ wr(1)

WRITE (*,*)

WRITE (*,*) ’ limits of the relative velocity’

WRITE (*,*) ’ nu = ’, ur - ul

WRITE (*,*) ’ nu_2s = ’, nu_2s

WRITE (*,*) ’ nu_2r = ’, nu_2r

WRITE (*,*)

END SUBROUTINE limits_relative_velocity_isot_pig

!================================================================

SUBROUTINE transonic_rarefaction_isot_pig (i, w, ws)

! Sonic values of the rarefaction wave

! similarity solution at xi = 0

IMPLICIT NONE

INTEGER, INTENT(IN) :: i ! eigenvalue

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: w

REAL(KIND=8), DIMENSION(:), INTENT(OUT) :: ws

REAL(KIND=8), DIMENSION(SIZE(w)) :: lambda

REAL(KIND=8) :: rho, E

lambda = eigenvalue(w)

rho = w(1)

SELECT CASE (i)

187

Page 188: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 188/195

CASE (1)

E = EXP(lambda(1)/a)

ws(1) = rho * E

ws(2) = rho * a * E

CASE (2)

E = EXP(-lambda(2)/a)

ws(1) = rho * E

ws(2) = -rho * a * E

END SELECT

END SUBROUTINE transonic_rarefaction_isot_pig

END MODULE Riemann_isot_pig_solvers

188

Page 189: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 189/195

FUNCTION psi_lim(a, b, limiter) RESULT(psi)

! Limiter function in Rebay’s form, as a function

! of two variables: a = Duˆcentred, b = Duûpwind

!

! limiter is an OPTIONAL parameter

!

! DEFAULT ---> van Leer

!

! limiter == -2 ---> Second-order scheme

! limiter == 0 ---> no limiter, first-order upwind

!

! limiter == 1 ---> van Leer

! limiter == 2 ---> minmod! limiter == 3 ---> superbee

! limiter == 4 ---> Monotonized Central

!

IMPLICIT NONE

REAL(KIND=8), INTENT(IN) :: a, b

INTEGER, OPTIONAL, INTENT(IN) :: limiter

REAL(KIND=8) :: psi

REAL (KIND=8), PARAMETER :: zero = 0, half = 0.5d0

IF (PRESENT(limiter)) THEN

SELECT CASE(limiter)

CASE(-2) ! Second-order scheme

p s i = b

CASE(0) ! no limiter, first-order upwind

p s i = 0

CASE(1) ! van Leer

psi = (a*ABS(b) + ABS(a)*b)/(ABS(a) + ABS(b) + 1.0d-8)

CASE(2) ! minmod

psi = (SIGN(half,a) + SIGN(half,b)) * MIN(ABS(a), ABS(b))

CASE(3) ! superbee

psi = (SIGN(half,a) + SIGN(half,b)) &

* MAX( MIN(ABS(a), 2*ABS(b)), MIN(2*ABS(a), ABS(b)) )

CASE(4) ! Monotonized Central

psi = MAX( zero, MIN((a+b)/2, 2*a, 2*b) ) &

+ MIN( zero, MAX((a+b)/2, 2*a, 2*b) )

189

Page 190: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 190/195

CASE DEFAULTWRITE (*,*) ’Unknown limiter specified’; STOP

END SELECT

ELSE ! default limiter: van Leer

psi = (a*ABS(b) + ABS(a)*b)/(ABS(a) + ABS(b) + 1.0d-8)

ENDIF

END FUNCTION psi_lim

190

Page 191: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 191/195

C.3 Exact solutions

MODULE analytic_sol_iig

! IIG Isothermal Ideal Gas

USE isothermal_ideal_gas, s_s_T => a

IMPLICIT NONE

CONTAINS

FUNCTION eigenvalue(u, i) RESULT(lambda_i)

! Eigenvalue

IMPLICIT NONE

REAL(KIND=8), DIMENSION(2), INTENT(IN) :: u

INTEGER, INTENT(IN) :: i

REAL(KIND=8) :: lambda_i

SELECT CASE(i)

CASE(1); lambda_i = u(2)/u(1) - s_s_T

CASE(2); lambda_i = u(2)/u(1) + s_s_T

CASE DEFAULT

WRITE (*,*) ’The index for the eigenvalues must be 1 for’

WRITE (*,*) ’the first eigenvalue and 2 for the second one’

WRITE (*,*) ’STOP’

STOP

END SELECT

END FUNCTION eigenvalue

SUBROUTINE Riemann_exact_sol_iig (u_l, u_i, u_r, x0, T, xx, uu)

REAL(KIND=8), DIMENSION(2), INTENT(IN) :: u_l, u_i, u_r

REAL(KIND=8), INTENT(IN) :: x0, T

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: xx

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: uu

191

Page 192: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 192/195

REAL(KIND=8), DIMENSION(SIZE(xx)) :: ee

REAL(KIND=8) :: rho_l, rho_i, rho_r, &

vb, ve, wb, we, a, &

x1, x2, x3, x4

a = s_s_T

! Evaluation of velocity at the limit under a condition

! on the density by distinguishing shock and rarefaction

!

! shock case: shock speed s

! rarefaction case: the limiting velocities are the eigenvalues

rho_l = u_l(1)

rho_i = u_i(1)

rho_r = u_r(1)

! left wave

IF (rho_l < rho_i) THEN ! LEFT SHOCK

vb = (u_i(2) - u_l(2)) / (rho_i - rho_l)

ve = vb

ELSE ! LRFT RAREFACTION

vb = eigenvalue(u_l, 1)

ve = eigenvalue(u_i, 1)

ENDIF

! right wave

IF (rho_i > rho_r) THEN ! RIGHT SHOCK

wb = (u_r(2) - u_i(2)) / (rho_r - rho_i)

we = wb

ELSE ! RIGHT RAREFACTION

wb = eigenvalue(u_i, 2)

we = eigenvalue(u_r, 2)

192

Page 193: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 193/195

ENDIF

x1 = x0 + vb*T

x2 = x0 + ve*T

x3 = x0 + wb*T

x4 = x0 + we*T

! After the evaluation of the limiting velocities and

! positions, the exact solution can be calculated

WHERE (xx <= x1) ! inside the left state

uu(1,:) = u_l(1)

uu(2,:) = u_l(2)

END WHERE

WHERE (xx > x1 .AND. xx < x2) ! left f an

ee = EXP(-((xx - x0)/T - vb)/a)

uu(1,:) = u_l(1) * ee

uu(2,:) = u_l(1) * ee * ((xx - x0)/T + a)

END WHERE

WHERE (xx >= x2 .AND. xx <= x3) ! intermediate state

uu(1,:) = u_i(1)

uu(2,:) = u_i(2)

END WHERE

WHERE (xx > x3 .AND. xx < x4) ! inside the right fan

ee = EXP(((xx - x0)/T - we)/a)

uu(1,:) = u_r(1) * ee

uu(2,:) = u_r(1) * ee * ((xx - x0)/T - a)

END WHERE

WHERE (xx >= x4) ! right state

uu(1,:) = u_r(1)

193

Page 194: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 194/195

uu(2,:) = u_r(2)

END WHERE

END SUBROUTINE Riemann_exact_sol_iig

SUBROUTINE exact_shock_reflection_iig (rho_i, rho_w, T, xx, uu)

! Propagation of a shock wave toward a right wall and

! reflection of in a time tc

! For given density values on the left and right of! discontinuity, the speed of the incident shock is calculated.

! the value rho_i must be greater than that of rho_w

! to have a right propagating shock

REAL(KIND=8), INTENT(IN) :: rho_i, rho_w, T

REAL(KIND=8), DIMENSION(:), INTENT(IN) :: xx

REAL(KIND=8), DIMENSION(:,:), INTENT(OUT) :: uu

REAL(KIND=8) :: m_i, s_inc, s_rif, tc, xd, &

L, rho_star, x_shock, a

REAL(KIND=8), PARAMETER :: m_w = 0

! Evaluation of the interval length and of the initial

! position (xd) of the discontinuity

a = s_s_T

L = MAXVAL(xx) - MINVAL(xx)

xd = MINVAL(xx) + L/2 ! the shock is at the interval midpoint

m_i = a * rho_i * (1 - rho_w/rho_i) * SQRT(rho_i/rho_w)

s_inc = a * SQRT(rho_i/rho_w)

tc = L / (2*s_inc)

PRINT *, tc

rho_star = rho_i**2 / rho_w

s_rif = -a * SQRT(rho_w/rho_i)

194

Page 195: ReportGodunov Method and Related Schemes  for Nonlinear Hyperbolic Problems

7/28/2019 ReportGodunov Method and Related Schemes for Nonlinear Hyperbolic Problems

http://slidepdf.com/reader/full/reportgodunov-method-and-related-schemes-for-nonlinear-hyperbolic-problems 195/195

IF (T <= tc) THEN ! before reflection

x_shock = x d + s_inc * T

WHERE (xx <= x_shock) ! left state

uu(1,:) = rho_i

uu(2,:) = m_i

ELSEWHERE ! right state

uu(1,:) = rho_w

uu(2,:) = m_w

END WHERE

ELSE ! After shock-wave reflection

x_shock = MAXVAL(xx) + s_rif * (T - tc)