1 Introduction

The compressible Euler equations of gas dynamics

(1.1)

are a system of partial differential equations (PDEs) where the conserved quantities are the mass \(\varrho \), the momenta , and the total energy . This is an archetypical system of non-linear hyperbolic conservation laws that have far reaching applications in engineering and natural sciences, e.g. [30, 33, 45]. In three spatial dimensions, this system has five equations but six unknowns: the density \(\varrho \in {\mathbb {R}}^+\), the velocity components , the internal energy \(e\in {\mathbb {R}}\), and the pressure \(p\in {\mathbb {R}}^+\). Thus, in order to close the system, an equation of state is necessary to relate thermodynamic state variables like pressure, density, and internal energy. Depending on the fluid and physical processes we wish to model the equation of state changes. Some examples include an ideal gas where \(p\equiv p(\varrho ,e)\) or polytropic processes where \(p\equiv p(\varrho )\) [30].

The connection between the equation of state, the fluid, and other thermodynamic properties is of particular relevance when examining the physical realizability of flow configurations. In particular, the entropy plays a crucial role to separate possible flow states from the impossible [7]. There is a long history investigating the thermodynamic properties of the compressible Euler equations through the use of mathematical entropy analysis for adiabatic processes [26, 35, 43] as well as polytropic processes [10, 37]. In this analysis the mathematical entropy is modeled by a strongly convex function \(s(\varrho ,e)\). There exist associated entropy fluxes, , such that the entropy function satisfies an additional conservation law

for smooth solutions that becomes an inequality

in the presence of discontinuous solutions, e.g. shocks. Note, we have adopted the convention common in mathematics that entropy is a decreasing quantity, e.g. [43].

For numerical methods, discretely mimicking this thermodynamic behavior leads to schemes that are entropy conservative (or entropy stable) depending on the solutions smoothness [26, 43]. Additionally, numerical approximations, especially schemes with higher order accuracy and low inbuilt numerical dissipation, that are thermodynamically consistent have a marked increase in their robustness [8, 25, 31, 49]. Thus, the design and application of entropy stable approximations, particularly for the compressible Euler equations, have been the subject of ongoing research for the past 50 years, e.g. [5, 8, 9, 11, 13, 16, 17, 25, 26, 28, 36, 43]. A major breakthrough came with the seminal work of Tadmor [41] wherein he developed a general condition for a finite volume numerical flux function to remain entropy conservative. It was then possible to selectively add dissipation to the baseline numerical approximation and guarantee entropy stability.

Many authors expanded on the entropy stability work of Tadmor, developing higher order spatial approximations through the use of WENO reconstructions [19, 20, 32], summation-by-parts (SBP) finite difference approximations [13, 16, 17], or the discontinuous Galerkin spectral element method (DGSEM) also with the SBP property [5, 8, 11, 24, 25]. The latter two numerical schemes both utilize the SBP property that discretely mimics integration-by-parts. This allows a direct translation of the continuous analysis and entropy stability proofs onto the discrete level, see [23, 40] for details. However, the design of these entropy stable approximations (low-order or high-order) has focused on adiabatic processes for the compressible Euler equations.

So, the main focus in this work is to design entropy conservative and entropy stable numerical methods for the polytropic Euler equations. As such, the mathematical entropy analysis is reinvestigated on the continuous level due to the selection of a different equation of state. This analysis also provides a roadmap to discrete entropy stability. We will show that isothermal limit (\(\gamma = 1\)) requires special considerations. The first contribution comes with the derivation of entropy conservative/stable numerical flux functions from Tadmor’s finite volume condition. This includes a computationally affordable definition of the baseline entropy conservative numerical flux as well as an explicit definition of the average states where the dissipation terms should be evaluated. In particular, a special mean operator, which is a generalization of the logarithmic mean [38], is introduced. The second contribution takes the finite volume derivations and builds them into a high-order DGSEM framework that remains consistent to the laws of thermodynamics. Complete details on the entropy aware DGSEM are given by Gassner et al. [25].

The paper is organized as follows: Sect. 2 presents the polytropic Euler system and performs the continuous mathematical entropy analysis. The derivations are kept general as the isothermal Euler equations are a special case of the polytropic system. The finite volume discretization and entropy stable numerical flux derivations are given in Sect. 3. In Sect. 4, a generalization of the entropy stable polytropic Euler method into a high-order DGSEM framework is provided. Numerical investigations in Sect. 5 verify the high-order nature of the approximations as well as the entropic properties. Concluding remarks are given in the final section.

2 Polytropic Euler equations

We first introduce notation that simplifies the continuous and discrete entropy analysis of the governing equations in this work. The state vector of conserved quantities is \(\mathbf u\) and the Cartesian fluxes are denoted by \(\mathbf f_1,\,\mathbf f_2,\,\mathbf f_3\). As in [3, 24], we define block vector notation with a double arrow

The dot product of a spatial vector with a block vector results in a state vector

Thus, the divergence of a block vector is

This allows a compact presentation for systems of hyperbolic conservation laws

(2.1)

on a domain \(\varOmega \subset {\mathbb {R}}^3\).

2.1 Governing equations

The polytropic Euler equations are a simplified version of the compressible Euler equations (1.1) which explicitly conserves the mass and momenta. In the equation of state for polytropic fluids the pressure depends solely on the fluid density and the total energy conservation law becomes redundant [10]. The simplified system takes the form of non-linear conservation laws (2.1) with

where \(\underline{ I}\) is a \(3\times 3\) identity matrix. We close the system with the polytropic or the isothermal gas assumption, which relate density and pressure:

$$\begin{aligned} \text {polytropic case:} \quad p(\varrho )=\kappa \varrho ^\gamma , \qquad \text {isothermal case:} \quad p(\varrho )=c^2 \varrho . \end{aligned}$$
(2.2)

For a polytropic gas \( \gamma > 1\) is the adiabatic coefficient and \( \kappa > 0 \) is some scaling factor depending on the fluid, e.g. for the shallow water equations with \(\kappa = g/2\) (gravitational acceleration) and \(\gamma = 2\) [18]. For the isothermal case \(\gamma =1\) and \(c > 0\) is the speed of sound [10]. To keep the analysis of the polytropic Euler equations general, we will only specify which equation of state is used when necessary. Further, in barotropic models the internal energy, \(e(\varrho )\), and the pressure form an admissible pair provided the ordinary differential equation

$$\begin{aligned} \varrho \frac{de}{d\varrho } = \frac{p(\varrho )}{\varrho }, \end{aligned}$$
(2.3)

is satisfied [10]. For the equations of state (2.2) the corresponding internal energies are

$$\begin{aligned} \text {polytropic case:} \quad e(\varrho )= \frac{\kappa \varrho ^{\gamma -1}}{\gamma -1}, \qquad \text {isothermal case:} \quad e(\varrho )=c^2 \ln (\varrho ). \end{aligned}$$
(2.4)

2.2 Continuous entropy analysis

We define the necessary components to discuss the thermodynamic properties of (2.1) from a mathematical perspective. To do so, we utilize well-developed entropy analysis tools, e.g. [26, 35, 42]. First, we introduce an entropy function used to define an injective mapping between state space and entropy space [26, 35].

For the polytropic Euler equations, a suitable mathematical entropy function is the total energy of the system [10]

(2.5)

with the internal energy taken from (2.4). Note that the entropy function \( s(\mathbf u) \) is convex under the physical assumption that \(\varrho >0\). From the entropy function we find the entropy variables to be

(2.6)

where we use the relation (2.3) to simplify the first entropy variable. The mapping between state space and entropy space is equipped with symmetric positive definite (s.p.d) entropy Jacobian matrices, e.g., [42]

$$\begin{aligned} \mathsf { H}^{-1} = \frac{\partial \mathbf w}{\partial \mathbf u}, \end{aligned}$$

and

$$\begin{aligned} \mathsf { H} = \frac{1}{a^2}\begin{bmatrix} \varrho&\varrho v_1&\varrho v_2&\varrho v_3\\ \varrho v_1&\varrho v_1^2 + a^2\varrho&\varrho v_1 v_2&\varrho v_1 v_3\\ \varrho v_2&\varrho v_1 v_2&\varrho v_2^2 + a^2\varrho&\varrho v_2 v_3 \\ \varrho v_3&\varrho v_1 v_3&\varrho v_2 v_3&\varrho v_3^2 + a^2\varrho \\ \end{bmatrix}, \end{aligned}$$
(2.7)

where we introduce a general notation for the sound speed

$$\begin{aligned} a^2 = \frac{\gamma p}{\varrho }. \end{aligned}$$

We note that this statement of \(\mathsf { H}\) is general for either equation of state from (2.2). The entropy fluxes, , associated with the entropy function (2.5) are

(2.8)

Finally, we compute the entropy flux potential that is needed later in Sect. 3.2 for the construction of entropy conservative numerical flux functions

(2.9)

To examine the mathematical entropy conservation we contract the system of conservation laws (2.1) from the left with the entropy variables (2.6). By construction, and assuming continuity, the time derivative term becomes

$$\begin{aligned} \mathbf w^T\frac{\partial \mathbf u}{\partial t} = \frac{\partial s}{\partial t}. \end{aligned}$$

