notes on godunov methods · notes on godunov methods hagala, r.; hansteen, v; mina, m. 1...

16
Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for simple equations like the advection equation with constant velocity u. For more complex systems of equations, it is a lot less clear which information travels in which direction, and at what velocity. Furthermore, as we have seen in the past lectures, discontinuities in the solution of a differential equation are a big problem from the numerical point of view. The reason for this is that the finite difference schemes commonly applied to evaluate (spatial) derivatives are based on the Taylor expansion, which requires differentiability. An example is the forward difference derivative: f 0 (x i ) f (x i x) - f (x i ) Δx . (1) The local error when ignoring the rest of the Taylor series is related to the sum of the higher order derivatives of the function, f 00 (xx/2 being the dominant error term. When a discontinuity is introduced – for instance where a shock front is forming – the local error terms for estimating the derivatives grow as the higher order derivatives diverge. A way to postpone (but not solve) this problem within the finite difference schemes would be to use higher order methods or higher resolution. However, for systems of partial differential equations describing conser- vation laws (e.g. Euler equations) it is possible to construct a class of con- servative numerical methods, which are able to capture and prevent shock formation in the numerical solution of the problem. 1

Upload: others

Post on 28-Mar-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Notes on Godunov Methods

Hagala, R.; Hansteen, V; Mina, M.

1 Introduction

1.1 Motivation

We already learned about upwind schemes, which make sense for simpleequations like the advection equation with constant velocity u. For morecomplex systems of equations, it is a lot less clear which information travelsin which direction, and at what velocity. Furthermore, as we have seen inthe past lectures, discontinuities in the solution of a differential equationare a big problem from the numerical point of view. The reason for thisis that the finite difference schemes commonly applied to evaluate (spatial)derivatives are based on the Taylor expansion, which requires differentiability.An example is the forward difference derivative:

f ′ (xi) ≈f (xi + ∆x)− f (xi)

∆x. (1)

The local error when ignoring the rest of the Taylor series is related to thesum of the higher order derivatives of the function, f ′′ (x) ∆x/2 being thedominant error term. When a discontinuity is introduced – for instancewhere a shock front is forming – the local error terms for estimating thederivatives grow as the higher order derivatives diverge. A way to postpone(but not solve) this problem within the finite difference schemes would be touse higher order methods or higher resolution.

However, for systems of partial differential equations describing conser-vation laws (e.g. Euler equations) it is possible to construct a class of con-servative numerical methods, which are able to capture and prevent shockformation in the numerical solution of the problem.

1

Page 2: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

1.2 Definitions

1.2.1 Systems of First-Order Partial Differential Equations

A system of n first-order partial differential equations can be expressed onlinear algebra form,

Ut + AUx + B = 0. (2)

Here U = (U1, · · · , Un)T is a set of independent physical quantities in thesystem, A is an n× n matrix deciding how these quantities interact, and Bis a vector of size n describing the source terms. Subscript t and x means an(element-wise) partial derivative with respect to time or space, Ux = ∂U/∂x.Generally, both A and B could depend on any Ui.

1.2.2 Conservation Laws

A system describing a set of conserved physical quantities U (e.g. density,momentum) can in general be written

Ut + F (U)x = 0, (3)

where F (U) = (F1 (U) , · · · , Fn (U))T is called the flux function. Each Fican be a function of all (U1, · · · , Un)T.

1.2.3 Jacobian of the flux function

The Jacobian matrix is given by

A (U) =∂F

∂U=

∂F1

∂U1

· · · ∂F1

∂Un...

. . ....

∂Fn∂U1

· · · ∂Fn∂Un

. (4)

A (quasi-)linear system described by equation (3) can be put on matrixform (2) by using the jacobian matrix A,

Ut + A (U) Ux = 0. (5)

2

Page 3: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

1.2.4 Hyperbolic, strictly hyperbolic, and elliptic system

A system on the form (2) is hyperbolic at point (x, t) if all n eigenvalues ofthe matrix A are real and correspond to n linearly independent eigenvec-tors K(1), · · · ,K(n). The system is strictly hyperbolic if all n eigenvalues aredistinct. If all eigenvalues are imaginary, the system is elliptic.

Example: Gas Dynamics. Gas dynamics are described by the equationsfor conservation of mass and momentum. In 1D given by

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

∂t (ρu) + ∂x(ρu2 + p

)= 0 (7)

From the above equations, one can directly see that we can write thesystem on conservative flux form (3) by using the set of conserved variables

U = (ρ, ρu)T and the flux function F = (ρu, ρu2 + p)T

.

[ρρu

]t

=

[ρu

ρu2 + p

]x

(8)

The jacobian of this system is given by

A =

∂F1

∂U1

∂F1

∂U2

∂F2

∂U1

∂F2

∂U2

(9)

=

∂ (ρu)

∂ (ρ)

∂ (ρu)

∂ (ρu)

∂ (ρu2 + p)

∂ (ρ)

∂ (ρu2 + p)

∂ (ρu)

. (10)

Notice that U2 = ρu is an independent variable, so ∂(ρu)/∂ρ = 0.

By assuming that p = p(ρ), and realizing that F = (U2, U22/U1 + p(ρ))

T,

one finds

A =

[0 1

−u2 + ∂p/∂ρ 2u

]. (11)

Often one defines c2s ≡ ∂p/∂ρ, where cs is the sound speed.

3

Page 4: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

For an isothermal gas, we have p = kρ with some constant k. Moregenerally, an adiabatic process has p = kργ, where γ is the adiabatic index.For an ideal monatomic gas, γ = 5/3, and for an ideal, diatomic gas (e.g.air), γ = 1.4.

The eigenvalues λi of this system can be found by solving

|A− λI| = det (A− λI) = 0, (12)

⇒ λ2 − 2uλ+ u2 − c2s = 0. (13)

With the solutions

λ± = u± 1

2

√4u2 − 4u2 + 4c2

s = u± cs. (14)

With a positive, real sound speed (∂p/∂ρ > 0), this is a strictly hyperbolicsystem.

1.3 The Riemann Problem

The Riemann problem is a specific Initial Value Problem (IVP) where theinitial conditions are piecewise constant, with only one discontinuity (usuallytaken to be at the origin). In the linear case, the general Riemann problemis

Ut + AUx = 0

U(x, t = 0) =

{UL for x < 0

UR for x > 0

(15)

The general solution U(x, t) in the strictly hyperbolic case is sketchedin Figure 1. The n eigenvalues of A are ordered from lowest to highest,λ1, λ2, · · · , λn. Each of them correspond to a characteristic wave travellingat velocity λi from the origin.

The state of the system to the left of the λ1 wave will stay UL, sinceno information from the other state can travel faster than the frontier wave.Likewise, the state to the right of λn will stay UR. The wedges between theleftmost and rightmost wave will be called star regions. Here, the state U∗

will be piecewise constant with discontinuities at each wavefront λi. U∗ willbe some linear combination of the decomposed right and left states.

To find the general solution, U, let’s first write the right and left statesas expansions of the n linearly independent eigenvectors of A, which we willdenote by K(1), · · · ,K(n).

4

Page 5: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Figure 1: General solution to the strictly hyperbolic Riemann problem in nvariables.

UL =n∑i=1

αiK(i) , UR =

n∑i=1

βiK(i). (16)

The eigenvectors K(i) describe the portion of the state information U thatis carried along with the wave corresponding to the eigenvalue λi. We cancombine the expansion (16) and our knowledge of the velocity of each char-acteristic wave to find the mixed state U∗ in any region. At any point (x, t)where the solution is to be found, we only need to identify which characteris-tic lines are to the left, and which are to the right of that point. Specifically,all λi < x/t are to the left of (x, t) – and have thus carried information fromthe right state to this point. All λi > x/t are to the right of (x, t) and theircorresponding information is carried from the left state. The general solutioncan in other words be written

U (x, t) =∑

i:λi>x/t

αiK(i) +

∑i:λi<x/t

βiK(i) . (17)

Note that for a point where x/t is smaller than or larger than all λi,equation (17) is equivalent to the spectral decomposition of UL or UR re-

5

Page 6: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

spectively (compare with equation 16). For a 2 × 2 system, there will onlybe three solutions at any time: a region where U = UL, a region whereU = UR, and the star region where U = U∗.

Example: Riemann Problem for Linearised Gas Dynamics.The equations for gas dynamics, (6) and (7), are quasi-linear, meaning thatthe matrix A is not constant, but depends on U. A perturbative expansionof the variables u = 0 + δu and ρ = ρ0 + δρ, while keeping only first orderterms of δu and δρ, gives the set of equations

∂tρ+ ρ0∂xu = 0, (18)

ρ0∂tu+ ∂xp = 0, (19)

where

∂xp =∂p

∂ρ∂xρ ≈ a2∂xρ. (20)

Here, a is constant, and equivalent to the sound speed when ρ = ρ0.On matrix form, this linearized system reads[

ρu

]t

+

[0 ρ0

a2/ρ0 0

] [ρu

]x

= 0. (21)

With the initial conditions

UL =

[ρLuL

], UR =

[ρRuR

]. (22)

Notice that the matrix A is constant in this case. This naturaly means thatthe characteristics λ1 and λ2 are the same for any Riemann problem with agiven ρ0 and a.

The eigenvalues of A are

λ1 = −a , λ2 = a, (23)

and a set of corresponding eigenvectors are

K(1) =

[ρ0

−a

], K(2) =

[ρ0

a

]. (24)

The eigenvector decomposition (16) of the left state UL is then

UL =

[ρLuL

]= α1

[ρ0

−a

]+ α2

[ρ0

a

]. (25)

6

Page 7: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

This system is a set of two equations which can be solved for the two unknowncoefficients α1 and α2. The results are

α1 =aρL − ρ0uL

2aρ0

, α2 =aρL + ρ0uL

2aρ0

, (26)

and similarly, for the right hand state UR, we get

β1 =aρR − ρ0uR

2aρ0

, β2 =aρR + ρ0uR

2aρ0

. (27)

The non-trivial part of the general solution is U∗, the star region wedgedbetween the two characteristics λ1 and λ2. Equation (17) shows that thesolution to the right of λ1 and to the left of λ2 is

U∗ =

[ρ∗

u∗

]= β1

[ρ0

−a

]+ α2

[ρ0

a

]. (28)

To find ρ∗ and u∗ expressed by uL, ρL, uR, ρR, ρ0 and a, one can of courseinsert α2 and β1 found above.

2 Conservative methods

For this chapter we will always refer to the general system of conservationlaws in one spatial dimension, expressed by equation (3). The treatmentwe perform in the next sections can be easily generalised in three spatialdimensions.

2.1 Integral form of conservation laws.

Each conservation law can always be expressed on an integral form. Startingfrom the system of conservation laws (3) and integrating the equations intime and space we obtain∫ x2

x1

∫ t2

t1

[Ut + F(U)x

]dxdt = 0. (29)

For a generic function w(a, b) of the independent variables a and b, the fun-damental theorem of integral calculus states:∫ a2

a1

∂w

∂ada = w(a2, b)− w(a1, b). (30)

7

Page 8: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Applying the the fundamental theorem of integral calculus on our system ofconservation laws we obtain∫ x2

x1

U(x, t2)dx =

∫ x2

x1

U(x, t1)dx+

∫ t2

t1

F(U(x1, t))dt−∫ t2

t1

F(U(x2, t))dt.

(31)The equation (31) represents the integral form of a system of conservationlaws and it is valid for any rectangular control volume [x1, x2]× [t1, t2].

2.2 Finite volume methods.

The Finite Volume Method (FVM) is a discretisation technique for partialdifferential equations, especially those that arise from physical conservationlaws. FVM uses a volume integral formulation of the problem with a finitepartitioning set of volumes to discretise the equations. Following the FVM’sapproach, the domain is divided into a number of control volumes or cellswhere the variable of interest is located at the centroid of the control vol-ume, as shown in Figure 2. Then the equations are integrated over eachcontrol volume. In this way, the discretisation of the equations expressesthe conservation principle for the variables inside the control volume. Themost compelling feature of the FVM is that the resulting solution satisfiesthe conservation of quantities such as mass, momentum, energy, etc. Thisis exactly satisfied for any control volume as well as for the whole compu-tational domain and for any number of control volumes. Even a coarse gridsolution exhibits exact integral balances.

Starting from the integral form of our system of conservation laws (31),we discretise space and time in the following way:{

x → i∆x

t → n∆t(32)

and we denote a generic control volume as [xi−1/2, xi+1/2] × [tn, tn+1]. Byreplacing our generic control volume in the equation (31), we have:∫ xi+1/2

xi−1/2

U(x, tn+1)dx =

∫ xi+1/2

xi−1/2

U(x, tn)dx

+

∫ tn+1

tn

F(U(xi−1/2, t))dt−∫ tn+1

tn

F(U(xi+1/2, t))dt

(33)

8

Page 9: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Figure 2: Illustration of a finite volume in 1D.

From the definition of integral average,

w =1

∆a

∫ a+∆a

a

w(a)da, (34)

we can rewrite the first term on right hand side of the equation (33) as∫ xi+1/2

xi−1/2

U(x, tn)dx = ∆xU. (35)

The quantity U contains a cell average of each conserved quantity and weassign it to each grid cell, obtaining our discretised quantities,

U = Uni . (36)

In the same way the cell averaged vector of conserved quantities at time tn+1

is given by the term on the left hand side of the equation (33) as follows:∫ xi+1/2

xi−1/2

U(x, tn+1)dx = ∆xUn+1i . (37)

Furthermore, the last two terms on the right hand side of the equation (33)are related to the time averaged fluxes at the boundaries xi±1/2 of the ith cell.We introduce the following notation for the numerical flux Fi±1/2 :

Fi±1/2 =1

∆t

∫ tn+1

tn

F(U(xi±1/2, t))dt. (38)

9

Page 10: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

The numerical flux is a (method dependent) numerical approximation of thephysical flux. Putting everything together, our system of conservation lawsreads:

∆xUn+1i = ∆xUn

i −∆t[Fi+1/2 − Fi−1/2

], (39)

or equivalently:

Un+1i = Un

i −∆t

∆x

[Fi+1/2 − Fi−1/2

]. (40)

Because the flux entering a given cell is identical to that leaving theadjacent cell, the equation (40) represents a conservative scheme.

The numerical flux can be evaluated involving an arbitrary number ofadjacent cells. A general numerical flux can be written as

Fi±1/2 = Fi±1/2(Ui−lL , . . . ,Ui+lR), (41)

where lL and lR are two non-negative integers. For any choice of lL andlR a corresponding conservative scheme results if the following consistencycondition is satisfied:

Fi±1/2(V, . . . ,V) = F(V) (42)

This means that if the arguments used for the evaluation of the numericalfluxes are equal (e.g. when U represents a uniform distribution), then thenumerical flux is the same as the physical flux.

3 Godunov’s Method

When we deal with a conservative scheme in the form (40), we need tocompute the fluxes at the interfaces of each cell in order to advance thesolution from time tn to time tn+1. By exploiting the definition of cell average,we can construct at each time step a piece-wise constant distribution asshown in Figure 3. In this way we have a set of local Riemann problems atcell boundaries, each one is defined as:

Ut + F(U)x = 0

U(x, 0) =

{UL for xi−1 < x < xi−1/2

UR for xi−1/2 < x < xi

(43)

10

Page 11: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Figure 3: Piece-wise constant distribution used in Godunov methods.

As we can easily understand, in order to compute the fluxes at cell in-terfaces, we have to solve two Riemann problems for each cell. For example,if we are considering the ith cell and we want compute the fluxes at the cellboundaries xi±1/2, we have to solve the two Riemann problems RP (Ui−1,Ui)and RP (Ui,Ui+1). Futhermore, since solutions of the two Riemann problemsare constant in time along the xi±1/2 axis, we do not need a time integral inevaluating the numerical flux, as required by (38), the CFL condition requires

max(|λi|)∆t

∆x≤ 1, (44)

where max(|λi|) is the absolute value of the highest eigenvalue of the Jacobianmatrices (i.e. the highest wave speed of the entire system). If the condition(44) is satisfied, then no waves will travel across discontinuities of adjacentRiemann problems and no waves will interact with the solutions of otherRiemann problems.

The idea described above was originally from Godunov. This methodis called Godunov’s scheme and it is a first order scheme. Higher orderGodunov’s schemes can be built, but for the purpose of these notes we willanalyse only the first order scheme.

Example: Linear advection equation.. The linear advection equation de-scribe the passive advection of a scalar field y at a constant velocity c:

yt + f(y)x = 0 with f(y) = cy (45)

11

Page 12: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

where f(y) represent the flux of the scalar field y. Here we assume, withoutloss of generality, that the constant velocity c is positive. Since we are con-sidering only one equation we have only one characteristic, which is definedby

x− ct = 0. (46)

In order to find the flux at the boundary within a local Riemann problem,we do not need to do additional calculations, because the solution of eachRiemann problem will always be:

y(x, t) =

{yL for x− ct < 0

yR for x− ct > 0(47)

By looking at Figure 4 we can see that since the velocity c is constantand positive, the flux at the boundary will always be given by

fi±1/2 = cyL (48)

By considering a generic couple of Riemann problems, then we have:{RP (yi−1, yi) : fi−1/2 = cyL = cyi−1

RP (yi, yi+1) : fi+1/2 = cyL = cyi(49)

In this way, the Godunov method reduces to the scheme:

yn+1i = yni −

∆t

∆x

[fi+1/2 − fi−1/2

]= yni −

c∆t

∆x

[yi − yi−1

] (50)

The last expression of equation (50) corresponds to the upwind method dis-cussed in previous lectures. The upwind scheme is one of the numericalmethod under the class of CIR methods.

Example: Non-linear gas dynamics: isothermal gas.. An isothermal gasis characterised by the equation of state:

p = kρ, (51)

where p is the pressure of the gas and k is the entropic function, which isconstant during the evolution of an isothermal process.

12

Page 13: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Figure 4: Solution if the Riemann problem for the advection equation withpositive advection velocity.

The system of equations governing the gas dynamics, written in terms ofconserved variables, reads:

∂ρ

∂t+

∂x(ρu) = 0,

∂t(ρu) +

∂x(ρu2 + p) = 0.

(52)

Since for an isothermal gas the speed of sound is constant and given by

cs =

öp

∂ρ=√k, (53)

we can rewrite the system (52) as follows:

∂ρ

∂t+

∂x(ρu) = 0,

∂t(ρu) +

∂x(ρu2 + c2

sρ) = 0.

(54)

We can also write the system of conservation laws on matrix form (equation(3)) by defining the vectors:

U =

(ρuρ

)and F(U) =

(ρu

ρu2 + c2sρ

)(55)

13

Page 14: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

As we have seen in the previous chapters, a system of conservation laws canbe written using the Jacobian matrix of the system:

Ut + A(U)Ux = 0 with A(U) =

(0 1

c2s − u2 2u

). (56)

In this case the Jacobian matrix is not constant and to construct an exactRiemann solver can be tricky. For this reason we choose to employ an ap-proximate Riemann solver: the Roe solver. Roe’s approach to the problem ofa non-linear Jacobian matrix consists into approximating the matrix A(U)with a constant matrix:

A(U)→ A, (57)

such that the flux of conserved quantities is given by:

F(U) ' AU. (58)

The approximation of the Jacobian matrix must satisfy the following condi-tions:

• A has only real eigenvalues and a complete set of eigenvectors, in orderto guarantee that the new linear system is truly hyperbolic and thatthe linear Riemann problem is solvable;

• A(UL,UR) → A(U) for UL,UR → U, in order to preserve the con-servation properties of the numerical scheme;

• ∆F = A∆U, in order to preserve the jumps in the solution and to beconsistent with the old system of conservation laws.

In order to find a matrix A satisfying all the previous conditions, we performa change of variables:

U → Z =

(z1

z2

)=

1√ρU =

( √ρ√ρu

). (59)

Then, in order to define a constant state at the discontinuity, we average theright and left values of the new set of variables:

Z =1

2

(ZL + ZR

)=

1

2

( √ρL +

√ρR√

ρLuL +√ρRuR

). (60)

14

Page 15: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

Now it is easy to check that

∆U =

(2z1 0z2 z1

)∆Z = B∆Z (61)

and

∆F =

(z2 z1

2c2s z1 2z2

)∆Z = C∆Z. (62)

The change of variables was performed in order to be able to express ∆Uand ∆F in the form of some matrix times ∆Z, so that we can readily findthe Roe matrix A as follows:{

∆U = B∆Z

∆F = C∆Z⇒ ∆F = CB−1∆U = A∆U (63)

Hence, for an isothermal gas, the Roe matrix A reads:

A = CB−1 =

(0 1

c2s − z2

2/z21 2z2/z1

)≡(

0 1c2s − u2 2u

), (64)

where we have defined the Roe-averaged velocity by:

u =z2

z1

=

√ρLuL +

√ρRuR√

ρL +√ρR

. (65)

We can see the Roe matrix A as the Jacobian matrix evaluated at the Roe-averaged velocity u.

The spectral decomposition of the Roe matrix A reads:

A = KΛK−1 (66)

where

Λ =

(λ1 0

0 λ2

)(67)

is the matrix containing the eigenvalues of A on its diagonal, and

K =

...

...

K(1) K(2)

......

(68)

15

Page 16: Notes on Godunov Methods · Notes on Godunov Methods Hagala, R.; Hansteen, V; Mina, M. 1 Introduction 1.1 Motivation We already learned about upwind schemes, which make sense for

is the matrix whose columns correspond to the eigenvectors of the matrix A.For our case, the spectral decomposition leads to:

λ1 = v − cs λ2 = v + cs (69)

K(1) =

(1

v − cs

)K(2) =

(1

v + cs

)(70)

By solving the two linear systems:

UL = KCL , UR = KCR , (71)

we can determine the coefficients of the eigenvector expansions for UL andUR, respectively denoted as

CL =

(α1

α2

), CR =

(β1

β2

). (72)

Once we have computed the coefficients of the eigenvector expansions, wecan calculate the solution at the discontinuity as:

U =∑j:λj>0

αjKj +

∑j:λj<0

βjKj (73)

Then the flux at the discontinuity is given by:

F = AU (74)

Solving a generic couple of adjacent Riemann problems we end up with:{RP (Ui−1,Ui) : → Fi−1/2 = Ai−1/2Ui−1/2

RP (Ui,Ui+1) : → Fi+1/2 = Ai+1/2Ui+1/2

(75)

and the solution of the system of conservation laws is updated through thescheme in equation (40):

Un+1i = Un

i −∆t

∆x

[Fi+1/2 − Fi−1/2

].

16