1 Introduction

The notion of conservation is essential in the numerical approximation of hyperbolic systems of conservation: if it is violated, there is no chance, in practice, to compute the right weak solution in the limit of mesh refinement. This statement is known since the celebrated work of Lax and Wendroff [20], and what happens when conservation is violated has been discussed by Hou and Le Floch [17]. This conservation requirement imposes the use of the conservation form of the system. However, in many practical situations, this is not really the one would like to deal with, since in addition to conservation constraints, one also seeks for the preservation of additional features, like contacts for fluid mechanics, or entropy decrease for shocks.

In this paper, we are interested in compressible fluid dynamics. Several authors have already considered the problem of the correct discretisation of the non-conservative form of the system. In the purely Lagrangian framework, when the system is described by the momentum equation and the Gibbs equality, this has been done since decades: one can consider the seminal work of Wilkins, to begin with, and the problem is still of interest; one can consider [5, 6, 10] where high order is sought for. In the case of the Eulerian formulation, there are less works. One can mention [4, 9, 16] where staggered meshes are used, the thermodynamic variables are localised in the cells, while the kinetic ones are localised at the grid points, or [3] where a non-conservative formulation with correction is used from scratch. The first two references show how to construct at most second-order scheme, while the last one shows this for any order. All constructions are quite involved in term of algebra, because one has to transfer information from the original grid and the staggered one.

In this paper, we aim at showing how the notion of conservation introduced in the residual distribution framework [1, 2, 23] is flexible enough to allow to deal directly with the non-conservative form of the system, while the correct solutions are obtained in the limit of mesh refinement. More precisely, we show how to deal with both the conservative and non-conservative forms of the PDE, without any switch, as it was the case in [19]. We illustrate our strategy on several versions of the non-conservative form, and provide first-, second and third-order accurate version of the scheme. More than a particular example, we describe a general strategy which is quite simple. The systems on which we will work are descriptions of the Euler equations for fluid mechanics.

  • The conservation one:

    $$\begin{aligned} \frac{\partial }{\partial t}\left(\begin{array}{c}\rho \\ \rho u \\ E\end{array}\right)+\frac{\partial }{\partial x}\left(\begin{array}{c} \rho u\\ \rho u^2+p\\ u(E+p)\end{array}\right)=0 \end{aligned},$$
    (1)
  • the primitive formulation:

    $$\begin{aligned} \frac{\partial }{\partial t} \left(\begin{array}{c}\rho \\ u \\ p\end{array}\right)+\left(\begin{array}{c}\frac{\partial \rho u}{\partial x}\\ u\frac{\partial u}{\partial x}+\frac{1}{\rho }\frac{\partial p}{\partial x}\\ u\frac{\partial p}{\partial x}+(e+p)\frac{\partial u}{\partial x} \end{array}\right)=0 \end{aligned},$$
    (2)
  • the “entropy” formulation:

    $$\begin{aligned} \frac{\partial }{\partial t}\left(\begin{array}{c}p \\ u \\ s\end{array}\right)+\left(\begin{array}{c}u\frac{\partial p}{\partial x}+(e+p)\frac{\partial u}{\partial x}\\ u\frac{\partial u}{\partial x}+\frac{1}{\rho }\frac{\partial p}{\partial x}\\ u\frac{\partial s}{\partial x} \end{array}\right)=0 \end{aligned},$$
    (3)

where as usual \(\rho \) is the density, u the velocity, p the pressure, \(E=e+\frac{1}{2}\rho u^2\) is the total energy, \(e=(\gamma -1)p\) and \(s=\log (p)-\gamma \log (\rho )\) is the entropy. The ratio of specific heats, \(\gamma \) is supposed to be constant here, mostly for simplicity.

This paper has several sources of inspirations. The first one is the residual distribution (RD) framework, and in particular [1, 2, 23]. The second one is the family of active flux [7, 11,12,13, 15], where the solution is represented by a cell average and point values. The conservation is recovered from how the average is updated. Here the difference comes from the fact that in addition several forms of the same system can be conserved, as (1)–(3) for the point value update while a Lax-Wendroff like result can still be shown. If the same systems were used, both for the cell average and the point values, this would easily fit into the RD framework, using the structure of the polynomial reconstruction. The difference with the active flux is that we use only the representation of the solution within one cell, and not a fancy flux evaluation. Another difference is about the way the solution is evolved in time: the active flux method uses the method of characteristics to evolve the point value, while here we rely on more standard Runge-Kutta methods.

The format of the paper is as follows. In the first part, we explain the general principles of our method, and justify why, under the assumptions made on the numerical sequence for the Lax-Wendroff theorem (boundedness in \(L^\infty \) and strong convergence in \(L^p\), \(p\geqslant 1\), of a subsequence toward a \(v\in L^p\), then this v is a weak solution of the problem), we can also show the convergence of a subsequence to a weak solution of the problem, under the same assumptions. In the second part, we describe several discretisations of the method, and in the third part, we provide several simulations to illustrate the method.

In this paper, the letter C denotes a constant, and we use the standard “algebra”, for example \(C\times C=C\), \(C+C=C\), or \(\alpha C=C\) for any constant \(\alpha \in {\mathbb{R}}\).

2 The Methods

2.1 Principle

We consider the problem

$$\begin{aligned} \frac{\partial {\mathbf{u}}}{\partial t}+\frac{\partial {{\mathbf{f}}}({\mathbf{u}})}{\partial x}=0,\quad x\in {\mathbb{R}}\end{aligned}$$
(4a)

with the initial condition

$$\begin{aligned} {\mathbf{u}}(x,0)={\mathbf{u}}_0(x),\quad x\in {\mathbb{R}}. \end{aligned}$$
(4b)

Here \({\mathbf{u}}\in {\mathcal{D}}_{\mathbf{u}}\subset {\mathbb{R}}^p\). For smooth solutions, we also consider an equivalent formulation in the form

$$\begin{aligned} \frac{\partial {\mathbf{v}}}{\partial t}+J\frac{\partial {\mathbf{v}}}{\partial x}=0 \end{aligned},$$
(4c)

where \({\mathbf{v}}=\Psi ({\mathbf{u}})\in {\mathcal{D}}_{\mathbf{v}}\) and \(\Psi :{\mathcal{D}}_{\mathbf{u}}\rightarrow {\mathcal{D}}_{\mathbf{v}}\) is assumed to be one-to-one and \(C^1\) (as well as the inverse function). For example, if (4) corresponds to (1), then

$$\begin{aligned} {\mathcal{D}}_{\mathbf{u}}=\left\{ (\rho , \rho u, E)\in {\mathbb{R}}^3 \text{ such that }\rho>0 \text{ and } E-\frac{1}{2}\rho u^2>0\right\} . \end{aligned}$$

If (4c) corresponds to (2), then