The contracted flux terms, after many algebraic manipulations, yield

Therefore, for smooth solutions contracting (2.1) into entropy space yields an additional conservation law for the total energy

(2.10)

Generally, discontinuous solutions can develop for non-linear hyperbolic systems, regardless of their initial smoothness. In the presence of discontinuities, the mathematical entropy conservation law (2.10) becomes the entropy inequality [42]

Note, due to the form of the entropy fluxes (2.8) the mathematical entropy conservation law (2.10) has an identical form to the conservation of total energy from the adiabatic compressible Euler equations (1.1). This reinforces that the total energy becomes an auxiliary conserved quantity for polytropic gases.

2.3 Eigenstructure of the polytropic Euler equations

To close this section we investigate the eigenstructure of the polytropic Euler equations. We do so to demonstrate the hyperbolic character of the governing equations. Additionally, a detailed description of the eigenvalues and eigenvectors is needed to select a stable explicit time step [12] as well as design operators that selectively add dissipation to the different propagating waves in the system, e.g. [47].

To simplify the eigenstructure discussion of the polytropic Euler system, we limit the investigation to one spatial dimension. This restriction simplifies the analysis and is done without loss of generality, because the spatial directions are decoupled and the polytropic Euler equations are rotationally invariant. To begin we state the one-dimensional form of (2.1)

$$\begin{aligned} \mathbf u_t + (\mathbf f_1)_x = \mathbf 0, \end{aligned}$$

where we have

$$\begin{aligned} \mathbf u = \left[ \varrho ,\varrho v_1,\varrho v_2,\varrho v_3\right] ^T,\qquad \mathbf f_1 = \left[ \varrho v_1,\,\varrho v_1^2 + p,\,\varrho v_1 v_2,\,\varrho v_1 v_3\right] ^T. \end{aligned}$$

We find the flux Jacobian matrix to be

$$\begin{aligned} \mathsf { A} = \frac{\partial \mathbf f_1}{\partial \mathbf u} = \begin{bmatrix} 0&1&0&0 \\ a^2 - v_1^2&2v_1&0&0 \\ -v_1 v_2&v_2&v_1&0 \\ -v_1 v_3&v_3&0&v_1 \\ \end{bmatrix}. \end{aligned}$$
(2.11)

The eigenvalues, \(\{\lambda _i\}_{i=1}^4\), of (2.11) are all real

$$\begin{aligned} \lambda _1 = v_1 - a \qquad \lambda _2=v_1 \qquad \lambda _3=v_1 \qquad \lambda _4 = v_1 + a. \end{aligned}$$
(2.12)

The eigenvalues are associated with a full set of right eigenvectors. A matrix of right eigenvectors is

$$\begin{aligned} \mathsf { R} = \left[ \mathbf r_1\,|\,\mathbf r_2\,|\,\mathbf r_3 \,|\,\mathbf r_4\right] = \begin{bmatrix} 1&0&0&1\\ v_1 - a&0&0&v_1 + a\\ v_2&1&0&v_2\\ v_3&0&1&v_3\\ \end{bmatrix}. \end{aligned}$$
(2.13)

From the work of Barth [2], there exists a positive diagonal scaling matrix \(\mathsf { Z}\) that relates the right eigenvector matrix (2.13) to the entropy Jacobian matrix (2.7)

$$\begin{aligned} \mathsf { H} = \mathsf { R}\mathsf { Z}\mathsf { R}^T. \end{aligned}$$
(2.14)

For the polytropic Euler equations this diagonal scaling matrix is

$$\begin{aligned} \mathsf { Z} = \mathrm {diag}\left( \frac{\varrho }{2a^2},\,\varrho ,\,\varrho ,\, \frac{\varrho }{2a^2}\right) . \end{aligned}$$

We will revisit the eigenstructure of the polytropic Euler equations and this eigenvector scaling in Sect. 3.3 in order to derive an entropy stable numerical dissipation term.

3 Discrete entropy analysis, finite volume, and numerical fluxes

In this section we derive entropy conservative and entropy stable numerical flux functions for the polytropic Euler equations. This discrete analysis is performed in the context of finite volume schemes and follows closely the work of Tadmor [43]. The derivations for entropy conservative numerical flux functions and appropriate dissipation terms are straightforward, albeit algebraically involved. Therefore, we restrict the discussion to the one dimensional version of the model for the sake of simplicity. As such, we suppress the subscript on the physical flux and simply state \(\mathbf f\).

3.1 Finite volume discretization

Finite volume methods are a discretization technique particularly useful to approximate the solution of hyperbolic systems of conservation laws. The method is developed from the integral form of the equations [33]

where is the outward pointing normal vector. In one spatial dimension we divide the interval into non-overlapping cells

$$\begin{aligned} \varOmega _i = \left[ x_{i-\tfrac{1}{2}},x_{i+\tfrac{1}{2}}\right] , \end{aligned}$$

and the integral equation contributes

$$\begin{aligned} \frac{d}{dt}\int \limits _{x_{i-1/2}}^{x_{i+1/2}}\mathbf u\,\mathrm {d}x + \mathbf f^*(x_{i+1/2}) - \mathbf f^*(x_{i-1/2}) = 0, \end{aligned}$$

on each cell. The solution approximation is assumed to be a constant value within the volume. Then we determine the cell average value with, for example, a midpoint quadrature of the solution integral

$$\begin{aligned} \int \limits _{x_{i-1/2}}^{x_{i+1/2}}\mathbf u\,\mathrm {d}x \approx \int \limits _{x_{i-1/2}}^{x_{i+1/2}}\mathbf u_i\,\mathrm {d}x = \mathbf u_i\varDelta x_i. \end{aligned}$$

Due to the integral form of the finite volume scheme the solution is allowed to be discontinuous at the boundaries of the cells. To resolve this, we introduce a numerical flux, \(\mathbf f^*\left( \mathbf u_L,\mathbf u_R\right) \) [33, 44] which is a function of two solution states at a cell interface and returns a single flux value. For consistency, we require that

$$\begin{aligned} \mathbf f^*\left( \mathbf q,\mathbf q\right) = \mathbf f, \end{aligned}$$
(3.1)

such that the numerical flux is equivalent to the physical flux when evaluated at two identical states.

The resulting finite volume spatial approximation takes the general form

$$\begin{aligned} \left( \mathbf u_t\right) _i + \frac{1}{\varDelta x_i}\left( \mathbf f^*_{{i+\tfrac{1}{2}}} - \mathbf f^*_{{i-\tfrac{1}{2}}}\right) = \mathbf 0. \end{aligned}$$
(3.2)

This results in a set of temporal ordinary differential equations that can be integrated with an appropriate ODE solver, e.g., explicit Runge–Kutta methods.

To complete the spatial approximation (3.2) requires a suitable numerical flux function \(\mathbf f^*\). Next, following the work of Tadmor, we will develop entropy conservative and entropy stable numerical fluxes for the polytropic Euler equations.

3.2 Entropy conservative numerical flux

First, we develop the entropy conservative flux function \(\mathbf f^{*,{\mathrm {EC}}}\) that is valid for smooth solutions and acts as the baseline for the entropy stable numerical approximation. We assume left and right discrete solution states, denoted by L and R, each on a cell with area \(\varDelta x/2\) separated by a common interface. We discretize the one-dimensional system semi-discretely and derive an approximation for the fluxes at the interface between the two cells, i.e., at the \(i+1/2\) interface:

$$\begin{aligned} {\frac{\varDelta x}{2}} \frac{\partial \mathbf {u}_L}{\partial t} = \mathbf f_L - \mathbf f^*\qquad \mathrm {and}\qquad {\frac{\varDelta x}{2}} \frac{\partial \mathbf u_R}{\partial t} = \mathbf f^* - \mathbf f_R, \end{aligned}$$
(3.3)

where the adjacent states feature the physical fluxes \(\mathbf f_{L,R}\) and the numerical interface flux \(\mathbf f^*\). This update (3.3) has two types of interpretation. One is a finite volume method where the left and right states are cell-averaged values separated by a flux interface value. The other interpretation is that the left and right states are vertex point values that surround a linear element centered at the point \(x_{i+\frac{1}{2}}\). This is a residual distribution scheme where the residual \(\mathbf f_L - \mathbf f_R\) is divided as \((\mathbf f_L-\mathbf f^*)+(\mathbf f^*-\mathbf f_R)\) and distributed to the left and right states respectively [1].

We define the jump in a quantity across an interface by

$$\begin{aligned} \left[ \!\left[ \cdot \right] \!\right] = (\cdot )_R - (\cdot )_L. \end{aligned}$$

We contract (3.3) into entropy space to obtain the semi-discrete entropy update in each cell

$$\begin{aligned} {\frac{\varDelta x}{2}} \frac{\partial s_L}{\partial t} = \mathbf w_L^T\left( \mathbf f_L - \mathbf f^*\right) \qquad \mathrm {and}\qquad {\frac{\varDelta x}{2}} \frac{\partial s_R}{\partial t} = \mathbf w_R^T\left( \mathbf f^* - \mathbf f_R\right) , \end{aligned}$$
(3.4)

where we assume continuity in time such that \(s_t = \mathbf w^T\mathbf u_t\). Next, we add the contributions from each side of the interface in (3.4) to obtain the total entropy update

