1 Introduction

Many problems in natural sciences and engineering are modelled by hyperbolic balance laws. One such system is the shallow water (SW) equations used in many geophysical processes such as river flows or coastal areas but can be also applied to atmospheric flows. The application of the SW is widespread and the development of effective and accurate numerical methods for the SW equations has received much interest in the last decades, and it is still ongoing, cf. [9, 10, 31, 32, 43, 56] and references therein. In particular, the construction of entropy (energy) conservative (dissipative) methods has been of great interest [10, 17, 21, 30, 51]. Contrarily, in many real applications and models real data are applied which come with uncertainties due to empirical approximations or measuring errors resulting in a stochastic partial differential system. In the context of hyperbolic conservation/balance laws, uncertainties can appear in the source terms, initial or boundary data or even the fluxes and different approaches exist to solve such stochastic PDE systems. Classical techniques are either stochastic collocation (SC), Monte Carlo (MC) algorithms, or the generalized Polynomial Chaos (gPC) approach (using a stochastic Galerkin (SG) ansatz), cf. [14, 33, 37, 39, 46, 50, 58, 57]. All of them (SC, MC, or SG) come with some advantages and disadvantages, and a nice summary in the context of hyperbolic equations can be found in [2]. In this manuscript, we focus on the gPC (SG) approach in the context of the SW equations with uncertainties. The SG ansatz applied to stochastic hyperbolic equations yields an augmented purely deterministic system, denoted as the SG system in the following, where classical solvers (MUSCL, FV, DG) can be used. However, a drawback of this approach is that one may lose the hyperbolicity of the SG system [14] and classical solvers in general fail to solve the extended system due to its ill-posedness. Further, the question rises about what kind of underlying structures we want to preserve, like what kind of entropies we have. To overcome the loss of the hyperbolicity, different techniques have been already proposed. Inspired by the kinetic theory, the entropy closure methods [40] or filtering procedures to ensure the hyperbolicity [15, 44] have been developed. Alternatively, it was demonstrated in [59] that by a pseudo-spectral approach with suitable quadrature rules, one can rewrite the SG scheme as an SC scheme on a set of specific nodes. The collocation scheme preserves the hyperbolicity of the original hyperbolic system. Also, recently, it has been demonstrated in [12, 13] that only a finite collection of positivity conditions on the stochastic water height at selected quadrature points in the parameter space is enough to preserve the hyperbolicity in the SG system. Alternatively, by introducing Roe variables directly inside the Galerkin projections one can as well ensure the hyperbolicity of the SG system [38, 39] but the question about the definition and existence of entropies rises. In recent works [22, 23], the authors were finally able to determine entropies for several hyperbolic SG systems, in particular the SW system (SG-SW). In the following manuscript, we use this new development and construct a high-order entropy conservative discontinuous Galerkin (DG) method for the SG-SW system. Different from the recent paper [59], our approach is truly intrusive, by which we mean that all integrals of the Galerkin ansatz are exactly computed in a pre-computation step and not during a simulation. We apply the flux differencing [7, 21, 41] ansatz in our DG formulation. The main idea is to use a split formulation inside the discretization, where the splitting is determined by entropy conservative numerical fluxes (in the sense of Tadmor [48]). To determine entropy conservative numerical fluxes, the flux potential is needed, and we derive for our entropy-entropy flux pair from [22] a flux potential. We use this potential finally to develop, in an analogous manner as in [35], an entropy conservative, numerical flux for our SG-SW system. Our result yields a new reliable numerical method for SW equations with uncertainties.

The paper is organized as follows. In Sect. 2, the numerical framework is introduced. We focus on the discontinuous Galerkin spectral element method (DGSEM) using a flux differencing approach. If entropy conservative fluxes are applied inside the discretization, we obtain a provable entropy conservative (dissipative) scheme. We also introduce in this section the gPC approach. Afterwards, in Sect. 3 the SW equation with uncertainty is introduced together with the Roe variable transformation, and the SG approach is used to determine the augmented system and derive the entropy-entropy flux pair following [22]. In Sect. 4, we derive first the entropy flux potential for the entropy-entropy flux pair and use it to develop entropy conservative numerical fluxes for the augmented SG-SW system. In numerical simulations in Sect. 5, we give a proof of concept that the application of such fluxes inside the DGSEM-flux differencing method results in an entropy conservative high-order scheme. A summary with an outlook finishes the main part of the manuscript where in Appendix A the concrete formulas of the flux potentials and numerical fluxes can be found up to the second-order series expansion of the SG approach together with some basic properties of the Haar wavelet expansions. By slide modifications, we explain also how to include bottom topography inside our study, and we specify an entropy conservative numerical flux with bottom topography for completeness.

2 Numerical Framework

In the following section, we shortly repeat the numerical framework which we use inside the manuscript. In particular, we introduce the DGSEM and explain how we can ensure entropy conservation (dissipation) for the scheme. Afterwards, we shortly introduce the gPC approach. This framework is used to extend the SW equations in the next section for which we will finally construct an entropy conservative (dissipative) method.

2.1 Discontinuous Galerkin Spectral Element Method (DGSEM)

There exist various approaches to construct entropy conservative (dissipative) numerical methods for hyperbolic conservation/balance laws, cf. [1, 3, 4, 8, 16,17,18,19, 28, 29, 34, 36] and references therein. In our work, we focus on the DG method with flux differencing ansatz as described in [7, 20] and used in the SW context in [21, 41, 51, 53, 54]. To clarify the method we start with a nodal DG scheme using summation-by-parts (SBP) operators and consider for simplicity the hyperbolic conservation law:

$$\begin{aligned} \partial _t u(t,x)+ \partial _{x} {f(u(t,x))}=0. \end{aligned}$$

As usual in finite elements, we make a domain decomposition \(x_{1/2}<x_{3/2}<\cdots < x_{N+1/2},\; \Omega _i=[x_{i-1/2},x_{i+1/2}], \Delta x_i=x_{i+1/2}-x_{i-1/2}\). Instead of calculating everything in \(\Omega _i\), every element is mapped into the standard element \([-1,1]\) where all the calculations are done.

In classical DG, we multiply with a test function \(v^h \in \mathcal {V}^{h}\) where \(\mathcal {V}^{h}\) is our solution space (broken polynomial space) and integrate in space. Then, we seek \(u^h \in \mathcal {V}^h\) such that for each \(v^h\in \mathcal {V}^h\) and \(1\leqslant i\leqslant N\):

$$\int _{\Omega _i} \frac{\partial u^h }{\partial t} v^h {\mathrm{d}{x}} -\int _{\Omega _i} f(u^h) \frac{\partial v^h}{\partial x} {\mathrm{d}{x}} = f^\mathrm{num}_{i-1/2}v^h(x_{i-1/2}^+)-f^\mathrm{num}_{i+1/2} v^h(x_{i+1/2}^-),$$
(1)

where we used integration-by-parts once to shift the derivative from the flux function to the test function. The right side corresponds to the boundary values. Since the flux functions at the boundaries are not unique, numerical fluxes have to be applied. Further, the test function \(v^h\) is evaluated also at the boundary where the superscript ± denotes the left or right value between two neighbouring elements specifying which approximations have to be used.

Instead of working with (1), we use integration-by-parts again and obtain the strong form

$$\begin{aligned} \int _{\Omega _i} \left( \frac{\partial u^h }{\partial t}+\frac{\partial f(u^h) }{\partial x} \ \right) v^h {\textrm{d}{x}}&=\left( f(u^h(t, x_{i+1/2}^-)) -f^\textrm{num}_{i+1/2} \right) v^h(x_{i+1/2}^-) \\&\quad - \left( f(u^h(t, x_{i-1/2}^+)) -f^\textrm{num}_{i-1/2} \right) v^h(x_{i-1/2}^+). \end{aligned}$$