$$\begin{aligned} {\mathcal{D}}_{\mathbf{v}}=\{(\rho , u, p)\text{ such that }\rho>0 \text{ and } p>0\} \end{aligned}$$

and (for a perfect gas) the mapping \(\Psi \) corresponds to \((\rho , \rho u, E)\mapsto \big(\rho , u, p=(\gamma -1)\big( E-\frac{1}{2}\rho u^2\big) \big),\) while

$$\begin{aligned} J=\left(\begin{array}{ccc} u &{} \rho &{}0\\ 0&{} u &{} \frac{1}{\rho }\\ 0&{} e+p &{} u \end{array}\right). \end{aligned}$$

For (3),

$$\begin{aligned} {\mathcal{D}}_{\mathbf{u}}=\{(p,u,s)\in {\mathbb{R}}^3, p>0 \}. \end{aligned}$$

More generally, we have \(J=\big[\nabla _{\mathbf{u}}\big(\Psi ^{-1}\big)\big]\nabla _{\mathbf{u}}{{\mathbf{f}}}\).

The idea is to discretise simultaneously (4a) and (4c). Forgetting the possible boundary conditions, \({\mathbb{R}}\) is divided into non-overlapping intervals \(K_{j+1/2}=[x_{j}, x_{j+1}],\) where \(x_j<x_{j+1}\) for all \(j\in {\mathbb{Z}}\). We set \(\Delta _{j+1/2}=x_{j+1}-x_j\) and \(\Delta =\max _j\Delta _{j+1/2}\). At the grid points, we will estimate \({\mathbf{v}}_j\) in time, while in the cells we will estimate the average value

$$\begin{aligned} \bar{\mathbf{u}}_{j+1/2}=\frac{1}{\Delta _{j+1/2}}\int _{x_j}^{x_{j+1}} {\mathbf{u}}(x) {\mathrm{d}}x. \end{aligned}$$

When needed, we have \({\mathbf{u}}_j=\Psi ^{-1}({\mathbf{v}}_j)\), however \(\bar{\mathbf{v}}_{j+1/2}=\Psi (\bar{\mathbf{u}}_{j+1/2})\) is meaningless since the \(\Psi \) does not commute with the average.

In \(K_{j+1/2}\) any continuous function can be represented by \({\mathbf{u}}_j={\mathbf{u}}(x_j)\), \({\mathbf{u}}_{j+1}={\mathbf{u}}(x_{j+1})\), and \(\bar{\mathbf{u}}_{j+1/2}\): one can consider the polynomial \(R_{\mathbf{u}}\) defined on \(K_{j+1/2}\) by

$$\begin{aligned} \big(R_{\mathbf{u}}\big)_{|K_{j+1/2}}(x)={\mathbf{u}}_j L_{j+1/2}^0+{\mathbf{u}}_{j+1}L_{j+1/2}^1+\bar{\mathbf{u}}_{j+1/2} L_{j+1/2}^{1/2} \end{aligned}$$

with

$$\begin{aligned} L_{j+1/2}^\xi (x)=\ell _\xi \left( \frac{x-x_{j}}{x_{j+1}-x_j}\right) \end{aligned}$$

and

$$\begin{aligned} \ell _0(s)=(1-s)(1-3s), \quad \ell _1(s)=s(3s-2), \qquad \ell _{1/2}(x)=6s(1-s). \end{aligned}$$

We see that

$$\begin{aligned}&\ell _0(0)=1, \quad \ell _0(1)=0, \quad \int _0^1 \ell _0(s) {\mathrm{d}}s=0,\\ &\ell _1(1)=1, \quad \ell _1(0)=0, \quad \int _0^1\ell _1(s) {\mathrm{d}}s=0,\\ &\ell _{1/2}(0)=0,\quad \ell _{1/2}(1)=0, \quad \int _0^1\ell _{1/2}(s) {\mathrm{d}}s=1. \end{aligned}$$

How to evolve \(\bar{\mathbf{u}}_{j+1/2}\) following (4a) and \(v_{j}\) following (4c) in time? The solution is simple for the average value: since

$$\begin{aligned} \Delta _{j+1/2} \; \frac{{\mathrm{d}}\bar{\mathbf{u}}_{j+1/2}}{{\mathrm{d}}t}+ {{\mathbf{f}}}({\mathbf{u}}_{j+1}(t))-{{\mathbf{f}}}({\mathbf{u}}_{j}(t)) =0, \end{aligned}$$

we simply take

$$\begin{aligned} \Delta _{j+1/2}\frac{{\mathrm{d}}\bar{\mathbf{u}}_{j+1/2}}{{\mathrm{d}}t}+\big( \hat{{\mathbf{f}}}_{j+1/2}-\hat{{\mathbf{f}}}_{j-1/2}\big)=0 \end{aligned},$$
(5a)

where \(\hat{{\mathbf{f}}}_{j+1/2}\) is a consistent numerical flux that depends continuously on its arguments. In practice, since the approximation is continuous, we take

$$\begin{aligned} \hat{{\mathbf{f}}}_{j+1/2}={{\mathbf{f}}}({\mathbf{u}}_j){={{\mathbf{f}}}\big(\Psi ^{-1}({\mathbf{v}}_j)\big).} \end{aligned}$$
(5b)

For \({\mathbf{v}}\), we assume a semi-discrete scheme of the following form:

$$\begin{aligned} \frac{{\mathrm{d}}{\mathbf{v}}_j}{{\mathrm{d}}t}+ \overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}+\overrightarrow{\Phi }^{\mathbf{v}}_{j-1/2}=0 \end{aligned},$$
(5c)

such that \(\overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}+\overrightarrow{\Phi }^{\mathbf{v}}_{j+1/2}\) is a consistent approximation of \(J\frac{\partial {\mathbf{v}}}{\partial x}\) in \(K_{j+1/2}\). We will give examples later, for now we only describe the principles. In general the residuals \(\overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}\) and \(\overrightarrow{\Phi }^{\mathbf{v}}_{j-1/2}\) need to depend on some \({\mathbf{v}}_l\) and \({\mathbf{v}}_{l+1/2}\approx {\mathbf{v}}(x_{l+1/2})\). We can recover the missing information at the half points in the following steps.

  1. (i)

    From \({\mathbf{v}}_j\), we can get \({\mathbf{u}}_j=\Psi ({\mathbf{v}}_j)\).

  2. (ii)

    Then in \([x_{j}, x_{j+1}]\) we approximate \({\mathbf{u}}\) by

    $$\begin{aligned} R_{\mathbf{u}}(x)={\mathbf{u}}_j\ell _0\left( \frac{x-x_j}{\Delta _{j+1/2}}\right) +\bar{\mathbf{u}}_{j+1/2}\ell _{1/2}\left( \frac{x-x_j}{\Delta _{j+1/2}}\right) +{\mathbf{u}}_{j+1} \ell _1\left( \frac{x-x_j}{\Delta _{j+1/2}}\right) , \end{aligned}$$

    which enable to provide \({\mathbf{u}}_{j+1/2}:=R_{\mathbf{u}}(x_{j+1/2})\), i.e.,

    $$\begin{aligned} {\mathbf{u}}_{j+1/2}=\frac{3}{2} \bar{\mathbf{u}}_{j+1/2}-\frac{{\mathbf{u}}_j+{\mathbf{u}}_{j+1}}{4}. \end{aligned}$$
    (5d)

    Note that this relation is simply \(\bar{\mathbf{u}}_{j+1/2}=\frac{1}{6}\big( {\mathbf{u}}_j+{\mathbf{u}}_{j+1}+4 {\mathbf{u}}_{j+1/2}\big),\) i.e., Simpson’s formula.

  3. (iii)

    Finally, we state

    $$\begin{aligned} {\mathbf{v}}_{j+1/2}=\Psi ^{-1}(R_{\mathbf{u}}(x_{j+1/2})). \end{aligned}$$