$$\begin{aligned} {\frac{\varDelta x}{2}} \frac{\partial }{\partial t}\left( s_L+s_R\right) = \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^* - \left[ \!\left[ \mathbf w^T\mathbf f \right] \!\right] . \end{aligned}$$
(3.5)

To ensure that the finite volume update satisfies the discrete entropy conservation law, the entropy flux of the finite volume discretization must coincide with the discrete entropy flux \(f^{s}\), i.e.,

$$\begin{aligned} \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^* - \left[ \!\left[ \mathbf w^T\mathbf f \right] \!\right] \mathop {=}\limits ^{{!}}-\left[ \!\left[ f^s \right] \!\right] . \end{aligned}$$

We use the linearity of the jump operator and rearrange to obtain the general entropy conservation condition of Tadmor [42]

$$\begin{aligned} \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^* = \left[ \!\left[ \mathbf w^T\mathbf f - f^s \right] \!\right] = \left[ \!\left[ \varPsi \right] \!\right] , \end{aligned}$$
(3.6)

where we apply the definition of the entropy flux potential (2.9). The entropy conservation condition (3.6) provides a mathematical constraint on the numerical surface flux \(\mathbf f^*\) that prescribes how a single interface affects the semi-discrete evolution of the entropy in the left and right cells (3.5). The discrete entropy conservation condition (3.6) is a single constraint for a vector quantity. Thus, the form of the entropy conservative numerical flux is not unique. However, the resulting numerical flux form (3.6) must remain consistent (3.1).

To derive an entropy conservative flux we note the properties of the jump operator

$$\begin{aligned} \left[ \!\left[ ab \right] \!\right] = \left\{ \!\left\{ a\right\} \!\right\} \left[ \!\left[ b \right] \!\right] + \left\{ \!\left\{ b\right\} \!\right\} \left[ \!\left[ a \right] \!\right] , \quad \left[ \!\left[ a^2 \right] \!\right] = 2\left\{ \!\left\{ a\right\} \!\right\} \left[ \!\left[ a \right] \!\right] , \end{aligned}$$
(3.7)

where we introduce notation for the arithmetic mean

$$\begin{aligned} \left\{ \!\left\{ \cdot \right\} \!\right\} = \frac{1}{2}\left( (\cdot )_R+(\cdot )_L\right) . \end{aligned}$$

For the numerical flux to remain applicable to either equation of state (2.2) we require a generalized average operator for the fluid density.

Definition 3.1

(\(\gamma \)-mean) The \(\gamma \)-mean of states \(\varrho _L\), \(\varrho _R\) is defined as

$$\begin{aligned} {\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }= {\left\{ \begin{array}{ll} \varrho _L, &{} \;\mathrm {if}\;\varrho _L = \varrho _R,\\ \dfrac{1}{\gamma }\dfrac{\left[ \!\left[ p \right] \!\right] }{\left[ \!\left[ e \right] \!\right] }, &{} \;\mathrm {otherwise}. \end{array}\right. }} \end{aligned}$$
(3.8)

We examine the evaluation of the average (3.8) for three cases substituting the appropriate forms of the pressure (2.2) and internal energy (2.4):

  1. 1.

    Polytropic (\(\gamma >1\)) yields

    $$\begin{aligned} \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }= \frac{1}{\gamma }\frac{\left[ \!\left[ \kappa \varrho ^\gamma \right] \!\right] }{\left[ \!\left[ \frac{\kappa }{\gamma -1}\varrho ^{\gamma -1} \right] \!\right] }= \frac{\gamma -1}{\gamma }\frac{\left[ \!\left[ \varrho ^\gamma \right] \!\right] }{\left[ \!\left[ \varrho ^{\gamma -1} \right] \!\right] }. \end{aligned}$$
    (3.9)
  2. 2.

    Isothermal (\(\gamma =1\)) where the special average becomes the logarithmic mean which also arises in the construction of entropy conservative fluxes for the adiabatic Euler equations [9, 28]

    $$\begin{aligned} \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }= \frac{1}{1}\frac{\left[ \!\left[ c^2\varrho \right] \!\right] }{\left[ \!\left[ c^2\ln (\varrho ) \right] \!\right] } = \frac{\left[ \!\left[ \varrho \right] \!\right] }{\left[ \!\left[ \ln (\varrho ) \right] \!\right] } :=\varrho ^{\ln }. \end{aligned}$$
    (3.10)
  3. 3.

    Shallow water (\(\gamma =2\)) for which the special average reduces to the arithmetic mean

    $$\begin{aligned} \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }= \frac{1}{2}\frac{\left[ \!\left[ \varrho ^2 \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = \frac{1}{2}\frac{2\left\{ \!\left\{ \varrho \right\} \!\right\} \left[ \!\left[ \varrho \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = \left\{ \!\left\{ \varrho \right\} \!\right\} . \end{aligned}$$

Remark 3.1

The \(\gamma \)-mean (3.8) is continuous and well-defined provided the states \(\varrho _L\), \(\varrho _R\) are positive real numbers [38].

Remark 3.2

The \(\gamma \)-mean (3.9) is a special case of the weighted Stolarsky mean, which serves as a generalization of the logarithmic mean [38]. Also, assuming without loss of generality that \(\varrho _L<\varrho _R\), it is guaranteed that the value of \(\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\in [\varrho _L,\varrho _R]\) [38, 39].

Remark 3.3

In practice, when the left and right fluid density values are close, there are numerical stability issues because the \(\gamma \)-mean (3.8) tends to a 0 / 0 form. Therefore, we provide a numerically stable procedure to compute (3.8) in “Appendix A.1”.

With Definition 3.1 and the discrete entropy conservation condition (3.6) we are equipped to derive an entropy conservative numerical flux function.

Theorem 3.1

(Entropy conservative flux) The numerical flux

$$\begin{aligned} \mathbf f^{*,{\mathrm {EC}}} = \begin{bmatrix} \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} ^2 + \left\{ \!\left\{ p\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\} \\ \end{bmatrix}, \end{aligned}$$
(3.11)

is consistent and satisfies the condition (3.6).

Proof

We first expand the right-hand-side of the entropy conservation condition (3.6)

$$\begin{aligned} \left[ \!\left[ \varPsi \right] \!\right] = \left[ \!\left[ pv_1 \right] \!\right] = \left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ p \right] \!\right] + \left\{ \!\left\{ p\right\} \!\right\} \left[ \!\left[ v_1 \right] \!\right] , \end{aligned}$$
(3.12)

where we use the jump properties (3.7). Next, we expand the jump in the entropy variables. To do so, we revisit the form of the entropy variable \(w_1\) as it changes depending on the equation of state

(3.13)

Taking the jump of the variable (3.13) we obtain

$$\begin{aligned} \left[ \!\left[ w_1 \right] \!\right] = {\left\{ \begin{array}{ll} \gamma \left[ \!\left[ e \right] \!\right] - \left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ v_1 \right] \!\right] - \left\{ \!\left\{ v_2\right\} \!\right\} \left[ \!\left[ v_2 \right] \!\right] - \left\{ \!\left\{ v_3\right\} \!\right\} \left[ \!\left[ v_3 \right] \!\right] , &{} \mathrm {polytropic}\\ \left[ \!\left[ e \right] \!\right] - \left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ v_1 \right] \!\right] - \left\{ \!\left\{ v_2\right\} \!\right\} \left[ \!\left[ v_2 \right] \!\right] - \left\{ \!\left\{ v_3\right\} \!\right\} \left[ \!\left[ v_3 \right] \!\right] , &{} \mathrm {isothermal} \end{array}\right. } \end{aligned}$$
(3.14)

because the values of \(\gamma \) and c are constant. Note that in the isothermal case \(\gamma = 1\), so the jump of \(w_1\) (3.14) has the same form regardless of the equation of state. Therefore, the total jump in the entropy variables is

(3.15)

We combine the expanded condition (3.12), the jump in the entropy variables (3.15), and rearrange terms to find

$$\begin{aligned} \begin{aligned}&f_1^*\left( \gamma \left[ \!\left[ e \right] \!\right] -\left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ v_1 \right] \!\right] -\left\{ \!\left\{ v_2\right\} \!\right\} \left[ \!\left[ v_2 \right] \!\right] -\left\{ \!\left\{ v_3\right\} \!\right\} \left[ \!\left[ v_3 \right] \!\right] \right) \\&\qquad +f_2^*\left[ \!\left[ v_1 \right] \!\right] +f_3^*\left[ \!\left[ v_2 \right] \!\right] +f_4^*\left[ \!\left[ v_3 \right] \!\right] \\&\quad = \left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ p \right] \!\right] +\left\{ \!\left\{ p\right\} \!\right\} \left[ \!\left[ v_1 \right] \!\right] . \end{aligned} \end{aligned}$$
(3.16)

To determine the first flux component we find

$$\begin{aligned} f_1^*\gamma \left[ \!\left[ e \right] \!\right] = \left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ p \right] \!\right] \qquad \Rightarrow \qquad f_1^* = \frac{1}{\gamma }\frac{\left[ \!\left[ p \right] \!\right] }{\left[ \!\left[ e \right] \!\right] }\left\{ \!\left\{ v_1\right\} \!\right\} = \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} , \end{aligned}$$
(3.17)

