numerical hyperbolic systems

Upload: iesus-sousa-freire

Post on 14-Jan-2016

224 views

Category:

Documents


0 download

DESCRIPTION

Numerical Hyperbolic Systems

TRANSCRIPT

  • Numerical methods for hyperbolic systems

    Eric SonnendruckerMax-Planck-Institut fur Plasmaphysik

    undZentrum Mathematik, TU Munchen

    Lecture notesSommersemester 2013

    July 16, 2013

  • Contents

    1 Introduction 2

    2 1D linear advection 42.1 Finite Difference schemes for the advection equation . . . . . . . . . . . . 4

    2.1.1 Obtaining a Finite Difference scheme . . . . . . . . . . . . . . . . . 42.1.2 The first order explicit upwind scheme . . . . . . . . . . . . . . . . 42.1.3 The first order upwind implicit scheme . . . . . . . . . . . . . . . . 52.1.4 The method of lines . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.5 Convergence of finite difference schemes . . . . . . . . . . . . . . . 62.1.6 High-order time schemes . . . . . . . . . . . . . . . . . . . . . . . . 122.1.7 The Cauchy-Kowalevsky procedure . . . . . . . . . . . . . . . . . . 15

    2.2 The Finite Volume method . . . . . . . . . . . . . . . . . . . . . . . . . . 152.2.1 The first order Finite Volume schemes . . . . . . . . . . . . . . . . 152.2.2 Higher order schemes . . . . . . . . . . . . . . . . . . . . . . . . . 17

    2.3 The Finite Element method . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4 The Discontinuous Galerkin (DG) method . . . . . . . . . . . . . . . . . . 22

    3 Linear systems 253.1 The Riemann problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.2 The discontinuous Galerkin method . . . . . . . . . . . . . . . . . . . . . 27

    4 Non linear conservation laws 294.1 Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.2 Weak solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    4.2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.2.2 The Rankine-Hugoniot condition . . . . . . . . . . . . . . . . . . . 304.2.3 Entropy solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    4.3 The Riemann problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.4 Numerical methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    4.4.1 The Godunov method . . . . . . . . . . . . . . . . . . . . . . . . . 354.4.2 Approximate Riemann solvers . . . . . . . . . . . . . . . . . . . . . 374.4.3 Higher order methods . . . . . . . . . . . . . . . . . . . . . . . . . 384.4.4 Strong stability preserving (SSP) Runge-Kutta methods. . . . . . . 38

    4.5 Nonlinear systems of conservation laws . . . . . . . . . . . . . . . . . . . . 394.5.1 The Rusanov flux . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.5.2 The Roe flux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    1

  • Chapter 1

    Introduction

    Hyperbolic systems arise naturally from the conservation laws of physics. Writing downthe conservation of mass, momentum and energy yields a system of equations that needsto be solved in order to describe the evolution of the system. In this lecture we willintroduce the classical methods for numerically solving such systems. Up to a few yearsago these were essentially finite difference methods and finite volume methods. Butin the last decades a new class of very efficient and flexible method has emerged, theDiscontinuous Galerkin method, which shares some features both with Finite Volumesand Finite Elements.

    In 1D the systems of conservation laws we consider have the form

    u

    t+F(u)

    x= 0,

    where u is a vector of unknown values. This can be written also

    u

    t+A(u)

    u

    x= 0,

    where A(u) is the Jacobian matrix with components ((Fiuj ))i,j . The system is called

    hyperbolic if for all u the matrix A has only real eigenvalues and is diagonalisable. It iscalled strictly hyperbolic if all eigenvalues are distinct.

    Examples:

    1D Maxwells equation 1D Euler equations

    t

    uE

    + x

    uu2 + pEu+ pu

    = 0,where , u and E are the density, velocity and energy density of the gas and p isthe pressure which is a known function of .

    The idea behind all numerical methods for hyperbolic systems is to use the fact thatthe system is locally diagonalisable and thus can be reduced to a set of scalar equations.For this reason, before going to systems it will be useful to first understand the scalarcase and then see how it can be extended to systems by local diagonalization.

    2

  • The first part of the lecture will be devoted to the linear case, starting with thescalar case which boils down to linear advection for which the core methods will be firstintroduced. This is fairly straightforward.

    Many additional problems arise in the nonlinear case. Indeed in this case even start-ing from a smooth initial condition discontinuities can appear in the solution. In thiscase the concept of weak solutions need to be introduced and there can be several solu-tions only one of which is physical. We thus need a criterion to find the physical solutionand numerical schemes that capture the physical solution. The notion of conservativityplays an essential role there. These will be addressed in the second part.

    3

  • Chapter 2

    1D linear advection

    2.1 Finite Difference schemes for the advection equation

    We consider first the linear 1D advection equation

    u

    t+ a

    u

    x= 0 pour x [a, b], t 0. (2.1)

    Let us assume for simplicity that the boundary conditions are periodic. This means thatu and all its derivatives are periodic of period b a. We have in particular u(a) = u(b).The constant a is given. As the problem is time dependent we also need an initialcondition u(x, 0) = u0(x).

    2.1.1 Obtaining a Finite Difference scheme

    We first consider a uniform mesh of the 1D computational domain, i.e. of the interval[a, b] where we want to compute the solution, see Figure 2.1. The cell size or space step

    . .

    a b

    x1x0 x2 xNxN1

    Figure 2.1: Uniform mesh of [a, b]

    is defined by x = baN where N is the number of cells in the mesh. The coordinates ofthe grid points are then defined by xi = a+ ix. We then need a time step t and wewill compute approximations of the solution at discrete times tn = nt, n N. As weassume the solution to be periodic of period b a it will be defined by its values at xifor 0 i N 1 and we shall have u(xN , tn) = u(x0, tn).

    We shall denote by unj = u(xj , tn).

    2.1.2 The first order explicit upwind scheme

    A Finite Difference scheme is classically obtained by approximating the derivatives ap-pearing in the partial differential equation by a Taylor expansion up to some given orderwhich will give the order of the scheme. As we know only the values of the unknown

    4

  • function at the grid points, we use Taylor expansion at different grid points and linearlycombine them so as to eliminate all derivatives up to the needed order.

    The same can be done for the time discretisation. For an approximation of order 1in space and time, we can simply write

    u

    t(xj , tn) =

    u(xj , tn+1) u(xj , tn)t

    +O(t), (2.2)

    u

    x(xj , tn) =

    u(xj , tn) u(xj1, tn)x

    +O(x). (2.3)

    Denoting by unj , the approximation of the solution at point xj and time tn and usingthe above formulas for the approximation of the partial derivatives we get the followingapproximation (2.1) at point xj and time tn:

    un+1j unjt

    + aunj unj1

    x= 0. (2.4)

    We thus obtain the following explicit formula which enables to compute un+1j in functionof the values of u at time tn and points xj1, xj and xj1 :

    un+1j = unj a

    t

    x(unj unj1). (2.5)

    Denote by Un the vector of RN whose components are un1 , . . . , unN1 and

    A =

    (1 atx ) 0 atx

    atx

    . . .. . .

    . . .. . . 0

    0 atx (1 atx )

    .The terms at the end of the first line comes from the periodic boundary conditions. Weuse that un1 = unN1 and u

    nN = u

    n0 . Except on the two diagonals all the terms vanish

    In this case the scheme (2.5) can be written in matrix form

    Un+1 = AUn.

    2.1.3 The first order upwind implicit scheme

    When using an uncentered difference scheme in the other direction for the time derivative,we get

    u

    t(xj , tn) =

    u(xj , tn) u(xj , tn1)t

    +O(t), (2.6)

    We use the same finite difference approximation for the space derivative. We then getthe following formula

    unj + at

    x(unj unj1) = un1j . (2.7)

    In this case the unj are defined implicitly from the un1j as solutions of a linear system.

    This is why this scheme is called implicit.

    5

  • Denote by B the matrix of the linear system:

    B =

    (1 + atx ) 0 atxatx

    . . .. . .

    . . .. . . 0

    0 atx (1 + atx )

    .The term at the end of the first line comes from the periodic boundary conditions. Weuse that un1 = unN1 and u

    nN = u

    n0 . The terms not on the two diagonals vanish.

    Going now from time step n to n+ 1 the implicit scheme in matrix form becomes

    BUn+1 = Un.

    2.1.4 The method of lines

    As we saw, the time discretisation can be performed by finite differences as for the spacediscretisation. However it is generally more convenient to separate the space and timediscretisation for a better understanding. The method of lines consists in applying only adiscretisation scheme in space first (this can be Finite Differences or any other scheme).Then one obtains a system of ordinary differential equations of the form

    dU

    dt= AU,

    where U(t) is the vector whose components are ui(t) the unknown values at the gridpoint at any time t. Then one can use any Ordinary Differential Equation (ODE) solverfor the time discretisation. For example using an explicit Euler method with the upwindmethod in space yields the previous explicit upwind scheme and when we use an implicitEuler method we get the implicit upwind scheme.

    2.1.5 Convergence of finite difference schemes

    So as to include explicit and implicit schemes, we consider a linear scheme in the followinggeneric matrix form

    LUn+1 = MUn, (2.8)

    where the matrices L and M , are normalised such that the coefficient of unj , is 1.Let us denote by

    V (tn) =

    u(x0, tn)...u(xN1, tn),

    where u is the exact solution of the Partial Differential Equation (PDE) that is approx-imated by the scheme (2.8).

    Definition 1 The scheme (2.8) is called consistent of order (q, p) if

    LV (tn+1)MV (tn) = tO(tq + xp).

    Proposition 1 If the exact solution is of class C3, the schemes (2.5) and (2.7) areconsistent of order 1 in t and in x.

    6

  • Proof. Lets start with (2.5). Using the Taylor formulas (2.2) and (2.3), we obtain forthe ith line of V (tn+1)AV (tn),

    (V (tn+1)AV (tn))i = u(xi, tn+1) u(xi, tn) + atx

    (u(xi, tn) u(xi1, tn))

    = t

    (u

    t(xi, tn) +O(t) + a

    u

    x(xi, tn) +O(x)

    ).

    The result follows as u is a solution of our equation. We thus get the (1,1) consistencyof this scheme.

    Then for (2.7), we use (2.6) and (2.3). The ith line of BV (tn) V (tn1),

    (BV (tn) V (tn1))i = u(xi, tn) u(xi, tn1) + atx

    (u(xi, tn) u(xi1, tn))

    = t

    (u

    t(xi, tn) +O(t) + a

    u

    x(xi, tn) +O(x)

    ).

    The result follows as u is a solution of the equation. We thus get the (1,1) consistencyof this scheme.

    Definition 2 The scheme (2.8) is called stable for some given norm . if there existconstants K and independent of t such that

    Un KU0 t such that 0 < t < .

    Proposition 2 The scheme (2.5) is stable for the L norm provided

    at

    x 1.

    This condition is called the Courant-Friedrichs-Lewy or CFL condition.Proof. Consider the scheme (2.5). Grouping the terms in unj1, u

    nj and u

    nj+1, this

    scheme (2.5) becomes

    un+1j =at

    xunj1 + (1

    at

    x)unj .

    As, a, t and x are positive, if atx 1 the two factors of unj1, unj are positive andequal to their absolute value. Hence

    |un+1j | at

    x|unj1|+ (1

    at

    x)|unj |

    (atx

    + (1 atx

    ))

    maxj|unj |,

    and somaxj|un+1j | maxj |u

    nj |,

    from which it follows that maxj |unj | maxj |u0j | for all n, which yields the L stability.

    7

  • von Neumann stability analysis. Due to the fact that the discrete Fourier trans-form conserves the L2 norm because of the discrete Plancherel inequality and that itdiagonalises the Finite Difference operators (provided the original PDE has constant co-efficients), it is particularly well adapted for studying the L2 stability. The von Neumannanalysis consists in applying the discrete Fourier transform to the discretised equation.To make this more precise we first recall the definition and main properties of the discreteFourier transform.

    Let P be the symmetric matrix formed with the powers of the nth roots of unity

    the coefficients of which are given by Pjk =1ne2ipijkn . Denoting by n = e

    2ipin , we have

    Pjk =1njkn .

    Notice that the columns of P , denoted by Pi, 0 i n 1 are the vectors Xinormalised so that P i Pj = i,j . On the other hand the vector Xk corresponds to adiscretisation of the function x 7 e2ipikx at the grid points xj = j/n of the interval[0, 1]. So the expression of a periodic function in the base of the vectors Xk is thusnaturally associated to the Fourier series of a periodic function.

    Definition 3 Discrete Fourier Transform.

    The dicrete Fourier transform of a vector x Cn is the vector y = P x. The inverse discrete Fourier transform of a vector y Cn is the vectorx = P 1x = Px.

    Lemma 1 The matrix P is unitary and symmetric, i.e. P1 = P = P .

    Proof. We clearly have P T = P , so P = P . There remains to prove that PP = I.But we have

    (PP )jk =1

    n

    n1l=0

    jllk =1

    n

    n1l=0

    e2ipinl(jk) =

    1

    n

    1 e 2ipin n(jk)1 e 2ipin (jk)

    ,

    and so (PP )jk = 0 if j 6= k and (PP )jk = 1 if j = k.

    Corollary 1 Let F,G Cn and denote by F = P F and G = P G, their discreteFourier transforms. Then we have

    the discrete Parseval identity:

    (F,G) = F T G = F TG = (F , G), (2.9)

    The discrete Plancherel identity:

    F = F, (2.10)

    where (., .) and . denote the usual euclidian dot product and norm in Cn.

    Proof. The dot product in Cn of F = (f1, . . . , gn)T and G = (g1, . . . , gn)T is defined by

    (F,G) =

    Ni=1

    figi = FT G.

    8

  • Then using the definition of the inverse discrete Fourier transform, we have F = PF ,G = PG, we get

    F T G = (PF )TPG = F TP T PG = F T

    G,

    as P T = P and P = P1. The Plancherel identity follows from the Parseval identity bytaking G = F .

    Remark 1 The discrete Fourier transform is defined as a matrix-vector multiplication.Its computation hence requires a priori n2 multiplications and additions. But because ofthe specific structure of the matrix there exists a very fast algorithm, called Fast FourierTransform (FFT) for performing it in O(n log2 n) operations. This makes it particularlyinteresting for many applications, and many fast PDE solvers make use of it.

    Let us now consider the generic matrix form of the Finite Difference scheme intro-duced above:

    LUn+1 = MUn.

    Note that on a uniform grid if the PDE coefficients do not explicitly depend on x thescheme is identical at all the grid points. This implies that L and M have the samecoefficients on any diagonal including the periodicity. Such matrices, which are of theform

    C =

    c0 c1 c2 . . . cn1cn1 c0 c1 cn2cn2 cn1 c0 cn3

    .... . .

    ...c1 c2 c3 . . . c0

    with c0, c1, . . . , cn1 R are called circulant.

    Proposition 3 The eigenvalues of the circulant matrix M are given by

    k =

    n1j=0

    cjjk, (2.11)

    where = e2ipi/n.

    Proof. Let J be the circulant matrix obtained from M by taking c1 = 1 and cj = 0 forj 6= 1. We notice that M can be written as a polynomial in J

    M =n1j=0

    cjJj .

    As Jn = I, the eigenvalues of J are the n-th roots of unity that are given by k = e2ikpi/n.Looking for Xk such that JXk =

    kXk we find that an eigenvector associated to theeigenvalue k is

    Xk =

    1k

    2k

    ...

    (n1)k

    .

    9

  • We then have that

    MXk =

    n1j=0

    cjJjXk =

    n1j=0

    cjjkXk,

    and so the eigenvalues of M associated to the eigenvectors Xk are

    k =n1j=0

    cjjk.

    Proposition 4 Any circulant matrix C can be written in the form C = PP whereP is the matrix of the discrete Fourier transform and is the diagonal matrix of theeigenvalues of C. In particular all circulant matrices have the same eigenvectors (whichare the columns of P ), and any matrix of the form PP is circulant.

    Corollary 2 We have the following properties:

    The product of two circulant matrix is circulant matrix. A circulant matrix whose eigenvalues are all non vanishing is invertible and its

    inverse is circulant.

    Proof. The key point is that all circulant matrices can be diagonalized in the samebasis of eigenvectors. If C1 and C2 are two circulant matrices, we have C1 = P1P

    andC2 = P2P

    so C1C2 = P12P .If all eigenvalues of C = PP are non vanishing, 1 is well defined and

    PP P1P = I.

    So the inverse of C is the circulant matrix P1P .

    Now applying the discrete Fourier transform to our generic scheme yields:

    P LUn+1 = P MUn P LPP Un+1 = P MPP Un

    which is equivalent toLU

    n+1 = M Un,

    where L and M are the diagonal matrices containing the eigenvalues of the circu-lant matrices M and L which are given explicitly from the matrix coefficients. It fol-lows because U = U for any vector U that the scheme is L2 stable if and only ifmaxi

    |M,i||L,i| 1, where M,i and L,i are the eigenvalues of M and L.

    Let us now apply this technique to the scheme (2.7):

    Proposition 5 The scheme (2.7) is stable for the L2 norm for all strictly positive valuesof x and t.

    Proof. Let us denote by = atx . We notice that matrix B is circulant with c0 = 1+,cn1 = , the other ci being 0.

    10

  • The eigenvalues of B thus are k = c0 + cn12ikpi/n. Which implies that

    1 for all k such that sin 2kpin 6= 0.

    Hence the scheme is unstable.

    Theorem 1 (Lax) The scheme (2.8) is convergent if it is stable and consistent.

    Proof. Let V (tn) be the vector whose components are the exact solution at the gridpoints at time tn. The, as the scheme is consistent, we have

    LV (tn+1) = MV (tn) + tO(tq + xp).

    Note En = Un V (tn) the vector containing the errors at each point at time tn, thenas LUn+1 = MUn, we have LEn+1 = MEn + tO(tq + xp). Hence

    En+1 = L1MEn + tK1(tq + xp),

    = L1M(En1 + tK1(tq + xp)) + tK1(tq + xp),

    = (L1M)n+1E0 + (1 + + (L1M)n)tK1(tq + xp).Hence

    En+1 (L1M)n+1E0+ (1 + + (L1M)n)tK1(tq + xp). (2.12)The stability implies that for any initial condition U0, as Un = (L1M)nU0, we have

    (L1M)nU0 KU0,which means that (L1M)n K for all n. Plugging this into (2.12), we obtain:

    En+1 KE0+ nKK1t(tq + xp).Then as on the one hand E0 taking as an initial in the scheme U0 = V (0), and on theother hand nt T the maximal considered time, we have

    En+1 KK1T (tq + xp),whence convergence.

    Corollary 3 If the exact solution is of class C3, the schemes (2.5) and (2.7) converge.

    Proof. This follows immediately from the Lax theorem by applying propositions 1 and2.

    11

  • 2.1.6 High-order time schemes

    When working with linear homogeneous equations with no source term, the simplestway to derive high order time schemes is to use a Taylor expansion in time and plug inthe expression of the successive time derivatives obtained from the differential systemresulting from the semi-discretization in space. Consider for example that after semi-discretization in space using Finite Differences (or any other space discretisation method)we obtain the differential systems

    dU

    dt= AU, with U =

    u0(t)...un1(t)

    ,and A the appropriate matrix coming from the semi-discretization in space. Then aTaylor expansion in time up to order p yields

    U(tn+1) = U(tn) + tdU

    dt(tn) + + t

    p

    p!

    dpU

    dtp(tn) +O(t

    p+1).

    Now if A does not depend on time and dUdt = AU , we get thatdpU

    dtp= ApU, for any integer p.

    Hence, denoting Un an approximation of U(tn), we get a time scheme of order p usingthe formula

    Un+1 = Un + tAUn + + tp

    p!ApUn = (I + tA+ + t

    p

    p!Ap)Un. (2.13)

    For p = 1 this boils down to the standard explicit Euler scheme.Writing Un the solution in vector form at time tn, we define the propagation matrix

    A such thatUn+1 = AUn.

    Definition 4 The numerical scheme defined by the propagation matrix A is stable ifthere exists > 0 such that Un is bounded for all n N and t < .

    Proposition 7 The numerical scheme defined by the propagation matrix A is stable ifthere exists > 0 such that for all t < all eigenvalues of A are of modulus less orequal to 1.

    Stability of Taylor schemes. For a Taylor scheme of order p applied to dUdt = AU ,we have A = I + tA + + tp! Ap. Then denoting by an eigenvalue of A, thecorresponding eigenvalue of A is = 1 +t+ +ptpp! . And one can plot the regionof the complex plane in which |(t)| 1 using for example ezplot in Matlab, whichare the stability regions. This means that the time scheme associate to the semi-discreteform dUdt = AU is stable provided all the eigenvalues of A are such that t is in thestability region.

    12

  • Examples.

    1. The Upwind scheme: dui(t)dt = aui(t)ui1(t)x corresponds to the circulant matrixA with c0 = ax = c1. So its eigenvalues verify kt = atx (1 e

    2ipijkn ).

    Obviously, for any integer value of k, kt is on a circle in the complex plane ofradius atx centred at (atx , 0). The stability region of the explicit Euler methodis the circle of radius 1 centred at (1, 0), so that in this case we see again thatthe scheme is stable provided atx 1. For the higher order schemes the radiuscorresponding to the maximal stability can be found by computing the second realroot (in addition to 0) of the equation |(t)| = 1, see Fig. 2.2. We find thatfor the order 2 scheme = 2, so that the stability condition is the same as forthe order 1 scheme. For the order 3 scheme we find that = 2.5127 and forthe order 4 scheme we find that = 2.7853. The value of corresponds to thediameter of the largest circle of eigenvalues that is still completely enclosed in thestability region. This yields the stability condition atx ||2 . We notice that themaximal stable time step is larger for the schemes of order 3 and 4.

    x

    y

    Maximal stability, order 2

    4 3 2 1 0 1 23

    2

    1

    0

    1

    2

    3

    x

    y

    Maximal stability, order 3

    4 3 2 1 0 1 23

    2

    1

    0

    1

    2

    3

    x

    y

    Maximal stability, order 4

    4 3 2 1 0 1 23

    2

    1

    0

    1

    2

    3

    Figure 2.2: Location of eigenvalues (blue circle) corresponding to maximal stability zonefor explicit time schemes of order 2, 3, 4 (left to right).

    2. The centred scheme: dui(t)dt = aui+1(t)ui1(t)2x corresponds to the circulant matrixA with c1 = a2x = cn1. The corresponding eigenvalues are such that

    kt = at2x

    (e2ipijkn e2ipijkn ) = iat

    xsin

    2pijk

    n.

    Hence the eigenvalues are all purely imaginary and the modulus of the largest oneis atx . The stability zones for the schemes of order 1 to 6 are represented in Fig.2.3. Note that for the order 1 and 2 scheme the intersection of the stability zonewith the imaginary axis is reduced to the point 0. So that when all eigenvaluesare purely imaginary as is the case here, these schemes are not stable for anypositive t. On the other hand the schemes of order 3 and 4 have a non vanishingstability zone on the imaginary axis, larger for the order 4 scheme. By computingthe intersection of the curve |(t)| = 1 with the imaginary axis we find thestability conditions for the order 3 scheme: atx

    3 and for the order 4 scheme

    atx 2

    2.

    13

  • Remark 2 The order 5 and 6 schemes are more problematic for eigenvalues of Aon the imaginary axis as the zooms of Figure 2.4 tell us. Even though there is a partof the imaginary axis in the stability zone, there is also a part in the neighborhood of0 which is not. Therefore small eigenvalues of A will lead to instability on longertime scales. This is problematic, as unlike usual Courant condition instabilityproblems which reveal themselves very fast, this leads to a small growth in time.

    0.00.0

    1.0 0.51.52.0

    1.0

    0.5

    y

    1.0

    x

    0.5y

    0.5

    1.5

    x

    0.51.50.0

    0.5

    1.5

    1.0

    0.02.0 1.0

    1.0

    1.0

    1

    2.5x

    1.5

    y

    0.02.00

    2

    2

    0.5

    1

    x

    00.52.0

    1

    2

    2

    1.5

    y

    2.5

    3

    0.0

    1

    3

    1.03.2 1.6

    1

    0.02.4

    1

    3

    0.41.2

    2

    02.02.8 0.8

    y

    x

    3

    2

    0.4

    2.4

    1.6

    4.0

    2.4

    13

    3.2

    10.0

    3.2

    0.8x02

    y

    4.0

    1.6

    0.8

    Figure 2.3: Stability zone for Taylor schemes. From top to bottom and left to rightorder 1, 2, 3, 4, 5, 6.

    3

    55

    3

    2010

    2y

    0

    10103

    15

    1

    1

    x

    0

    2

    0.5

    1*104 5*1050.0

    x

    y

    0*100

    0.5

    Figure 2.4: Stability zone for Taylor schemes. Zoom around imaginary axis. Left order5, right order 6.

    14

  • 2.1.7 The Cauchy-Kowalevsky procedure

    The Cauchy-Kowalevsky procedure consists in writing a Taylor expansion in time toupdate the scheme from time tn to tn+1 and then to use the equation to replace the timederivatives in the Taylor expansion by spatial derivatives. This is particularly simple forthe linear advection, but can be used in principle (with more complicated computations)for any hyperbolic equation or system. Let us now apply this procedure: (we denote asusual by uni = u(tn, xi))

    un+1i = uni + t

    u

    t(tn, xi) +

    t2

    2

    2u

    t2(tn, xi) +O(t

    3). (2.14)

    Then using the equation ut + aux = 0 we get

    u

    t(tn, xi) = au

    x(tn, xi),

    2u

    t2(tn, xi) =

    t(au

    x) a

    x

    u

    t= a2

    2u

    x2(tn, xi),

    and now we use centred schemes for the first and second order spatial derivatives of u:

    u

    x(tn, xi) =

    uni+1 uni12x

    +O(x2),2u

    x2(tn, xi) =

    uni+1 2uni + uni1x2

    +O(x2).

    Plugging this into the Taylor expansion (2.14), we get:

    un+1i = uni

    at

    2x(uni+1 uni1) +

    a2t2

    2x2(uni+1 2uni + uni1) + tO(t2 + x2).

    This scheme, which is second order in space and time, is known as the Lax-Wendroffscheme.

    2.2 The Finite Volume method

    2.2.1 The first order Finite Volume schemes

    Let us introduce the Finite Volume method on the generic scalar conservation law of theform

    u

    t+f(u)

    x= 0. (2.15)

    In the case of our linear advection equation, we have f(u) = au.In the Finite Volume method, the computational domain is divided into cells (inter-

    vals in 1D) and the unknown quantity that is numerically computed is the cell averageof u on each cell. Recall that for Finite Differences the unknowns were the point valuesof u at the grid points. We need to number the cells. In 1D a convenient way to do itin order to avoid confusion with the grid points, is to assign half integers. Let us denoteby

    ui+ 12(t) =

    1

    xi+1 xi

    xi+1xi

    u(t, x) dx.

    The Finite Volume numerical scheme is then obtained by integrating the originalequation on each cell of the domain. As for the time scheme there are at least twoclassical ways, the first is to also integrate in time between tn and tn+1 and then use aquadrature formula to compute the integral, for example, the left hand rectangle rule

    15

  • yields a first order explicit formula. The second is to use the method of lines and separatespace discretisation from time discretisation. Then standard ODE discretisation schemescan be used. This is what we shall do mostly in this lecture.

    So integrating (2.15) on the cell [xi, xi+1] and dividing by xi+ 12

    = xi+1 xi yields

    dui+ 12(t)

    dt+

    1

    xi+ 12

    (f(u(t, xi+1)) f(u(t, xi))) = 0.

    Here we see that a second ingredient is needed in order to define the algorithm. Weonly know the cell averages of u, how do we define the value at u at the cell interfaces.The simplest scheme, which is first order accurate in space consists in assuming thatu is constant on each cell and thus equal to its cell average. But it is not defined atthe cell interface. In order to complete the Finite Volume scheme we need to define aso called numerical flux at each cell interface denoted by gi that needs to be consistentwith f(xi), i.e. gi = f(u(xi)) + O(x

    p) for some positive p. A numerical flux of order2 is the centred flux gi =

    12(f(ui 12 ) + f(ui+ 12 )). This yields the following scheme for a

    uniform x:dui+ 1

    2(t)

    dt+

    (f(ui+ 32) f(ui 1

    2))

    2x= 0.

    Coupling it with an explicit Euler scheme in time this becomes, and applying it to thelinear advection (f(u) = au) we get

    un+1i+ 1

    2

    = uni+ 1

    2

    at2x

    (ui+ 32 ui 1

    2). (2.16)

    We recognise here the centred Finite Difference scheme shifted to the cell centres. Re-member that this scheme is unstable, so that it cannot be used in practice. In orderto get stable scheme, we need to introduce the notion of unwinding like for Finite Dif-ferences. This can be done very easily in the definition of the numerical flux by simplychoosing the value of u in the upwind cell only to define the numerical flux. We havef(u)x = f

    (u)ux . This means that locally at each cell interface the direction of the trans-port is defined by the sign of f (u) (in the case of the linear advection f (u) = a andthe upwind direction is determined by the sign of a). So the upwind numerical flux isdefined by

    gi =

    f(ui 12 ) if f(ui 12

    +ui+12

    2 ) 0f(ui+ 1

    2) if f (

    ui 12

    +ui+12

    2 ) < 0

    Again, combining the Finite Volume scheme with an upwind flux and an explicit Eulertime discretisation yields for the linear advection with a > 0

    un+1i+ 1

    2

    = uni+ 1

    2

    atx

    (ui+ 12 ui 1

    2). (2.17)

    We also recognise here the first order in time and space upwind scheme shifted to thecell centres.

    Remark 3 Using the midpoint rule

    ui+ 12

    =1

    x

    xi+1xi

    u(x) dx = u(xi+ 12) +O(x2).

    16

  • The we can reinterpret the Finite Volume as a Finite Difference scheme at the cellcentres, which explains that we get the same formulas. However this is not true forhigher orders, for which Finite Volume and Finite Difference schemes are genuinelydifferent.

    2.2.2 Higher order schemes

    In order to get high order Finite Volume schemes, the idea is to reconstruct polynomialsof some given degree from the cell averages that are obtained with the Finite Volumeprocedure. The main idea for doing this is to contract an interpolation polynomial forthe primitive of the polynomial we are looking for.

    At time step tn we know unj+ 1

    2

    known average value of un on cell [xj , xj+1] of length

    xj+ 12

    = xj+1 xj . We want to construct a polynomial pm(x) of degree m such that

    1

    xj+ 12

    xj+1xj

    pm(x) dx = unj+ 1

    2

    .

    To this aim we look for pm(x) such thatddx pm(x) = pm(x). Then

    xj+ 12unj+ 1

    2

    =

    xj+1xj

    pm(x) dx = pm(xj+1) pm(xj).

    Let W (x) = xx0un(x) dx a primitive of the piecewise constant function un with value

    unj+ 1

    2

    on [xj , xj+1]. Then W (xj+1) =j

    k=1 hk+ 12unk+ 1

    2

    and

    W (xj+1)W (xj) = xj+ 12unj+ 1

    2

    = pm(xj+1) pm(xj).

    Then we take for pm an interpolating polynomial at points xj of W so that

    1

    xj+ 12

    xj+1xj

    pm(x) dx =1

    xj+ 12

    (pm(xj+1) pm(xj))

    =1

    xj+ 12

    (W (xj+1)W (xj)) = unj+ 12

    .

    There are many ways to choose an interpolating polynomial, one could use spline in-terpolation or Hermite interpolation, but the simplest and most used choice is to use aLagrange interpolation polynomial. This being said, a Lagrange interpolating polyno-mial of degree k is defined with k + 1 interpolation points. So we need to use as manyvalues in neighbouring cells as needed.

    In order to reconstruct a polynomial of a given degree in a given cell there are manypossible stencils, i.e. ensembles of cells, that can be used. For the reconstruction of apolynomial of degree k exactly k average values corresponding to k neighbouring cellsare needed. The only constraint is that the value on the cell where the polynomial beingreconstructed is used. High-order methods are prone to oscillations especially arounddiscontinuities. So one good idea is to use the stencil which minimises the oscillations.This can be easily done by choosing automatically the stencil based on the Newtondivided differences which can be used to construct the interpolating polynomial. Thismethod is called ENO (Essentially Non Oscillatory). See for example [4] for a detaileddescription.

    17

  • The ENO method can be still improved by taking all possible stencils but putting aweight on each of the polynomials obtained. This is called the WENO method (WeightedEssentially Non Oscillatory) A good review of this technique is given in [7].

    2.3 The Finite Element method

    The Finite Element method is mathematically more involved that the previous methods.The discretisation idea is based on the Galerkin principle of approximating the functionspace in which the solution is defined by a finite dimensional subspace. It uses also aweak (or variational form of the equation). In order to obtain the weak form, the ideais to multiply by a smooth test function and integrate over the whole domain, with apossible integration by parts to eliminate the highest derivatives.

    Let us describe it on the advection-diffusion problem (assuming periodic boundaryconditions on the domain [0, L]):

    u

    t+ a

    u

    x

    2u

    x2= 0.

    Multiplying by a test function v which does not depend on t and integrating, with anintegration by parts in the last integral and periodic boundary conditions, yields

    d

    dt

    L0uv dx+ a

    L0

    u

    xv dx+

    L0

    u

    x

    v

    xdx = 0.

    The natural space in which this formulation is defined isH1([0, L]) = {u L2([0, L]) | ux L2([0, L])}. The variational problem thus reads Find u H1 such that

    d

    dt

    L0uv dx+ a

    L0

    u

    xv dx+

    L0

    u

    x

    v

    xdx = 0 v H1([0, L]).

    Now in order to define a Finite Element approximation, we need to construct a sequenceof subspaces Vh of H

    1([0, L]) which is dense in H1([0, L]) (in order to get convergence).One subspace is of course enough to compute a numerical approximation. There aremany ways to construct such subspaces. The classical Lagrange Finite Element methodconsists in building a mesh of the computational domain and to assume that the approx-imating function is polynomial say of degree k in each cell. For the piecewise polynomialfunction space to be a included in H1([0, L]) the only additional requirement is thatthe functions are continuous at the cell interfaces. So the subspace Vh on the meshx0 < x1 < < xn1 is defined by

    Vh ={vh C0([a, b]) | vh|[xi,xi+1] Pk([xi, xi+1])

    }.

    In order to express a function vh Vh we need a basis of Vh. This can be constructedeasily combining bases of Pk([xi, xi+1]). In order to impose the continuity requirement atthe cell interface, the simplest is to use a Lagrange basis Pk([xi, xi+1]) with interpolationpoints on the edge of the intervals. Given k + 1 interpolation points xi = y0 < y1 < < yk = xi+1 the Lagrange basis functions of degree k denoted by lk,i, 0 i k, arethe unique polynomials of degree k verifying lk,i(yj) = i,j . Because of this property,

    any polynomial p(x) Pk([xi, xi+1]) can be expressed as p(x) =k

    j=0 p(yj)lj,k(x) andconversely any polynomial p(x) Pk([xi, xi+1]) is uniquely determined by its values

    18

  • at the interpolation points yj , 0 j k. Hence in order to ensure the continuityof the piecewise polynomial at the cell interface xi it is enough that the values of thepolynomials on both sides of xi have the same value at xi. This constraint removes onedegree of freedom in each cell, so that the total dimension of Vh is nk and the functionsof Vh are uniquely defined in each cell by their value at the degrees of freedom (whichare the interpolation points) in all the cells. The basis functions denoted of Vh denotedby (i)0jnk are such that their restriction on each cell is a Lagrange basis function.

    Note that for k = 1, corresponding to P1 finite elements, the degrees of freedom arejust the grid points. For higher order finite elements internal degrees of freedom areneeded. For stability and conveniency issues this are most commonly taken to be theGauss-Lobatto points on each cell.

    In order to obtain a discrete problem that can be solved on a computer, the Galerkinprocedure consist in replacing H1 by Vh in the variational formulation. The discretevariational problem thus reads: Find uh Vh such that

    d

    dt

    L0uv dx+ a

    L0

    u

    xv dx+

    L0

    u

    x

    v

    xdx = 0 vh Vh.

    Now expressing uh (and vh) in the basis of Vh as uh(t, x) =nk

    j=1 uj(t)j(x), vh(x) =nkj=1 vjj(x) and plugging these expression in the variational formulation, denoting by

    U = (u0, u1, , unk)T and similarly for V yields: Find U Rnk such that

    d

    dt

    i,j

    ujvi

    L0i(x)j(x) dx+ a

    i,j

    ujvi

    L0

    j(x)

    xi(x) dx

    + i,j

    ujvi

    L0

    i(x)

    x

    j(x)

    xdx = 0 V Rnk,

    which can be expressed in matrix form

    V T (MdU

    dt+DU +AU) = 0 V Rnk,

    which is equivalent to

    MdU

    dt+DU +AU = 0

    where the square nk nk matrices are defined by

    M = (

    L0j(x)i(x) dx)i,j , D = (

    L0

    j(x)

    xi(x) dx)i,j , A = (

    L0

    i(x)

    x

    j(x)

    xdx)i,j .

    Note that these matrices can be computed exactly as they involve integration ofpolynomials on each cell. Moreover because the Gauss-Lobatto quadrature rule is exactfor polynomials of degree up to 2k 1, both A and D can be computed exactly with theGauss-Lobatto quadrature rule. Moreover, approximating the mass matrix M with theGauss-Lobatto rule introduces an error which does not decrease the order of accuracyof the scheme [2] and has the big advantage of yielding a diagonal matrix. This is whatis mostly done in practice.

    19

  • Matrix Assembly. Usually for Finite Elements the matrices M , D and A are com-puted from the corresponding elementary matrices which are obtained by change ofvariables onto the reference element [1, 1] for each cell. So L

    0i(x)j(x) dx =

    n1=0

    x+1x

    i(x)j(x) dx,

    and doing the change of variable x = x+1x2 x+x+1+x

    2 , we get x+1x

    i(x)j(x) dx =x+1 x

    2

    11(x)(x) dx,

    where (x) = i(x+1x

    2 x+x+1+x

    2 ). The local indices on the reference element gofrom 0 to k and the global numbers of the basis functions not vanishing on element are j = k + . The are the Lagrange polynomials at the Gauss-Lobatto points inthe interval [1, 1].

    The mass matrix in Vh can be approximated with no loss of order of the finiteelement approximation using the Gauss-Lobatto quadrature rule. Then because theproducts (x)(x) vanish for 6= at the Gauss-Lobatto points by definition of the which are the Lagrange basis functions at these points, the elementary matrix M isdiagonal and we have 1

    1(x)

    2 dx k

    =0

    wGL (x)2 = wGL

    using the quadrature rule, where wGL is the Gauss-Lobatto weight at Gauss-Lobattopoint (x) [1, 1]. So that finally M = diag(wGL0 , . . . wGLk ) is the matrix with k + 1lines and columns with the Gauss-Lobatto weights on the diagonal.

    Let us now compute the elements of D. As previously we go back to the interval[1, 1] with the change of variables x = x+1x2 x + x+1+x2 and we define (x) =i(

    x+1x2 x+

    x+1+x2 ). Note that a global basis function i associated to a grid point

    has a support which overlaps two cells and is associated to two local basis functions.Thus one needs to be careful to add the two contributions as needed in the final matrix.

    We get (x) =x+1x

    2 i(x+1x

    2 (x+ 1) + x). It follows that x+1x

    j(x)i(x) dx = 11

    2

    x+1 x (x)(x)

    x+1 x2

    dx =

    11(x)(x) dx.

    The polynomial (x) is of degree k so that (x) is of degree k 1 so that the Gauss-

    Lobatto quadrature rule with k + 1 points is exact for the product which is of order2k 1. Using this rule 1

    1(x)(x) dx =

    km=0

    wGLm (xm)(xm) = w

    GL

    (x),

    As before, because are the Lagrange polynomials at the Gauss-Lobatto points, onlythe value at x in the sum is one and the others are 0. On the other hand evaluating

    20

  • the derivatives of the Lagrange polynomial at the Gauss-Lobatto points at these Gauss-Lobatto points can be done using the formula

    (x) =p/px x for 6= and

    (x) =

    6=

    (x),

    where p = 6=(x x). This formula is obtained straightforwardly by taking the

    derivative of the explicit formula for the Lagrange polynomial

    (x) =

    6=

    (x x) 6=

    (x x)

    and using this expression at the Gauss-Lobatto point x 6= x. We refer to [1] for adetailed description.

    We can now conclude with the computation of the stiffness matrix A. Having alreadycomputed the expression of the change of variable of the derivatives we can quickly goto the result. We have in each element x+1

    x

    j(x)i(x) dx =

    11

    (2

    x+1 x

    )2(x)

    (x)

    x+1 x2

    dx

    =2

    x+1 x

    11(x)

    (x) dx =

    2

    x+1 xk

    m=0

    wGLm (xm)

    (xm).

    As the polynomial being integrated is of degree 2(k 1) = 2k 2 the Gauss-Lobattoquadrature is exact. Here no simplifications occurs in the sum, which has to be computed.Still the expressions of the derivatives at the Gauss-Lobatto points computed above canthen be plugged in.

    Time advance and stability. At the end we get as for the finite difference and finitevolume methods a system of differential equations that can be solved with any ODEsolver. Let us make a few remarks concerning the stability of the scheme (once discretisedin time). As we saw previously this depends on whether the eigenvalues of the matrixA is included in the stability zone of the ODE solver. Here A = M1(D + A). Notethat the matrices M and A are obviously symmetric and thus have only real eigenvalues.On the other hand, for periodic boundary conditions and integration by parts, yields

    that j(x)

    x i(x) dx = j(x)

    i(x)x dx. Hence D is skew symmetric and has only

    imaginary eigenvalues. Remember that the stability zones of our explicit ODE solvers liemostly on the left-hand side of the imaginary axis in the complex plane, and that onlythe third and fourth order schemes have a stability zone on the imaginary axis. Hencein the pure advection case = 0 A has purely imaginary eigenvalues and the order oneand two time schemes are always unstable. In order to stabilise the method a procedurethat is often used with a finite element discretisation of a pure advection problem is toadd a diffusive term that goes to 0 with the cell size, i.e take = x, in this case asmall negative real part is added to the eigenvalues which are thus pushed into the lefthalf of the complex plane and the stability zone is enhanced.

    21

  • 2.4 The Discontinuous Galerkin (DG) method

    The DG method represents the unknowns like the Finite Element method by piecewisepolynomial functions, but unlike Finite Element methods the polynomials are discon-tinuous at the cell interfaces and a numerical flux is defined at the cell interface in thesame way as for Finite Volume methods.

    So on each cell the discrete unknown uh is represented as a linear combination of wellchosen basis functions of the space of polynomials of degree k Pk. The dimension of thisspace is k+1. As no continuity is enforced at the element interface, there is no constrainton the basis functions and generally two kinds of basis functions are used: either theLegendre polynomials which form an orthogonal basis, we then speak of modal DG orone can use a Lagrange basis defined on a set of interpolation points within the cell wethen speak of nodal DG. The interpolation points are generally chosen to be either theGauss points or the Gauss-Lobatto points which are both very convenient as they allowto express the integrals appearing in the formulation exactly (for Gauss) or almost (forGauss-Lobatto) using the associated quadrature rule.

    For the derivation of a DG scheme, the equation is multiplied by a polynomial testfunction on each cell and and integration by parts is used so that a boundary termappears which will allow the coupling between two neighbouring cells. Let us apply ithere to the conservation law

    u

    t+f(u)

    x= 0.

    We then get

    d

    dt

    x+1x

    uv dx+

    x+1x

    f(u)

    xv dx

    =d

    dt

    x+1x

    uv dx x+1x

    f(u)v

    xdx+ (f(u(x+1))v(x+1) f(u(x))v(x)) = 0.

    (2.18)

    The DG method has then two key ingredients.

    1. Choose on each cell a finite dimensional representation, usually by a polynomialas said previously.

    2. Define a unique numerical flux denoted by g = g(uL(x), uR(x))) at the cellinterface which is constructed from the two values coming from the cells sharingthe interface on the left and on the right. This is defined using similar recipes asfor the finite volume method.

    Choosing as local representation for u and the test function v the Lagrange polyno-mials at the Gauss-Lobatto points simplifies the computation of the fluxes, as in this caseonly the Lagrange polynomial associated to the edge node does not vanish at the edge.This situation is different when using Legendre polynomials or Lagrange polynomials atonly interior nodes (like the Gauss points). Note however that Legendre polynomialshave the advantage of having exactly a diagonal mass matrix. This is obtained alsowith Lagrange polynomials at the Gauss-Lobatto points but in this case at the price ofa small quadrature error.

    As opposite to the Finite Element method, only local matrices on each element,in practice only the elementary matrices on the [1, 1] reference interval need to be

    22

  • assembled. The elementary mass matrix M on cell on the reference interval has thecomponents

    M, =

    11(x)(x) dx, 0 , k.

    When the basis functions are the Legendre polynomials which form an orthonormalbasis.

    as in the previous section using the Gauss-Lobatto quadrature

    M = diag(wGL0 , . . . wGLk ).

    From this matrix, the local mass matrix M+ 12

    on cell [x , x+1] can be expressed as

    M+ 12

    =x+1 x

    2M.

    Let us denote by K+ 12

    the local matrix containing the derivative of v. In order to get

    an expression for the components of K+ 12

    we introduce the local basis functions and

    compute using again the affine change of variable to the reference interval [1, 1]: x+1x

    f(u)ix

    dx =

    11f(u(x))

    2

    x+1 x (x)

    x+1 x2

    dx =

    11f(u(x))(x) dx.

    Then using the Gauss-Lobatto quadrature rule this becomes 11f(u(x))(x) dx

    k=0

    wGL f(u(x))(x) =

    k=0

    wGL f(u)(x),

    where u = u(x) is the th component of u on the Lagrange basis. Denoting U+ 12

    =

    (u0, u1, . . . , uk) on the cell [x , x+1], thus defining the component of matrix K+ 12

    at

    line and column as being wGL (x), we get that 1

    1f(u(x))(x) dx

    k=0

    wGL f(u)(x) = (K+ 1

    2f(U+ 1

    2)),

    where f(U+ 12) = (f(u0), f(u1), . . . , f(uk)).

    Remark 4 Because the Gauss-Lobatto quadrature is exact in this case, we notice thatthe matrix K+ 1

    2is exactly the matrix associated to the compotents x+1x

    j(x)ix

    dx =

    11(x))

    (x) dx = w

    GL

    (x).

    We also notice that this matrix does not depend on the specific interval and is equal tothe matrix on the reference element K = K+ 1

    2for all .

    Now plugging all this into the formula (2.18) we get on each cell

    V T+ 1

    2

    M+ 12

    dU+ 12

    t= V T

    + 12

    Kf(U+ 12) (g+1vk gv0).

    23

  • Then introducing the vector G+ 12 Rk whose only non zero components are the first

    which is g and the last which is g+1, we get the following system of ODE

    x+1 x2

    MdU+ 1

    2

    t= Kf(U+ 1

    2) +G+ 1

    2.

    The numerical flux g depends on values of u coming from the neighbouring cell, this iswhere the coupling between the cells takes place. The matrix M being diagonal there isno linear system to solve. Simple examples of fluxes in the linear case f(u) = au are thesame as for the finite volume method with the centred or upwind fluxes, the two valuesbeing used here are the values of u on the interface coming from the two cells sharingthe interface, this will be the local value of uk from the left cell and the local value ofu0 from the right cell.

    24

  • Chapter 3

    Linear systems

    Let us know consider linear systems of conservation laws in 1D. This can be written inthe general form

    U

    t+A

    U

    x= 0,

    where U(t, x) is a vector in Rn and A a given matrix with constant coefficients. We willfocus in the following on the Discontinuous Galerkin method, which includes the firstorder Finite Volume method when polynomials of degree 0, i.e. constants are taken oneach cell.

    3.1 The Riemann problem

    The main numerical issue when constructing a Finite Volume or Discontinuous Galerkinscheme is to find a good numerical flux that is consistent (i.e. converges towards theexact flux when the cell size goes to 0) and stable. As we saw previously in the linearscalar case enhanced stability is given by upwinding. We now need to generalise the ideaof upwind to the case of systems.

    The construction of a numerical flux is a local procedure at the interface betweentwo cells, where a different value is given on the left side and on the right side fromthe polynomial approximation (or reconstruction for Finite Volumes). In order to getinformation from the equation itself the idea is to solve it locally using an initial condi-tion which is a step function. The Riemann problem is the corresponding initial valueproblem:

    U

    t+A

    U

    x= 0,

    U(0, x) =

    UL if x < 0,UR if x 0,where UL and UR are two given constant vectors.

    The system being hyperbolic implies that A has real eigenvalues and can be diago-nalised. Hence A = PP1, where is the diagonal matrix containing the eigenvalues.Then introducing the so-called characteristic variables V = P1U , and multiplying thesystem by P1 on the left we get

    P1U

    t+ P1APP1

    U

    x=V

    t+

    V

    x= 0.

    25

  • So in the variable V the system is diagonal and reduces to the set of linear advectionequations

    vit

    + ivix

    = 0, 1 i nwhere the vi are the components of V and the i the eigenvalues of A. The exactsolution of these equations is given by vi(t, x) = vi(0, x it), where the vi(0, x) are thecomponents of the initial vector which take the constant values VL = P

    1UL if x < 0and VR = P

    1UR if x 0. In other terms

    vi(t, x) =

    vi,L if x < it,vi,R if x it.In practice we want to use the Riemann problem to determine the value of V (and U) atthe cell interface, corresponding to x = 0, the discontinuity point at any strictly positivetime. And we deduce from the previous solution that

    vi(t, 0) =

    vi,L if 0 < i,vi,R if 0 i.In order to get a vector expression, we introduce the diagonal matrices + where thenegative eigenvalues are replaced by 0 and where the positive eigenvalues are replacedby 0. Obviously = + + . Then for t > 0 we have

    V (t, 0) = +V (t, 0) + V (t, 0) = +VL + VR,

    as for all positive eigenvalues the corresponding component of V (t, 0) is vi,L and forall negative eigenvalues the corresponding component of V (t, 0) is vi,R. Note that asV (t, 0) is multiplied by the components of V (t, 0) corresponding to 0 eigenvalues donot need to be considered as they are multiplied by 0 anyway. So the side where thestrict inequality is used for the initial condition of the Riemann problem plays no role.

    Denoting by A+ = P+P1 and A = PP1 the flux AU(t, 0) associated to the

    solution of the Riemann problem at the cell interface can also be expressed convenientlydirectly in terms of U

    AU(t, 0) = P+V (t, 0) + PV (t, 0) = P+VL + PVR = A+UL +AUR.

    This expression AU(t, 0) = A+UL + AUR can be used to define the numerical fluxat the cell interface, using the value UL coming from the left-hand side of the interfaceand UR coming from the right-hand side of the interface. For actual computations,the matrices A+ and A need to be computed explicitely from the eigenvalues andeigenvectors of the matrix A. Notice that in the case of a scalar equation the matrixA is reduced to the scalar a which is then obviously the only eigenvalue of the 1 1matrix and if a > 0 we have A+ = a and A = 0, so that the numerical flux becomesau(t, 0) = auL and the same way if a < 0 au(t, 0) = auR, so that the numerical fluxobtained from the solution of the Riemann problem reduces to the upwind flux.

    Example. We consider the 1D Maxwell equations which can be written in dimension-less units:

    E

    t+B

    x= 0,

    B

    t+E

    x= 0.

    26

  • This can be written in the form of a linear system

    U

    t+A

    U

    x= 0, with U =

    (EB

    ), A =

    (0 11 0

    ).

    The eigenvalues of A are the solutions of det(AI) = 0, i.e. 2 = 1. So the eigenvaluesare 1 = 1 and 2 = 1. They are real and distinct so that the system is strictlyhyperbolic. Let Vi be a normalised eigenvector associated to the eigenvalue i, i = 1, 2.We have AV1 = V1 so that V1 = 12(1,1)T and AV2 = V2 so that V1 =

    12(1, 1)T . We

    define P the matrix whose columns are V1 and V2. P is obviously orthonormal, so thatits inverse is its transpose. Then we have PA = P . So that we can define:

    A+ = P+PT =

    1

    2

    (1 11 1

    )(0 00 1

    )(1 11 1

    )=

    1

    2

    (1 11 1

    ),

    A = PP T =1

    2

    (1 11 1

    )(1 00 0

    )(1 11 1

    )=

    1

    2

    (1 11 1

    )Hence, the upwind flux is given by

    AU(t, 0) = A+UL +AUR =1

    2

    (UL,1 + UL,2 + (UR,1 + UR,2)UL,1 + UL,2 + (UR,1 UR,2)

    ).

    Remark 5 As for the scalar problem, the numerical flux can be taken as a linear com-bination of the centred flux and the upwind flux (solution the Riemann problem):

    Gj = 1

    2A(UL + UR) + (1 )(A+UL +AUR), 0 1.

    3.2 The discontinuous Galerkin method

    The discontinuous Galerkin method can be generalised to a system in a straightforwardmanner. Each component of the approximate solution vector that we shall denote by Uhis defined locally in each cell as a polynomial of degree k, i.e. an element of Pk[x , x+1].Denoting by 0, . . . , k a basis of Pk[x , x+1], the restriction of Uh to the cell [x , x+1],that we shall denote by U

    + 12

    h can be expressed as

    U+ 1

    2h (t, x) =

    kj=0

    j(x)U+ 1

    2j (t), with U

    + 12

    j (t) =

    u+ 1

    2j,1 (t)

    ...

    u+ 1

    2j,d (t)

    .The unknown function Uh(t, x) is completely determined by its components U

    + 12

    j (t).In order to determine those we proceed like in the scalar case and plug this expression inthe equation, multiply by each of the basis functions and integrate the derivative termby part to let the flux through the interface appear:

    dU+ 1

    2j (t)

    dt

    x+1x

    i(x)j(x) dx x+1x

    AU+ 1

    2j (t)

    i(x)j(x) dx

    + G+1i(x+1)Gi(x) = 0.

    27

  • The numerical flux G is a consistent approximation of the real flux AU(t, x) at thecell interface x which is identical for both cells sharing x .

    Choice of the numerical flux: As in the scalar case, there are many possiblechoices of the numerical flux.

    1. Centred flux: Use an average from the fluxes coming from both cells G =12A(U 1

    2(t, x) + U+ 1

    2(t, x)

    ).

    2. Solution of the Riemann problem corresponding to UL = U 12(t, x) and UR =

    U+ 12(t, x). This is the generalisation of the upwind flux to systems. Better

    stability properties but more diffusive.

    3. Linear combination of the above to combine good stability properties of the latterand lower diffusion properties of former.

    4. Generalised Lax-Friedrichs flux (also called Rusanov flux).

    G =1

    2

    [A(U 1

    2(t, x) + U+ 1

    2(t, x)

    )

    (U+ 1

    2(t, x)U 1

    2(t, x)

    )],

    with = max |k|, where the k are the eigenvalues of A. This solver has goodstability properties without needing to solve the Riemann problem. Especiallyinteresting in the non linear case when the Riemann problem is hard to solve.

    28

  • Chapter 4

    Non linear conservation laws

    4.1 Characteristics

    We consider a generic scalar conservation law of the form

    u

    t+f(u)

    x= 0, with the initial condition u(0, x) = u0(x).

    Assuming f C1(R) and denoting by a(u) = f (u), u also verifiesu

    t+ a(u)

    u

    x= 0.

    We now define the characteristic curves (or characteristics) associated to the conser-vation law the solution of the differential equation

    dX

    dt= a(u(t,X)).

    Then using the chain rule we have

    d

    dt(u(t,X(t)) =

    u

    t(t,X(t))+

    dX

    dt

    u

    x(t,X(t)) =

    u

    t(t,X(t))+a(u(t,X(t))

    u

    x(t,X(t)) = 0,

    if u is a solution of the equation. From this we deduce that u(t,X(t)) = u(0, X(0)) =u0(X(0)) which is independent of t. It follows that the characteristic curves are thestraight lines in the (t, x) plane of equation:

    X(t) = X(0) + a(u0(X(0)))t.

    And it follows that the solutions of the conservation law satisfy u(t,X(t)) = u0(X(0)).This allows us to get the solution at a given point x and time t if the characteristic curvecan be traced back in the (t, x) plane to the line t = 0. This is not always the case whenf is non linear.

    Remark 6 In the linear case we have f(u) = au, then the characteristics are the parallellines of slope a. They obey the equation X(t) = X(0) + at. So they never cross and sotaking X(t) = x, we have X(0) = x at, and we recover the classical solution of thelinear advection equation

    u(t, x) = u0(x at).

    29

  • Example. Burgers equation. It corresponds to f(u) = 12u2, so that a(u) = f (u) = u.

    Then the characteristic X(t;x) such that X(0) = x satisfies X(t;x) = x+ tu0(x). Henceif we consider x2 > x1, we have

    X(t;x2)X(t;x1) = x2 x1 + t(u0(x2) u0(x1)).

    Then if u0 is non decreasing we have X(t;x2) > X(t;x1) for all positive times, but if u0 isstrictly decreasing then X(t;x2) = X(t;x1) for t = x2x1u0(x1)u0(x2) . So the characteristicscan cross and in this case the method of characteristics cannot be used to compute thesolution which is then no more C1.

    4.2 Weak solutions

    4.2.1 Definition

    As we have seen in the case of Burgers equation, the characteristics associated to a nonlinear conservation law can cross, in which case the method of characteristics can nonlonger be used to find a solution. Actually when this happens the solution is no longer ofclass C1 and can even become discontinuous. We thus need another form of the equationuu +

    f(u)x = 0 associated to the initial condition u(0, x) = u0(x) to make it well defined

    for such absolution.Let us first recall the definition of a classical solution:

    Definition 5 Let u0 C1(R), then u is called a classical solution if u C1(R+ R)and u satisfies

    u

    u+f(u)

    x= 0, and U(0, x) = u0(x)

    in the classical sense.

    Now we can define the notion of weak solution:

    Definition 6 Let u0 L(R), then u L(R+ R) is called a weak solution of ourscalar conservation law if u satisfies T

    0

    +

    u

    t+ f(u)

    xdt dx+

    +

    u0(x)(0, x) dx = 0 C1c ([0, T [R.

    Multiplying the equation uu +f(u)x = 0 by and integrating by parts, it is easy to

    verify that a classical C1 solution is also a weak solution. So the notion of weak solutionsgeneralises the notion of classical solutions.

    4.2.2 The Rankine-Hugoniot condition

    In most physical cases the solution is actually piecewise C1 and there is only one (or afew) lines of discontinuities in the space-time plane. The Rankine-Hugoniot conditiongives a constraint on the discontinuity along a line for the piecewise smooth solution tobe a weak solution of the equation.

    Theorem 2 Assume the half space R+R is split into two parts M1 and M2 by a smoothcurve S parametrized by (t, (t)) with C1(R+). We also assume that u L(R+R)

    30

  • and that u1 = u|M1 C1(M1) and u2 = u|M2 C1(M2) with u1 and u2 two classicalsolutions of our equation in respectively M1 and M2.

    Then u is a weak solution if and only if

    [u1(t, (t)) u2(t, (t))](t) = f(u1(t, (t))) f(u2(t, (t))) t R+. (4.1)

    Relation (4.1) is called the Rankine-Hugoniot condition. It is often written in thesimplified manner

    (u1 u2)s = f(u1) f(u2),where s = (t) is the propagation speed of the discontinuity.Proof. Assume u is a weak solution of our equation. Then by definition T

    0

    +

    u

    t+ f(u)

    xdt dx+

    +

    u0(x)(0, x) dx = 0 C1c ([0, T [R.

    Then we can split the first double integral into an integral on M1 and an integral on M2and integrate these integrals by parts as u is C1 on each of these domains. We then getusing Greens divergence formula, with denoting the outward unit normal vector,

    v dx =

    v dx

    v ds

    thatM1

    u

    t+ f(u)

    xdt dx =

    M1

    (u

    t+f(u)

    x

    )dt dx+

    M1

    (u

    f(u)

    ) 1ds

    Because u = u1 is a classical solution in M1 the first term on the right hand side vanishes.The boundary term is composed of a part on the t = 0 line which cancels with the part ofthe integral on the initial condition which is in M1 and a part that can be parametrizedusing . A tangent vector to the parametrized curve S is given by (1, (t)). Hence theoutward unit normal is given by

    1 =1

    1 + (t)2

    ((t)1

    ).

    Recall that the integral over a curve parametrized by : [a, b] Rn is defined bySF ds =

    baF ((t))(t))2 dt.

    Thus the part of the boundary integral corresponding to the integral on S which isparametrized by (t) = (t, (t)) becomes

    S

    (u1

    f(u1)

    ) 1ds =

    T0

    11 + (t)2

    [(t)u1(t, (t)) f(u1(t, (t)))

    ](t, (t))

    1 + (t)2 dt,

    =

    T0

    [(t)u1(t, (t)) f(u1(t, (t)))

    ](t, (t)) dt.

    31

  • In the same way for the part on M2 for which the outward normal is 2 = 1 we getS

    (u1

    f(u1)

    ) 1ds =

    T0

    [(t)u2(t, (t)) + f(u2(t, (t)))](t, (t)) dt.Adding the two pieces we find T

    0

    [(t)(u1(t, (t)) u2(t, (t))) + f(u2(t, (t))) f(u1(t, (t)))

    ](t, (t)) dt = 0.

    This is true for all C1 functions , hence its factor in the integral vanishes. This corre-sponds to the Rankine-Hugoniot relation.

    Conversely, the same calculation proves that if the Rankine-Hugoniot relation issatisfied then u is a weak solution.

    Example: Consider the Burgers equation which corresponds to f(u) = u2

    2 :

    u

    t+

    1

    2

    u2

    x= 0,

    with the initial condition

    u0(x) =

    0 if x < 0,1 if x 0.1. Using the Rankine-Hugoniot relation let us see under what condition a piecewise

    constant solution can be a weak solution of this problem. Because the character-istics of the Burgers equation are straight lines, it is natural to look for piecewisesmooth solutions which are separated by a straight line in the t x plane. Astraight line can be parametrized by (t, t). Then the candidate piecewise solutionwrites

    u(t, x) =

    0 if x < t,1 if x t.As (t) = t, we have s = (t) = and so the Rankine-Hugoniot condition(u1 u2)s = f(u1) f(u2) becomes

    (0 1) = 12

    (0 1)

    and thus the only weak solution consisting of two constant states is u correspondingto = 12 . Such a discontinuous solution is called a shock.

    2. Let us now define

    u(t, x) =

    0 if x < 0,

    x/t if 0 x < t,1 if x t.

    The two constant values are obviously classical solutions in their part of the do-main. On the other hand u(t, x) = x/t verifies ut (t, x) = xt2 and u

    2

    x (t, x) =2xt2

    so thatu

    t(t, x) +

    1

    2

    u2

    x(t, x) = x

    t2+

    1

    2

    2x

    t2= 0

    and u(t, x) = x/t is also a classical solution on its domain of definition. It isstraightforward to verify that this solution is continuous on the lines x = 0 and

    32

  • x = t, so that the Rankine-Hugoniot conditions are automatically verified (nojump) but not C1. This solution which goes continuously from one constant stateto the other, but is not C1 on two lines is called a rarefaction wave.

    So we proved that this is also a weak solution of the Burgers equation, whichmeans that the equation we are considering in this example has at least two weaksolutions. In practice it is possible to construct other weak solutions with severalconstant states separated by a line of discontinuity (see [3] for examples).

    4.2.3 Entropy solution

    The last example shows us that the uniqueness of a weak solution is not guaranteed.However the physical solution is unique. This means that there is a piece missing in ourtheory that will enable us to characterise the physically correct weak solution. The ideathat will lead us there is that an exact conservation law is unlikely to be physical. Thereis always a small amount of dissipation. Mathematically this can be modelled by addinga small diffusion term to our conservation law: for a small positive we consider

    u

    t+f(u)

    x

    2u

    x2= 0. (4.2)

    Associated to a smooth initial condition this equation has a unique smooth solution. Andthe physically correct solution of our conservation law, will be the unique limit of thissolution (which depends on ) when 0. This unique solution can be characterisedusing the notion of entropy.

    Definition 7 Let U,F C2(R) such that(i) U is strictly convex,

    (ii) F = U f

    Then U is called an entropy and F an entropy flux associated to the conservation law

    u

    t+f(u)

    x= 0.

    Theorem 3 Assume the conservation law ut +f(u)x = 0 can be associated to an entropy

    U with entropy flux F . Then if (u) is a sequence of smooth solutions of (4.2) suchthat uL is bounded uniformly in and u u almost everywhere then u is a weaksolution of the conservation law and verifies the entropy condition

    U(u)

    t+F (u)

    x 0 (4.3)

    in the weak sense, i.e. T0

    +

    (U(u)

    t+ F (u)

    x) dt dx 0 C1c (]0, T [R), 0.

    Definition 8 A weak solution that verifies the entropy condition (4.3) is called an en-tropy solution.

    33

  • It has been proven by Kruzhkov (see [3] and references therein) that for a boundedinitial condition u0 and a smooth flux f(u), there exists a unique entropy solution of thescalar conservation law.

    In the case of a strictly convex flux (f (u) > 0) which is verified by the Burgersequation, there is a simple characterisation of the entropy condition for a shock, whichis called the Lax entropy condition:

    f (uL) > s > f (uR), with s =f(uR) f(uL)

    uR uL .

    This is the Rankine-Hugoniot setting and s is the shock speed. This tells us that theshock is the entropy solution provided the characteristics lines cross at the shock linex = st. Else the entropy solution is a rarefaction wave.

    Remark 7 Because f is strictly convex f is increasing and the entropy condition canbe satisfied only if uL > uR and in this case because of the strict convexity, s which is theslope of the line joining (uL, f(uL)) and (uR, f(uR)) on the graph of f lies necessarilybetween f (uR) and f (uL).

    Example: Consider again the Burgers equation ut +12u2

    x = 0 with piecewise constantinitial conditions u0(x) = uL for x < 0 and u0(x) = uR for x 0. We compute previouslythe characteristics for Burgers equation which are given by X(t;x) = x+ tu0(x). So inour case we have two families of characteristics, those issued from the negative values ofx at t = 0 which become X(t;x) = x+ tuL and those issued from the positive values of xat t = 0 which become X(t;x) = x+ tuR. The flux of the Burgers equation f(u) =

    12u

    2

    is strictly convex, so the Lax criterion applies and the Lax entropy condition can besatisfied only if uL > uR which is the case when the characteristics cross.

    Remark 8 In the case of a linear flux f(u) = au for some constant a. If U is anentropy, the associated entropy flux is F = au and we have, as u satisfies ut + a

    ux = 0,

    U

    t+F

    x=U

    t+ a

    U

    x= U (t)(

    u

    t+ a

    u

    x) = 0.

    So the entropy condition is always verified in this case.This is a simple case, which also can appear for some of the waves in non linear

    systems. In this case two different values are just propagated side by side without inter-fering. This case is called a contact discontinuity.

    We will restrict in this lecture to the two simplest cases of scalar conservation laws,namely the cases of a strictly convex flux and of a linear flux. These often occur inapplications, but not always. A more complex study is needed in other cases. We referto the book of Leveque [4] for details.

    4.3 The Riemann problem

    Let us here compute the exact entropy solution of the Riemann problem for a strictlyconvex flux i.e. f (u) > 0.

    The Riemann problem for the 1D scalar non linear conservation laws reads

    u

    t+f(u)

    x= 0,

    34

  • u0(x) =

    uL if x < 0,uR if x 0.Case 1: uL < uR. We saw previously that in this case the shock does not satisfy theLax entropy condition and is not entropic. We thus look for a rarefaction wave which iscontinuous across each of the characteristics issued from the left and right of 0. Betweenthese two characteristics, we look for an explicit solution of the form u(t, x) = v(x/t).Plugging this function into our equation, we get

    xt2v(x

    t) + f (v(

    x

    t))

    1

    tv(x

    t) = 0.

    Setting = x/t this becomes

    (f (v()) )v() = 0.

    So we get two kinds of solution, either v() = C (C constant), or v such that f (v()) =0. The constant solution is not possible as it would yield non entropic shocks. As f > 0,f is strictly increasing and thus invertible. Hence the solution can be expressed asv() = (f )1().

    Finally the entropy solution of the Riemann problem in this case is the rarefactionwave defined by

    u(t, x) =

    uL if x < f

    (uL)t,(f )1(x/t) if f (uL)t x < f (uR)t,

    uR if x f (uR)t.

    Case 2: uL > uR. In this case we saw that the shock separating the two constant statesuL and uR and propagating at the speed defined by the Rankine-Hugoniot condition

    s =f(uL) f(uR)

    uL uRis entropic and so is the unique physical solution. This is defined by

    u(t, x) =

    uL if x < st,uR if x st.4.4 Numerical methods

    4.4.1 The Godunov method

    The idea of the Godunov method is that if one is looking for piecewise constant solutionsthen as the solution is propagating at a finite speed which is known, the solution can becomputed exactly by solving a Riemann problem for each cell interface. If s = max |f (u)|denotes the fastest possible wave then the neighbouring Riemann problems do noteinteract provided the time step t verifies st 12x. In principle the solution at timetn+1 could be computed by integrating over the solutions of all the Riemann problems atthis time to find the new constant value on each cell by averaging. However, this could

    35

  • be quite complicated. The Godunov method can be expressed in a much simpler wayby integrating the starting equation in space and time over one cell and one time step: tn+1

    tn

    xi+1xi

    (u

    t+f(u)

    x

    )dx dt = 0.

    Denoting by uni+ 1

    2

    = 1x xi+1xi

    u(tn, x) dx the average of u over a cell at time tn = nt,

    this yields

    x(un+1i+ 1

    2

    uni+ 1

    2

    ) +

    tn+1tn

    (f(u(t, xi+1)) f(u(t, xi))) dt = 0.

    Now as u is assumed to be constant on each cell and equal to its average, the value ofthe flux f(u(t, xi)) can be exactly computed by solving the Riemann problem betweenthe left value un

    i 12

    and the right value uni+ 1

    2

    at the interface xi. Note that we only need

    the solution of the Riemann problem exactly on the interface and this solution does notdepend on time as long as there is no interaction with the neighbouring problem onthe interface, which cannot occur if st x. Here because we are only interested inthe solution directly at the interface we gain a factor 12 as we do not care about otherinteractions.

    As we saw previously, assuming that the flux f(u) is strictly convex, the entropysolution of the Riemann problem can be either a shock or a rarefaction wave, but u(t, xi)will take a value different from un

    i 12

    or uni+ 1

    2

    only if the rarefaction wave has an interaction

    with x = xi which is the case only if f(uL) < 0 and f (uR) > 0. Let us clearly distinguish

    the cases and express the solution of the local Riemann problem at the interface x = xi.Recall that we consider the local Riemann problem with the initial condition (at timetn)

    u(tn, x) =

    uni 1

    2

    if x < xi,

    uni+ 1

    2

    if x xi.If un

    i 12

    < uni+ 1

    2

    the entropy solution is a rarefaction wave so that

    u(t, xi) =

    uni 1

    2

    if f (uni 1

    2

    ) > 0,

    (f )1(0) if f (uni 1

    2

    ) 0 f (uni+ 1

    2

    ),

    uni+ 1

    2

    if f (uni+ 1

    2

    ) < 0.

    If uni 1

    2

    > uni+ 1

    2

    the entropy solution is a shock wave so that

    u(t, xi) =

    uni 1

    2

    if s > 0,

    uni+ 1

    2

    if s < 0,

    where s is the shock speed given by the Rankine-Hugoniot condition: s = f(uL)f(uR)uLuR .Using the exact solution of the Riemann problem, the numerical flux gni = g(u

    ni 1

    2

    , uni+ 1

    2

    )

    is taken to be the flux associated to the exact solution of the Riemann problem, i.e.f(u(t, xi)) for x = xi and t > tn. Noticing that for a strictly convex flux, the minimumof f is reached at the points (f )1(0) and going through the different cases we find that

    gni =

    min

    u[ui 12

    ,ui+12

    ]f(u) if ui 1

    2< ui+ 1

    2,

    maxu[u

    i 12,ui+12

    ]f(u) if ui 1

    2> ui+ 1

    2.

    36

  • With this, the flux at the interface can be computed and the Godunov scheme iswell defined (here in the case of a strictly convex flux). In the case of a linear flux, theGodunov scheme amounts to the first order upwind scheme. For other smooth fluxes,the Riemann problem can generally also be solved even though it is more complicated.

    4.4.2 Approximate Riemann solvers

    Computing the exact solution of the local Riemann problems is in principle the bestmethod. However it can be complicated or numerically expensive. Moreover, as thereare other sources of numerical errors anyway, it might be numerically as good or almostas good to replace the solution of the exact Riemann problem by some approximation.

    1. The Rusanov flux (also called Local Lax-Friedrichs flux). The idea behind this flux,instead of approximating the exact Riemann solver, is to recall that the entropysolution is the limit of viscous solutions and to take a centred flux to which someviscosity (with the right sign) is added. This flux is given by

    gni = g(uni 1

    2

    , uni+ 1

    2

    ) =1

    2

    [f(ui 1

    2) + f(ui+ 1

    2) max

    u[ui 12

    ,ui+12

    ]|f (u)|(ui+ 1

    2 ui 1

    2)

    ].

    Taking the viscosity parameter as the largest local wave speed guarantees thestability of the scheme. On the other hand taking the largest local wave speed(instead of globally) adds less viscosity in regions where the solution is smoothand ui 1

    2is close to ui+ 1

    2.

    2. The Roe flux (also called Murman or Murman-Roe in the scalar case): the idea hereis to linearise the flux f(u) around the cell interface and then use the upwind flux.Assuming two constant values uL and uR on each side, this amounts to replacingf(u) by a(uL, uR)u with a well chosen velocity a(uL, uR) that will enable us to geta flux which is close to the flux given by the solution of the exact Riemann problem.Looking at the solution of the exact Riemann problem an approximation that looksinteresting for both rarefaction wave and shocks is to take the Rankine-Hugoniotvelocity

    a(uL, uR) =f(uL) f(uR)

    uL uR ,

    if there is a discontinuity i.e. uL 6= uR, and simply a(uL, uR) = f (uL) = f (uR) ifuL = uR. Indeed if uL and uR are close, which will be the case in smooth regionsa(uL, uR) defines a good approximation of both f

    (uL) and f (uR). Moreover ifboth f (uL) and f (uR) have the same sign a(uL, uR) will also have this sign, sothat the same value of the numerical flux will be obtained as in the exact Riemannproblem was solved. The only case where this does not yield the same solution asthe exact Riemann solver is the case of a rarefaction wave with f (uL) and f (uR) ofdifferent signs. In this case, it is possible that the solution obtained by the schemeis not the correct entropy solution, the non entropic shock being approximatedinstead of the rarefaction wave. So a fix, known as entropy fix, is needed. For thislet us express the Murman-Roe flux as a centred flux with some added viscosity.

    37

  • The Murman-Roe flux is an upwind flux for the linearised problem we just intro-duced. The case uL = uR being trivial, we consider only uL 6= uR. Then

    g(uL, uR) =

    f(uL) if a(uL, uR) > 0,f(uR) if a(uL, uR) 0.If a(uL, uR) =

    f(uL)f(uR)uLuR > 0 and uL 6= uR we have

    f(uL) =1

    2

    (f(uL) + f(uR) f(uR) f(uL)

    uR uL (uR uL)),

    and if a(uL, uR) =f(uL)f(uR)

    uLuR < 0 and uL 6= uR we have

    f(uR) =1

    2

    (f(uL) + f(uR) +

    f(uR) f(uL)uR uL (uR uL)

    ),

    so that we can define the numerical flux in all cases by

    g(uL, uR) =1

    2(f(uL) + f(uR) |a(uL, uR)|(uR uL)) .

    Here we also see that the numerical viscosity vanishes when a(uL, uR) 0 whichcan happen close to the minimum of the convex function f . Then a non entropicshock might be selected by the scheme. A simple fix, introduced by Harten, consistsin smoothing the graph of the absolute value close to 0 (see [4] for details). Thisconsists in replacing the absolute value in the formula defining the flux by

    () =

    || || ,(2 + 2)/(2) || < .This ensures that () and that there is always some dissipation. This worksand yields the correct entropy solution provided is well tuned to the problem athand.

    4.4.3 Higher order methods

    Higher order methods can be designed using the Finite Volume or the DiscontinuousGalerkin methodology. In both cases what needs to be defined is the numerical fluxconstructed from the two values uL and uR on each side of the interface. The samenumerical fluxes as previously can be used in this case. However for the scheme to bestable close to discontinuities a limiting procedure needs to be introduced so that thescheme falls back to first order in the cells where a discontinuity is detected. There is avast literature on limiters that we shall not detail here.

    4.4.4 Strong stability preserving (SSP) Runge-Kutta methods.

    Fluxes are generally constructed so that the associated scheme has some stability proper-ties when used with a first order explicit Euler time solver. When higher order methodsin x are used, it makes sense to use also higher order methods in time. A specific classof Runge-Kutta methods has been developed to keep the strong stability properties ofthe explicit Euler solver at each stage (See [5]).

    38

  • 4.5 Nonlinear systems of conservation laws

    Going from the scalar case to systems in the non linear case, is similar to what is donein the linear case. The hyperbolicity of the system is essential so that the system canbe locally diagonalised and the eigenvalues explicitely used in the definition of the flux.

    The derivation of a Finite Volume or Discontinuous Galerkin scheme can be donecomponent by component and so reduces to the scalar case except for the definitionof the numerical flux which in general mixes the different components and needs to bespecific to the system at hand. We shall restrict in this lecture to the introduction oftwo of the most used numerical fluxes, namely the Rusanov (or local Lax-Friedrichs)flux and the Roe flux.

    4.5.1 The Rusanov flux

    As in the scalar case, the main idea here is to use a centred flux to which just enoughdissipation is added to ensure stability in all cases. In the scalar case the needed viscositywas given by the largest local wave speed. A system of n components corresponds tothe superposition of n waves the local speed of each being given by the correspondingeigenvalue. So taking the viscosity coefficient in the flux as the maximum over alleigenvalues should do the job. This yields the Rusanov flux for systems, which is thesimplest stable flux. It is defined for a linear system of the form

    U

    t+F(U)

    x= 0,

    as

    G(UL,UR) =1

    2

    (F(UL) + F(UR) max

    U[UL,UR]|(F(U))|(UR UL)

    ),

    where maxU[UL,UR] |(F(U))| denotes the maximum modulus of the eigenvalues of theJacobian matrix F(U).

    4.5.2 The Roe flux

    Roes method consists in locally linearising the non linear flux with a well chosen pro-cedure. The linearised matrix between two constant states UL and UR is denoted byA(UL,UR) and constructed such that the following properties are verified:

    F(UR) F(UL) = A(UL,UR)(UR UL). A(U,U) = F(U). A(UL,UR) is diagonalisable, has real eigenvalues and a complete system of eigen-

    vectors.

    Such a matrix is not always easy to find, but there are procedures, described in [4] forexample, to construct them. Moreover classical Roe matrices are known for the mostusual systems [4].

    Once the Roe matrix is defined, the flux can be computed by solving the correspond-ing linear Riemann problem that we treated in Chapter 3. Let us rewrite the formula,so that we can also include the entropy fix, which as in the scalar case is needed for nonlinear systems to make sure that the scheme always converges to the correct entropysolution.

    39

  • In the case of linear systems, the flux was defined as AU(t, 0) = A+UL + AUR.Defining the absolute value of a matrix as |A| = A+A, the flux can also be expressedas

    AU(t, 0) =1

    2(AUL +AUR |A|(UR UL)) .

    Using the properties of the Roe matrix in the non linear case, the same expressionwill be used to define the Roe flux:

    G(UL,UR) =1

    2(A(UL,UR)UL +A(UL,UR)UR |A(UL,UR)|(UR UL)) .

    The same entropy fix consisting in replacing the absolute value by the function whichis bounded away from 0 can be applied in this formula.

    40

  • Bibliography

    [1] J.-P. Berrut, L.N. Trefethen: Barycentric Lagrange Interpolation, SIAM Rev. 46(3), pp. 501517.

    [2] G. Cohen, Higher-Order Numerical Methods for Transient Wave equation,Springer-Verlag, 2001.

    [3] E. Godlewski and P.A. Raviart: Numerical Approximation of Hyperbolic Systemsof Conservation Laws, Springer, 1996.

    [4] R. J. Leveque: Finite Volume Methods for Hyperbolic Problems, Cambridge Textsin Applied Mathematics, 2002.

    [5] J. S. Hesthaven and T. Warburton: Nodal Discontinuous Galerkin methods,Springer, 2008.

    [6] D. A. Di Pietro and A. Ern: Mathematical Aspects of Discontinuous GalerkinMethods, vol. 69 SMAI Mathematiques et Applications, Springer, 2012.

    [7] Chi-Wang Shu: High Order Weighted Essentially Nonoscillatory Schemes for Con-vection Dominated Problems. SIAM Rev. 51 (1), pp. 82126.

    41