In some situations, described later, we will also make the approximation

$$\begin{aligned} {\mathbf{v}}_{j+1/2}=\Psi ^{-1}(\bar{\mathbf{u}}_{j+1/2}), \end{aligned}$$

which is nevertheless consistent (but only first order accurate). As written above, the fluctuations \(\overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}\) and \(\overrightarrow{\Phi }^{\mathbf{v}}_{j+1/2}\) are functionals of the form \(\Phi \big( \{{\mathbf{v}}_l, {\mathbf{v}}_{l+1/2}\}, j-p\leqslant l\leqslant j+p \big)\) for some fixed value of p. We will make the following assumptions.

  1. (i)

    Lipschitz continuity: there exists C that depends only on \({\mathbf{u}}^0\) and T such that for any \(j\in {\mathbb{Z}}\),

    $$\begin{aligned} \Vert \Phi ( \{{\mathbf{v}}_l, {\mathbf{v}}_{l+1/2}\}, j-p\leqslant l\leqslant j+p)\Vert \leqslant \frac{C}{\Delta _{j+1/2}}\left( \sum _{l=-p}^p \Vert {\mathbf{v}}_l-{\mathbf{v}}_{l+1/2}\Vert \right) . \end{aligned}$$
    (6a)
  2. (ii)

    Consistency: set \({\mathbf{v}}^h=R_{\mathbf{u}}\), then

    $$\begin{aligned} \sum _{j\in {\mathbb{Z}}}\int _{K_{j+1/2}}\left\| \overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}+\overrightarrow{\Phi }^{\mathbf{v}}_{j+1/2} -J\frac{\partial {\mathbf{v}}^h}{\partial x}\right\| {\mathrm{d}}{\mathbf{x}}\leqslant C \Delta . \end{aligned}$$
    (6b)
  3. (iii)

    Regular mesh: the meshes are regular in the finite element sense.

The ODE systems (5) are integrated by a standard ODE solver. We will choose the Euler forward method, and the second order and third order SSP Runge-Kutta scheme.

2.2 Analysis of the Method

In order to explain why the method can work, we will choose the simplest ODE integrator, namely the Euler forward method. The general case can be done in the same way, with more technical details. So we integrate (5) by

$$\begin{aligned} \bar{\mathbf{u}}_{j+1/2}^{n+1}=\bar{\mathbf{u}}_{j+1/2}^n-\frac{\Delta t_n}{\Delta _{j+1/2}} \big(\underbrace{ {{\mathbf{f}}}({\mathbf{u}}_{j+1}^n)-{{\mathbf{f}}}({\mathbf{u}}_j^n)}_{:=\delta _{j+1/2} {{\mathbf{f}}}}\big) \end{aligned}$$
(7)

and

$$\begin{aligned} {\mathbf{v}}_j^{n+1}={\mathbf{v}}_j^n -{\Delta t_n }\big( \overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}+\overrightarrow{\Phi }^{\mathbf{v}}_{j-1/2}\big). \end{aligned}$$
(8)

Setting \(\Delta _j\) as the average of \(\Delta _{j+1/2}\) and \(\Delta _{j-1/2}\), we rewrite (8) as

$$\begin{aligned} {\mathbf{v}}_j^{n+1}={\mathbf{v}}_j^n -\frac{\Delta t_n }{\Delta _j}\delta _x{\mathbf{v}}_j \end{aligned}$$
(9)

and we note that, using the assumption (6a) as well as the fact that the mesh is shape regular, that there exists \(C>0\) depending only on \({\mathbf{u}}^0\) and T such that

$$\begin{aligned} {\Vert \delta _x {\mathbf{v}}_j}\Vert \leqslant C \sum _{j=p-1}^{p+1} \Vert {\mathbf{v}}_j-{\mathbf{v}}_{j+1/2}\Vert . \end{aligned}$$

Using the transformation (5d), from (8), we can evaluate \({\mathbf{u}}_j^{n+1}=\Psi ({\mathbf{v}}_j^{n+1})\), and then write the update of \({\mathbf{u}}\) as

$$\begin{aligned} {\Delta _j \big( {\mathbf{u}}_j^{n+1}-{\mathbf{u}}_j^n\big) +\Delta t_n \delta _x{\mathbf{u}}_{j}=0}, \end{aligned}$$
(10)

where

$$\begin{aligned} \delta _x{\mathbf{u}}_{j}=\frac{\Delta _j}{\Delta t_n}\bigg( \Psi \bigg({\mathbf{v}}_j^n-\frac{\Delta t_n}{\Delta _j} \delta {\mathbf{v}}_j \bigg)-\Psi ({\mathbf{v}}_j^n) \bigg), \end{aligned}$$

which, thanks to the assumptions we have made on \(\Psi \) satisfies

$$\begin{aligned} \Vert \delta _x {\mathbf{u}}_{j+1/2}\Vert \leqslant C \Vert \delta _x {\mathbf{v}}_j\Vert \leqslant C\sum _{j=-p}^{p}\Vert {\mathbf{v}}_{j+l}-{\mathbf{v}}_{j+l+1}\Vert \leqslant C \sum _{l=-p}^{p}\Vert {\mathbf{u}}_{j+l}-{\mathbf{u}}_{j+1+l}\Vert \end{aligned}$$

for some constants that depend on the gradient of \(\Psi \) and the maximum of the \({\mathbf{v}}_i^n\) for \(i\in {\mathbb{Z}}\).

To explain the validity of the approximation, we start by the Simpson formula, which is exact for quadratic polynomials:

$$\begin{aligned} \int _{x_{j}}^{x_{j+1}} f(x) {\mathrm{d}}x\approx \frac{\Delta _{j+1/2}}{6}\big( f(x_j)+4 f(x_{j+1/2})+f(x_{j+1})\big). \end{aligned}$$