from the \(\gamma \)-mean in Definition 3.1. The expanded flux condition (3.16) is rewritten into linear jump components. We gather the like terms of each jump component to facilitate the construction of the remaining flux components:

$$\begin{aligned} \begin{aligned} \left[ \!\left[ v_1 \right] \!\right] :\quad -f_1^*\left\{ \!\left\{ v_1\right\} \!\right\} + f_2^*&= \left\{ \!\left\{ p\right\} \!\right\} ,\\ \left[ \!\left[ v_2 \right] \!\right] :\quad -f_1^*\left\{ \!\left\{ v_2\right\} \!\right\} + f_3^*&= 0,\\ \left[ \!\left[ v_3 \right] \!\right] :\quad -f_1^*\left\{ \!\left\{ v_3\right\} \!\right\} + f_4^*&= 0. \end{aligned} \end{aligned}$$
(3.18)

Now, it is straightforward to solve the expressions in (3.18) and find

$$\begin{aligned} \begin{aligned} f_2^*&= \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} ^2 + \left\{ \!\left\{ p\right\} \!\right\} ,\\ f_3^*&= \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\} ,\\ f_4^*&= \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\} . \end{aligned} \end{aligned}$$
(3.19)

If we assume the left and right states are identical in (3.17) and (3.19) it is straightforward to verify that the numerical flux is consistent from its form and the properties of the \(\gamma \)-mean. \(\square \)

Remark 3.4

There are two values of \(\gamma \) that change the form of the entropy conservative flux (3.11):

  1. 1.

    Isothermal case (\(\gamma =1\)): The numerical flux becomes

    $$\begin{aligned} \mathbf f^{*,{\mathrm {EC}}}_{\mathrm {iso}} = \begin{bmatrix} \varrho ^{\ln }\left\{ \!\left\{ v_1\right\} \!\right\} \\ \varrho ^{\ln }\left\{ \!\left\{ v_1\right\} \!\right\} ^2 + \left\{ \!\left\{ p\right\} \!\right\} \\ \varrho ^{\ln }\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\} \\ \varrho ^{\ln }\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\} \\ \end{bmatrix}, \end{aligned}$$

    where the fluid density is computed with the logarithmic mean (3.10) just as in the adiabatic case [9, 28].

  2. 2.

    Shallow water case (\(\gamma =2\)): Here the numerical flux simplifies to become

    $$\begin{aligned} \mathbf f^{*,{\mathrm {EC}}}_{\mathrm {sw}} = \begin{bmatrix} \left\{ \!\left\{ \varrho \right\} \!\right\} \left\{ \!\left\{ v_1\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} \left\{ \!\left\{ v_1\right\} \!\right\} ^2 + \left\{ \!\left\{ p\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} \left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\} \\ \end{bmatrix} =\begin{bmatrix} \left\{ \!\left\{ \varrho \right\} \!\right\} \left\{ \!\left\{ v_1\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} \left\{ \!\left\{ v_1\right\} \!\right\} ^2 + \kappa \left\{ \!\left\{ \varrho ^2\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} \left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\} \\ \end{bmatrix}, \end{aligned}$$

    where the velocity component in the z direction is ignored due to the assumptions of the shallow water equations [45]. If we let the fluid density be denoted as the water height, \(\varrho \mapsto h\), and take \(\kappa =g/2\) where g is the gravitational constant, then we recover the entropy conservative numerical flux function originally developed for the shallow water equations by Fjordholm et al. [18].

Remark 3.5

(Multi-dimensional entropy conservative fluxes) The derivation of entropy conservative numerical fluxes in the other spatial directions is very similar to that shown in Theorem 3.1. So, we present the three-dimensional entropy conservative fluxes in the y and z directions in “Appendix B”.

3.3 Entropy stable numerical flux

As previously mentioned, the solution of hyperbolic conservation laws can contain or develop discontinuities regardless of the smoothness of the initial conditions [15]. In this case, a numerical approximation that is entropy conservative is no longer physical and should account for the dissipation of entropy near discontinuities. Such a numerical method is called entropy stable, e.g., [17, 42]. To create an entropy stable numerical flux function we begin with a general form

$$\begin{aligned} \mathbf f^{*,{\mathrm {ES}}} = \mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\mathsf { D}\left[ \!\left[ \mathbf u \right] \!\right] , \end{aligned}$$
(3.20)

where \(\mathsf { D}\) is a symmetric positive definite dissipation matrix. An immediate issue arises when we contract the entropy stable flux (3.20) into entropy space. We must guarantee that the dissipation term possesses the correct sign [48]; however, contracting (3.20) with the jump in entropy variables gives

$$\begin{aligned} \begin{aligned} \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^{*,{\mathrm {ES}}}&= \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\left[ \!\left[ \mathbf w \right] \!\right] ^T\mathsf { D}\left[ \!\left[ \mathbf u \right] \!\right] \\&=-\left[ \!\left[ f^{s} \right] \!\right] -\frac{1}{2}\left[ \!\left[ \mathbf w \right] \!\right] ^T\mathsf { D}\left[ \!\left[ \mathbf u \right] \!\right] . \end{aligned} \end{aligned}$$
(3.21)

So, there is a mixture of entropy and conservative variable jumps in the dissipation term that must be guaranteed positive to ensure that entropy is dissipated correctly. In general, it is unclear how to guarantee positivity of the dissipation term in (3.21) as required for entropy stability [2]. To remedy this issue we rewrite \(\left[ \!\left[ \mathbf u \right] \!\right] \) in terms of \(\left[ \!\left[ \mathbf w \right] \!\right] \). This is possible due to the one-to-one variable mapping between conservative and entropy space as we know that

$$\begin{aligned} \frac{\partial \mathbf u}{\partial x} = \mathsf { H}\frac{\partial \mathbf w}{\partial x}. \end{aligned}$$

For the discrete case we wish to recover a particular average evaluation of the entropy Jacobian (2.7) at a cell interface such that

$$\begin{aligned} \left[ \!\left[ \mathbf u \right] \!\right] \mathop {=}\limits ^{{!}} \hat{\mathsf { H}}\left[ \!\left[ \mathbf w \right] \!\right] . \end{aligned}$$
(3.22)

To generate a discrete entropy Jacobian that satisfies (3.22) we need a specially designed average for the square of the sound speed.

Definition 3.2

(Average square sound speed) A mean value of the square sound speed for states \(p_L\), \(p_R\) and \(\varrho _L\), \(\varrho _R\) is defined as

$$\begin{aligned} \overline{a^2}= \frac{\left[ \!\left[ p \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] }. \end{aligned}$$
(3.23)

Remark 3.6

The average (3.23) is consistent. To demonstrate this, consider the polytropic equation of state from (2.2) and take \(\varrho _R = \varrho + \epsilon \) and \(\varrho _L=\varrho \) so that

$$\begin{aligned} \overline{a^2}= \frac{\left[ \!\left[ p \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = \frac{\frac{1}{\epsilon }\kappa \left( (\varrho +\epsilon )^{\gamma } - \varrho ^{\gamma }\right) }{\frac{1}{\epsilon }\left( (\varrho +\epsilon ) - \varrho \right) } \mathop {=}\limits ^{{\epsilon \rightarrow 0}} \gamma \kappa \varrho ^{\gamma -1} = \frac{\gamma \kappa \varrho ^{\gamma }}{\varrho } = \frac{\gamma p}{\varrho } = a^2. \end{aligned}$$

Remark 3.7

Again examining the special values of \(\gamma \) we find:

  1. 1.

    Isothermal (\(\gamma =1\)) gives

    $$\begin{aligned} \overline{a^2}= \frac{\left[ \!\left[ p \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = \frac{\left[ \!\left[ c^2\varrho \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = c^2, \end{aligned}$$

    as \(c^2\) is a constant.

  2. 2.

    Shallow water (\(\gamma =2\)) yields

    $$\begin{aligned} \overline{a^2}= \frac{\left[ \!\left[ p \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = \frac{\left[ \!\left[ \kappa \varrho ^2 \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = \frac{g}{2}\frac{2\left\{ \!\left\{ \varrho \right\} \!\right\} \left[ \!\left[ \varrho \right] \!\right] }{\left[ \!\left[ \varrho \right] \!\right] } = g\!\left\{ \!\left\{ \varrho \right\} \!\right\} , \end{aligned}$$

    where, again, we take \(\kappa =g/2\) and apply a property of the jump operator (3.7). Denoting the fluid density as the water height, \(\varrho \mapsto h\), we recover an average of the wave celerity for the shallow water model [18].

Remark 3.8

Just as with the \(\gamma \)-mean, the sound speed average (3.23) exhibits numerical stability issues for the polytropic case \(\gamma >1\) when the fluid density values are close. Therefore, we present a numerically stable procedure to evaluate (3.23) in “Appendix A.2”.

Lemma 3.1

(Discrete entropy Jacobian evaluation) The mean value entries of the entropy Jacobian from the states \(\mathbf u_L\), \(\mathbf u_R\)

$$\begin{aligned}&\hat{\mathsf { H}} = \frac{1}{\overline{a^2}}\nonumber \\&\quad \begin{bmatrix} \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_2\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_3\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_1\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_1\right\} \!\right\} ^2 + \overline{a^2}\left\{ \!\left\{ \varrho \right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_2\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_2\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_2\right\} \!\right\} ^2 + \overline{a^2}\left\{ \!\left\{ \varrho \right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_2\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\} \\ \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_3\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_1\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_2\right\} \!\right\} \left\{ \!\left\{ v_3\right\} \!\right\}&\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\!\left\{ \!\left\{ v_3\right\} \!\right\} ^2 + \overline{a^2}\left\{ \!\left\{ \varrho \right\} \!\right\} \\ \end{bmatrix} \end{aligned}$$
(3.24)

relates the the jump in conservative variables to the jump in entropy variables

$$\begin{aligned} \left[ \!\left[ \mathbf u \right] \!\right] = \hat{\mathsf { H}}\left[ \!\left[ \mathbf w \right] \!\right] . \end{aligned}$$
(3.25)

Proof

We demonstrate how to obtain the first row of the discrete matrix \(\hat{\mathsf { H}}\). From the condition (3.25) we see that

$$\begin{aligned}&\left[ \!\left[ \varrho \right] \!\right] \mathop {=}\limits ^{{!}} \hat{\mathsf { H}}_{11}\left( \gamma \left[ \!\left[ e \right] \!\right] -\left\{ \!\left\{ v_1\right\} \!\right\} \left[ \!\left[ v_1 \right] \!\right] -\left\{ \!\left\{ v_2\right\} \!\right\} \left[ \!\left[ v_2 \right] \!\right] -\left\{ \!\left\{ v_3\right\} \!\right\} \left[ \!\left[ v_3 \right] \!\right] \right) \nonumber \\&\qquad \quad +\, \hat{\mathsf { H}}_{12}\left[ \!\left[ v_1 \right] \!\right] + \hat{\mathsf { H}}_{13}\left[ \!\left[ v_2 \right] \!\right] + \hat{\mathsf { H}}_{14}\left[ \!\left[ v_3 \right] \!\right] . \end{aligned}$$
(3.26)

To determine the first entry of the matrix we apply the definition of the \(\gamma \)-mean (3.8) and the sound speed average (3.23) to obtain

$$\begin{aligned} \hat{\mathsf { H}}_{11} = \frac{1}{\gamma }\frac{\left[ \!\left[ \varrho \right] \!\right] }{\left[ \!\left[ e \right] \!\right] } = \frac{1}{\gamma }\frac{\left[ \!\left[ \varrho \right] \!\right] }{\frac{1}{\gamma }\frac{\left[ \!\left[ p \right] \!\right] }{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}} = \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\frac{\left[ \!\left[ \varrho \right] \!\right] }{\left[ \!\left[ p \right] \!\right] } = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}{\overline{a^2}}. \end{aligned}$$

The remaining components in the first row of \(\hat{\mathsf { H}}\) from (3.26) are

$$\begin{aligned} \hat{\mathsf { H}}_{12} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} }{\overline{a^2}},\quad \hat{\mathsf { H}}_{13} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_2\right\} \!\right\} }{\overline{a^2}},\quad \hat{\mathsf { H}}_{14} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_3\right\} \!\right\} }{\overline{a^2}}. \end{aligned}$$

Repeating this process we obtain the remaining unknown components in the relation (3.22) and arrive at the discrete entropy Jacobian (3.24). \(\square \)

Next, we select the dissipation matrix \(\mathsf { D}\) to be a discrete evaluation of the eigendecomposition of the flux Jacobian (2.11)

$$\begin{aligned} \mathsf { D}=\hat{\mathsf { R}}|{{\hat{\mathsf {\Lambda }}}}| \hat{\mathsf { R}}^{-1}, \end{aligned}$$
(3.27)

where \(\mathsf { R}\) is the matrix of right eigenvectors (2.13) and \({\mathsf {\Lambda }}\) is a diagonal matrix containing the eigenvalues (2.12). From the discrete entropy Jacobian (3.24), we seek a right eigenvector and diagonal scaling matrix \(\hat{\mathsf { Z}}\) such that a discrete version of the eigenvector scaling (2.14)

$$\begin{aligned} \hat{\mathsf { H}} \mathop {=}\limits ^{{!}} \hat{\mathsf { R}}\hat{\mathsf { Z}}\hat{\mathsf { R}}^T, \end{aligned}$$
(3.28)

holds whenever possible.

Lemma 3.2

(Discrete eigenvector and scaling matrices) The right eigenvector and diagonal scaling matrices evaluated between the states \(\mathbf u_L\), \(\mathbf u_R\)

$$\begin{aligned} \hat{\mathsf { R}} = \begin{bmatrix} 1&0&0&1\\ \left\{ \!\left\{ v_1\right\} \!\right\} - \sqrt{\overline{a^2}}&0&0&\left\{ \!\left\{ v_1\right\} \!\right\} + \sqrt{\overline{a^2}}\\ \left\{ \!\left\{ v_2\right\} \!\right\}&1&0&\left\{ \!\left\{ v_2\right\} \!\right\} \\ \left\{ \!\left\{ v_3\right\} \!\right\}&0&1&\left\{ \!\left\{ v_3\right\} \!\right\} \\ \end{bmatrix},\quad \hat{\mathsf { Z}} = \mathrm {diag}\left( \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}{2\overline{a^2}},\,\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma },\, \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma },\,\frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}{2\overline{a^2}}\right) , \end{aligned}$$
(3.29)

satisfy the relationship

$$\begin{aligned} \hat{\mathsf { H}}\simeq \hat{\mathsf { R}}\hat{\mathsf { Z}}\hat{\mathsf { R}}^T, \end{aligned}$$
(3.30)

where equality holds everywhere except for the second, third, and fourth diagonal entries.

Proof

The procedure to determine the discrete evaluation of the matrices \(\hat{\mathsf { R}}\) and \(\hat{\mathsf { Z}}\) is similar to that taken by Winters et al. [47]. We relate the individual entries of \(\hat{\mathsf { H}}\) to those in \(\hat{\mathsf { R}}\hat{\mathsf { Z}}\hat{\mathsf { R}}^T\) and determine the 16 individual components of the matrices. We explicitly demonstrate two computations to outline the general technique and qualify the average states inserted in the final form.

We begin by computing the first entry of the first row of the system that should satisfy

$$\begin{aligned} \hat{\mathsf { H}}_{11} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}{\overline{a^2}} \mathop {=}\limits ^{{!}} \frac{{\hat{\varrho }}}{{\hat{a}}^2} = \left( \hat{\mathsf { R}}\hat{\mathsf { Z}} \hat{\mathsf { R}}^T\right) _{\!11}. \end{aligned}$$

This leads to two entries of the diagonal scaling matrix

$$\begin{aligned} \hat{\mathsf { Z}}_{11} = \hat{\mathsf { Z}}_{44} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}{2\overline{a^2}}. \end{aligned}$$