Focusing now on the reference element, instead of evaluating the integrals exactly, we apply the Gauss-Lobatto quadrature \(-1=\xi _0<\xi _1<\cdots <\xi _p=1\) with corresponding quadrature weights \(\{\omega _j\}_{j=0}^p\). Further, we use a Lagrangian nodal basis for these quadrature points, i.e., \(L_j(\xi _l)=\delta _{jl}\), and define the discrete inner \(\left\langle u,v\right\rangle _{\omega }=\sum \nolimits _{j=0}^p \omega _j u(\xi _j) v(\xi _j)\). To make the connection to the SBP operators, we have

  • difference matrix \(\underline{\underline{D}}\) with \(\underline{\underline{D}}_{jl} =L_l'(\xi _j);\)

  • mass matrix \(\underline{\underline{M}}_{jl}=\left\langle L_j,L_l\right\rangle _{\omega } =\omega _j \delta _{jl}\), so that \(\underline{\underline{M}} = \mathop {\textrm{diag}}\{\omega _0, \cdots , \omega _p\};\)

  • stiffness matrix \(\underline{\underline{Q}}_{jl}=\left\langle L_j',L_l\right\rangle _{\omega } =\left\langle L_j,L_l'\right\rangle _{\omega }\), boundary matrix \(\underline{\underline{B}}=\mathop {\textrm{diag}}(-1,0,\cdots ,0,1).\)

The above operators fulfil the SBP property as shown for instance in [7, Theorem 3.1]. In our nodal DG formulation, we approximate the flux function as well by a polynomial and since \(v^h\) has been arbitrary, we get the strong DG scheme for one node

$$\begin{aligned} \frac{\Delta x}{2} \partial _t u_j + \sum _{l=0}^p D_{jl} f_l= \frac{\tau _j}{w_j}\left( f_j-f^\textrm{num}_j\right), \end{aligned}$$
(2)

where \(\tau _j \in \{-1,0,1\}\) depending which node is considered. Finally, a system of equations is obtained. Method (2) is referred to as the DGSEM. However, in general, this method is not entropy conservative (dissipative). To ensure the entropy conservation, we have to modify the scheme and use suitable numerical fluxes. Therefore, we assume that the entropy function \(\eta\) is strictly convex, defining the entropy variable \(v=\eta '(u)=: \partial _u \eta (u)\). Due to the strictly convex entropy function \(\eta\), there exists as well a potential \(\psi '(v)= f(u(v))\). A consistent, symmetric two-point numerical flux \(f^\textrm{num}(u_{ {l}}, u_{ {r}})\) is called entropy conservative (dissipative) (in the sense of Tadmor) if it satisfies

$$\begin{aligned}{}[[v]]f^\textrm{num}(u_l, u_r) {\mathop {=}\limits ^{(\leqslant )}} [[\psi ]] \Longleftrightarrow (v_r-v_l) f^\textrm{num}(u_l, u_r) {\mathop {=}\limits ^{(\leqslant )}} (\psi _r-\psi _l). \end{aligned}$$
(3)

Here, \(v_l, v_r\) and \(\psi _l, \psi _r\) are the entropy variables and potential at the left and right states, whereas \([[\cdot ]]\) denotes the jump, cf. [48, 49] for more details. Combing back to the DG formulation to balance the internal entropy, we use a split formulation. The scheme reads than

$$\begin{aligned} \frac{\Delta x}{2} \partial _t u_j + 2\sum _{l=0}^p D_{jl} f^\textrm{num}_S(u_j,u_l)= \frac{\tau _j}{w_j}\left( f_j-f^\textrm{num}_j\right) , \end{aligned}$$
(4)

where \(f^\textrm{num}_S\) are numerical two-point fluxes. Finally, the properties of the scheme depend highly on the selected fluxes as the following theorem describes, cf. [7, Sect. 3].

Theorem 1

(Flux differencing theorem) If \(f^\textrm{num}_S(u_j,u_l)\) is consistent and symmetric, then (4) is conservative and high-order accurate. If we further assume that \(f^\textrm{num}_S(u_j,u_l)\) is entropy conservative (3), then (4) is also entropy conservative within a single element. If \(f^\textrm{num}\) is further entropy conservative (dissipative), then the resulting scheme is entropy conservative (dissipative) in general.

Because of this theorem, it is enough to construct consistent, symmetric, and entropy-conservative fluxes to develop a high-order entropy-conservative scheme. This will be the major part in Sect. 4.

Remark 1

The considerations can be extended to multi-dimensional space dimensions using a tensor-product strategy. Additionally, it is possible to get diagonal operators for triangle grids if enough nodes are added at the boundaries.

To obtain an entropy dissipative scheme, an entropy dissipative flux has to be used at the element interfaces. By adding artificial dissipation (in the local Lax-Friedrich sense) to our entropy conservative flux, we would obtain an entropy dissipative flux and use it for \(f^\textrm{num}\) an entropy dissipative scheme, cf. [35].

2.2 Polynomial Chaos for Hyperbolic System

We introduce the gPC expansion referring to [22, 35, 38], which aims to express the stochastic problem in a deterministic surrounding and use classical numerical schemes. Therefore, let \((\Omega ,\mathbb {F},\mathbb {P})\) be a probability space with the event space \(\Omega\), and the probability measure \(\mathbb {P}\) defined on the \(\sigma\)-field \(\mathbb {F}\). We consider \(\xi = \{\xi _k(\omega )\}^N_{j=0}\) the set of N independent and identically distributed random variables for \(\omega \in \Omega\). Based on that, we introduce the function space

$$\begin{aligned} \mathbb {L}^2 (\Omega ,\mathbb {P}):= \left\{ Z \vert Z{:} \,\Omega \rightarrow \mathbb {R} \,\, \text {measurable, } \,\, \Vert Z\Vert < \infty \right\} \end{aligned}$$

with the scalar product

$$\begin{aligned} {\langle Z_1 Z_2\rangle }:= \int Z_1 Z_2 \textrm{d} \mathbb {P}. \end{aligned}$$
(5)

We denote by \(\{\phi _k(\xi ) \}_{k=0}^\infty\) for \(\mathbb {L}^2 (\Omega ,\mathbb {P})\) a set of orthogonal basis functions. Focusing on our conservation law, we are interested in quantities u which now are not only dependent on the space x and the time t but also influenced by the random variable \(\xi\), i.e., \(u(t,x,\xi )\) is searched. We proceed analogously to the deterministic case and expand the weak formulation by \(u(t,x;\,{\xi })\). This leads us to

$$\begin{aligned} \int _0^{\text {T}} \int _{\mathbb {R}} \mathbb {E} \Bigl [ \Big(u(t,x;\,{\xi })\cdot \frac{\partial {\varphi }}{\partial t} + f(u(t,x;\,\xi ))\cdot \frac{\partial {\varphi }}{\partial x} \Big)\phi _k(\xi )\Bigr ] \textrm{d}x\textrm{d}t = 0, \end{aligned}$$

where the expected value with corresponding \(\phi _k\) contains the integration over \(\xi,\) i.e.,

$$\begin{aligned} \mathbb {E}[u(x,t;\,\xi )] = \int _{\Omega } u(x,t;\,\xi (\omega ))\textrm{d}\mathbb {P}(\omega ) = \int _\mathbb {R}u(x,t;\,y)\rho (y)\textrm{d}y. \end{aligned}$$

Here, \(\rho\) denotes the probability density function. As mentioned in [2, 52], the foundation of gPC is to use the spectral expansion

$$\begin{aligned} u(x,t;\,\xi ) = \sum _{k=0}^{\infty } u_k(t,x)\phi _k \end{aligned}$$
(6)

for a random field. The set of coefficients \(\{u_k(x,t)\}\) is purely deterministic and has to be calculated using our favourite numerical method. Now the gPC is introduced as a set of orthogonal subspaces \(\hat{S} _k \subset \mathbb {L}^2(\Omega ,\mathbb {P})\) with \(S _K:= \bigoplus \limits _{k=0}^K \hat{S} _k \rightarrow \mathbb {L}^2(\Omega ,\mathbb {P}) \quad \textrm{for} \quad K \rightarrow \infty .\) We consider now the projection operator onto the gPC basis of the degree \(K \in \mathbb {N}_0\). It is

$$\begin{aligned} G _K[u](t,x; \,\xi ):= \sum _{k=0}^K\hat{u}_k(t,x)\phi _k(\xi ), \quad \hat{u}_k(t,x):= \frac{\langle u(t,x;\,\cdot )\phi _k( \cdot ) \rangle }{\Vert \phi _k\Vert ^2}, \end{aligned}$$
(7)

which approximates for any fixed (tx) the solution. The convergence of \(G_K\) to u for \(K \rightarrow \infty\) is ensured by the Cameron-Martin theorem [6], i.e., it guarantees, that the truncated series expansion (7) converges to the spectral expansion (6). Later, we calculate \(\hat{u}_k\) using our spectral Galerkin ansatz. Through straightforward calculations, we have for the first two moments using an orthogonal basis:

  • expected value

    $$\begin{aligned} \begin{aligned} \mathbb {E}\left[ G _K[u]\right] (t,x)&= \hat{u}_0(x,t) \int _{\mathbb {R}} \phi _0(y)\rho (y)\textrm{d}y + \int _{\mathbb {R}} \sum _{k=1}^K \hat{u}_k(x,t)\phi _k(y)\rho (y)\textrm{d}y=\hat{u}_0(x,t); \end{aligned} \end{aligned}$$
  • variance

    $$\begin{aligned} \begin{aligned} \textrm{Var}\left[ G _K[u]\right] (t,x)&= \mathbb {E}[\hat{u}^2(x,t;\,\cdot )]-\mathbb {E}^2[\hat{u}(x,t;\,\cdot )] \sum _{k=1}^K \hat{u}_k^2(x,t) \mathbb {E}[\phi ^2_k] = \sum _{k=1}^K \hat{u}_k^2(x,t). \end{aligned} \end{aligned}$$

Additionally, we assume for simplicity normed basis functions, i.e., \(\Vert \phi _k\Vert =1\). For our later considerations, we need the following operator, called the Galerkin product. It is given by

$$\begin{aligned} \begin{aligned} \hat{G} _K[y,z](t,x;\,\xi )&:= \sum _{k=0}^K(\hat{y}*\hat{z})_k(t,x)\phi _k(\xi ) \end{aligned} \end{aligned}$$
(8)

with \((\hat{y}*\hat{z})_k(t,x):= \sum _{i,j=0}^K\hat{y}_i(t,x)\hat{z}_j(t,x)\langle \phi _i \phi _j \phi _k \rangle\). This can be reformulated using the symmetric matrix \(\mathcal {P}(\hat{y}):= \sum _{l=0}^{K} \hat{y}_{l} M_l^K \quad \textrm{with} \quad M_l^K:= \left( \langle \phi _l \phi _i \phi _j \rangle \right) _{i,j = 0, \cdots , K}.\) We obtain \(\hat{y}*\hat{z} = \mathcal {P}(\hat{y})\hat{z}\) and \(\mathcal {P} \in \mathbb {R}^{(K+1)\times (K+1)}\). The product in M is derived from the scalar product (5) and reads as \(\langle \phi _l \phi _i \phi _j \rangle = \int _\Omega \phi _l(\xi )\phi _i(\xi )\phi _j(\xi ) \textrm{d}\mathbb {P}.\) In our further computations, we reduce the set

$$\begin{aligned} \mathbb {H}^+:=\left\{ \hat{u}\in \mathbb {R}^{K+1} \vert \mathcal {P}(\hat{u}) \ \textrm{is} \ \textrm{strictly} \ \textrm{positive} \ \textrm{definite}\right\} . \end{aligned}$$
(9)

This condition is fulfilled if we have a positive expansion [25, 47]. We will not introduce that technically, but explain what it means for our model in Sect. 3. We need to make an additional note on some properties of the matrix \(\mathcal {P}({\hat{\alpha }})\) from [22].

Lemma 1

The following properties are equivalent for the matrix \(\mathcal {P}(\alpha )\), which is defined as above:

  1. i.

    the precomputed matrices \(\mathcal {M}_l\) and \(\mathcal {M}_k\) commute for all \(l,k = 0, \cdots ,K;\)

  2. ii.

    the matrices \(\mathcal {P}({\hat{\alpha }})\) and \(\mathcal {P}({\hat{\beta }})\) commute for all \({\hat{\alpha }}, {\hat{\beta }} \in \mathbb {R}^{K+1};\)

  3. iii.

    there is an eigenvalue decomposition \(\mathcal {P}({\hat{\alpha }})=VD_{\mathcal {P}}({\hat{\alpha }})V^{\text {T}}\) with constant eigenvectors.

These properties are important but not universal. We call bases that satisfy Lemma 1 Haar type bases. Those are rare and have to be well-chosen. The Haar-wavelets used later are such a basis, whereas classical orthogonal polynomials are not. Finally, we fix the following property of \(\mathcal {P}({\hat{\alpha }})\) which is needed later.

Lemma 2

Property of \(\mathcal {P}({\hat{\alpha }})\). For any \({\hat{\alpha }},{\hat{\beta }},{\hat{\gamma }} \in \mathbb {R}^{K+1}\), it holds \({\hat{\alpha }}^{\text {T}} \mathcal {P}({\hat{\gamma }}){\hat{\beta }} = {\hat{\beta }}^{\text {T}}\mathcal {P}({\hat{\gamma }}){\hat{\alpha }}.\)

Proof

We consider the transposition \(\left( {\hat{\alpha }}^{\text {T}} \mathcal {P}({\hat{\gamma }}){\hat{\beta }}\right) ^{\text {T}} = {\hat{\beta }}^{\text {T}} \mathcal {P}({\hat{\gamma }})^{\text {T}}{\hat{\alpha }} = {\hat{\beta }}^{\text {T}} \mathcal {P}({\hat{\gamma }}){\hat{\alpha }}.\) The last equality holds due to the symmetry of \(\mathcal {P}({\hat{\gamma }})\). The assertion follows because \({\hat{\alpha }}^{\text {T}} \mathcal {P}({\hat{\gamma }}){\hat{\beta }}\) is a scalar.

3 Shallow Water (SW) Equations with Uncertainties

In the following section, we shortly repeat the SW model with uncertainty together with Roe variable transformation and introduce the entropy-entropy flux pair from [22]. The SW system can be derived from the Navier-Stokes equations and is defined in the one-dimensional case via

$$\begin{aligned} \frac{\partial }{\partial t} \begin{pmatrix} h \\ h\textsf {v}\end{pmatrix} + \frac{\partial }{\partial x} \begin{pmatrix} h\textsf {v}\\ h\textsf {v}^2 + \frac{1}{2}gh^2 \end{pmatrix} = \begin{pmatrix} 0 \\ gh \frac{\partial }{\partial x}b, \end{pmatrix}, \end{aligned}$$
(10)

where h denotes the water height, \(\textsf {v}\) the velocity, g the gravitational constant, and b the bottom topography. The first equation describes the balance of mass and the second one the balance of momentum \(q=h\textsf {v}\). The conserved vector is \(u=(h, q)^{\text {T}}\). The right-hand side denotes the source terms (here only bottom topography) but could also include Coriolis force and friction. For simplicity, we assume flat bathymetry (\(b\equiv 0\)) in the following. Instead of having a purely deterministic system (10), we have an additional random input \(\xi\) and the stochastic SW reads

$$\begin{aligned} \frac{\partial }{\partial t} \left( \begin{array}{c}h(t,x;\, \xi ) \\ q(t,x;\, \xi ) \end{array} \right) + \frac{\partial }{\partial x} \left( \begin{array}{c} q(t,x;\, \xi ) \\ \frac{q^2 (t,x;\, \xi )}{h(t,x;\, \xi )} + \frac{1}{2}gh^2(t,x;\, \xi ) \end{array} \right) =0. \end{aligned}$$
(11)

As demonstrated in [14], using an SG extension of (11) we lose the hyperbolicity of the system. Therefore, we introduce first the Roe variable transformation for the SWE.

Definition 1

(Roe variables) With the velocity \(\textsf {v}(u):=\frac{q}{h}\) as auxiliary variables the Roe variables are defined as \(\omega :=(\alpha ,\beta ):= \left( \sqrt{h},\sqrt{h}\textsf {v}(y)\right)\) and the gPC modes as \({\hat{\omega }}:=({\hat{\alpha }},{\hat{\beta }})\) for \({\hat{\alpha }} \in \mathbb {H}^+\) defined on the set

$$\begin{aligned} \mathbb {H}^+= \{{\hat{\alpha }} \in \mathbb {R}^{K+1} \vert \mathcal {P}({\hat{\alpha }})\ \text {is strictly positive definite} \}. \end{aligned}$$

The mapping between Roe and conserved variables is

$$\begin{aligned} &\mathcal {Y}{:} \, \mathbb {R}^+ \times \mathbb {R} \quad \rightarrow \mathbb {R}^+ \times \mathbb {R},\qquad {\hat{\omega }} \mapsto \left( \begin{array}{l} \alpha ^2 \\ \alpha \beta \end{array} \right) \,\, =u \quad {\mathrm{for}} \quad K=0, \\ &\hat{{\mathcal{Y}}}{:} \, \mathbb {H}^+ \times \mathbb {R}^{K+1} \rightarrow \left( \mathbb {R}^+ \times \mathbb {R}^K \right) \times \mathbb {R}^{K+1}, \quad {\hat{\omega }} \mapsto \left( \begin{array}{l} {\hat{\alpha }} * {\hat{\alpha }} \\ {\hat{\alpha }}*{\hat{\beta }} \end{array} \right) = \hat{u} \quad \mathrm{for} \quad K \in \mathbb {N}. \end{aligned}$$

Therefore, all predefinitions are set to apply the SG formulation with the Roe variable transformation on the SW equations. A formulation of SW in terms of Roe variables is given through

$$\begin{aligned} \frac{\partial }{\partial t} \left( \begin{array}{c}\alpha ^2(t,x;\, \xi ) \\ \alpha \beta (t,x;\, \xi ) \end{array} \right) + \frac{\partial }{\partial x} \left( \begin{array}{c} (\alpha \beta ) (t,x;\, \xi ) \\ \beta ^2(t,x;\, \xi ) + \frac{1}{2}g\alpha ^4(t,x;\, \xi ) \end{array} \right) =0. \end{aligned}$$

The SG expansion leads us to

$$\begin{aligned} \left\langle \frac{\partial }{\partial t} \left( \begin{array}{c} \hat{\mathcal {G}}_K [\alpha ,\alpha ](t,x;\, \xi ) \\ \hat{\mathcal {G}}_K [\alpha ,\beta ] (t,x;\, \xi ) \end{array} \right) + \frac{\partial }{\partial x}\left( \begin{array}{c} \hat{\mathcal {G}}_K[\alpha ,\beta ](t,x;\, \xi ) \\ \hat{\mathcal {G}}_K [\beta ,\beta ](t,x;\, \xi )+ \frac{1}{2}g \hat{\mathcal {G}}_K^4 [\alpha ] (t,x;\, \xi ) \end{array}\right) ,\phi _k(\xi ) \right\rangle = 0, \end{aligned}$$
(12)

where \(\mathcal {G}\) denotes the Galerkin product (8). We need the Roe variable formulation to ensure the hyperbolicity. We work with the gPC modes of (12) and obtain

$$\begin{aligned} \left( \begin{array}{c} {\hat{\alpha }}*{\hat{\alpha }} \\ {\hat{\alpha }}*{\hat{\beta }} \end{array} \right) _t + \left( \begin{array}{c} {\hat{\alpha }}*{\hat{\beta }} \\ {\hat{\beta }}*{\hat{\beta }} + \frac{1}{2}g ({\hat{\alpha }}*{\hat{\alpha }})*({\hat{\alpha }}*{\hat{\alpha }}) \end{array} \right) _x = 0 \end{aligned}$$

with the flux function \(\hat{f} (\hat{u}):= \hat{f}_1 (\hat{u}) + \hat{f}_2(\hat{u})\) formulated in conservative variables \(\hat{u} = \hat{\mathcal {Y}}({\hat{\omega }})\) for

$$\begin{aligned} \hat{f}_1 (\hat{u}):= \left( \begin{array}{c} \hat{q} \\ \frac{1}{2}g \hat{h}*\hat{h} \end{array}\right) \quad \textrm{and} \quad \hat{f}_2 (\hat{u}):= \tilde{f}\left( \hat{\mathcal {Y}}^{-1} (\hat{u}) \right) := \left( \begin{array}{c} 0 \\ {\hat{\beta }}*{\hat{\beta }} \end{array}\right) . \end{aligned}$$
(13)

To express the entropy-entropy flux pair and to derive later the potential and the numerical fluxes, we introduce some additional variables to express the expanded system similar to the original one in conservative variables. Further, we introduce matrices to simplify the notation which will be useful due to some technical parts in the proofs later.

Definition 2

Similar to the velocity in the deterministic case, we define \({\hat{\textsf {v}}}({\hat{\omega }}):= \mathcal {P}^{-1}({\hat{\alpha }}){\hat{\beta }}, \; {\hat{\textsf {v}}}^2({\hat{\omega }}):= \mathcal {P}_2({\hat{\omega }}){\hat{\beta }}\) with the matrices representation \(\mathcal {P}_1({\hat{\omega }}):=\mathcal {P}({\hat{\beta }})\mathcal {P}^{-1}({\hat{\alpha }}) \quad \textrm{and} \quad \mathcal {P}_2({\hat{\omega }}):=\mathcal {P}({\hat{\beta }})\mathcal {P}^{-2}({\hat{\alpha }}).\)

Finally, we have all the ingredients to repeat the main result of [22] the definition of an entropy-entropy flux pair for SW equations.

Theorem 2

(SW equations [22]) Let a Haar type expansion be given, and let states in the open, admissible set

$$\begin{aligned} \mathbb {H}=\left\{ \hat{u}:=(\hat{h},\hat{q})^{\text {T}} \in \left( \mathbb {R}^+ \times \mathbb {R}^{K} \right) \times \mathbb {R}^{K+1} \vert {\hat{\alpha }} \in \mathbb {H}^+ \quad {for} \quad ({\hat{\alpha }},{\hat{\beta }})^{\text {T}} = \hat{\mathcal {Y}}^{-1}(\hat{u}) \right\} \end{aligned}$$

be given. Then, the Jacobian of the flux function (13) is

$$\begin{aligned} \textrm{D}_{\hat{u}} \hat{f}(\hat{u}) = \begin{pmatrix} {\textbf {0}} &{} \quad {\textbf {1}} \\ g\mathcal {P}(\hat{h}) - \mathcal {P}^2_1({\hat{\omega }}) &{} \quad 2\mathcal {P}_1({\hat{\omega }}) \end{pmatrix} \end{aligned}$$

for \({\hat{\omega }}=({\hat{\alpha }}, {\hat{\beta }})\) and \(\mathcal {P}_1({\hat{\omega }}) = \mathcal {P}({\hat{\beta }})\mathcal {P}^{-1}({\hat{\alpha }}).\) The eigenvalue decomposition

$$\textrm{D}_{\hat{u}}\hat{f}(\hat{u}):=[\mathcal {V}\hat{T}({\hat{\omega }})]{\hat{\Lambda }}({\hat{\omega }})[\mathcal {V}\hat{T}({\hat{\omega }}]^{-1}$$

reads as

$$\begin{aligned} {\hat{\Lambda }}^{\pm }({\hat{\omega }})&:=D_{\mathcal {P}}({\hat{\beta }})D^{-1}_{\mathcal {P}}({\hat{\alpha }})\pm \sqrt{gD_{\mathcal {P}}(\hat{h})}, &\quad{\hat{\Lambda }}{({\hat{\omega }})}:={}&\textrm{diag}\{{\hat{\Lambda }}^+({\hat{\omega }}),{\hat{\Lambda }}^-({\hat{\omega }})\},\\ \hat{T}({\hat{\omega }})&:=\begin{pmatrix} {\textbf {1}} &{} {\textbf {1}} \\ {\hat{\Lambda }}^+({\hat{\omega }}) &{} {\hat{\Lambda }}^-({\hat{\omega }}) \end{pmatrix},&{\mathcal {V}}:={}&\textrm{diag}\{V,V\}, \end{aligned}$$

while \(D_{\mathcal {P}}\) results of the eigenvalue decomposition of \(\mathcal {P}\) in Lemma 1. As the entropy-entropy flux pair we obtain \((\eta ,\mu ):= \left( \eta _1 + \eta _2, \mu _1 + \mu _2 \right) (\hat{u})\) with

$$\left\{ \begin{aligned} \begin{aligned}&\eta _1 (\hat{u}):= \frac{g}{2} \Vert \hat{h}\Vert _2^2 \quad {and} \quad \eta _2(\hat{u}):= {\tilde{\eta }}_2 \left( \hat{ \mathcal {Y}}^{-1}(\hat{u}) \right) := \frac{1}{2}\Vert {\hat{\beta }}\Vert _2^2, \\&\mu _1(\hat{u}):= g\hat{h}^{\text {T}}\hat{q} \quad \; \, {and} \quad \mu _2(\hat{u}):={\tilde{\mu }}_2\left( \hat{\mathcal {Y}}^{-1}(\hat{u})\right) := \frac{1}{2}{\hat{\beta }}^{\text {T}}\mathcal {P}_1({\hat{\omega }}){\hat{\beta }}. \end{aligned} \end{aligned}\right.$$
(14)

4 Construction of Entropy Conservative Numerical Fluxes

This is the main part of this current work. We will construct symmetric, consistent, entropy-conservative numerical two-point fluxes according to [48, 49]. Therefore, we need to remind the flux function (13) to compute the flux potential. We denote again by v the entropy variable and \(\mu\) is the entropy flux. Then, the flux potential is defined through

$$\begin{aligned} \psi (v):= \langle v,f(v)\rangle -\mu (u(v)). \end{aligned}$$

To construct the numerical flux, we have to express the above expression in terms according to the used variables. Therefore, we need the entropy variable \(\textrm{D}_{\hat{u}}\eta (\hat{u})\) expressed in conservative variables. We recall Definition 2 and get

$$\begin{aligned} \textrm{D}_{{\hat{\textsf {v}}}}\eta ({\hat{\textsf {v}}}) = \left( g\hat{h}^{\text {T}}-\frac{1}{2}{\hat{\textsf {v}}}^{2^{\text {T}}},{\hat{\textsf {v}}}^{\text {T}}\right) := (v_1^{\text {T}},v_2^{\text {T}}) \quad \textrm{with} \ v_1, v_2 \in \mathbb {R}^{K+1}, \end{aligned}$$
(15)

which leads us to

$$\begin{aligned} \hat{h} = \frac{v_1+\frac{1}{2}v_2^2}{g}, \ \hat{h}\in \mathbb {R}^{K+1}. \end{aligned}$$
(16)

Note that \(v_1, v_2\) are vectors and by a slide abuse of notation we denote \(v_2^2\) to express as well a vector. Then, the sum is well-defined. This definition helps us to treat the vector-valued expression similar to the deterministic case in a component-wise sense. For further computations, we need to put the following property down on \(v_2^2\).

Lemma 3

It holds for the introduced velocity in Definition 2\(v_2 = {\hat{\textsf {v}}} = \mathcal {P}^{-1}({\hat{\alpha }}){\hat{\beta }}\) with its particularly defined square \(v_2^2 = {\hat{\textsf {v}}}^2 = \mathcal {P}_2({\hat{\omega }}){\hat{\beta }}\) for every \(\gamma \in \mathbb {R}^{K+1}\): \((v_2^2)^{\text {T}} \mathcal {P}(\gamma )v_2 = v_2^{\text {T}} \mathcal {P}(\gamma )v_2^2.\)

Proof

The proof is simply calling the definitions and applying the property iii of Lemma 1. We get

$$\begin{aligned} \begin{aligned} (v_2^2)^{\text {T}} \mathcal {P}(\gamma )v_2&= {\hat{\beta }}^{\text {T}}\mathcal {P}^{-2}({\hat{\alpha }})\mathcal {P}({\hat{\beta }})\mathcal {P}(\gamma )\mathcal {P}^{-1}({\hat{\alpha }}{\hat{\beta }} ) \\ {}&= {\hat{\beta }}\mathcal {P}^{-1}({\hat{\alpha }})\mathcal {P}(\gamma )\mathcal {P}({\hat{\beta }})\mathcal {P}^{-2}({\hat{\alpha }}){\hat{\beta }} = v_2^{\text {T}} \mathcal {P}(\gamma )v_2^2. \end{aligned} \end{aligned}$$

We insert now this formulation of \(\hat{h}\) (16) into the flux function. So we have the flux function in terms of the entropy variables. This allows us to go on with the construction. Thus, we receive

$$\begin{aligned} \hat{f}_1\left( \hat{u}(v) \right) = \begin{pmatrix} g\mathcal {P}\left( \frac{v_1+\frac{1}{2}v_2^2}{g} \right) v_2 \\ \frac{1}{2}g\left( \frac{v_1+\frac{1}{2}v_2^2}{g} * \frac{v_1+\frac{1}{2}v_2^2}{g} \right) \end{pmatrix} = \frac{1}{g} \begin{pmatrix} \mathcal {P}\left( v_1+\frac{1}{2}v_2^2\right) v_2 \\ \frac{1}{2}\mathcal {P} \left( v_1+\frac{1}{2}v_2^2\right) \left( v_1+\frac{1}{2}v_2^2\right) \end{pmatrix} \end{aligned}$$

and

$$\begin{aligned} \hat{f}_2 \left( \hat{u}(v)\right) = \begin{pmatrix} 0 \\ \frac{v_1+\frac{1}{2}v_2^2}{g} * v \end{pmatrix} =\frac{1}{g} \begin{pmatrix} 0 \\ \mathcal {P} \left( v_1+\frac{1}{2}v_2^2 \right) v_2^2 \end{pmatrix}. \end{aligned}$$

We apply the variable v from (15) on our entropy flux \(\mu\) (14) and by reformulation, we get

$$\begin{aligned} \begin{aligned} \mu (\hat{u})&= g\hat{h}^{\text {T}}\hat{q} + \frac{1}{2}{\hat{\beta }}^{\text {T}}\mathcal {P}_1({\hat{\omega }}){\hat{\beta }} {\mathop {=}\limits ^{*}}g\hat{h}^{\text {T}}\mathcal {P}(\hat{h})v_2+\frac{1}{2}{\hat{\beta }}^{\text {T}}\mathcal {P}({\hat{\beta }})\mathcal {P}^{-1}({\hat{\alpha }}){\hat{\beta }}\\&= g\hat{h}^{\text {T}}\mathcal {P}(\hat{h})v_2+\frac{1}{2}({\hat{\beta }}*{\hat{\beta }})v_2 = g\hat{h}^{\text {T}}\mathcal {P}(\hat{h})v_2+\frac{1}{2}\left( v_2^2\right) ^{\text {T}} \mathcal {P}(\hat{h})v_2. \end{aligned} \end{aligned}$$

For \(*\), we apply for the first term that \({\hat{\textsf {v}}}^{\text {T}}({\hat{\omega }})\mathcal {P}(\hat{h}) = ({\hat{\alpha }} * {\hat{\beta }})^{\text {T}}\) holds and for the second one, we use just the definition of \(\mathcal {P}_1({\hat{\omega }})\). The next line follows from Definition 2. The last follows from this short computation

$$\begin{aligned} \begin{aligned} {\hat{\beta }}*{\hat{\beta }} = \mathcal {P}^2({\hat{\alpha }})\mathcal {P}^{-2}({\hat{\alpha }})\mathcal {P}({\hat{\beta }}){\hat{\beta }} = \mathcal {P}(\hat{h})\mathcal {P}({\hat{\beta }})\mathcal {P}^{-2}({\hat{\alpha }}){\hat{\beta }} = \mathcal {P}(\hat{h})v_2^2 = \left( v_2^2\right) ^{\text {T}}\mathcal {P}(\hat{h}). \end{aligned} \end{aligned}$$

Therefore we apply the expression of \(\hat{h}\) in entropy variables (16), and receive the entropy flux \(\mu\) in entropy variables. It is given through

$$\begin{aligned} \mu \left( \hat{u}(v)\right) =\left( v_1^{\text {T}}+\frac{1}{2}\left(v_2^{2}\right)^{\text {T}} \right) \mathcal {P}\left( \frac{v_1+\frac{1}{2}v_2^2}{g} \right) v_2 + \frac{1}{2g}\left( v_2^2\right) ^{\text {T}} \mathcal {P}\left( v_1+\frac{1}{2}v_2^2\right) v_2. \end{aligned}$$

For further simplification, we use that the argument appears linear in every entry of \(\mathcal {P}\)

$$\begin{aligned} \mathcal {P}\left( v_1+\frac{1}{2}v_2^2\right) v_2 = \left( \mathcal {P}(v_1) + \frac{1}{2}\mathcal {P}(v_2^2)\right) v_2 = \mathcal {P}(v_1)v_2 + \frac{1}{2}\mathcal {P}(v_2^2)v_2. \end{aligned}$$

Following this scheme, we get

$$\begin{aligned} \hat{f}\left( \hat{u}(v)\right) = \frac{1}{g} \begin{pmatrix} \mathcal {P}(v_1)v_2 + \frac{1}{2}\mathcal {P}(v_2^2)v_2 \\ \frac{1}{2}\mathcal {P}(v_1)v_1 + \frac{3}{2} \mathcal {P}(v_1)v_2^2 + \frac{5}{8} \mathcal {P}(v_2^2)v_2^2 \end{pmatrix}. \end{aligned}$$

4.1 Flux Potential

Due to our considerations before, we are now able to construct an explicit formula for the flux potential in component-wise formulations. This leads to the foundation of our flux construction later. We first derive a general formula for the flux potential. From the condition \(\psi = {{\textbf {v}}^{\text {T}} \hat{{\textbf {f}}}}-\mu\), we obtain by simple calculations

$$\begin{aligned} \begin{aligned} \psi&= \frac{1}{g} {\textbf {v}}^{\text {T}} \begin{pmatrix} \mathcal {P}(v_1)v_2 + \frac{1}{2}\mathcal {P}(v_2^2)v_2 \\ \frac{1}{2}\mathcal {P}(v_1)v_1 + \frac{3}{2} \mathcal {P}(v_1)v_2^2 + \frac{5}{8} \mathcal {P}(v_2^2)v_2^2 \end{pmatrix} \\&\quad -\frac{1}{g} \left( v_1^{\text {T}} \mathcal {P}(v_1)v_2 +\frac{1}{2}(v_2^2)^{\text {T}} \mathcal {P}(v_1)v_2+v_1^{\text {T}}\frac{1}{2}\mathcal {P}(v_2^2)v_2 + \frac{1}{4}(v_2^2)^{\text {T}} \mathcal {P}(v_2^2)v_2 \right) \\&\quad - \frac{1}{2g} \left( \left( v_2^2\right) ^{\text {T}}\mathcal {P}(v_1)v_2 + \frac{1}{2}\left( v_2^2\right) ^{\text {T}}\mathcal {P}(v_2^2)v_2 \right) \\&= \frac{1}{g} \Biggl (v_1^{\text {T}}\mathcal {P}(v_1)v_2 + \frac{1}{2}v_1^{\text {T}} \mathcal {P}(v_2^2)v_2 + \frac{1}{2}v_2^{\text {T}} \mathcal {P}(v_1)v_1 + \frac{3}{2} v_2^{\text {T}}\mathcal {P}(v_1)v_2^2+\frac{5}{8} v_2^{\text {T}}\mathcal {P}(v_2^2)v_2^2 \\&\quad -\biggl ( v_1^{\text {T}} \mathcal {P}(v_1)v_2 + \frac{1}{2}(v_2^2)^{\text {T}} \mathcal {P}(v_1)v_2 + \frac{1}{2}v_1^{\text {T}} \mathcal {P}(v_2^2)v_2 \\&\quad +\frac{1}{4}(v_2^2)^{\text {T}} \mathcal {P}(v_2^2)v_2 + \frac{1}{2}(v_2^2)^{\text {T}} \mathcal {P}(v_1)v_2 + \frac{1}{4}(v_2^2)^{\text {T}} \mathcal {P}(v_2^2)v_2\biggr ) \Biggr ) \\&= \frac{1}{2g} \left( v_2^{\text {T}} \mathcal {P}(v_1)v_1 + v_2^{\text {T}} \mathcal {P}(v_1)v_2^2 + \frac{1}{4} v_2^{\text {T}}\mathcal {P}(v_2^2)v_2^2 \right) \\&= \frac{1}{2g} \left( v_2^{\text {T}}(v_1*v_1)+v_2^{\text {T}}(v_1*v_2^2)+ \frac{1}{4}v_2^{\text {T}}(v_2^2*v_2^2) \right) . \end{aligned} \end{aligned}$$
(17)

Now we can formulate the following theorem which gives us an explicit expression of the flux potential.

Theorem 3

The potential \(\psi\) for different dimensions K can be explicitly written as

$$\begin{aligned} \begin{aligned} \psi&= \frac{1}{2g} \Biggl ( \sum _{i,j,k=0}^K v_{2_i}v_{1_j}v_{1_k}{\langle \phi _i \phi _j \phi _k\rangle } + \sum _{i,j,k=0}^K v_{2_i}v_{1_j}v^2_{2_k} {\langle \phi _i \phi _j \phi _k\rangle } \\&\quad + \frac{1}{4} \sum _{i,j,k=0}^K v_{2_i}v^2_{2_j}v^2_{2_k} {\langle \phi _i \phi _j \phi _k\rangle } \Biggr ). \end{aligned} \end{aligned}$$
(18)

Proof

We remind the matrix formulation of the Galerkin product (8). Then we consider the penultimate expression of (17), take the first summand and apply a basic matrix-vector or rather a vector-vector multiplication

$$\begin{aligned} \begin{aligned} v_2^{\text {T}} \mathcal {P}(v_1)v_1&=(v_{2_1}, \cdots , v_{2_K})\left( \sum _{k=0}^K v_{1_k} M_k^K \right) \begin{pmatrix} v_{1_1} \\ \vdots \\ v_{1_K} \end{pmatrix} \\&=\sum _{k,i,j=0}^K v_{2_i} v_{1_k} v_{1_j} M_{k_{i_j}} =\sum _{i,j,k=0}^K v_{2_i} v_{1_j}v_{1_k} {\langle \phi _i\phi _j \phi _k\rangle }. \end{aligned} \end{aligned}$$

Analogous calculations for the remaining summands lead us to the desired result.

Having the flux potential, we can now follow [35] to obtain an entropy-conservative numerical flux. We denote with \(\overline{v}:= \frac{v(+)\,+\,v(-)}{2}\) the mean value and \([[v]]:= v(+)-v(-)\) the jump between two states. To receive an entropy conservative numerical flux, it needs to fulfil the equality in (3), i.e.,

$$\begin{aligned}{}[[v]]\cdot f^{\textrm{num}} = [[\psi ]]. \end{aligned}$$

Therefore, we need to identify \([[\psi ]]\), which is not unique here. To derive a formulation, we use the discrete analogue of the product rule \([[v_i v_j]] = \overline{v_i}[[v_j]]+[[v_i]]\overline{v_j}.\) Applying our choice of averaging to \(\psi\), we obtain

$$\begin{aligned}{}[[{\psi }]]= & {} \frac{1}{2g} \left( [[{v_2^{\text {T}}(v_1*v_1)}]] + [[{v_2^{\text {T}}(v_1*v_2^2)}]]+\frac{1}{4}[[{v_2^{\text {T}}(v_2^2*v_2^2)}]] \right) \nonumber \\= & {} \frac{1}{2g} \Biggl ( \sum _{i,j,k=0}^K [[{v_{2_i}v_{1_j}v_{1_k}}]] {\langle \phi _i\phi _j\phi _k\rangle } + \sum _{i,j,k=0}^K [[{v_{2_i}v_{1_j}v_{2_k}^2}]] {\langle \phi _i\phi _j\phi _k\rangle } \nonumber \\{} & {} + \frac{1}{4} \sum _{i,j,k=0}^K [[{v_{2_i}v_{2_j}^2 v_{2_k}^2}]] {\langle \phi _i\phi _j\phi _k\rangle } \Biggr ) \nonumber \\= & {} \frac{1}{2g} \Biggl ( \sum _{i,j,k=0}^K \left( [[{v_{2_i}v_{1_j}v_{1_k}}]] + [[{v_{2_i}v_{1_j}v_{2_k}^2}]] +\frac{1}{4} [[{v_{2_i}v_{2_j}^2 v_{2_k}^2}]] \right) {\langle \phi _i\phi _j\phi _k\rangle } \Biggr ) \nonumber \\= & {} \frac{1}{2g} \Biggl ( \sum _{i,j,k=0}^K \biggl ( \overline{v_{2_i}}\ \overline{v_{1_k}}[[{v_{1_j}}]] + \overline{v_{2_i}}\ \overline{v_{1_j}}[[{v_{1_k}}]] + [[{v_{2_i}}]]\overline{v_{1_i}v_{1_k}}\nonumber \\{} & {} + [[{v_{1_j}}]]\overline{v_{2_i}v_{2_k}^2} + \overline{v_{1_j}}[[{v_{2_i}}]] \overline{v_{2_k}^2}+ 2\overline{v_{1_j}}\ \overline{v_{2_i}}[[{v_{2_k}}]] \overline{v_{2_k}}\nonumber \\{} & {} +\frac{1}{4} [[{v_{2_i}}]]\overline{v_{2_j}^2 v_{2_k}^2} +\frac{1}{2} \overline{v_{2_i}}\ \overline{v_{2_j}}\overline{ v_{2_k}^2} [[{v_{2_j}}]] + \frac{1}{2} \overline{v_{2_i}}\ \overline{v_{2_k}}\overline{v_{2_j}^2}[[{v_{2_k}}]] \biggr ){\langle \phi _i\phi _j\phi _k\rangle } \Biggr )\nonumber \\= & {} \frac{1}{2g} \Biggl (\sum _{i,j,k=0}^K \biggl ( [[{v_{1_j}}]] \left(\overline{v_{2_i}}\ \overline{v_{1_k}}+ \overline{v_{2_i}v_{2_k}^2}\right) + [[{v_{1_k}}]] \overline{v_{1_j}}\ \overline{v_{2_i}}\nonumber \\{} & {} + [[{v_{2_i}}]] \left(\overline{v_{1_j}}\overline{v_{1_k}}+ \overline{v_{1_j}}\ \overline{v_{2_k}^2} + \frac{1}{4} \overline{v_{2_j}^2 v_{2_k}^2}\right)+ [[{v_{2_k}}]] \big(2\overline{v_{1_j}}\ \overline{v_{2_i}}\ \overline{v_{2_k}}\nonumber \\{} & {} + \frac{1}{2} \overline{v_{2_i}}\ \overline{v_{2_k}}\overline{v_{2_j}^2}\big) + [[{v_{2_j}}]] \frac{1}{2} \overline{v_{2_i}}\ \overline{v_{2_j}}\overline{ v_{2_k}^2} \biggr ) {\langle \phi _i\phi _j\phi _k\rangle } \Biggr ). \end{aligned}$$
(19)

Remark 2

In Appendix A.1 an explicit representation for \(K \in \{0,1,2\}\) determined with a straightforward calculation compared to the results obtained by use of Theorem 3 and expression (19) is given. Here, we like to point out that for \(K=0\), we end up with the purely determined flux potential as described and used in [41]. Therefore, our calculation is obviously in accordance with the purely deterministic case.

4.2 Numerical Fluxes

Finally, we can construct entropy conservative numerical fluxes from condition (3). We reformulate (3) to \([[{v_1, v_2}]] \cdot \begin{pmatrix} f_1^{\textrm{num}} \\ f_2^{\textrm{num}} \end{pmatrix} = [[{\psi }]]\) and search for the two parts.

There are many possibilities to choose such a numerical flux. We require the condition in a way where we split \([[{\psi }]]\) in summands depending on \([[{v_1}]]\) and \([[{v_2}]]\). We get for the part depending on \([[{v_1}]]\)

$$\begin{aligned} \begin{aligned}{}[[{\psi _1}]]&= \frac{1}{2g} \Biggl (\sum _{i,j,k=0}^K \biggl ( [[{v_{1_j}}]] \left(\overline{v_{2_i}}\ \overline{v_{1_k}}+ \overline{v_{2_i}v_{2_k}^2}\right) + [[{v_{1_k}}]] \overline{v_{1_j}}\ \overline{v_{2_i}}\biggr ){\langle \phi _i\phi _j\phi _k\rangle } \\&= \frac{1}{2g}\Biggl ( \sum _{j=0}^K[[{v_{1_j}}]] \sum _{i,k=0}^K \overline{v_{2_i}}\ \overline{v_{1_k}}+ \overline{v_{2_j}v_{2_k}^2} +\sum _{k=0}^K [[{v_{1_k}}]] \sum _{i,j=0}^K \overline{v_{1_j}}\ \overline{v_{2_i}}\Biggr ){\langle \phi _i\phi _j\phi _k\rangle }. \end{aligned} \end{aligned}$$

An indices transformation leads us to

$$\begin{aligned}{}[[{\psi _1}]] =\frac{1}{2g} \sum _{n=0}^K [[{v_{1_n}}]] \sum _{i,j=0}^K \biggl (\overline{v_{1_j}}\ \overline{v_{2_i}}+ \overline{v_{2_i}}\ \overline{v_{1_j}}+ \overline{v_{2_i}v_{2_0}^2} \biggr ){\langle \phi _i\phi _j\phi _{i_n}\rangle }. \end{aligned}$$

Additionally to that, we have vectors \(v_1,v_2 \in \mathbb {R}^{K+1}\), so we get through the definition of the scalar product the sum \([[{v_1}]] \cdot f^{\text {num}}_1 = \sum _{n=0}^K v_{1_n} f_{1_n}^{\text {num}}.\) For simplicity, we choose the approach where we consider every single \(f_{1_n}^{\textrm{num}}\). Thus, we have the first component of our flux

$$\begin{aligned} \begin{aligned}{}[[{v_{1_n}}]] f_{1_n}^{\textrm{num}}&= [[{v_{1_n}}]] \frac{1}{2g} \sum _{i,j=0}^K \biggl (\overline{v_{1_j}}\ \overline{v_{2_i}}+ \overline{v_{2_i}}\ \overline{v_{1_j}}+ \overline{v_{2_i}v_{2_j}^2} \biggr ){\langle \phi _i\phi _j\phi _n\rangle } \\ \Leftrightarrow f_{1_n}^{\textrm{num}}&= \frac{1}{2g} \sum _{i,j=0}^K \biggl (\overline{v_{1_j}}\ \overline{v_{2_i}}+ \overline{v_{2_i}}\ \overline{v_{1_j}}+ \overline{v_{2_i}v_{2_j}^2} \biggr ){\langle \phi _i\phi _j\phi _n\rangle }. \end{aligned} \end{aligned}$$

For the second part including \([[{v_2}]]\), we have

$$\begin{aligned} \begin{aligned}{}[[{\psi _2}]]&= \frac{1}{2g} \sum _{i,j,k=0}^K \biggl ( [[{v_{2_i}}]] \left(\overline{v_{1_j}}\overline{v_{1_k}}+ \overline{v_{1_j}}\ \overline{v_{2_k}^2} + \frac{1}{4} \overline{v_{2_j}^2 v_{2_k}^2}\right) + [[{v_{2_k}}]] \biggl (2\overline{v_{1_j}}\ \overline{v_{2_i}}\ \overline{v_{2_k}}\\&\quad + \frac{1}{2} \overline{v_{2_i}}\ \overline{v_{2_k}}\overline{v_{2_j}^2}\biggr) + [[{v_{2_j}}]] \frac{1}{2} \overline{v_{2_i}}\ \overline{v_{2_j}}\overline{ v_{2_k}^2} \biggr ) {\langle \phi _i\phi _j\phi _k\rangle }, \end{aligned} \end{aligned}$$

which leads through variable transformation to

$$\begin{aligned} \begin{aligned}{}[[{v_{2_n}}]] f_{2_n}^{\textrm{num}}&= [[{v_{2_n}}]] \frac{1}{2g} \sum _{i,j=0}^K \biggl ( \overline{v_{1_j}}\overline{v_{1_i}}+ \overline{v_{1_j}}\ \overline{v_{2_i}^2} + 2\overline{v_{1_j}}\ \overline{v_{2_i}}\ \overline{v_{2_n}}\\&\quad + \frac{1}{4}\overline{v_{2_j}^2 v_{2_i}^2} + \overline{v_{2_i}}\ \overline{v_{2_n}}\overline{v_{2_j}^2} \biggr ) {\langle \phi _i\phi _j\phi _n\rangle } \\ \Leftrightarrow f_{2_n}^{\textrm{num}}&= \frac{1}{2g} \sum _{i,j=0}^K \biggl ( \overline{v_{1_j}}\overline{v_{1_i}}+ \overline{v_{1_j}}\ \overline{v_{2_i}^2} + 2\overline{v_{1_j}}\ \overline{v_{2_i}}\ \overline{v_{2_n}}\\&\quad + \frac{1}{4}\overline{v_{2_j}^2 v_{2_i}^2} + \overline{v_{2_i}}\ \overline{v_{2_n}}\overline{v_{2_j}^2} \biggr ) {\langle \phi _i\phi _j\phi _n\rangle }. \end{aligned} \end{aligned}$$

With this, we have finally constructed our entropy-conservative numerical flux and can formulate the following theorem.

Theorem 4

Under the above considerations, a numerical entropy conservative flux for the SG-SW system is given in a close formula for each component via \(f^{\textrm{num}} = \left( f_{1_0}^{\textrm{num}},\cdots ,f_{1_K}^{\textrm{num}},f_{2_0}^{\textrm{num}},\cdots ,f_{2_K}^{\textrm{num}}\right) ^{\text {T}}\) with

$$\begin{aligned} \begin{pmatrix} f_{1_n}^{\textrm{num}} \\ f_{2_n}^{\textrm{num}} \end{pmatrix} = \frac{1}{2g} \sum _{i,j=0}^n \begin{pmatrix} 2\overline{v_{1_j}}\ \overline{v_{2_i}}+ \overline{v_{2_i}v_{2_j}^2} \\ \overline{v_{1_j}}\overline{v_{1_i}}+ \overline{v_{1_j}}\ \overline{v_{2_i}^2} +\frac{1}{4} \overline{v_{2_j}^2 v_{2_i}^2} + 2\overline{v_{1_j}}\ \overline{v_{2_i}}\ \overline{v_{2_n}}+ \overline{v_{2_i}}\ \overline{v_{2_n}}\overline{v_{2_j}^2} \end{pmatrix} {\langle \phi _i\phi _j\phi _n\rangle }. \end{aligned}$$

To get finally an explicit expression, we insert the mean value in (8) and get for \(f^{\textrm{num}}_1\):

$$\begin{aligned} \begin{aligned} 2g f_{1_{i,j,n}}^{\textrm{num}}&=\Biggl ( 2\overline{v_{1_j}}\ \overline{v_{2_i}}+ \overline{v_{2_i}v_{2_j}^2}\Biggr ) {\langle \phi _i\phi _j\phi _n\rangle }\\&=\Biggl ( 2 \frac{v_{1_{j_-}}+v_{1_{j_+}}}{2} \frac{v_{2_{i_-}}+v_{2_{i_+}}}{2}+\frac{v_{2_{i_-}}v_{2_{j_-}}^2+v_{2_{i_+}}v_{2_{j_+}}^2}{2}\Biggr ){\langle \phi _i\phi _j\phi _n\rangle } \\&=\frac{v_{1_{j_-}}v_{2_{i_-}}+v_{1_{j_-}}v_{2_{i_+}}+v_{1_{j_+}}v_{2_{i_-}}+v_{1_{j_+}}v_{2_{i_+}}+v_{2_{i_-}}v_{2_{j_-}}^2+v_{2_{i_+}}v_{2_{j_+}}^2}{2} {\langle \phi _i\phi _j\phi _n\rangle }, \end{aligned} \end{aligned}$$

where we obtain for the second part

$$\begin{aligned} \begin{aligned} 2g f_{2_{i,j,n}}^{\textrm{num}}&= \biggl ( \overline{v_{1_j}v_{1_i}}+\overline{v_{1_j}}\overline{v_{2_i}^2}+\frac{1}{4}\overline{v_{2_j}^2v_{2_i}^2}+2\overline{v_{1_j}}\ \overline{v_{2_i}}\ v_{2_{n_-}}+\overline{v_{2_i}}\ v_{2_{n_-}}\overline{v_{2_j}^2}\biggr ) {\langle \phi _i\phi _j\phi _n\rangle } \\&=\Biggl ( \frac{v_{1_{j_+}}v_{1_{i_+}}+v_{1_{j_-}}v_{1_{i_-}}}{2}+\frac{v_{1_{j_+}}+v_{1_{j_-}}}{2}\frac{v_{2_{i_+}}^2+v_{2_{i_-}}^2}{2}+\frac{1}{4}\frac{v_{2_{i_+}}^2v_{2_{j_+}}^2+v_{2_{i_-}}^2v_{2_{j_-}}^2}{2} \\&\quad + 2\frac{v_{1_{j_+}}+v_{1_{j_-}}}{2}\frac{v_{2_{i_+}}+v_{2_{i_-}}}{2}\frac{v_{2_{n_+}}+v_{2_{n_-}}}{2}\\&\quad +\frac{v_{2_{i_+}}+v_{2_{i_-}}}{2}\frac{v_{2_{n_+}}+v_{2_{n_-}}}{2}\frac{v_{2_{j_+}}^2+v_{2_{j_-}}^2}{2}\Biggr ) {\langle \phi _i\phi _j\phi _n\rangle } \\&=\frac{1}{2}\left( \left( v_{1_{j_+}}v_{1_{i_+}}+v_{1_{j_-}}v_{1_{i_-}}\right) +\frac{1}{2}\left( v_{1_{j_+}}v_{2_{i_+}}^2+v_{1_{j_+}}v_{2_{i_-}}^2+v_{1_{j_-}}v_{2_{i_+}}^2+v_{1_{j_-}}v_{2_{i_-}}^2\right) \right. \\&\quad + \frac{1}{4}\left( v_{2_{j_+}}^2v_{2_{i_+}}^2+v_{2_{j_-}}^2v_{2_{i_-}}^2\right) \\&\quad +\frac{1}{2}\left( v_{1_{j_+}}v_{2_{i_+}}v_{2_{n_+}}+v_{1_{j_+}}v_{2_{i_-}}v_{2_{n_+}}+v_{1_{j_-}}v_{2_{i_+}}v_{2_{n_+}}+v_{1_{j_-}}v_{2_{i_-}}v_{2_{n_+}}\right. \\&\quad + \left. v_{1_{j_+}}v_{2_{i_+}}v_{2_{n_-}}+v_{1_{j_+}}v_{2_{i_-}}v_{2_{n_-}}+v_{1_{j_-}}v_{2_{i_+}}v_{2_{n_-}}+v_{1_{j_-}}v_{2_{i_-}}v_{2_{n_-}}\right) \\&\quad + \frac{1}{4}\left( v_{2_{i_+}}v_{2_{n_+}}v_{2_{j_+}}^2+v_{2_{i_+}}v_{2_{n_-}}v_{2_{j_+}}^2+v_{2_{i_-}}v_{2_{n_+}}v_{2_{j_+}}^2 +v_{2_{i_-}}v_{2_{n_-}}v_{2_{j_+}}^2\right. \\&\quad +\left. \left. v_{2_{i_+}}v_{2_{n_+}}v_{2_{j_-}}^2+v_{2_{i_+}}v_{2_{n_-}}v_{2_{j_-}}^2+v_{2_{i_-}}v_{2_{n_+}}v_{2_{j_-}}^2+v_{2_{i_-}}v_{2_{n_-}}v_{2_{j_-}}^2\right) \right) {\langle \phi _i\phi _j\phi _n\rangle }. \end{aligned} \end{aligned}$$

Before we apply this flux in our numerical scheme, we give the following example for explanation.

Example 1

If \(K=0\), we are again in the purely deterministic case. By direct calculations, we obtain

$$\begin{aligned} \begin{aligned} f^{\textrm{num}} = \begin{pmatrix} f_{1_0}^{\textrm{num}} \\ f_{2_0}^{\textrm{num}} \end{pmatrix} = \frac{1}{2g} \begin{pmatrix} 2\overline{v_1} \ \overline{v_2} + \overline{v_2^3}\\ \overline{v_1^2} + \overline{v_1} \overline{v_2^2} + \frac{1}{4}\overline{v_2^4} + 2 \overline{v_1} \ \overline{v_2}^2 + \overline{v_2}^2 \overline{v_2^2} \end{pmatrix}. \end{aligned} \end{aligned}$$

This is exactly the flux described in [41] with parameters \(a_1=a_2=1\). This can be also seen with the explicit representation, where we obtain

$$\begin{aligned} f^{\textrm{num}}_1 = \frac{1}{2g} \left( v_{1_-}v_{2_-}+v_{1_-}v_{2_+}+v_{1_+}v_{2_-}+v_{1_+}v_{2_+}+v_{2_-}^3+v_{2_+}^3 \right) \end{aligned}$$

for the first part and

$$\begin{aligned} \begin{aligned} f^{\textrm{num}}_2&= \frac{1}{2g} \left( \frac{1}{2}\left( v_{1_+}^2+v_{1_-}^2\right) +\frac{1}{4}\left( v_{1_+}v_{2_+}^2+v_{1_+}v_{2_-}^2+v_{1_-}v_{2_+}^2+v_{1_-}v_{2_-}^2\right) \right. \\&\quad + \frac{1}{8}\left( v_{2_+}^4+v_{2_-}^4\right) +\frac{1}{4}\left( v_{1_+}v_{2_+}^2+v_{1_+}v_{2_-}v_{2_+}+v_{1_-}v_{2_+}^2\right. \\&\quad +\left. v_{1_-}v_{2_-}v_{2_+}+v_{1_+}v_{2_+}v_{2_-}+v_{1_+}v_{2_-}^2+v_{1_-}v_{2_+}v_{2_-}+v_{1_-}v_{2_-}^2\right) \\&\quad + \left( v_{2_+}^4+v_{2_+}^3v_{2_-}+v_{2_-}v_{2_+}^3+v_{2_-}^2v_{2_+}^2+v_{2_+}^2v_{2_-}^2+v_{2_+}v_{2_-}^3+v_{2_-}^3v_{2_+}+v_{2_-}^4\right) \Big) \\&= \frac{1}{2}\left( v_{1_+}^2+v_{1_-}^2\right. \big)+\frac{1}{2}\left( v_{1_+}v_{2_+}^2+v_{1_+}v_{2_-}^2+v_{1_-}v_{2_+}^2 \right. \\&\quad +\left. v_{1_-}v_{2_-}^2+v_{1_+}v_{2_-}v_{2_+}+v_{1_-}v_{2_-}v_{2_+}\right) \\&\quad + \frac{1}{4}\left( v_{2_+}^4+v_{2_-}^4+v_{2_+}^3v_{2_-}+v_{2_-}^3v_{2_+}+v_{2_-}^2v_{2_+}^2\right) \end{aligned} \end{aligned}$$

for the second one. Again this is the same one as in [41] with the selection of \(a_1=a_2=1\).

By selecting another averaging procedure, we would have delivered another parameter form. Our study is, therefore, consistent with the purely deterministic case. For \(K\in \{1,2\}\), explicit formulas can be found in Appendix A.2.

In the following section, we have finally constructed entropy-conservative two-point fluxes for our SG-SW system. The idea is based on the development of an entropy flux potential and using condition (3). However, we have not included bottom topography in our investigation up to this point. A possible way including it is described in Appendix C.

5 Numerical Results

For the numerical experiments, we use Julia [5] with the numerical simulation framework Trixi [42, 45]. Several entropy conservative/dissipative high-order schemes can be found in Trixi.jl, in particular the DGSEM with flux differencing introduced in Sect. 2.1. We apply for the time discretization always the strong-stability preserving Runge-Kutta methods SSPRK33 [11]. In this work, we focus on purely academic test cases as a proof of concept, where we demonstrate the entropy conservation and the high-order accuracy of our approach. For the Haar type expansion, we select the Haar wavelets as our basis for the probability space. Therefore, we assume a uniform distribution of the random variable. Due to a new close formula for Haar wavelets [24], we can avoid solving a minimization problem in every step which has normally been done to obtain the Galerkin square root [38]. This also increases the efficiency of our approach. We shortly repeat the definition of the Haar wavelets and some of their main properties.

Definition 3

(Haar wavelets [38]) The wavelet system is defined by

$$\begin{aligned} \psi (\xi ):= {\left\{ \begin{array}{ll} 1 &{} \quad \text {if} \ \ 0\leqslant \xi \leqslant 1/2, \\ -1 &{} \quad \text {if} \ \ 1/2\leqslant \xi < 1, \\ 0 &{} \quad \text {else} \end{array}\right. } \end{aligned}$$
(20)

with

$$\begin{aligned} \psi _{j,k}(\xi ) = 2^{j/2}\psi (2^j \xi -k), \quad j=0,1, \cdots ; \quad k=0,\cdots ,2^{j-1}. \end{aligned}$$

This yields through a lexicographical order to basis functions

$$\begin{aligned} \phi _1 = \psi , \ \ \phi _2 = \psi _{1,0}, \ \text {and} \ \phi _3 = \psi _{1,1}. \end{aligned}$$

We can develop according to [24] a closed formulation for every gPC mode based on the orthogonal eigenvalue decomposition \(\mathcal {P}_J(\hat{u}) = \mathcal {H}_J \textrm{D}_J(\hat{u})\mathcal {H}^{\text {T}}_J\) with the classical Haar matrices

$$\begin{aligned} \mathcal {H}_J = \begin{bmatrix} \mathcal {H}_{J-1} \otimes (1,1) \\ {\textbf {1}}\otimes (1,-1) \end{bmatrix} \ \ \text {for} \ \ \mathcal {H}_0 = \begin{bmatrix} 1 &{} \quad 1 \\ 1 &{} \quad -1 \end{bmatrix}. \end{aligned}$$
(21)

Theorem 5

The gPC modes \({\hat{\alpha }},{\hat{\beta }}\), and \({\hat{\textsf {v}}}\) are for a gPC expansion with Haar wavelets, given through the closed formulas

$$\begin{aligned} \begin{aligned} {\hat{\alpha }} = \mathcal {H}\textrm{D}(\hat{h})^{\frac{1}{2}} \mathcal {H}^{\text {T}} \hat{e}_1, \quad {\hat{\beta }} = \mathcal {H}\textrm{D}(\hat{h})^{-\frac{1}{2}}\textrm{D}(\hat{q})\mathcal {H}^{\text {T}}\hat{e}_1, \quad {\hat{\textsf {v}}} = \mathcal {H}\textrm{D}(\hat{h})^{-1}\textrm{D}(\hat{q})\mathcal {H}^{\text {T}} \hat{e}_1 \end{aligned} \end{aligned}$$

with the classical Haar matrices (21).

The proof can be found in Appendix B for completeness and was given first up-to-our knowledge in [24].

We are now able to construct numerical test cases. Again, we focus in this paper on purely basic simulations and consider some generic test cases to give a first proof of concept. More realistic experiments, a comparison, and numerical analysis will be done in future work. We give here only results for selecting \(K=3\) which denotes the four term series expansion. For simplification, we consider always in our test the gravitational constant \(g=1\). We fix a few further parameters which will not be changed in our experiments. The mesh on our simulation domain \([-1,1]\) is built with an initial refinement of 5, which means the original mesh, consisting of 2 cells, is \(2^5\) times refined, and we obtain a grid of \(2^{5+1}=64\) cells. We choose for our solver the DGSEM with polynomials of degree 2 and our entropy-conservative numerical flux as the surface flux and also as the volume flux. Therefore, we test here only for entropy conservation. The initial conditions change for every experiment, but we use periodic boundary conditions always. We test if our numerical fluxes preserve the lake at rest state, study convergence and entropy-conserving properties on the model of a simple wave. Consider first the lake-at-rest stateFootnote 1. Lake-at-rest means that in the case of a flat, not moving water surface no velocity will occur over time.

Experiment 1

Lake at rest. We consider the initial conditions

$$\begin{aligned} h_0 = 6, \quad h_1 = 0.8, \quad h_2 = 0.6, \quad h_3 = 0.577, \quad q_0=q_1=q_2=q_3=0 \end{aligned}$$

without any velocity, observed until \(T=0.5\) with the time step \(\Delta t = 10^{-3}\). The initial conditions are chosen according to the uniform distribution \(\mathcal {U}(4,8)\) following [22]. They are given in conservative variables by

$$\begin{aligned} u(0,x;\,\xi )= \begin{pmatrix} h (0,x;\, \xi ) \\ q(0,x;\, \xi ) \end{pmatrix} =\begin{pmatrix} \xi \\ 0 \end{pmatrix} \quad \text {with } x \in [-1,1]\text { and } \xi \in \mathcal {U}(4,8). \end{aligned}$$

So \(h_0\) describes the expected value and the sum over the squares of the higher coefficients, the variance.

Fig. 1
figure 1

Experiment 1

We observe in Fig. 1 that neither in the velocity (up to errors in machine precision \(\approx 10^{-16}\) ) nor the water heights any movements can be recognized during our simulations. Thus, Experiment 1 confirms our result. The here developed method preserves the steady state.

In the next tests, we consider some variations in the water height and momentum. These tests are, in particular, academic test cases and are constructed to validate entropy conservation and high-order accuracy. Therefore, we give directly the initial conditions in terms of the developed coefficients.

Experiment 2

We start with a flat water surface and model a sinus wave on it, represented through the following initial conditions:

$$\begin{aligned} h_0 = 6, \quad h_1 = 0.8, \quad h_2 = 0.6, \quad h_3 = 0.577, \quad q_0=q_1=q_2=q_3=\frac{1}{2}\sin (\uppi x). \end{aligned}$$

Again, the initial conditions are derived from a uniform distribution \(\mathcal {U}(4,8)\) following [22]. The water starts moving over time, which can be observed in Fig. 2 but no discontinuous are built.

Fig. 2
figure 2

Experiment 2

We take a look at the entropy. We aimed for an entropy conservative method which means we expect no change in entropy over time. We integrate the time derivative of the entropy over the domain \(\Omega\) in every time step and give the plot in Fig. 3. We recognize that the change of entropy is in machine precision. This verifies numerically that our method is indeed entropy conservative.

Fig. 3
figure 3

Change in entropy in Experiments 2 and 3

Finally, in our last test, we want to investigate the high-order accuracy of our DGSEM approach in space. Here, we simulate a sinus wave on an already nonflat water surface.

Experiment 3

$$\begin{aligned} \begin{aligned}&h_0 = 6-q_0, \quad h_1 = 0.8-q_1, \quad h_2 = 0.6-q_2,\\&h_3-q_3 = 0.577,\quad q_0=q_1=q_2=q_3=\sin \left( \frac{\uppi x}{2}\right) ^2, \end{aligned} \end{aligned}$$

which is shown in Fig. 4.

Fig. 4
figure 4

Experiment 3

We consider the errors, referring to the solution of the finest mesh \(h_{\textrm{ref}}\), in \(L^2\)- and \(L^{\infty }\)-norms on our computational domain \(\Omega = [-1,1]\), where N denotes the original number of grid cells and 2N the next higher refinement.

The convergence analysis runs for initial conditions from Experiment 3 with the additional quantities time step size \(\Delta t = 10^{-9}\) and final time \(T=10^{-8}\). So, we observe 100 time steps. The initial mesh refinement is 2, which means the mesh contains 8 cells, and we go over 4 iterations/refinements. The time step is chosen this small to guarantee the error of the solver of the time-dependent ODE will not mask the error of our DGSEM for the spatial discretization.

Fig. 5
figure 5

EOC tables for the conservative variables water height h and momentum q

The convergence Fig. 5 confirms a third-order experimental order of convergence (EOC). This behaviour has been expected and also verified. Similar results can be observed while changing the polynomial degree in the solver which gives us always the desired order.

6 Summary and Outlook

In this paper, we have developed an entropy-conservative DG method for the SW equations with uncertainties. We used the SG approach in the context of UQ and by applying the Roe variable transformation, we could rewrite our stochastic system in a purely deterministic hyperbolic one. Due to recent investigations by Herty and Gerster [22], an entropy flux pair is known for this augmented system and we derived from this pair a corresponding entropy flux potential in the closed form. We use this entropy flux potential in the following to construct for the first time entropy conservative numerical fluxes for the SG-SW system. By applying these fluxes in the DGSEM with flux differencing, we finally obtain an entropy conservative scheme. In our first academic numerical experiments, we have considered lake-at-rest, convergence in space, and entropy behaviours. Our scheme preserves lake-at-rest and is high-order accurate in space and entropy conservative which was of particular interest. Up to this point, we have considered only academic test cases to give proof of concept. In future work, we will extend our investigation. First, we will consider also nonzero bottom topography and test our scheme for well-balancing and entropy conservation. The next aspect which is already under investigation is the consideration of more advanced tests and realistic experiments including discontinuities like in stochastic damn-break. Here, we have to use an entropy dissipative scheme which can be obtained using entropy dissipative numerical surface fluxes (local Lax-Friedrich, etc.) together with the EC fluxes. However, additional limiting strategies are further needed to handle strong shocks. Additionally, the convergence analysis concerning the Galerkin expansion has to be studied and comparison analysis to other techniques [26, 27, 39, 55, 59] will be as well considered in future work. Especially the non-intrusive approach from [59] is of particular interest. In our intrusive method, all stochastic integrals are calculated exactly before the calculations where in [59] a pseudo-spectral ansatz is used with suitable quadrature rules in the stochastic space where the underlying deterministic solver in this paper and the one in [59] is the same.

In this manuscript, we have only considered the lake-at-rest state without any bottom topography. Other generalized approaches to ensure equilibria are also of interest and are already investigated in the context of SW with uncertainty in [12, 13].