From the point values \({\mathbf{u}}_j\), \({\mathbf{u}}_{j+1}\), and \({\mathbf{u}}_{j+1/2}\) at times \(t_n\) and \(t_{n+1}\), we define the quadratic Lagrange interpolant \(R_{{\mathbf{u}}^n}\) and \(R_{{\mathbf{u}}^{n+1}}\) and then write

$$\begin{aligned}&\int _{x_{j}}^{x_{j+1}} { \varphi (x,t)} \big( R_{{\mathbf{u}}^{n+1}}-R_{{\mathbf{u}}^{n}}\big) {\mathrm{d}}x\approx \frac{\Delta _{j+1/2}}{6}\big(\varphi _{j+1}({\mathbf{u}}_{j+1}^{n+1}-{\mathbf{u}}_{j+1}^n)\\ &\qquad \qquad \qquad \qquad \qquad \qquad \qquad+4\varphi _{j+1/2} ({\mathbf{u}}_{j+1/2}^{n+1}-{\mathbf{u}}_{j+1/2}^n)+ \varphi _{j}({\mathbf{u}}_{j}^{n+1}-{\mathbf{u}}_j^n)\big). \end{aligned}$$

Accuracy is not an issue here. Using (8) and (10), setting \(\delta _j^{n+1/2}{\mathbf{u}}={\mathbf{u}}_j^{n+1}-{\mathbf{u}}_j^n\), we get

$$\begin{aligned} \Sigma :=&\sum \limits _{[x_j, \,x_{j+1}], \,j\in {\mathbb{Z}}}\frac{\Delta _{j+1/2}}{6}\bigg( \varphi _{j+1}^n \delta _j^{n+1/2} {\mathbf{u}}+4\varphi _{j+1/2}^n \delta _{j+1/2}^{n+1/2}{\mathbf{u}}+ \varphi _{j}^n\delta _j^{n+1/2}{\mathbf{u}}\bigg)\\ =&\sum \limits _{[x_j, \,x_{j+1}], \,j\in {\mathbb{Z}}} \frac{\Delta _{j+1/2}}{6}\bigg(\varphi _{j+1}^n \delta _{j+1}^{n+1/2}{\mathbf{u}}\\ &+ 4\varphi _{j+1/2}^n\bigg( \frac{3}{2} \delta _{j+1/2}^{n+1/2} \bar{\mathbf{u}}-\frac{\delta _{j+1}^{n+1/2} {\mathbf{u}}+\delta _j^{n+1/2} {\mathbf{u}}}{4} \bigg)+ \varphi _{j}^n \delta _{j}^{n+1/2}{\mathbf{u}}\bigg)\\ =&\sum \limits _{[x_j, \,x_{j+1}], \,j\in {\mathbb{Z}}}\Delta _{j+1/2} \varphi _{j+1/2}^n\delta _{j+1/2}^{n+1/2}\bar{\mathbf{u}}\\ &+ \underbrace{\sum \limits _{j\in {\mathbb{Z}}} \frac{\delta _{j}^{n+1/2} {\mathbf{u}}}{6} \bigg(\Delta _{j+1/2}\big( \varphi _j-\varphi _{j+1/2}\big) +\Delta _{j-1/2}\big(\varphi _j-\varphi _{j-1/2}\big)\bigg)}_{S_n}.\end{aligned}$$

So that we get, using (10)

$$\begin{aligned} &\sum \limits _{n\in {\mathbb{N}}}\sum \limits _{[x_j, \,x_{j+1}], \,j\in {\mathbb{Z}}}\frac{\Delta _{j+1/2}}{6}\bigg( \varphi _{j+1}^n \delta _j^{n+1/2} {\mathbf{u}}+4\varphi _{j+1/2}^n \delta _{j+1/2}^{n+1/2}{\mathbf{u}}+ \varphi _{j}^n\delta _j^{n+1/2}{\mathbf{u}}\bigg)\\ & {-}\sum \limits _{n\in {\mathbb{N}}} \Delta t_n\sum \limits _{[x_j, \,x_{j+1}], \,j\in {\mathbb{Z}}} \varphi _{j+1/2}^n\delta _{j+1/2}{{\mathbf{f}}}\\ & -\sum \limits _{n\in {\mathbb{N}}} S_n=0. \end{aligned}$$
(11)

Then using again (10) and the fact that the mesh is regular, we observe that

$$\begin{aligned} S_n= \Delta t_n \sum _j \Delta _j \; \delta _x{\mathbf{u}}_j+O(\Delta ^3). \end{aligned}$$

In Appendix A, we will show that in the limit, the contribution of the \(S_n\) term will converges towards 0, while the first term of (11) will converge to

$$\begin{aligned} \int _0^{+\infty }\int _{\mathbb{R}}\frac{\partial \varphi }{\partial t}{\mathbf{u}} {\mathrm{d}}x {\mathrm{d}}t-\int _{\mathbb{R}}{\mathbf{u}}_0 {\mathrm{d}}x, \end{aligned}$$

while the second term will converge towards

$$\begin{aligned} \int _0^{+\infty }\int _{{\mathbb{R}}} \frac{\partial \varphi }{\partial x} {{\mathbf{f}}}({\mathbf{u}}) {\mathrm{d}}{\mathbf{x}}. \end{aligned}$$

This will be shown, using classical arguments, in Appendix A, so that we have

Proposition 1

We assume that the mesh is regular: there exist \(\alpha \) and \(\beta \) such that \(\alpha \leqslant \Delta _{j+1/2}/\Delta _{j-1/2}\leqslant \beta .\) If \(\max _{j\in {\mathbb{Z}}} \Vert {\mathbf{u}}_j^n\Vert _\infty \) and \(\max _{j\in {\mathbb{Z}}} \Vert v_{j+1/2}^n\Vert _\infty \) are boundedand a subsequence of \({\mathbf{u}}_\Delta \) converges in \(L^1\) towards \({\mathbf{u}},\) then \({\mathbf{u}}\) is a weak solution of the problem.

Remark 1

Indeed, the definition of a precise \(\Delta _j\) is not really needed, and we come back to this in the next section. What is needed is a spatial scale that relates the updates in \({\mathbf{v}}\) and \({\mathbf{u}}\) in an incremental form of the finite difference type. This is why the assumption of mesh regularity is fundamental.

3 Some Examples of Discretisation

We list possible choices: for \(\frac{\partial {\mathbf{v}}}{\partial t}+J\frac{\partial {\mathbf{v}}}{\partial x}=0,\) where J is the Jacobian of \({{\mathbf{f}}}\) with respect to \({\mathbf{u}}\); they have been used in the numerical tests. The question here is to define \(\overleftarrow{\Phi }_{j+1/2}\) and \(\overrightarrow{\Phi }_{j+1/2}\) that are the contributions of \(K_{j\pm 1/2}\) to \(J\frac{\partial {\mathbf{v}}}{\partial x}\) so that