The second computation is to determine the second entry of the second row of the system given by

$$\begin{aligned} \hat{\mathsf { H}}_{22} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} ^2}{\overline{a^2}} + \left\{ \!\left\{ \varrho \right\} \!\right\} \mathop {=}\limits ^{{!}} \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }}{2\overline{a^2}}\left( \left( {\hat{v}}_1+{\hat{a}}\right) ^2 + \left( {\hat{v}}_1 - {\hat{a}}\right) ^2\right) = \left( \hat{\mathsf { R}}\hat{\mathsf { Z}} \hat{\mathsf { R}}^T\right) _{\!22}. \end{aligned}$$

It is clear that we must select \({\hat{v}}_1 = \left\{ \!\left\{ v_1\right\} \!\right\} \) and \({\hat{a}} = \sqrt{\overline{a^2}}\) in the second row of the right eigenvector matrix \(\hat{\mathsf { R}}\). Unfortunately, just as in the ideal MHD case, we cannot enforce strict equality between the continuous and the discrete entropy scaling analysis [14, 47] and find

$$\begin{aligned} \hat{\mathsf { H}}_{22}\simeq \left( \hat{\mathsf { R}} \hat{\mathsf { Z}}\hat{\mathsf { R}}^T\right) _{\!22} = \frac{\left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }\left\{ \!\left\{ v_1\right\} \!\right\} ^2}{\overline{a^2}} + \left\{ \!\left\{ \varrho \right\} \!\right\} _{\!\gamma }. \end{aligned}$$

We apply this same process to the remaining unknown portions from the condition (3.28) and, after many algebraic manipulations, determine a unique averaging procedure for the discrete eigenvector and scaling matrices (3.29). The derivations were aided and verified using the symbolic algebra software Maxima [34]. \(\square \)

Remark 3.9

In a similar fashion from [47] we determine the discrete diagonal matrix of eigenvalues

$$\begin{aligned} {{\hat{\mathsf {\Lambda }}}} = \mathrm {diag}\left( \left\{ \!\left\{ v_1\right\} \!\right\} -\sqrt{\overline{a^2}},\,\left\{ \!\left\{ v_1\right\} \!\right\} ,\, \left\{ \!\left\{ v_1\right\} \!\right\} ,\,\left\{ \!\left\{ v_1\right\} \!\right\} +\sqrt{\overline{a^2}}\right) . \end{aligned}$$

Now, we have a complete discrete description of the entropy stable numerical flux function from (3.20)

$$\begin{aligned} \begin{aligned} \mathbf f^{*,{\mathrm {ES}}}&= \mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\mathsf { D}\left[ \!\left[ \mathbf u \right] \!\right] \\&=\mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\hat{\mathsf { R}}|{{\hat{\mathsf {\Lambda }}}}| \hat{\mathsf { R}}^{-1}\hat{\mathsf { H}}\left[ \!\left[ \mathbf w \right] \!\right] , \quad \text {from } (3.25)\text { and }(3.27)\\&\simeq \mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\hat{\mathsf { R}}|{{\hat{\mathsf {\Lambda }}}}| \hat{\mathsf { R}}^{-1}\hat{\mathsf { R}}\hat{\mathsf { Z}} \hat{\mathsf { R}}^T\left[ \!\left[ \mathbf w \right] \!\right] ,\quad \text {from } (3.30)\\&=\mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\hat{\mathsf { R}}|{{\hat{\mathsf {\Lambda }}}}| \hat{\mathsf { Z}}\hat{\mathsf { R}}^T\left[ \!\left[ \mathbf w \right] \!\right] . \end{aligned} \end{aligned}$$

This leads to the main result of this section.

Theorem 3.2

(Entropy stable flux) The numerical flux function

$$\begin{aligned} \mathbf f^{*,{\mathrm {ES}}} = \mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\hat{\mathsf { R}}|{{\hat{\mathsf {\Lambda }}}}| \hat{\mathsf { Z}}\hat{\mathsf { R}}^T\!\left[ \!\left[ \mathbf w \right] \!\right] , \end{aligned}$$
(3.31)

is guaranteed to dissipate entropy with the correct sign.

Proof

To begin we restate the discrete evolution of the entropy at a single interface where we insert the newly derived entropy stable flux (3.31)

$$\begin{aligned} {\frac{\varDelta x}{2}}\frac{\partial }{\partial t}\left( s_L+s_R\right) = \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^{*,{\mathrm {ES}}} - \left[ \!\left[ \mathbf w^T\mathbf f \right] \!\right] . \end{aligned}$$

From the construction of the entropy conservative flux function from Theorem 3.1 we know that

$$\begin{aligned} \left[ \!\left[ \mathbf w \right] \!\right] ^T\mathbf f^{*,{\mathrm {ES}}} - \left[ \!\left[ \mathbf w^T\mathbf f \right] \!\right]= & {} \left[ \!\left[ \mathbf w \right] \!\right] ^T\left( \mathbf f^{*,{\mathrm {EC}}} - \frac{1}{2}\hat{\mathsf { R}}|{{\hat{\mathsf {\Lambda }}}}| \hat{\mathsf { Z}}\hat{\mathsf { R}}^T\left[ \!\left[ \mathbf w \right] \!\right] \right) - \left[ \!\left[ \mathbf w^T\mathbf f \right] \!\right] \\= & {} -\left[ \!\left[ f^{s} \right] \!\right] - \frac{1}{2}\left[ \!\left[ \mathbf w \right] \!\right] ^T\hat{\mathsf { R}}| {{\hat{\mathsf {\Lambda }}}}|\hat{\mathsf { Z}} \hat{\mathsf { R}}^T\left[ \!\left[ \mathbf w \right] \!\right] . \end{aligned}$$

So, (3.3) becomes

$$\begin{aligned} {\frac{\varDelta x}{2}}\frac{\partial }{\partial t}\left( s_L+s_R\right) + \left[ \!\left[ f^{s} \right] \!\right] = - \frac{1}{2}\left[ \!\left[ \mathbf w \right] \!\right] ^T\hat{\mathsf { R}}| {{\hat{\mathsf {\Lambda }}}}|\hat{\mathsf { Z}} \hat{\mathsf { R}}^T\left[ \!\left[ \mathbf w \right] \!\right] \le 0, \end{aligned}$$

because the matrices \(|{{\hat{\mathsf {\Lambda }}}}|\) and \(\hat{\mathsf { Z}}\) are symmetric positive definite, the dissipation term is a quadratic form in entropy space and guarantees a negative contribution. \(\square \)

4 Extension of ES scheme to discontinuous Galerkin numerical approximation

In this section, we extend the entropy conservative/stable finite volume numerical fluxes to higher spatial order by building them into a nodal discontinuous Galerkin (DG) spectral element method. We provide an abbreviated presentation of the entropy stable DG framework, but complete details can be found in [25]. For simplicity we restrict the discussion to uniform Cartesian elements; however, the extension to curvilinear elements is straightforward [25, Appendix B].

First, we subdivide the physical domain \(\varOmega \) into \(N_{\mathrm {el}}\) non-overlapping Cartesian elements

$$\begin{aligned} E_m = [x_{m,1},x_{m,2}]\times [y_{m,1},y_{m,2}]\times [z_{m,1},z_{m,2}],\quad m = 1,\ldots ,N_{\mathrm {el}} \end{aligned}$$

To simplify the discussion we assume that all elements have the same size, i.e. \(\varDelta x = x_{m,2}-x_{m,1}\), \(\varDelta y = y_{m,2}-y_{m,1}\), and \(\varDelta z = z_{m,2}-z_{m,1}\) for all \(m=1,\ldots ,N_{\mathrm {el}}\). Next, we create a transformation between the reference element \(E_0 = [-1,1]^3\) and each element \(E_m\). To do so, we use mappings \((X_m,Y_m,Z_m): E_0\rightarrow E_m\) such that \((x,y,z) = \left( X_m(\xi ),Y_m(\eta ),Z_m(\zeta )\right) \) are

$$\begin{aligned} X_m(\xi ) = x_{m,1} + \frac{\xi +1}{2}\varDelta x,\quad Y_m(\eta ) = y_{m,1} + \frac{\eta +1}{2}\varDelta y,\quad Z_m(\zeta ) = z_{m,1} + \frac{\zeta +1}{2}\varDelta z,\quad \end{aligned}$$
(4.1)

for \(m=1,\ldots ,N_{\mathrm {el}}\). Under the transformations (4.1) the conservation law in physical coordinates (2.1) becomes a conservation law in reference coordinates

$$\begin{aligned} J\mathbf u_t + {(\tilde{\mathbf f}_1)_{\xi } + (\tilde{\mathbf f}_2)_{\eta } + (\tilde{\mathbf f}_3)_{\zeta }} = \mathbf 0, \end{aligned}$$
(4.2)

where we introduce notation for the divergence in reference coordinates as well as the Jacobian and contravariant flux components

$$\begin{aligned} J = \frac{\varDelta x\varDelta y\varDelta z}{8},\qquad \tilde{\mathbf f}_1 = \frac{\varDelta y\varDelta z}{4}\mathbf f_1, \qquad \tilde{\mathbf f}_2 = \frac{\varDelta x\varDelta z}{4}\mathbf f_2, \qquad \tilde{\mathbf f}_3 = \frac{\varDelta x\varDelta y}{4}\mathbf f_3. \end{aligned}$$

For each element, we approximate the components of the state vector, the flux vectors, etc. with polynomials of degree N in each spatial direction. The polynomial approximations are denoted with capital letters, e.g. \(\mathbf U \in {\mathbb {P}}^{N}\!(E)\). Here we consider the construction of a nodal discontinuous Galerkin spectral element method (DGSEM), in which the polynomials are written in terms of Lagrange basis functions, e.g. \(\ell _i(\xi )\) with \(i=0,\ldots ,N\), that interpolate at the Legendre–Gauss–Lobatto (LGL) nodes [29]. The DG method is built from the weak form of the mapped conservation law (4.2) where we multiply by a test function \(\varphi \in {\mathbb {P}}^N\) and integrate over the reference element

$$\begin{aligned} \int \limits _{E_0}\left( J\mathbf U_t + {\left( \tilde{\mathbf F}_1\right) _{\xi } + \left( \tilde{\mathbf F}_2\right) _{\eta } + \left( \tilde{\mathbf F}_3\right) _{\zeta }} \right) \varphi \,{\mathrm {d}\xi \mathrm {d}\eta \mathrm {d}\zeta } = \mathbf 0. \end{aligned}$$
(4.3)

Note, that there is no continuity of the approximate solution or \(\varphi \) assumed between elements boundaries.

We select the test function to be the tensor product basis \(\varphi =\ell _i(\xi )\ell _j(\eta )\ell _k(\zeta )\) for \(i,j,k=0,\ldots ,N\). The integrals in (4.3) are approximated with LGL quadrature and we collocate the quadrature nodes with the interpolation nodes. This exploits that the Lagrange basis functions are discretely orthogonal and simplifies the nodal DG approximation [29]. The integral approximations introduce the mass matrix

$$\begin{aligned} \mathcal M = \mathrm {diag}(\omega _0,\ldots ,\omega _N), \end{aligned}$$

where \(\{\omega _i\}_{i=0}^N\) are the LGL quadrature weights. In addition to the discrete integration matrix, the polynomial basis functions and the interpolation nodes form a discrete polynomial derivative matrix