$$\begin{aligned} J\frac{\partial {\mathbf{v}}}{\partial x}(x_i)\approx \overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}+{\overrightarrow{\Phi }^{\mathbf{v}}_{j-1/2}}. \end{aligned}$$

We follow the work of Iserles [18] who gives all the possible schemes that guarantee a stable (in \(L^2\)) semi-discretisation of the convection equation, for a regular grid which we assume. The only difference in his notations and ours is that the grid on which are defined the approximation of the derivative is made of the mesh points \(x_j\) and the half points \(x_{j+1/2}\).

The first list of examples has an upwind flavour:

$$\begin{aligned} \overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2}=\big({ J({\mathbf{v}}_j)}\big)^- \frac{\delta ^-_{j}{\mathbf{v}}}{\Delta _{j+1/2}/2}\quad \text{and}\quad \overrightarrow{\Phi }^{\mathbf{v}}_{j+1/2}=\big( J({\mathbf{v}}_{j+1})\big)^+\frac{\delta _{j+1}^+{\mathbf{v}}}{\Delta _{j+1/2}/2}, \end{aligned}$$
(12)

where \(\delta ^\pm _j \) is an approximation of \(\Delta _{j+1/2} \frac{\partial v}{\partial x}\) obtained from [18]Footnote 1.

  • First-order approximation: we take

    $$\begin{aligned} \delta _j^+{\mathbf{v}}={\mathbf{v}}_{j}-{\mathbf{v}}_{j-1/2}, \quad \delta _j^-{\mathbf{v}}={\mathbf{v}}_{j+1/2}-{\mathbf{v}}_j. \end{aligned}$$
    (13)
  • Second order: we take

    $$\left \{\begin{aligned} \delta _j^-{\mathbf{v}}&=-\frac{3}{2}{\mathbf{v}}_j+2{\mathbf{v}}_{j+1/2}-\frac{{\mathbf{v}}_{j+1}}{2},\\ \delta _j^+{\mathbf{v}}&=\frac{{\mathbf{v}}_{j-1}}{2}-2{\mathbf{v}}_{j-1/2}+\frac{3}{2}{\mathbf{v}}_{j}. \end{aligned}\right.$$
    (14)
  • Third order: we take

    $$\left \{\begin{aligned} {\delta _j^-=-\frac{v_{i+1}}{6}+v_{i+1/2}-\frac{v_i}{2}-\frac{v_{i-1/2}}{3}},\\ { \delta _j^+=\frac{v_{i-1}}{6}-v_{i-1/2}+\frac{v_i}{2}+\frac{v_{i+1/2}}{3}}. \end{aligned}\right.$$
    (15)
  • Fourth order: the fully centered scheme would be

    $$\begin{aligned} \delta _j^\pm {\mathbf{v}}={\frac{{\mathbf{v}}_{j+1}-{\mathbf{v}}_{j-1}}{12}+2\frac{{\mathbf{v}}_{j+1/2}-{\mathbf{v}}_{j-1/2}}{3}}, \end{aligned}$$

    but we prefer

    $$\left \{\begin{aligned} \delta _j^-{\mathbf{v}}&=\frac{{\mathbf{v}}_{j-1/2}}{4}+\frac{5}{6}{\mathbf{v}}_j- \frac{3}{2}{\mathbf{v}}_{j+1/2}+\frac{{\mathbf{v}}_{j+1}}{2}-\frac{{\mathbf{v}}_{j+3/2}}{12},\\ \delta _j^+{\mathbf{v}}&=\frac{{\mathbf{v}}_{j+1/2}}{4}+\frac{5}{6}{\mathbf{v}}_j- \frac{3}{2}{\mathbf{v}}_{j-1/2}+\frac{1}{2}{\mathbf{v}}_{j-1}-\frac{{\mathbf{v}}_{j-3/2}}{12}. \end{aligned}\right.$$
    (16)
  • Etc \(\cdots \)

It can be useful to have more dissipative versions of a first-order scheme. We take

$$\begin{aligned} \bigg(J\frac{\partial v}{\partial x}\bigg)_j=\overleftarrow{\Phi }_{j+1/2}+\overrightarrow{\Phi }_{j-1/2} \end{aligned}$$

with

$$\begin{aligned} \frac{\Delta _{j+1/2}}{2}\overleftarrow{\Phi }_{j+1/2}&=\frac{1}{2} \widehat{J\frac{\partial {\mathbf{v}}}{\partial x_j}}+\alpha \left({\mathbf{v}}_j-\frac{{\mathbf{v}}_j+{\mathbf{v}}_{j+1/2}}{2}\right),\\ \frac{\Delta _{j+1/2}}{2}\overrightarrow{\Phi }_{j+1/2}&=\frac{1}{2} \widehat{J\frac{\partial {\mathbf{v}}}{\partial x_{j+1}}}+\alpha \left({\mathbf{v}}_{j+1}- \frac{{\mathbf{v}}_{j+1}+{\mathbf{v}}_{j+1/2}}{2}\right), \end{aligned}$$

where \(\widehat{J\frac{\partial v}{\partial x_l}}\) is a consistent approximation of \(J\frac{\partial u}{\partial x}\) at \(x_l\) and \(\alpha \) is an upper-bound of the spectral radius of \(J({\mathbf{v}}_j)\), \(J({\mathbf{v}}_{j+1/2})\), and \(J({\mathbf{v}}_{j+1})\). We take, for simplicity, \({\mathbf{v}}_{j+1/2}=\Psi ^{-1}(\bar{\mathbf{u}}_{j+1/2})\). For the model (2), we take

$$\begin{aligned} \frac{\Delta _{j+1/2}}{2}\widehat{J\frac{\partial v}{\partial x_j}}=\left(\begin{array}{c} (\rho u)_{j+1/2}-(\rho u)_j\\ \frac{1}{2} \big( u_{j+1/2}^2-u_j^2) + \frac{1}{{\tilde{\rho }}_{j+1/2}}\big( p_{j+1/2}-p_j\big)\\ {\tilde{u}}_{j+1/2}\big(p_{j+1/2}-p_j)+{\tilde{\rho c}^2}_{j+1/2}\big(u_{j+1/2}-u_j\big) \end{array}\right), \end{aligned}$$

where \({\tilde{\rho }}_{j+1/2}\) is the geometric average of \(\rho _j\) and \(\rho _{j+1/2}\), \({\tilde{u}}_{j+1/2}\) is the arithmetic average of \(u_j\) and \(u_{j+1/2}\), while \({\tilde{\rho c}^2}_{j+1/2}\). For the model (3), we take

$$\begin{aligned} \frac{\Delta _{j+1/2}}{2}\widehat{J\frac{\partial v}{\partial x_j}}=\left(\begin{array}{c} {\tilde{u}}_{j+1/2} \big( s_{j+1/2}-s_j\big)\\ \frac{1}{2} \big( u_{j+1/2}^2-u_j^2) + \frac{1}{{\tilde{\rho }}_{j+1/2}}\big( p_{j+1/2}-p_j\big)\\ {\tilde{u}}_{j+1/2}\big(p_{j+1/2}-p_j)+{\tilde{\rho c}^2}_{j+1/2}\big(u_{j+1/2}-u_j\big) \end{array}\right) . \end{aligned}$$

All this has a local Lax-Friedrichs’ flavour, and seems to be positivity preserving for the velocity and the pressure.

Using this, the method is

$$\begin{aligned} \frac{{\mathrm{d}}{\mathbf{v}}_j}{{\mathrm{d}}t}+\overleftarrow{\Phi }_{j+1/2}^{\mathbf{v}}+\overrightarrow{\Phi }_{j-1/2}^{\mathbf{v}}=0 \end{aligned}$$
(17a)

combined with

$$\begin{aligned} \Delta x\frac{{\mathrm{d}}\bar{\mathbf{u}}_{j+1/2}}{{\mathrm{d}}t}+{{{\mathbf{f}}}({\mathbf{u}}_{j+1})-{{\mathbf{f}}}({\mathbf{u}}_j)}=0. \end{aligned}$$
(17b)

We see in (17a) that the time derivative of \({\mathbf{v}}\) is obtained by adding two fluctuations, one computed for the interval \(K_{j+1/2}=[x_j,x_{j+1}]\) and one for the interval \(K_{j-1/2}=[x_{j-1},x_j]\). These fluctuations are obtained from (12) with the increments in \({\mathbf{v}}\) defined by (13), (15), (16), etc. In the sequel, we denote the scheme applied on the interval \(K_{j+1/2}\) by \(S_{j+1/2}(k)\) where the averages are integrated by (17b) and \({\mathbf{v}}\) by (17a) with the fluctuations (13) for \(k=1\), (14) for \(k=2\), and (15) for \(k=3\), etc. To make sure that the first-order scheme is positivity preserving (at least experimentally), we may also consider the case denoted by \(k=0,\) where \(S_{j+1/2}(0)\) is the local Lax-Friedrichs scheme defined above. Both fluctuation (13) and the local Lax-Friedrichs scheme are first-order accurate, but the second one is quite dissipative but positivity preserving while the scheme (13) is not (experimentally) positivity preserving. The system (17) is integrated in time by a Runge-Kutta solver: RK1, RK SSP2, and RK SSP3.

3.1 Error Analysis in the Scalar Case

Here, the mesh is uniform, so that \(\Delta _{j+1/2}=\Delta \) for any \(j\in {\mathbb{Z}}\). It is easy to check the consistency, and in Fig. 1 we show the \(L^1\) error on u and \({\bar{u}}\) for (17) with SSPKR2 and SSPRK3 (CFL = 0.4) for a convection problem

$$\begin{aligned} \frac{\partial u}{\partial t}+\frac{\partial u}{\partial x}=0 \end{aligned}$$

with periodic boundary conditions and the initial condition \(u_0=\cos (2\uppi x)\).

Fig. 1
figure 1

Error plot for u and \({\bar{u}}\) for (17) with SSPKR2 and SSPRK3 (CFL = 0.4). Here \(f(u)=u\). The second-order results are obtained with SSPRK2 with (17a) and (17b), the third-order results are obtained by (17a) and (17b)

Remark 2

(Linear stability) In Appendix B, we perform the \(L^2\) linear stability and we get, with \(\lambda =\frac{\Delta t}{\Delta }\),

  • first-order scheme, \(\vert \lambda \vert \leqslant 0.92\),

  • second-order scheme, \(\vert \lambda \vert \leqslant 0.6\),

  • third-order scheme, \(\vert \lambda \vert \leqslant 0.5\).

We also have run this scheme for the Burgers equation, and compared it with a standard finite volume (with local Lax-Friedrichs). The conservative form of the PDE is used for the average, and the non-conservative one for the point values: \(J=u\) and \(\psi (u)=u\). This is an experimental check of conservation. The initial condition is

$$\begin{aligned} {\mathbf{u}}_0(x)=\sin (2\uppi x)+\frac{1}{2} \end{aligned}$$

on [0, 1], so that there is a moving shock (Fig. 2).

Fig. 2
figure 2

Solution of Burgers with 10 000 points, \(t_{{\mathrm{fin}}}=0.4\), \(\text{CFL}=0.4\) for the second order (a, b) [(17a) and (17b) with SSPRK2] and third order (c, d) [(17a) and (17b) with SSPRK3]. The global solution is represented in a and c, and a zoom around the discontinuity is shown in b and c

We can see that the agreement is excellent and that the numerical solution behaves as expected.

3.2 Non-linear Stability

As such, the scheme is at most linearly stable, with a CFL condition based on the fine grid. However, in case of discontinuities or the occurrence of gradients that are not resolved by the grid, we have to face oscillations, as usual.

In order to get high-order oscillation free results, a natural option would be to extend the MUSCL approach to the present context. However, it is not very clear how to proceed, so we have relied on the MOOD paradigm [8, 24]. The idea is to work with several schemes ranging from order p to 1, with the lowest-order it is able to provide results with positive density and pressure. These schemes are the \(S_{j+1/2}(k), k=1, \cdots ,3\) schemes defined above. They are assumed to work for a given CFL range, and the algorithm is as follows: for each Runge-Kutta sub-step, starting from \(U^n=\{\bar{\mathbf{u}}_{j+1/2}^n, \bar{\mathbf{v}}_j^n\}_{j\in {\mathbb{Z}}}\), we compute

$$\left \{\begin{aligned} \tilde{\bar{\mathbf{u}}}_{j+1/2}^{n+1}&=\bar{\mathbf{u}}_{j+1/2}^n -\lambda _n\big( {{\mathbf{f}}}({\mathbf{u}}_{j+1}^n)-{{\mathbf{f}}}({\mathbf{u}}_j^n)\big), \quad \lambda _n=\frac{\Delta t_n}{\Delta _{j+1/2}},\\ {\tilde{{\mathbf{v}}}}_j^{n+1}&={\tilde{{\mathbf{v}}}}_j^{n} - 2\Delta t_n\overleftarrow{\Phi }^{\mathbf{v}}_{j+1/2},\\ {\tilde{{\mathbf{v}}}}_{j+1}^{n+1}&={\tilde{{\mathbf{v}}}}_{j+1}^{n}-2\Delta t_n\overrightarrow{\Phi }^{\mathbf{v}}_{j+1/2} \end{aligned}\right.$$
(18)

by the scheme \(S_{j+1/2}(p)\). Then we test the validity of these results in the interval \([x_{j}, x_{j+1}]\) for the density (and possibly the pressure). This is described a little bit later. The variable \({\mathbf{v}}\) is updated as in (18), because at \(t_{n+1}\), the true update of \({\mathbf{v}}_j\) is the half sum of \({\tilde{{\mathbf{v}}}}_j^{n+1}\) and \({\tilde{{\mathbf{v}}}}_{j+1}^{n+1}\).

If the test is positive, then we keep the scheme \(S_{j+1/2}(p)\) in that interval, else we start again with \(S_{j+1/2}(p-1)\), and repeat the procedure unless all the intervals \(K_{j+1/2}\) have successfully passed the test. This is described in Algorithm 1 where \({\mathcal{S}}_{j+1/2}\) is the stencil used in \(K_{j+1/2}\).

figure a

Now, we describe the tests. We do, in the following order, for each element \(K_{j+1/2}\), at the iteration \(k>0\) of the loop of (i): the tests are performed on variables evaluated from \({\mathbf{u}}\) and \({\mathbf{v}}\). For the scalar case, they are simply the point values at \(x_j, x_{j+1/2}\), and \(x_{j+1}\). For the Euler equations they are the density, and possibly the pressure.

  1. (i)

    We check if all the variables are numbers (i.e., not NaN). If not, we state \({\mathbb{S}}_{j+1/2}=S_{j+1/2}(k-1)\).

  2. (ii)

    (Only for the Euler equations) We check if the density is positive. We can also request to check if the pressure is also positive. If the variable is negative, then we state that \({\mathbb{S}}_{j+1/2}=S_{j+1/2}(k-1)\).

  3. (iii)

    Then we check if at \(t_n\), the solution was not constant in the numerical stencils of the degrees of freedom in \(K_{j+1}\), in order to avoid detecting a fake maximum principle. We follow the procedure of [24]. If we observe that the solution was locally constant, then \({\mathbb{S}}_{j+1/2}\) is not modified.

  4. (iv)

    Then we apply a discrete maximum principle, even for systems though it is not very rigorous. For the variable \(\xi \) (in practice the density, and we may request to do the same on the pressure), we compute \(\min _{j+1/2}\xi \) (resp. \(\max _{j+1/2}\xi \)) the minimum (resp. maximum) of the values of \(\xi \) on \(K_{j+1/2}\), \(K_{j-1/2}\), and \(K_{j+3/2}\). We say we have a potential maximum if \({\tilde{\xi }}^{n+1}\not \in [\min _{j+1/2}\xi ^n+\varepsilon _{j+1/2}, \max _{j+1/2}\xi ^n-\varepsilon _{j+1/2}]\)with \(\epsilon _{j+1/2}\) estimated as in [8]. Then we get the followings.

    • If \({\tilde{\xi}}^{n+1}\in [\min _{j+1/2}\xi ^n+\varepsilon _{j+1/2}, \max _{j+1/2}\xi ^n-\varepsilon _{j+1/2}]\), then \({\mathbb{S}}_{j+1/2}\) is not modified.

    • Else we use the following procedure introduced in [24]. In each \(K_{l+1/2}\), we can evaluate a quadratic polynomial \(p_{l+1/2}\) that interpolates \(\xi \). Note that its derivative is linear in \(\xi \). We compute \(\begin{aligned} p'_{j-1/2}(x_j), p'_{j+3/2}(x_{j+1}), p'_{j+1/2}(x_j) \quad \text{and}\quad p'_{j+1/2}(x_{j+1}). \end{aligned}\)

      • If \(\begin{aligned}&p'_{j+1/2}(x_j) \in [\min (p'_{j-1/2}(x_j),p'_{j+3/2}(x_{j+1})]\\ &\quad \text{and}\quad p'_{j+1/2}(x_{j+1}) \in [\min (p'_{j-1/2}(x_j),p'_{j+3/2}(x_{j+1})], \end{aligned}\)we say it is a true regular extrema and \({\mathbb{S}}_{j+1/2}\) will not be modified.

      • Else the extrema is declared not to be regular, and \({\mathbb{S}}_{j+1/2}=S_{j+1/2}(k-1).\)

As a first application, to show that the oscillations are well controlled without sacrificing the accuracy, we consider the advection problem (with constant speed unity) on [0, 1], periodic boundary conditions with the initial condition:

$$\begin{aligned} u_0(x)= \left\{ \begin{array}{ll} 0&{}\text{ if } y\in [-1,-0.8[,\\ \frac{1}{6}\big(G(y, \beta , z-\delta )+G(y,\beta ,z+\delta )+4G(y,\beta ,z)\big) &{} \text{ if }y\in [-0.8,-0.6],\\ 1&{} \text{ if } y\in [-0.4,-0.2]\\ 1-\vert 10y-1\vert &{} \text{ if }y\in [0,0.2],\\ \frac{1}{6}\big(F(y, \beta , z-\delta )+G(y,\beta ,z+\delta )+4F(y,\beta ,z)\big) &{} \text{ else.} \end{array} \right. \text{ with } y=2x-1, \end{aligned}$$

Here \(a=0.5\), \(z=-0.7\), \(\delta =0.005\), \(\alpha =10\),

$$\begin{aligned} \beta =\frac{\log 2}{36\delta ^2} \end{aligned}$$

and

$$\begin{aligned} G(t,\beta ,z)=\exp \big( -\beta (t-z)^2\big), \quad F(t,a,\alpha )=\sqrt{\max \big(0, 1-\alpha (t-a)^2\big)}. \end{aligned}$$

Using the MOOD procedure with the third-order scheme, the results obtained for 300 points for \(T=10\) are displayed in Fig. 3. They look very reasonable.

Fig. 3
figure 3

Shu-Jiang problem, CFL = 0.4, third-order scheme with MOOD, 300 points, periodic conditions, 10 periods. The point values and cell average are almost undistinguishable

4 Numerical Results for the Euler Equations

In this section, we show the flexibility of the approach, where conservation is recovered only by (17a), and so lots of flexibility is possible with the relations on the \({\mathbf{u}}_i\). To illustrate this, we consider the Euler equations. We will consider the conservative formulation (1) for the average value, so \({\mathbf{u}}=(\rho , \rho u, E)^{\mathrm{T}}\) and either the form (2), i.e., \({\mathbf{v}}=(\rho , u, p)\) or the form (3) with \({\mathbf{v}}=(p,u,s)^{\mathrm{T}}\).

4.1 Sod Test Case

The Sod case is defined for [0, 1], the initial condition is

$$\begin{aligned} (\rho ,u,p)^{\mathrm{T}}=\left\{ \begin{array}{ll} (1,0,1)^{\mathrm{T}} &{} \quad \text{for } x<0.5,\\ (0.125,0,0.1)^{\mathrm{T}} &{}\quad \text{else}. \end{array}\right. \end{aligned}$$

The final time is \(T=0.16\). The problem is solved with (1) and (2) and displayed in Figs. 4, 5, 6 and 7, while the solution obtained with the combination (1)–(3) is shown in Figs. 8 and 9. When the MOOD procedure is on, it is applied with \(\rho \) and p and all the tests are performed. The exact solution is also shown every time. Different orders in time/space are tested. The results are good, even though the MOOD procedure is not perfect. The use of the combination (1)–(3) seems more challenging, we have performed a convergence study (with 10 000 points). This is shown in Fig. 9, and a zoom around the contact discontinuity is also shown.

Fig. 4
figure 4

One hundred grid points, and the second-order SSPRK2 scheme with CFL = 0.1. a density, b velocity, c pressure

Fig. 5
figure 5

One hundred grid points, and the second-order SSPRK2 scheme with CFL = 0.1. a density, b velocity, c pressure. MOOD test made on \(\rho \) and p

Fig. 6
figure 6

One hundred grid points, and the third-order SSPRK3 scheme with CFL = 0.1. a density, b velocity, c pressure

Fig. 7
figure 7

One hundred grid points, and the third-order SSPRK3 scheme with CFL = 0.1. a density, b velocity, c pressure. Mood test made on \(\rho \) and p

Fig. 8
figure 8

Solution with the variables (sup) for 100 points, comparison with the exact solution, third order in time/space with MOOD and non MOOD. MOOD is done on \(\rho \) and p. CFL = 0.2

Fig. 9
figure 9

Solution with the variables (sup) for 10 000 points, comparison with the exact solution. CFL = 0.1, no MOOD. The zoomed figures are for \(x\in [0.6,0.7]\) and the ticks are for \(10^{-7}\). We plot u and p across the contact

We can observe a numerical convergence to the exact one in all cases. In Appendix C, we show some results on irregular meshes, with the same conclusions.

4.2 A Smooth Case

We consider a fluid with \(\gamma =3\): the characteristics are straight lines. The initial condition is inspired from Toro: in \([-1,1]\),

$$\left \{\begin{aligned} \rho _0(x)&=1+\alpha \sin (2\uppi x),\\ u_0(x)&=0,\\ p_0(x)&=\rho _0(x)^\gamma . \end{aligned}\right.$$
(19)

The classical case is for \(\alpha =0.999{\;} 995\) where the vacuum is almost reached. Here, since we do not want to test the robustness of the method, we take \(\alpha =\frac{3}{4}\). The final time is set to \(T=0.1\).

The exact density and velocity in this case can be obtained by the method of characteristics and are explicitly given by

$$\begin{aligned} \rho (x,t) = \frac{1}{2}\big( \rho _0(x_1) + \rho _0(x_2)\big), \quad u(x,t) = \sqrt{3}\big(\rho (x,t)-\rho _0(x_1) \big), \end{aligned}$$

where for each coordinate x and time t the values \(x_1\) and \(x_2\) are solutions of the non-linear equations

$$\begin{aligned}&x + \sqrt{3}\rho _0(x_1) t - x_1 = 0, \\ &x - \sqrt{3}\rho _0(x_2) t - x_2 = 0. \end{aligned}$$

An example of the numerical solution, superimposed with the exact one, is shown in Fig. 10. It is obtained with the third-order (time and space) scheme, and here we have used the model \((\rho ,u,p)\). The CFL number is set to 0.2.

Fig. 10
figure 10

Solutions (numerical and exact) for the conditions (19). The number of grid points is set to 80, with periodic boundary conditions

The errors are shown in Table 1.

Table 1 \(L^1\), \(L^2\) and \(L^\infty \) errors for the initial conditions (19) with the third-order scheme

The errors, computed in \([-1,1]\) are in reasonable agreement with the \(-3\) expected slopes. We also have done the same test with the non-linear stabilisation procedure described in Sect. 3.2. Exactly the same errors are obtained: the order reduction test is never activated.

4.3 Shu-Osher Case

The initial conditions are

$$\begin{aligned} (\rho , u, p)=\left\{ \begin{array}{ll} (3.857 \,143, 2.629 \,369, 10.333{\;}333{\;}3) &{}\text{if } x<-4,\\ (1+0.2\sin (5x), 0, 1) &{}\text{else} \end{array}\right. \end{aligned}$$

on the domain \([-5,5]\) until \(T=1.8\). We have used the combination (1) and (2), since another one seems less robust. The density is compared to a reference solution (obtained with a standard finite volume scheme with 20 000 points, and the solution obtained with the third-order scheme with \(\text{CFL}=0.3\) and 200, 400, 800 and 1 600 points. The MOOD procedure uses the first-order upwind scheme if a PAD, a NaN or a DMP is detected, the other cases use the third-order scheme. The solutions are displayed in Fig. 11. With little resolution, the results are very close to the reference one.

Fig. 11
figure 11

a Solution of the Shu-Osher problem, b zoom of the solution around the shock

For Fig. 11, the second-order scheme is used as a rescue scheme.

4.4 Le Blanc Case

The initial conditions are

$$\begin{aligned} (\rho ,u,e)=\left\{ \begin{array}{ll} (1,0,0.1) &{} \quad \text{if } x\in [-3,3],\\ (0.001,0.10^{-7} ) &{} \quad \text{if } x\in [3,6], \end{array} \right. \end{aligned}$$

where \(e=(\gamma -1) p\) and \(\gamma =\frac{5}{3}\). The final time is \(t=6\). This is a very strong shock tube and we use the combination (1) and (2). It is not possible to run higher than first order without the MOOD procedure. The second- and third-order results are shown in Fig. 12, and zooms around the shocks and the fan are showed in Fig. 13.

Fig. 12
figure 12

Le Blanc test case, \(\text{CFL}=0.1\), from 400 to 800 points. Left column: MOOD test on \(\rho \) and p, second order; right column: MOOD test on \(\rho \) and p, third order

Fig. 13
figure 13

Le Blanc test case, zooms, comparison on the pressure between second order and third order with 400 points

At time \(t=6\), the shock wave should be at \(x=8\): in addition to the extreme conditions, it is generally difficult to get a correct position of the shock wave; this is why a convergence study is shown in Fig. 14. It is performed with 400, 800, 10 000 grid points, and the third-order SSPRK3 scheme with CFL = 0.1. It is compared to the exact solution, and the results are good, see for example [22] for a comparison with other methods, or [21] for a comparison with Lagrangian methods.

Fig. 14
figure 14

Convergence study on the density for the Le Blanc test case

5 Conclusion

This study is preliminary and should be seen as a proof of concept. We show how to combine, without any test, several formulations of the same problem, one in the conservative form and the others in the non-conservative form, to compute the solution of hyperbolic systems. The emphasis is mostly put on the Euler equations.

We explain why the formulation leads to a method that satisfies a Lax-Wendroff-like theorem. We also propose a way to provide the non-linearity stability, and this method works well but is not yet completely satisfactory.

Besides the theoretical results, we also show numerically that we get the convergence to the correct weak solution. This is done on standard benchmark and it is very challenging.

We intend to extend the method to several space dimensions and improve the limiting strategy. Different systems, such as the shallow water system, will also be considered.