$$\begin{aligned} {\mathcal D_{ij} = \ell _j^{\prime }(\xi _i),\quad i,j = 0,\ldots ,N,} \end{aligned}$$
(4.4)

where \(\{\xi _i\}_{i=0}^N\) are the LGL nodes. The derivative matrix (4.4) is special as it satisfies the summation-by-parts (SBP) property for all polynomial orders N [23]

$$\begin{aligned} \mathcal M\mathcal D + \left( \mathcal M\mathcal D\right) ^T = \mathcal B = \mathrm {diag}(-1,0,\ldots ,0,1). \end{aligned}$$

The SBP property is a discrete equivalent of integration-by-parts that is a crucial component to develop high-order entropy conservative/stable numerical approximations, e.g. [16, 17].

We apply the SBP property once to generate boundary contributions in the approximation of (4.3). Just like in the finite volume method, we resolve the discontinuity across element boundaries with a numerical surface flux function, e.g. \(\mathbf F_1^*(-1,\eta _j,\zeta _k;{\hat{n}})\) where \(j,k=0,\ldots ,N\) and \({\hat{n}}\) is the normal vector in reference space. We apply the SBP property again to move discrete derivatives back onto the fluxes inside the volume. Further, we introduce a two-point numerical volume flux, e.g. \(\mathbf F_1^{\#}\left( \mathbf U_{ijk},\mathbf U_{mjk}\right) \), that is consistent (3.1) and symmetric with respect to its arguments, e.g. [25]. These steps produce a semi-discrete split form DG approximation

$$\begin{aligned} \begin{aligned}&J\left( \mathbf U_t\right) _{ijk} + \frac{1}{\omega _{N}}\left[ \tilde{\mathbf F}^{*}_1 (1,\eta _j,\zeta _k;{\hat{n}})- \left( \tilde{\mathbf F}_1\right) _{Njk}\right] \\&\quad -\frac{1}{\omega _{0}}\left[ \tilde{\mathbf F}_1^{*} (-1,\eta _j,\zeta _k;{\hat{n}})- \left( \tilde{\mathbf F}_1\right) _{0jk}\right] +2\!\sum \limits _{m=0}^N \mathcal D_{im}\tilde{\mathbf F}_1^{\#}(U_{ijk},U_{mjk})\\&\quad +\frac{1}{\omega _{N}}\Big [\tilde{\mathbf F}^{*}_2(\xi _i,1,\zeta _k;{\hat{n}}) - \left( \tilde{\mathbf F}_2\right) _{iNk}\Big ] \\&\quad - \frac{1}{\omega _{0}}\Big [\tilde{\mathbf F}_2^{*}(\xi _i,-1,\zeta _k;{\hat{n}}) -\left( \tilde{\mathbf F}_2\right) _{i0k}\Big ]+2\!\sum \limits _{m=0}^N \mathcal D_{im}\tilde{\mathbf F}_2^{\#}(U_{ijk},U_{imk})\\&\quad + \frac{1}{\omega _{N}}\left[ \tilde{\mathbf F}^{*}_3(\xi _i,\eta _j,1;{\hat{n}}) - \left( \tilde{\mathbf F}_3\right) _{ijN}\right] \\&\quad - \frac{1}{\omega _{0}}\left[ \tilde{\mathbf F}_3^{*}(\xi _i,\eta _j,-1;{\hat{n}}) -\left( \tilde{\mathbf F}_3\right) _{ij0}\right] +2\!\sum \limits _{m=0}^N \mathcal D_{im}\tilde{\mathbf F}_3^{\#}(U_{ijk},U_{ijm})=\mathbf 0, \end{aligned}\nonumber \\ \end{aligned}$$
(4.5)

for \(i,j,k=0,\ldots ,N\).

To create an entropy aware high-order DG approximation we select the numerical surface and volume numerical fluxes to be those from the finite volume context [5, 25].

Two variants of the split form DG scheme (4.5) are of interest for the polytropic Euler equations:

  1. 1.

    Entropy conservative DG approximation: Select \(\mathbf F^{\#}\)and\(\mathbf F^{*}\) to be the entropy conserving fluxes developed in Sect. 3.2.

  2. 2.

    Entropy stable DG approximation: Take \(\mathbf F^{\#}\) to be the entropy conserving fluxes from Sect. 3.2 and \(\mathbf F^{*}\) to be the entropy stable fluxes from Sect. 3.3.

5 Numerical results

We present numerical tests to validate the theoretical findings of the previous sections for an entropy conservative/stable DG spectral element approximation. To do so, we perform the numerical tests in the two dimensional domain \(\varOmega = [0,1]^2\). We subdivide the domain into \(N_{\mathrm {el}}\) non-overlapping, uniform Cartesian elements such that the DG approximation takes the form presented in Sect. 4. The semi-discrete scheme (4.5) is integrated in time with the explicit five-state, fourth order low storage Runge–Kutta method of Carpenter and Kennedy [6]. A stable time step is computed according to an adjustable coefficient \(CFL\in (0,1]\), the local maximum wave speed, and the relative grid size, e.g. [22]. For uniform Cartesian meshes the explicit time step is selected by

$$\begin{aligned} \varDelta t :=CFL\frac{\varDelta x}{\lambda _{\mathrm {max}}(2N+1)}. \end{aligned}$$

First, we will verify the high-order spatial accuracy for the DG scheme with the method of manufactured solutions. For this we assume the solution to polytropic Euler equations takes the form

$$\begin{aligned} {\mathbf {u}} = \left[ h,\,\frac{1}{2}h,\,\frac{3}{2}h\right] ^T\quad \mathrm {with}\quad h(x,y,t) = 8 + \cos (2\pi x)\sin (2\pi y)\cos (2\pi t). \end{aligned}$$
(5.1)

This introduces an additional residual term on the right hand side of (2.1) that reads

$$\begin{aligned} {\mathbf {r}} = \begin{bmatrix} h_t + \frac{1}{2}h_x + \frac{3}{2}h_y\\ \frac{1}{2}h_t + \frac{1}{4}h_x + b\varrho _x + \frac{3}{4}h_y\\ \frac{1}{2}h_t + \frac{3}{4}h_x + \frac{9}{4}h_y + b\varrho _y \end{bmatrix}, \qquad b = {\left\{ \begin{array}{ll} \kappa \gamma \varrho ^{\gamma -1}, &{} \mathrm {polytropic}\\ c^2, &{} \mathrm {isothermal} \end{array}\right. }. \end{aligned}$$
(5.2)

Note that the residual term (5.2) is \(\gamma \) dependent.

The second test will demonstrate the entropic properties of the DG approximation. To do so, we use a discontinuous initial condition

$$\begin{aligned} {\mathbf {u}} = {\left\{ \begin{array}{ll} {[}1.2,\,0.1,\,0.0{]}^T, &{} x \le y\\ {[}1.0,\, 0.2,\, -0.4{]}^T, &{} x>y \end{array}\right. }. \end{aligned}$$
(5.3)

To measure the discrete entropy conservation of the DG approximation we examine the entropy residual of the numerical scheme [21]. To compute the discrete entropy growth, (4.5) is rewritten to be

$$\begin{aligned} J\left( \mathbf U_t\right) _{ij} + \mathbf {Res}\left( \mathbf U\right) _{ij} = \mathbf 0, \end{aligned}$$
(5.4)

where \(i,j = 0,\ldots ,N\) and

$$\begin{aligned} \mathbf {Res}\left( \mathbf U\right) _{ij}&= \frac{1}{\omega _{N}}\left[ \tilde{\mathbf F}^{*}_1(1,\eta _j;{\hat{n}}) - \left( \tilde{\mathbf F}_1\right) _{Nj}\right] - \frac{1}{\omega _{0}}\left[ \tilde{\mathbf F}_1^{*}(-1,\eta _j;{\hat{n}}) -\left( \tilde{\mathbf F}_1\right) _{0j}\right] \nonumber \\&\quad +2\!\sum \limits _{m=0}^N \mathcal D_{im}\tilde{\mathbf F}_1^{\#}(U_{ij},U_{mj})+\frac{1}{\omega _{N}}\Big [\tilde{\mathbf F}^{*}_2(\xi _i,1;{\hat{n}}) - \left( \tilde{\mathbf F}_2\right) _{iN}\Big ]\nonumber \\&\quad - \frac{1}{\omega _{0}}\Big [\tilde{\mathbf F}_2^{*}(\xi _i,-1;{\hat{n}}) - \left( \tilde{\mathbf F}_2\right) _{i0}\Big ] +2\!\sum \limits _{m=0}^N \mathcal D_{im}\tilde{\mathbf F}_2^{\#}(U_{ij},U_{im}). \end{aligned}$$
(5.5)

The growth in discrete entropy is computed by contracting (5.4) with the entropy variables (2.6)

$$\begin{aligned} J{\mathbf {W}}_{ij}^T\left( \mathbf U_t\right) _{ij} = -\mathbf W_{ij}^T\mathbf {Res}\left( \mathbf U\right) _{ij} \quad \Leftrightarrow \quad J\left( S_t\right) _{ij} = -\mathbf W_{ij}^T\mathbf {Res}\left( \mathbf U\right) _{ij}, \end{aligned}$$

where we apply the definition of the entropy variables to obtain the temporal derivative, \((S_t)_{ij}\), at each LGL node. The DG approximation is entropy conservative when the two-point finite volume flux from Theorem 3.1 is taken to be the interface flux, i.e. \(\tilde{\mathbf F}^{\#}=\tilde{\mathbf F}^{*}=\tilde{\mathbf F}^{{\mathrm {EC}}}\), in (5.5). This means that

$$\begin{aligned} \sum _{\nu =1}^{N_{\mathrm {el}}} J_k\sum _{i=0}^N\sum _{j=0}^N\omega _i\omega _j\left( S_t\right) _{ij} = 0, \end{aligned}$$
(5.6)

should hold for all time. We numerically verify this property by computing the integrated residual over the domain \(\varOmega \)

$$\begin{aligned} IS_t = -\sum _{\nu =1}^{N_{\mathrm {el}}} J_k\sum _{i=0}^N\sum _{j=0}^N\omega _i\omega _j{\mathbf {W}}_{ij}^T \mathbf {Res}\left( \mathbf U\right) _{ij}, \end{aligned}$$
(5.7)

and demonstrate that (5.7) is on the order of machine precision for the discontinuous initial condition (5.3). If interface dissipation is included, like that described in Sect. 3.3, the DG approximation is entropy stable and (5.7) becomes

$$\begin{aligned} IS_t \le 0. \end{aligned}$$
(5.8)

We consider two particular values of \(\gamma \) in these numerical studies: Sect. 5.1 presents results for the isothermal Euler equations where \(\gamma =1\) and Sect. 5.2 contains results for the polytropic Euler equations where \(\gamma =1.4\). We forgo presenting entropy conservative/stable DG numerical results for the shallow water variant (\(\gamma = 2\)) as they can be found elsewhere in the literature, e.g. [46].

5.1 Isothermal flow

Here we take \(\gamma =1\) and the speed of sound to be \(c=1\).

5.1.1 Convergence

We use the manufactured solution (5.1) and additional residual (5.2) to investigate the accuracy of the DG approximation for two polynomial orders \(N=3\) and \(N=4\). Further, we examine the convergence rates of the entropy conservative DGSEM where \({\mathbf {F}}^{\#}={\mathbf {F}}^{*}={\mathbf {F}}^{{\mathrm {EC}}}\) (the flux from Theorem 3.1) as well as the entropy stable DGSEM where \({\mathbf {F}}^{\#}={\mathbf {F}}^{{\mathrm {EC}}}\) (the flux from Theorem 3.1) and \({\mathbf {F}}^{*} = {\mathbf {F}}^{{\mathrm {ES}}}\) (the flux from Theorem 3.2). We run the solution up to a final time of \(T=1.0\) We compute the \(L^2\) error in the density between the approximation and the manufactured solution of different mesh resolution for each polynomial order. In Table 1 we present the experimental order of convergence (EOC) for the entropy conservative DGSEM. We observe an odd/even effect, that is an EOC of N for odd polynomial orders and \(N+1\) for even polynomial orders, which has been previously observed, e.g. [23, 27]. This is particularly noticeable for higher resolution numerical tests. Table 2 gives the EOC results for the entropy stable DGSEM where there is no longer an odd/even effect and the convergence rate is \(N+1\), as expected for a nodal DG scheme, e.g. [4, 27].

Table 1 Experimental order of convergence (EOC) for the entropy conservative DG approximation of the isothermal Euler with \(c=1\)
Table 2 Experimental order of convergence (EOC) for the entropy stable DG approximation of the isothermal Euler with \(c=1\)

5.1.2 Entropy conservation and stability tests

For the test of entropy conservation we compute the entropy residual (5.5) for two polynomial orders, \(N=3\) and \(N=4\), and different mesh resolutions. We select the volume and surface fluxes to be \({\mathbf {F}}^{\#}={\mathbf {F}}^{*}={\mathbf {F}}^{{\mathrm {EC}}}\) (the flux from Theorem 3.1). We see in Table 3 that the magnitude of the entropy residual is on the order of machine precision for the discontinuous initial condition (5.3) for all resolution configurations.

Table 3 Entropy conservation test for the DG approximation of the isothermal Euler with \(c=1\)

To numerically verify the entropy stability statement (5.8) we activate interface dissipation terms of the form given in Theorem 3.2. That is, we select the volume flux to be \({\mathbf {F}}^{\#}={\mathbf {F}}^{{\mathrm {EC}}}\) and surface fluxes to be \({\mathbf {F}}^{*}={\mathbf {F}}^{{\mathrm {ES}}}\). We use the discontinuous initial condition (5.3) and apply the DG approximation with the polynomial orders \(N=3\) and \(N=4\) each on a mesh with \(N_{\mathrm {el}}=50\) Cartesian elements. In Fig. 1 we present the time evolution of the (normalized) integrated entropy up to a final time \(T=0.25\). We see that the entropy decays from its initial value. Also, we see that increasing the resolution for the higher polynomial order reduces the amount of entropy dissipation in the run.

Fig. 1
figure 1

Temporal evolution of the normalized integrated entropy S (5.6) for the isothermal Euler equations with the discontinuous initial condition (5.3). The simulation runs to a final time of \(T=0.25\) for two polynomial orders \(N=3\) and \(N=4\) each with \(N_{\mathrm {el}}=50\) uniform Cartesian elements

5.2 Polytropic flow

Here we take \(\gamma =1.4\) and the scaling factor to be \(\kappa =0.5\).

5.2.1 Convergence

The formulation of the convergence test is very similar to those discussed in Sect. 5.1.1 where we use the manufactured solution (5.1) and additional residual (5.2) to investigate the accuracy of the DG approximation for two polynomial orders \(N=3\) and \(N=4\). We run the solution up to a final time of \(T=1.0\) and compute the \(L^2\) error in the density. Table 4 gives the EOC for the entropy conservative DGSEM where we observe an odd/even effect with respect to the polynomial order of the approximation. The entropy stable EOC results in Table 5, again, show optimal convergence order of \(N+1\) and no such odd/even effect.

Table 4 Experimental order of convergence (EOC) for the entropy conservative DG approximation of the polytropic Euler with \(\kappa =0.5\)
Table 5 Experimental order of convergence (EOC) for the entropy stable DG approximation of the polytropic Euler with \(\kappa =0.5\)

5.2.2 Entropy conservation and stability tests

Just as in Sect. 5.1.2 to verify entropy conservation we compute the entropy residual (5.5) for two polynomial orders, \(N=3\) and \(N=4\), and different mesh resolutions. The volume and surface fluxes are both taken to be the entropy conservative flux from Theorem 3.1. Table 6 shows that the entropy residual for the polytropic test is on the order of machine precision for the discontinuous initial condition (5.3) and all resolution configurations.

Table 6 Entropy conservation test for the DG approximation of the polytropic Euler with \(\kappa =0.5\)

We also verify the claim of entropy stability numerically for the polytropic Euler equations. We activate interface dissipation, again, taking the volume flux to be the entropy conservative form from Theorem 3.1 and the surface fluxes to be the form given in Theorem 3.2. We use the discontinuous initial condition (5.3) and apply the DG approximation with the polynomial orders \(N=3\) and \(N=4\) each on a mesh with \(N_{\mathrm {el}}=50\) Cartesian elements. We present in Fig. 2 the time evolution of the (normalized) integrated entropy up to a final time \(T=0.25\). Just as with the isothermal result in Sect. 5.1.2, we see that the entropy decays from its initial value and the amount of dissipation decreases for increased spatial resolution.

Fig. 2
figure 2

Temporal evolution of the normalized integrated entropy S (5.6) for the polytropic Euler equations with the discontinuous initial condition (5.3). The simulation runs to a final time of \(T=0.25\) for two polynomial orders \(N=3\) and \(N=4\) each with \(N_{\mathrm {el}}=50\) uniform Cartesian elements

6 Conclusions

In this work we developed entropy conservative (and entropy stable) numerical approximations for the Euler equations with an equation of state that models a polytropic gas. For this case the pressure is determined from a scaled \(\gamma \)-power law of the fluid density. In turn, the total energy conservation equation became redundant and it was removed from the polytropic Euler system. In fact, the total energy acted as a mathematical entropy function for the polytropic Euler equations where its conservation (or decay) became an auxiliary condition not explicitly modeled by the PDEs.

We analyzed the continuous entropic properties of the polytropic Euler equations. This provided guidance for the semi-discrete entropy analysis. Next, we derived entropy conservative numerical flux functions in the finite volume context that required the introduction of a special \(\gamma \)-mean, which is a generalization of the logarithmic mean present in the adiabatic Euler case. Dissipation matrices were then designed and incorporated to guarantee the finite volume fluxes obeyed the entropy inequality discretely. We also investigated two special cases of the polytropic system that can be used to model isothermal gases (\(\gamma =1\)) or the shallow water equations (\(\gamma =2\)). The finite volume scheme was extended to high-order spatial accuracy through a specific discontinuous Galerkin spectral element framework. We then validated the theoretical analysis with several numerical results. In particular, we demonstrated the high-order spatial accuracy and entropy conservative/stable properties of the novel numerical fluxes for the polytropic Euler equations.