1 Introduction

The main goal of this paper is to present high order accurate discontinuous Galerkin (DG) methods for the shallow water equations on unstructured triangular meshes, which are not only well-balanced for the still water steady-state solutions, but also preserve the non-negativity of the water depth. The shallow water equations with a non-flat bottom topography play a critical role in the modeling and simulation of flows in rivers, lakes and coastal areas. They have wide applications in ocean, hydraulic engineering and atmospheric modeling. The two-dimensional shallow water equations take the form

$$\begin{aligned} \left\{ \begin{array}{l} h_t+(hu)_x+(hv)_y=0 \\ (hu)_t+\left( hu^2+\frac{1}{2}gh^2 \right) _x+\left( huv\right) _y=-ghb_x \\ (hv)_t+\left( huv \right) _x+\left( hv^2+\frac{1}{2}gh^2 \right) _y=-ghb_y, \end{array} \right. \end{aligned}$$
(1.1)

where \(h\) denotes the water height, \((u,v)^T\) is the velocity vector, \(b\) represents the bottom topography and \(g\) is the gravitational constant. Other terms, such as a friction term, could also be added in (1.1).

Due to the large scientific and engineering applications of the shallow water equations, research on effective and accurate numerical methods for their solutions has attracted great attention in the past two decades. One difficulty encountered is the treatment of the source terms. An essential part for the shallow water equations and other conservation laws with source terms is that they often admit steady-state solutions in which the flux gradients are exactly balanced by the source term. For the shallow water equations, people are particularly interested in the still water steady-state solution, which represents a still flat water surface, and often referred as “lake at rest” solution:

$$\begin{aligned} u=v=0 \quad \text{ and} \quad h+b=const. \end{aligned}$$
(1.2)

Traditional numerical schemes with a straightforward handling of the source term cannot balance the effect of the source term and the flux, and usually fail to capture the steady state well. They will introduce spurious oscillations near the steady state. The well-balanced schemes are specially designed to preserve exactly these steady-state solutions up to machine error with relatively coarse meshes, and therefore it is desirable to design numerical methods which have the well-balanced property. The other major difficulty often encountered in the simulations of the shallow water equations is the appearance of dry areas in many engineering applications including the dam break problem and flood waves etc. Special attention needs to be paid near the dry/wet front, otherwise they may produce non-physical negative water height, which becomes problematic when calculating the eigenvalues \(u\pm \sqrt{gh}\) and \(v\pm \sqrt{gh}\) to determine the time step size \(\Delta t\), and renders the system not hyperbolic and not well posed.

In the past decade, many well-balanced numerical methods have been developed for the shallow water equations, see, e.g. [13, 22, 25, 26] and the references therein. There are also a number of positivity-preserving schemes [4, 6, 7, 9, 14, 17] proposed for (1.1), and a few of them [1, 8, 14, 21] can resolve both difficulties at the same time. Recently, high-order accurate DG methods have attracted increasing attention in many computational fields, including the geophysical fluid dynamics. DG method is a class of finite element methods using discontinuous piecewise polynomial space as the solution and test function spaces (see [10] for a historic review). Several advantages of the DG method, including its accuracy, high parallel efficiency, flexibility for hp-adaptivity and arbitrary geometry and meshes, make it particularly suited for the shallow water equations, see the first work by Schwaneberg and Kongeter [29], followed by [13, 15, 18, 23] and others. Recently, several well-balanced DG methods have been proposed, by Xing and Shu [33, 34, 36], Ern et al. [14], Rhebergen et al. [27] and other researchers [20]. Also, some discussions on DG methods involving wetting and drying treatments for the shallow water equations can be found in [5, 9, 14].

In [36], high order accurate DG methods, which can maintain the still water steady state exactly, and at the same time can preserve the non-negativity of the water height, are developed for the shallow water equations on one-dimensional and two-dimensional rectangular meshes. Due to the complex geometry of the computational domains in many real-world applications, triangular meshes are often used. In this paper, we are interested in the extension of the positivity-preserving well-balanced methods developed in [36] on unstructured triangular meshes. A simple source term discretization will be presented, and shown to be balanced with the numerical fluxes at the steady-state solution. With the introduction of a special designed Gaussian quadrature rule, we will demonstrate that the simple positivity-preserving limiter used in [39] is still plausible on triangular meshes, and does not affect the high order accuracy, as well as the mass conservation.

This paper is organized as follows. In Sect. 2, we present the well-balanced DG methods for the shallow water equations on triangular meshes, following the technique proposed in [34]. The positivity-preserving well-balanced DG methods are presented in Sect. 3, which involves a simple positivity-preserving limiter. Section 4 contains extensive numerical simulation results to demonstrate the behavior of our DG methods for two-dimensional shallow water equations on triangular meshes, verifying high order accuracy, the well-balanced property, positivity-preserving property, and good resolution for smooth and discontinuous solutions. Concluding remarks are given in Sect. 5.

2 Well-Balanced DG Methods

In this section, we first reinstate the classical Runge-Kutta discontinuous Galerkin (RKDG) methods applied for the shallow water equations. A few well-balanced DG methods have been developed recently, see the recent book chapter [25] for a review and the references therein. In this paper, we consider the approach developed by one of the authors in [34], where we observed that the classical RKDG methods are well-balanced for the still water solution (1.2), if a hydrostatic reconstruction is employed on the flux. The same technique is also used in [14, 20, 36] to derive well-balanced positivity-preserving methods. This is one of the simplest approaches to obtain a high order well-balanced scheme, and the extra computational cost due to the well-balanced property is negligible. Its extension to a triangulation will be introduced in this section, and this scheme will serve as the basis for the positivity-preserving technique presented in Sect. 3.

Let \(\mathcal T _{\tau }\) be a family of partitions of the computational domain \(\Omega \) parameterized by \(\tau >0\). For any triangle \(K\in \mathcal T _{\tau }\), we define \(\tau _{K}:=\text{ diam}(K)\) and \(\tau :=\max \limits _{K\in \mathcal T _\tau } \tau _K\). For each edge \(e_K^i\; (i=1,2,3)\) of \(K\), we denote its length by \(l_K^i\), and outward unit normal vector by \(\nu _K^i\). Let \(K(i)\) be the neighboring triangle along the edge \(\mathrm{{e}}_K^{i}\) and \(|K|\) be the area of the triangle \(K\).

For the ease of presentation, we denote the shallow water equations (1.1) by

$$\begin{aligned} U_{t}+f(U)_x+g(U)_y=s(h,b), \quad \text{ or} \quad U_{t}+\nabla \cdot \mathbf F (U)=s(h,b), \end{aligned}$$

where \(U=(h,hu,hv)^{T}\) with the superscript \(T\) denoting the transpose, \(f(U),\,g(U)\) or \(\mathbf F (U)=(f(U), g(U))\) are the flux and \(s(h,b)\) is the source term. In a high order DG method, we seek an approximation, still denoted by \(U\) with an abuse of notation, which belongs to the finite dimensional space

$$\begin{aligned} V_\tau =V_\tau ^k\equiv \left\{ w\in L^2(\Omega );\; w|_K \in P^k(K)\quad \forall K\in \mathcal T _\tau \right\} , \end{aligned}$$
(2.1)

where \(P^{k}(K)\) denotes the space of polynomials on \(K\) of degree at most \(k\). We project the bottom function \(b\) into the same space \(V_\tau \), to obtain an approximation which is still denoted by \(b\), again with an abuse of notation. Let \(\mathbf x \) denote \((x,y)\), then the numerical scheme is given by

$$\begin{aligned} \int \int \limits _{K}\partial _{t}Uw\,\mathrm{d}\mathbf x -\int \int \limits _{K}\mathbf F (U)\cdot \nabla w\,\mathrm{d}\mathbf x +\sum \limits _{i=1}^3\int \limits _{\mathrm{{e}}_K^{i}}\widehat{\mathbf{F }}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^{i} w \,\mathrm{d}s =\int \int \limits _{K}s(h,b)w\,\mathrm{d}\mathbf x , \qquad \end{aligned}$$
(2.2)

where \(w(\mathbf x )\) is a test function from the test space \(V_\tau \). The numerical flux \(\widehat{\mathbf{F }}\) is defined by

$$\begin{aligned} \widehat{\mathbf{F }}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^{i}=\mathcal F \Big (U_i^{int(K)},\;U_i^{ext(K)},\;\nu _K^i \Big ), \end{aligned}$$
(2.3)

where \(U_i^{int(K)}\) and \(U_i^{ext(K)}\) are the approximations to the values on the edge \(\mathrm{{e}}_K^{i}\) obtained from the interior and the exterior of \(K\).

We could, for example, use the simple global Lax-Friedrichs flux

$$\begin{aligned}&\mathcal F (a_{1},a_{2},\nu )=\frac{1}{2}\Big [\mathbf F (a_{1})\cdot \nu +\mathbf F (a_{2})\cdot \nu -\alpha (a_{2}-a_{1})\Big ],\nonumber \\&\quad \alpha =\max \left( (|u|+\sqrt{gh}, |v|+\sqrt{gh}) \cdot \nu \right) , \end{aligned}$$
(2.4)

where the maximum is taken over the whole region. It satisfies the conservativity and consistency

$$\begin{aligned} \mathcal F (a_{1},a_{2},\nu )=-\mathcal F (a_{2},a_{1},-\nu ),\quad \mathcal F (a_{1},a_{1},\nu )=\mathbf F (a_1)\cdot \nu . \end{aligned}$$
(2.5)

A simple Euler forward time discretization of (2.2) gives the fully discretized scheme

$$\begin{aligned} \int \int \limits _{K}\frac{U^{n+1}-U^{n}}{\Delta t}w\,\mathrm{d}\mathbf x -\int \int \limits _{K}\mathbf F (U)\cdot \nabla w\,\mathrm{d}\mathbf x +\sum _{i=1}^3\int _{\mathrm{{e}}_K^{i}}\widehat{\mathbf{F }}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^{i} w\,\mathrm{d}s =\int \int \limits _{K}s(h,b)w\,\mathrm{d}\mathbf x . \nonumber \\ \end{aligned}$$
(2.6)

Total variation diminishing (TVD) high order Runge-Kutta time discretization [31] is used in practice for stability and to increase temporal accuracy. For example, the third order TVD Runge-Kutta method is used in the simulation in this paper:

$$\begin{aligned} U^{(1)}&= U^{n}+\Delta t\mathcal L (U^{n}) \nonumber \\ U^{(2)}&= \frac{3}{4}U^{n}+\frac{1}{4}\left( U^{(1)}+\Delta t\mathcal L (U^{(1)})\right) \nonumber \\ U^{n+1}&= \frac{1}{3}U^{n}+\frac{2}{3}\left( U^{(2)}+\Delta t\mathcal L (U^{(2)})\right) , \end{aligned}$$
(2.7)

where \(\mathcal L (U)\) is the spatial operator.

In order to achieve the well-balanced property, we are interested in preserving the still water stationary solution (1.2) exactly. Following the technique presented in [34], our well-balanced numerical scheme, modified from the classical version (2.6), takes the form:

$$\begin{aligned} \int \int \limits _{K}\frac{U^{n+1}-U^{n}}{\Delta t}w\,\mathrm{d}\mathbf x -\int \int \limits _{K}\mathbf F (U)\cdot \nabla w\,\mathrm{d}\mathbf x +\sum \limits _{i=1}^3\int \limits _{\mathrm{{e}}_K^{i}}\widehat{\mathbf{F }}^{*}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^i w\,\mathrm{d}s =\int \int \limits _{K}s(h,b)w\,\mathrm{d}\mathbf x , \nonumber \\ \end{aligned}$$
(2.8)

or equivalently,

$$\begin{aligned}&\int \int \limits _{K}\frac{U^{n+1}-U^{n}}{\Delta t}w\,\mathrm{d}\mathbf x -\int \int \limits _{K}\mathbf F (U)\cdot \nabla w\,\mathrm{d}\mathbf x +\sum \limits _{i=1}^3\int \limits _{\mathrm{{e}}_K^{i}}\widehat{\mathbf{F }}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^i w\,\mathrm{d}s\nonumber \\&\quad \quad \quad =\int \int \limits _{K}s(h,b)w\,\mathrm{d}\mathbf x + \sum \limits _{i=1}^3\int \limits _{\mathrm{{e}}_K^{i}}(\widehat{\mathbf{F }}-\widehat{\mathbf{F }}^{*})|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^{i} w\,\mathrm{d}s. \end{aligned}$$
(2.9)

The left side of (2.9) is the classical RKDG scheme, and the right side is our approximation to the source term. The flux \(\widehat{\mathbf{F }}^{*}\) is computed based on the hydrostatic reconstruction technique [1] and will be explained later. However we point out here that the difference \(\widehat{\mathbf{F }}-\widehat{\mathbf{F }}^{*}\) is a high order correction term at the level of \(O(h^{k+1})\) regardless of the smoothness of the solution \(U\). Therefore, the scheme (2.8) is a spatially \((k+1)\)-th order conservative scheme and will converge to the weak solution.

After computing boundary values \(U_i^{int(K)}\) and \(U_i^{ext(K)}\) on the edge \(\mathrm{{e}}_K^{i}\), we set

$$\begin{aligned} h_i^{*,int(K)}&= \max \left( 0,h_i^{int(K)}+b_i^{int(K)}-\max \big (b_i^{int(K)},\;b_i^{ext(K)}\big )\right) \nonumber \\ h_i^{*,ext(K)}&= \max \left( 0,h_i^{ext(K)}+b_i^{ext(K)}-\max \big (b_i^{int(K)},\; b_i^{ext(K)}\big )\right) \end{aligned}$$
(2.10)

and redefine the interior and exterior values of \(U\) as:

$$\begin{aligned}&U_i^{*,int(K)}=\left( \begin{array}{l} h_i^{*,int(K)} \\ h_i^{*,int(K)}u_i^{int(K)} \\ h_i^{*,int(K)}v_i^{int(K)} \end{array} \right) =\frac{h_i^{*,int(K)}}{h_i^{int(K)}}U_i^{int(K)},\nonumber \\&U_i^{*,ext(K)}=\left( \begin{array}{l} h_i^{*,ext(K)} \\ h_i^{*,ext(K)}u_i^{ext(K)} \\ h_i^{*,ext(K)}v_i^{ext(K)} \end{array} \right) =\frac{h_i^{*,ext(K)}}{h_i^{ext(K)}}U_i^{ext(K)}. \end{aligned}$$
(2.11)

Introducing the notations

$$\begin{aligned} \delta _{i,x}^{*} \!=\! \left( 0, \frac{g}{2}\big (h_i^{int(K)}\big )^{2}\!-\!\frac{g}{2}\big (h_i^{*,int(K)}\big )^{2} , 0\right) ^T, \quad \delta _{i,y}^{*} \!=\! \left( 0, 0, \frac{g}{2}\big (h_i^{int(K)}\big )^{2}\!-\!\frac{g}{2}\big (h_i^{*,int(K)}\big )^{2}\right) ^T \end{aligned}$$

on the edge \(\mathrm{{e}}_K^{i}\), the flux \(\widehat{\mathbf{F }}^{*}\) is then given by:

$$\begin{aligned} \widehat{\mathbf{F }}^{*}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^i = \mathcal F \Big (U_i^{*, int(K)},\;U_i^{*, ext(K)},\;\nu _K^i \Big ) + \big \langle \delta _{i,x}^{*},\; \delta _{i,y}^{*} \big \rangle \cdot \nu _K^i . \end{aligned}$$
(2.12)

We also require that all the integrals in formula (2.8) should be calculated exactly at the still water state. This can be easily achieved by using suitable Gauss-quadrature rules since the numerical solutions \(h,\,b\) and \(w\) are polynomials at the still water state in each triangle \(K\), hence \(\mathbf F (U)\) and \(s(h,b)\) are both polynomials. We can prove that the above methods (2.8), combined with the choice of fluxes (2.12), are actually well-balanced for the still water steady state of the shallow water equations. The key idea is to show that, at the still water steady state (1.2), the numerical fluxes \(\widehat{\mathbf{F }}^{*}\) becomes \(\mathbf F (U_i^{int(K)})\) on the edge \(\mathrm{{e}}_K^{i}\). We refer to [34] for the technical details of the proof.

When applied to problems which contain discontinuous solution, RKDG methods may generate oscillation and even nonlinear instability. We often apply nonlinear limiters to control these oscillations. Many limiters have been studied in the literature. In this paper, we use the classical characteristic-wise total variation bounded (TVB) limiter in [12, 30], with a corrected minmod function defined by

$$\begin{aligned} \overline{m}(a_{1},\cdots ,a_{n})=\left\{ \begin{array}{ll} a_{1}, &{} \quad \text{ if}\; |a_{1}|\le M\Delta x^{2}, \\ m(a_{1},\cdots ,a_{n}), &{} \quad \text{ otherwise}, \end{array} \right. \end{aligned}$$
(2.13)

where \(M\) is the TVB parameter to be chosen adequately [11] and the minmod function \(m\) is given by

$$\begin{aligned} m(a_{1},\cdots ,a_{n})=\left\{ \begin{array}{ll} s\min _{i}|a_{i}|, &{} \quad \text{ if}\; s=\text{ sign}(a_{1})=\cdots =\text{ sign} (a_{n}), \\ 0, &{} \quad \text{ otherwise}. \end{array} \right. \end{aligned}$$

Usually, the limiter is applied on the function \(U\) after each inner stage in the Runge-Kutta time stepping. For the shallow water system, we perform the limiting in the local characteristic variables. However, this limiter procedure might destroy the preservation of the still water steady state \(h+b=const\), since if the limiter is enacted, the resulting modified solution \(h\) may no longer satisfy this steady-state relation. Therefore, following the idea presented in [33, 36], we present the following strategy to perform the limiter, which works well with the well-balance property. As explained in [36], we note that the TVB limiter procedure actually involves two steps: the first one is to check whether any limiting is needed in a specific cell; and, if the answer is yes, the second step is to apply the TVB limiter on the variables in this cell. We first check if the limiting is needed, based on \((h+b,hu,hv)^{T}\). If a certain cell is flagged by this procedure needing limiting, then the actual TVB limiter is implemented on the variables \((h,hu,hv)^{T}\). Note that if in a steady-state region where \(h+b=const\) and \(u=v=0\), we first check if the limiting is needed based on \((h+b,hu,hv)^{T}=(const, 0, 0)^T\), which demonstrates that limiting is not needed in this cell. Therefore the flat surface \(h+b=const\) will not be affected by the limiter procedure and the well-balanced property is maintained. Also, we observe that this procedure will not destroy the conservativity of \(h\), which will be maintained during the limiter process. When the limiting procedure is implemented this way, numerical results show that this choice of the TVB limiter does not destroy the well-balanced property, and also it works well with the positivity-preserving limiter presented in the next section.

3 Positivity-Preserving Limiter

In this section, we present a simple positivity-preserving limiter on triangular meshes, and couple it with the well-balanced DG methods developed for the shallow water equations in Section 2. We will start by showing the positivity of a first order scheme with the well-balanced flux, and later generalize the idea to high order schemes. For the ease of presentation, Euler forward time discretization (2.8) will be discussed, but all the results hold for the TVD high order Runge-Kutta and multi-step time discretizations.

3.1 Preliminaries

For convenience, let \(\mathcal F _1\) and \(\widehat{\mathbf{F }}^{*}_1|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^i\) denote the first components of \(\mathcal F \) and \(\widehat{\mathbf{F }}^{*}|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^{i}\) respectively. Then \(\widehat{\mathbf{F }}^{*}_1|_{\mathrm{{e}}_K^{i}}\cdot \nu _K^{i}=\mathcal F _1(U_i^{*, int(K)},\;U_i^{*, ext(K)},\;\nu _K^i)\) by (2.12). Taking the test function as \(w\equiv 1\) in (2.8), we get the the scheme satisfied by the cell averages for the water height \(h\):

$$\begin{aligned} \overline{h}^{n+1}_K=\overline{h}^{n}_K-\frac{\Delta t}{|K|}\sum \limits _{i=1}^3\int \limits _{\mathrm{{e}}_K^{i}}\mathcal F _1(U_i^{*, int(K)},\;U_i^{*, ext(K)},\;\nu _K^{i})\,\mathrm{d}s, \end{aligned}$$
(3.1)

where \(\overline{h}^{n}_K\) stands for the average of \(h\) over the triangle \(K\) at time level \(n\).

Suppose we use \(L\)-point Gaussian quadrature for the line integral in (2.8) and (3.1), and the subscript \((i,\beta )\) will denote the point value at the \(\beta \)-th quadrature point of the \(i\)-th edge. Let \(w_\beta \) denote the Gauss quadrature weight on the interval \([-1/2, \, 1/2]\). Then (3.1) becomes

$$\begin{aligned} \overline{h}^{n+1}_K=\overline{h}^{n}_K-\frac{\Delta t}{|K|}\sum \limits _{i=1}^3\sum \limits _{\beta =1}^L \mathcal F _1\Big (U_{i,\beta }^{*, int(K)},\;U_{i,\beta }^{*, ext(K)},\;\nu _K^i \Big ) w_\beta l_K^i. \end{aligned}$$
(3.2)

3.2 First order schemes

To investigate the positivity of a high order scheme (3.2), we need to study its first order counterpart. Given piecewise constants \(U^n_K\) for the solution and \(b_K\) for the bottom on each triangle \(K\) at time level \(n\), consider a first order scheme for the water height,

$$\begin{aligned} h_{K}^{n+1}=h_{K}^{n}-\frac{\Delta t}{|K|}\sum \limits _{i=1}^3 \mathcal F _1\Big (U_i^{*, int(K)},\;U_i^{*, ext(K)},\;\nu _K^{i} \Big ) l^i_K, \end{aligned}$$
(3.3)

where

$$\begin{aligned} U_i^{*, int(K)}=\frac{h^{{*},i}_K}{h^n_K}U^n_K, \quad U_i^{*, ext(K)}=\frac{h^{{*},i}_{K(i)}}{h^n_{K(i)}}U^n_{K(i)}, \end{aligned}$$

with

$$\begin{aligned} h^{{*},i}_K&= \max \left( 0,h^n_K+b_K-\max (b_K,b_{K(i)})\right) ,\nonumber \\ h^{{*},i}_{K(i)}&= \max \left( 0,h^n_{K(i)}+b_{K(i)}-\max (b_{K},b_{K(i)})\right) , \end{aligned}$$

Lemma 3.1

Under the CFL condition \(\frac{\Delta t}{|K|} \alpha \sum \limits _{i=1}^3 l^i_K \le 1\), with

$$\begin{aligned} \alpha =\max \left( \big (|u|+\sqrt{gh},\; |v|+\sqrt{gh}\big ) \cdot \nu \right) , \end{aligned}$$
(3.4)

if \(h_{K}^{n}\) is non-negative for any \(K\), then \(h_{K}^{n+1}\) is non-negative in the first order scheme (3.3).

Proof

By (2.4), the flux in (3.3) is

$$\begin{aligned}&\mathcal F _1\Big (U^{*, int(K)}_i,\;U^{*, ext(K)}_i,\;\nu _K^{i}\Big )\\&\quad =\frac{1}{2}\left[ \frac{h^{{*},i}_K}{h^n_K}\Big \langle (hu)^n_K,\;(hv)^n_K \Big \rangle \cdot \nu _K^{i} + \frac{h^{{*},i}_{K(i)}}{h^n_{K(i)}}\Big \langle (hu)^n_{K(i)},\;(hv)^n_{K(i)}\Big \rangle \cdot \nu _K^{i} -\alpha \Big (h^{*,i}_{K(i)}-h^{*,i}_K \Big ).\right] \end{aligned}$$

And the scheme (3.3) can be written as

$$\begin{aligned} h^{n+1}_{K}&= \left[ 1-\frac{1}{2}\frac{\Delta t}{|K|}\sum \limits _{i=1}^3 l^i_K\frac{h^{{*},i}_K}{h^n_K} \left( \alpha +\big \langle u^n_K,\;v^n_K \big \rangle \cdot \nu _K^{i}\right) \right] h^n_K\nonumber \\&\quad +\frac{1}{2}\frac{\Delta t}{|K|}\sum \limits _{i=1}^3 l^i_K\frac{h^{{*},i}_{K(i)}}{h^n_{K(i)}}\left( \alpha - \big \langle u^n_{K(i)},\;v^n_{K(i)}\big \rangle \cdot \nu _K^{i}\right) h^n_{K(i)} \end{aligned}$$
(3.5)

Notice that \(h^{{*},i}_K/h^n_K,\, h^{{*},i}_{K(i)}/h^n_{K(i)}\in [0,1]\). And we have \(|\langle u^n_K,\;v^n_K\rangle \cdot \nu _K^{i} |\le \alpha \) for any \(K\) by (3.4). Therefore, (3.5) is a linear combination of \(h_K^n\) and \(h_{K(i)}^n\) with non-negative coefficients. Thus, \(h^{n+1}_K\) is non-negative if \(h_K^n\) and \(h_{K(i)}^n\) are non-negative. \(\square \)

3.3 High order schemes

Following the approach in [39], the first step is to decompose the cell average \(\overline{h}_K^n\) as a convex combination of point values of the DG polynomial \(h_K(x,y)\) by a quadrature satisfying:

  • The quadrature rule is exact for integration of \(h_K(x,y)\) on \(K\).

  • The quadrature points include all \(L\)-point Gauss quadrature points for each edge \(\mathrm{e}_K^i\).

  • All the quadrature weights should be positive.

This particular quadrature rule can be constructed by a transformation of the tensor product of \(M\)-point Gauss-Lobatto and \(L\)-point Gauss quadrature, which is summarized below (see [39] for details).

Let \(\{v^{\beta }: \beta =1,\cdots ,L\}\) denote the Gauss quadrature points on \([-\frac{1}{2},\frac{1}{2}]\) with weights \(w_{\beta }\), and \(\{\widehat{u}^{\alpha }: \alpha =1,\cdots ,M\}\) denote the Gauss-Lobatto quadrature points on \([-\frac{1}{2},\frac{1}{2}]\) with weights \(\widehat{w}_{\alpha }\). In the barycentric coordinates, the set of quadrature points \(S_K\) can be written as

$$\begin{aligned} S_K&= \left\{ \left( \frac{1}{2}+v^{\beta },\;\big (\frac{1}{2}+\widehat{u}^{\alpha }\big )\big (\frac{1}{2}-v^{\beta }\big ),\; \big (\frac{1}{2}-\widehat{u}^{\alpha }\big )\big (\frac{1}{2}-v^{\beta }\big )\right) ,\right. \nonumber \\&\quad \quad \left( \big (\frac{1}{2}-\widehat{u}^{\alpha }\big )\big (\frac{1}{2}-v^{\beta }\big ),\;\frac{1}{2}+v^{\beta }, \big (\frac{1}{2}+\widehat{u}^{\alpha }\big )\big (\frac{1}{2}-v^{\beta }\big )\right) , \nonumber \\&\quad \quad \left. \left( \big (\frac{1}{2}+\widehat{u}^{\alpha }\big )\big (\frac{1}{2}-v^{\beta }\big ),\;\big (\frac{1}{2}-\widehat{u}^{\alpha }\big )\big (\frac{1}{2}-v^{\beta }\big ),\;\frac{1}{2}+v^{\beta }\right) :\alpha =1,\cdots ,M;\right. \nonumber \\&\left. \qquad \qquad \beta =1,\cdots ,L\right\} . \end{aligned}$$
(3.6)

In particular, for the P\(^2\)-DG method used in numerical tests of this paper, \(4\)-point Gauss quadrature rule is needed so that the line integral in (2.8) is exactly calculated for the still water state. And the \(3\)-point Gauss-Lobatto quadrature is sufficient to construct \(S_K\). See Fig. 1 for the quadrature points.

Fig. 1
figure 1

The quadrature points on a triangle for P\(^2\) polynomials. There are 24 distinct points. Three points near the centroid of the triangle are very close to one another

Let \(h_K(x,y)\) denote the DG polynomial for the water height at time level \(n\) and \(w_\mathbf x \) denote the quadrature weight for the point \(\mathbf x \in S_K\) of the quadrature rule (3.6). Let \(h^{int(K)}_{i,\beta }\) denote the point value of \(h_K(\mathbf x )\) at the \(\beta \)-th Gauss quadrature point of the \(i\)-th edge of \(K\). Then the quadrature weight for \(h^{int(K)}_{i,\beta }\) is \(2w_\beta \widehat{w}_1/3\), see [39] for the detail.

The cell average \(\overline{h}^n_K\) can now be written as a convex combination of point values of \(h_K(\mathbf x )\) via the quadrature rule \(S_K\),

$$\begin{aligned} \overline{h}^n_K\!=\!\int \int \limits _K h_K(\mathbf x )\,\mathrm{d}\mathbf x \!=\! \sum \limits _{\mathbf{x }\in S_K} h_K(\mathbf x ) w_\mathbf x =\sum \limits _{i=1}^3\sum \limits _{\beta =1}^L\frac{2}{3} w_\beta \widehat{w}_1 h^{int(K)}_{i,\beta }\! +\!\sum \limits _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x ,\qquad \end{aligned}$$
(3.7)

where \(\overline{S}_K\) is the set of the points in \(S_K\) that lie in the interior of the triangle \(K\).

Theorem 3.2

For the scheme (3.2) to be positivity preserving, i.e., \(\overline{h}_K^{n+1}\ge 0\), a sufficient condition is that \(h_K(\mathbf x )\ge 0,\; \forall \mathbf x \in S_K\) for all \(K\), under the CFL condition

$$\begin{aligned} \alpha \frac{\Delta t}{|K|}\sum \limits _{i=1}^{3}l_K^{i} \le \frac{2}{3}\widehat{w}_1. \end{aligned}$$
(3.8)

Here \(h_K(\mathbf x )\) denotes the polynomial for water height at time level \(n,\,\widehat{w}_1\) is the quadrature weight of the \(M\)-point Gauss-Lobatto rule on \([-1/2,\,1/2]\) for the first quadrature point. For \(k=2,3,\) \(\widehat{w}_1=1/6\) and for \(k=4,5,\,\widehat{w}_1=1/12\).

Proof

Rewrite the scheme (3.2) as

$$\begin{aligned} \overline{h}^{n+1}_K&= \overline{h}^{n}_K-\frac{\Delta t}{|K|}\sum \limits _{i=1}^3\sum \limits _{\beta =1}^{L} \mathcal F _1\Big (U^{{*},int(K)}_{i,\beta },\;U^{{*},ext(K)}_{i,\beta },\;\nu _K^{i}\Big )w_{\beta }l_K^i\nonumber \\&= \overline{h}^{n}_K-\frac{\Delta t}{|K|}\sum \limits _{\beta =1}^{L}w_{\beta }\left( \sum \limits _{i=1}^3\mathcal F _1\Big (U^{{*},int(K)}_{i,\beta },\;U^{ {*},ext(K)}_{i,\beta },\;\nu _K^{i}\Big )l^i_K\right) . \end{aligned}$$
(3.9)

Then decompose the flux term inside the bracket. Let

$$\begin{aligned}&\sum \limits _{i=1}^3\mathcal F _1\Big (U^{{*},int(K)}_{i,\beta },\;U^{{*},ext(K)}_{i,\beta },\; \nu _K^i \Big )l_K^i\nonumber \\&\quad =\mathcal F _1\Big (U^{{*},int(K)}_{1,\beta },\;U^{{*},ext(K)}_{1,\beta },\;\nu _K^1 \Big )l_K^1+\mathcal F _1\Big (U^{{*},int(K) }_{2,\beta },\;U^{{*},ext(K)}_{2,\beta },\;\nu _K^2 \Big )l_K^2\nonumber \\&\quad \quad +\mathcal F _1\Big (U^{{*},int(K)}_{3,\beta },\;U^{{*},ext(K)}_{3,\beta },\;\nu _K^3 \Big )l^3_K\nonumber \\&\quad =\mathcal F _1\Big (U^{{*},int(K)}_{1,\beta },\;U^{{*},ext(K)}_{1,\beta },\;\nu _K^1 \Big )l^1_K+\mathcal F _1\Big (U^{{*},int(K) }_{1,\beta },\;U^{{*},int(K)}_{2,\beta },\;-\nu _K^1 \Big )l^1_K\nonumber \\&\quad \quad +\mathcal F _1\Big (U^{{*},int(K)}_{2,\beta },\;U^{{*},int(K)}_{1,\beta },\;\nu _K^1 \Big )l^1_K+\mathcal F _1\Big (U^{{*},int(K) }_{2,\beta },\;U^{{*},ext(K)}_{2,\beta },\;\nu _K^2 \Big )l^2_K\nonumber \\&\quad \quad +\mathcal F _1\Big (U^{{*},int(K)}_{2,\beta },\;U^{{*},int(K)}_{3,\beta },\;\nu _K^3 \Big )l^3_K\nonumber \\&\quad \quad +\mathcal F _1\Big (U^{{*},int(K)}_{3,\beta },\;U^{{*},int(K)}_{2,\beta },\;-\nu _K^3 \Big )l^3_K+\mathcal F _1\Big (U^{{*},int(K)}_{3, \beta },\;U^{{*},ext(K)}_{3,\beta },\;\nu _K^3 \Big )l^3_K,\nonumber \\ \end{aligned}$$
(3.10)

where we have used the conservativity of the flux (2.5).

Plugging (3.7) and (3.10) into (3.9), we get the monotone form

$$\begin{aligned} \overline{h}^{n+1}_K&= \sum \limits _{i=1}^3\sum \limits _{\beta =1}^L\frac{2}{3} w_\beta \widehat{w}_1 h^{int(K)}_{i,\beta } +\sum \limits _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x \nonumber \\&\quad -\frac{\Delta t}{|K|}\sum \limits _{\beta =1}^{L}w_{\beta }\left( \sum \limits _{i=1}^3\mathcal F _1\Big (U^{{*},int(K)}_{i,\beta },\;U^{{*}, ext(K)}_{i,\beta },\;\nu _K^i \Big )l^i_K\right) \nonumber \\&= \sum \limits _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x +\sum \limits _{\beta =1}^{ L}\frac{2}{3} w_{\beta }\widehat{w}_1 \Big [H_{1,\beta }+H_{2,\beta }+H_{3,\beta }\Big ], \end{aligned}$$
(3.11)

where \(H_{1,\beta }, H_{2,\beta },\) and \(H_{3,\beta }\) are

$$\begin{aligned} H_{1,\beta }&= h^{int(K)}_{1,\beta }-\frac{3\Delta t}{2\widehat{w}_1|K|}\left[ \mathcal F _1 \Big (U^{*,int(K)}_{1,\beta },\;U^{*,ext(K)}_{1,\beta },\; \nu _K^1 \Big )l^1_K\right. \\&\qquad \qquad \qquad \qquad \qquad \qquad +\left. \mathcal F _1 \Big (U^{*,int(K) }_{1,\beta },\;U^{*,int(K)}_{2,\beta },\;-\nu _K^1 \Big )l^1_K\right] , \\ H_{2,\beta }&= h^{int(K)}_{2,\beta }-\frac{3\Delta t}{2\widehat{w}_1|K|}\left[ \mathcal F _1 \Big (U^{*,int(K)}_{2,\beta },\;U^{*,int(K)}_{1,\beta },\;\nu _K^1 \Big )l^1_K\right. \\&\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad +\left. \mathcal F _1 \Big (U^{*,int(K) }_{2,\beta }, \;U^{*,ext(K)}_{2,\beta },\;\nu _K^2 \Big )l^2_K\right. \\&\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad +\left. \mathcal F _1 \Big (U^{*,int(K)}_{2,\beta },\;U^{*,int(K)}_{3,\beta },\;\nu _K^3 \Big )l^3_K\right] \\ H_{3,\beta }&= h^{int(K)}_{3,\beta }-\frac{3\Delta t}{2\widehat{w}_1|K|}\left[ \mathcal F _1 \Big (U^{*,int(K)}_{3,\beta },\;U^{*,int(K)}_{2,\beta },\;-\nu _K^3 \Big )l^3_K\right. \\&\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad +\left. \mathcal F _1 \Big (U^{*, int(K)}_{3,\beta },\;U^{*,ext(K)}_{3,\beta },\;\nu _K^3 \Big )l^3_K \right] . \end{aligned}$$

Following Lemma 3.1, under the CFL condition (3.8), \(H_{2,\beta }\ge 0\) if \(h^{int(K)}_{i,\beta },\; h^{ext(K)}_{i,\beta }\ge 0\). The positivity of \(H_{1,\beta }\) and \(H_{3,\beta }\) follows the analysis of one-dimensional first order positivity-preserving methods presented in [36, Lemma3.1].

Therefore, if all the point values involved in (3.11), \(h^{int(K)}_{i,\beta },\;h^{ext(K)}_{i,\beta }\) and \(h_K(\mathbf x )\) for \(\mathbf{x }\in \overline{S}_K\) are non-negative, which is equivalent to \(h_K(\mathbf x )\ge 0,\; \forall \mathbf x \in S_K\) for all \(K\), then we have the positivity \(\overline{h}^{n+1}_K\ge 0\) in (3.11). \(\square \)

Remark 3.3

As mentioned in [35, 38], for those points in \(\overline{S}_K\), instead of requiring \(h_K(\mathbf x )\ge 0,\, \forall \mathbf{x }\in \overline{S}_K\), it suffices to require \(\sum _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x \ge 0\) to have positivity of \(\overline{h}^{n+1}_K\) in (3.11). Notice that \(\sum \nolimits _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x /\sum \nolimits _{\mathbf{x }\in \overline{S}_K}w_\mathbf x \) is a convex combination of point values of \(h_K(\mathbf x )\), thus by the Mean Value Theorem, there exists some point \(\mathbf x ^*\in K\) such that \(h_K(\mathbf x ^*)=\frac{1}{\sum \nolimits _{\mathbf{x }\in \overline{S}_K}w_\mathbf x } \sum \nolimits _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x \). By (3.7), we have

$$\begin{aligned} h_K(\mathbf x ^*)\!=\!\frac{1}{\sum \limits _{\mathbf{x }\in \overline{S}_K}w_\mathbf x } \sum \limits _{\mathbf{x }\in \overline{S}_K} h_K(\mathbf x ) w_\mathbf x \!=\!\frac{1}{1-2\widehat{w}_1}\left( \overline{h}^{n+1}_K\!-\! \sum \limits _{i=1}^3\sum \limits _{\beta =1}^L\frac{2}{3} w_\beta \widehat{w}_1 h^{int(K)}_{i,\beta }\right) ,\qquad \end{aligned}$$
(3.12)

where we use the fact \(\sum \nolimits _{\mathbf{x }\in \overline{S}_K}w_\mathbf x =1-\sum \nolimits _{i=1}^3\sum \nolimits _{\beta =1}^L\frac{2}{3} w_\beta \widehat{w}_1 =1-2\widehat{w}_1.\) So a more relaxed but less intuitive sufficient condition for (3.2) to satisfy \(\overline{h}^{n+1}_K \ge 0\) is, \(\overline{h}^n_K,\; h^{int(K)}_{i,\beta },\;h^{ext(K)}_{i,\beta },\; h_K(\mathbf x ^*)\ge 0\) with the CFL condition (3.8), where \( h_K(\mathbf x ^*)\) is defined in (3.12).

3.4 The Limiter

At time level \(n\), given the water height DG polynomial \(h_K(\mathbf x )\) with its cell average \(\overline{h}^n_K\ge 0\), to enforce the sufficient condition \(h_K(\mathbf x )\ge 0,\;\forall \mathbf x \in S_K\), the limiter in [39] can be used directly, i.e., replacing \(h_K(\mathbf x )\) by a linear scaling around the cell average:

$$\begin{aligned} \widetilde{h}_K(\mathbf x )=\theta _K \Big (h_K(\mathbf x )-\overline{h}^n_K \Big )+\overline{h}^n_K, \end{aligned}$$
(3.13)

where \(\theta _K\in [0,1]\) is determined by

$$\begin{aligned} \theta _K=\min _\mathbf{x \in S_K} \theta _\mathbf{x },\quad \theta _\mathbf{x }=\min \left\{ 1,\frac{\overline{h}^n_K}{ \overline{h}^n_K-h_K(\mathbf x )}\right\} . \end{aligned}$$
(3.14)

This limiter is conservative (the cell average of \(\widetilde{p}_K\) is still \(\overline{h}^n_K\)), positivity-preserving (\(\widetilde{h}_K(\mathbf x )\ge 0,\;\forall \mathbf x \in S_K\)) and high order accurate. See [36, 37, 39] for the discussion of the limiter.

An alternative limiter is to enforce the relaxed condition in Remark 3.3. Let \(\widetilde{S}_K\) denote the points in \(S_K\) which lie on the edges of \(K\), then we can use (3.13) with

$$\begin{aligned} \theta _K=\min \left\{ \theta _\mathbf{x ^*},\;\min _\mathbf{x \in \widetilde{S}_K} \theta _\mathbf{x }\right\} ,\quad \theta _\mathbf{x }=\min \left\{ 1,\;\frac{\overline{h}^n_K}{ \overline{h}^n_K-h_K(\mathbf x )}\right\} . \end{aligned}$$
(3.15)

Compared to (3.14), evaluating \(h_K(\mathbf x ), \mathbf{x }\in \overline{S}_K\) is avoided in (3.15) since \(h_K(\mathbf x ^*)\) can be obtained by (3.12), which is preferred since these point values are not Gaussian quadrature points on a triangle thus not used in the DG scheme (2.8).

Notice that the positivity-preserving limiter (3.13) or (3.14) will not take any effect if the DG polynomials satisfy (1.2). So the positivity-preserving limiter does not affect the well-balanced property.

3.5 The Algorithm for Runge-Kutta Time Discretizations

At the end, we present the algorithm flowchart of our positivity-preserving well-balanced methods, when coupled with third order TVD Runge-Kutta methods.

First of all, one notices that, for Euler forward time discretization, the CFL constraint (3.8) is sufficient rather than necessary for preserving positivity. Second, for a Runge-Kutta time discretization, to enforce the CFL condition rigorously, we need to obtain an accurate estimation of (3.4) for all the stages of Runge-Kutta based only on the numerical solution at time level n, which is very difficult in most of test examples. So an efficient implementation is, if a preliminary calculation to the next time step produces negative water height, we restart the computation from the time step \(n\) with half of the time step size.

The algorithm of positivity-preserving well-balanced discontinuous Galerkin method with the third order TVD Runge-Kutta time discretization on triangular meshes can be summarized as below:

  1. 1.

    Given the DG polynomials \(U_K(\mathbf x )\) at time step \(n\) satisfying the cell average of \(h\) is non-negative and \(h_{K}(\mathbf x )>0, \;\forall \mathbf x \in \widetilde{S}_{K}\), calculate \( \alpha =\max \left( (|u|+\sqrt{gh},\; |v|+\sqrt{gh}) \cdot \nu \right) \), where the maximum of \(u,v,h\) is taken over \(\widetilde{S}_K\) and the maximum of \(\nu \) is taken over \(\nu _K^{i}\) for all \(K\). Set the time step

    $$\begin{aligned} \Delta t=\min \frac{2}{3}\frac{\widehat{w}_1 |K|}{\alpha \sum \nolimits _{i=1}^{3}l^i_K}. \end{aligned}$$
  2. 2.

    Calculate the first stage with \(U_K(\mathbf x )\) based on (2.8) with the numerical fluxes (2.12). Let \(U_K^1(\mathbf x )\) denote the solution of the first stage. Modify it by first the TVB limiter then the positivity limiter (3.13) or (3.14) into \(\widetilde{U}_K^1(\mathbf x )\).

  3. 3.

    Calculate the second stage with \(\widetilde{U}_K^1(\mathbf x )\). Let \(U_K^2(\mathbf x )\) denote the solution of the second stage. If its cell average of water height is negative (by Theorem 3.2, this means that \(\alpha \) calculated based on \(U_K(\mathbf{x })\) is smaller than the one of \(\widetilde{U}_{K}^1(\mathbf{x })\)), then go back to step two and restart with half time step; otherwise, modify it by the limiters into \(\widetilde{U}_{K}^2(\mathbf x )\).

  4. 4.

    Calculate the third stage with \(\widetilde{U}_K^2(\mathbf x )\). Let \(U_K^3(\mathbf x )\) denote the solution of the third stage. If its cell average of water height is negative (by Theorem 3.2, this means that \(\alpha \) calculated based on \(U_K(\mathbf x )\) is smaller than the one of \(\widetilde{U}_K^{2}(\mathbf{x })\)), then go back to step two and restart with half time step; otherwise, modify it by the limiters into \(\widetilde{U}_K^3(\mathbf{x })\), which is the solution at time step \(n+1\).

4 Numerical Examples

In this section we present numerical results of our positivity-preserving well-balanced DG methods when applied to the two-dimensional shallow water equations on unstructured triangular meshes. The third order finite element DG method (i.e. \(k=2\)), coupled with the third order TVD Runge-Kutta time discretization (2.7), is implemented in the examples. Global Lax-Friedrichs numerical flux is used, and the gravitation constant \(g\) is fixed as \(9.812\,\mathrm{{m}}/\mathrm{{s}}^2\) except the test in Subsect. 4.7. The time step is taken as indicated by the CFL condition (3.8). All the meshes are unstructured, and generated by EasyMesh [24].

4.1 Well-Balanced Test

The purpose of the first test problem is to verify the well-balanced property of our algorithm towards the steady-state solution.

We consider a rectangular computational domain \([0,\,1]\times [0,\,1]\). The bottom function is chosen as:

$$\begin{aligned} b(x,y) = \max \left( 0,\, 1-(10x-5)^2-(10y-5)^2\right) , \end{aligned}$$
(4.1)

and the initial data is the stationary solution:

$$\begin{aligned} h(x,y,0)=2-b(x,y), \quad hu(x,y,0)=hv(x,y,0) = 0. \end{aligned}$$

A periodic boundary condition is used. This steady state should be exactly preserved, and the surface should remain flat. We compute the solution until \(t=0.5\) on the triangular meshes with the mesh size \(\tau _K=0.025\). In order to demonstrate that the still water solution is indeed maintained up to round-off error, we use the double-precision to perform the computation, and show the \(L^1\) and \(L^\infty \) errors for the water height \(h\) (note: \(h\) in this case is not a constant function!) and the discharges \(hu,\,hv\) in Table 1. We can clearly see that all errors are at the level of round-off errors, which verifies the well-balanced property.

Table 1 \(L^1\) and \(L^\infty \) errors for the stationary solution in Sect. 4.1

4.2 Accuracy Test

In this example we will test the high order accuracy of our schemes when applied to the following two-dimensional problem. The computational domain is set as a unit square \([0,\,1]^2\). The bottom topography and the initial data are given by:

$$\begin{aligned} b(x,y)&= \sin ^2\left( \frac{\sqrt{2}\pi }{2}( x+y)\right) , \quad h(x,y,0) = 5+\mathrm{{e}}^{\cos \left( \sqrt{2}\pi ( x+y)\right) },\\ (hu)(x,y,0)&= (hv)(x,y,0) = \frac{\sqrt{2}}{2}\sin \left( \cos \left( \sqrt{2}\pi ( x+y)\right) \right) , \end{aligned}$$

which are obtained by rotating the setup of the one-dimensional accuracy test in [32, 35] by an angle of \(45^{\circ }\). Periodic boundary conditions are considered here for simplicity. The final time is set as \(t=0.05\) to avoid the appearance of shocks in the solution. Since the exact solution is also not known explicitly for this case, we use the one-dimensional well-balanced DG methods presented in [34], with a refined 12,800 uniform cells, to compute a reference solution. After rotating that solution by an angle of \(45^{\circ }\), this reference solution is treated as the exact solution in computing the numerical errors. The TVB constant \(M\) in the TVB limiter (2.13) is taken as 100 here. The computational domain, and the unstructured triangular mesh with \(\tau _K=0.1,\,0.025\), are shown in Fig. 2. Table 2 contains the \(L^1\) errors and orders of accuracy for the cell averages. We can clearly see that, in this two-dimensional test case, third order accuracy is achieved for the RKDG scheme.

Fig. 2
figure 2

The computational domain and unstructured triangular meshes of the accuracy test problem in Sect. 4.2. Left with mesh size \(\tau _K=0.1\); right with mesh size \(\tau _K=0.025\)

4.3 A Small Perturbation of a Steady-State Solution

This is a classical example to show the capability of the proposed scheme for the perturbation of the stationary state. This test was given by LeVeque [22], and has also been used in [8, 32, 34].

We solve the system in the rectangular domain \([0,2] \times [0,1]\). The bottom topography is an isolated elliptical shaped hump:

$$\begin{aligned} b(x,y)=0.8 \; \exp \big (-5(x-0.9)^2-50(y-0.5)^2 \big ). \end{aligned}$$
(4.2)

The initial condition is given by:

$$\begin{aligned} h(x,y,0)&= \left\{ \begin{array} {l l} 1-b(x,y)+0.0001, &{} \quad \text{ if} \; 0.05\le x\le 0.15, \\ 1-b(x,y), &{} \quad \text{ otherwise,} \end{array} \right. \\ hu(x,y,0)&= hv(x,y,0)=0 . \nonumber \end{aligned}$$
(4.3)

Initially, the surface is almost flat except for \(0.05\le x\le 0.15\), where \(h\) is perturbed upward by a small magnitude of 0.0001. Theoretically, this disturbance should split into two waves, propagating left and right at the characteristic speeds \(\pm \sqrt{gh}\). We use the outlet boundary condition on the left and right, and reflection boundary conditions on the top and bottom sides. TVB constant \(M\) is taken as ten in the test. Figure 3, left, displays the right-going disturbance as it propagates past the hump on the triangular meshes with \(\tau _K=0.00625\). The surface level \(h+b\) is presented at different times. The results indicate that our schemes can resolve the complex small features of the flow very well. As a comparison, we refer to [8, Fig. 5] for the output if a non-well-balanced method is used.

Table 2 \(L^1\) errors and numerical orders of accuracy for the example in Sect. 4.2
Fig. 3
figure 3

The contours of the surface level \(h+b\) for the problem in Sect. 4.3. 40 Uniformly spaced contour lines. From top to bottom at time \(t=0.12\) from 0.999993 to 1.00007; at time \(t=0.24\) from 0.9999 to 1.0001; at time \(t=0.36\) from 0.9998 to 1.0002; at time \(t=0.48\) from 0.99985 to 1.00005; and at time \(t=0.6\) from 0.9999 to 1.0001. Left results with the bottom (4.2). Right results with the bottom (4.4)

Next, we increase the height of the bottom topography to reach the water surface. The modified bottom topography takes the form:

$$\begin{aligned} b(x,y)=\exp \big (-5(x-0.9)^2-50(y-0.5)^2 \big ). \end{aligned}$$
(4.4)

The other set up remains the same. We repeat the simulation and plot the surface level at different times in Fig. 3, right. As one can see, the general structure of the solution is well resolved. For small time when the right-going wave does not reach the bottom hump, the surface stays the same for these two simulations with different bottom topography. Obvious difference can be observed as the wave reaches and passes the hump.

4.4 Circular Dam-Break Problem

This is a classical test case for testing the complete break of a circular dam separating a basin of water and dry bed. It has been previously tested in [6, 16].

We consider a square computatinal domain \([-100,\,100]\times [-100,\,100]\) with a flat bottom topography (i.e. \(b=0\)). The dam is located at \(r=\sqrt{x^2+y^2}=60\), and the water height \(h\) is initially set as ten inside the dam and zero outside. Both components of the velocity u and v are set to zero initially. At time \(t=0\), the circular wall forming the dam collapses. We discretize the domain with the triangular meshes and \(\tau _K\) is set as one. A 3D view and contour lines of the water height at time \(t=1.75\) are shown in Fig. 4. We can observe an almost perfectly symmetric solution, and there is no oscillation (\(\max (h)=10\)) in the numerical results.

Fig. 4
figure 4

Numerical results at time \(t=1.75\) of the circular dam-break problem in Sect. 4.4. Left 3D view of the surface level; right the contours of the surface level with 30 uniformly spaced contour lines between zero and ten

4.5 Water Drop Problem

Next, we apply our methods to a numerical test case which simulates the water drop problem. Following the setup in [28], we consider the 2D Gaussian shaped peak initial condition given by:

$$\begin{aligned} h(x,y,0)&= 1+0.1\exp \left( -100\big ((x-0.5)^2+(y-0.5)^2 \big ) \right) , \nonumber \\ hu(x,y,0)&= hv(x,y,0)=0, \end{aligned}$$
(4.5)

in the computational domain \([0,1]^2\). The reflective boundary conditions are employed. The initial Gaussian shaped water drop generates a wave that reflects off the boundary. We have provided the evolution of water surface at various times in Fig. 5, which shows that the wave is well simulated by our methods.

Fig. 5
figure 5

The water surface level in the water drop problem with the flat bottom topography at different times

As a comparison, we also repeat the test with a non-zero bottom topography:

$$\begin{aligned} b(x,y)=0.5 \, \exp \left( -10\big ((x-0.75)^2+(y-0.5)^2 \big )\right) . \end{aligned}$$
(4.6)

The results are shown in Fig. 6, where we can observe the effect of the bottom on the propagation of the wave.

Fig. 6
figure 6

The water surface level in the water drop problem with the bottom topography (4.6) at different times

4.6 Flooding on a Channel with Three Mounds

In this test example, we consider the simulation of a flow through a channel which contains three mounds on its bottom [7, 17]. The length of the channel is 75 and width is 30. The bottom topography takes the form of

$$\begin{aligned} b(x,y)=\max \big (0,m_1(x,y),m_2(x,y),m_3(x,y)\big ), \end{aligned}$$
(4.7)

where

$$\begin{aligned} m_1(x,y)&= 1-0.1\sqrt{(x-30)^2+(y-22.5)^2}, \\ m_2(x,y)&= 1-0.1\sqrt{(x-30)^2+(y-7.5)^2}, \\ m_1(x,y)&= 12.8-0.28\sqrt{(x-47.5)^2+(y-15)^2} . \end{aligned}$$

Initially, the domain is set as dry, i.e. \(h=hu=hv=0\). We impose the reflecting boundary condition on the upper and lower boundaries in y-direction. The right \(x\)-boundary is a open-wall outflow boundary. At the left \(x\)-boundary, we impose an inflow of the form: \(u=1,\,v=0\) and the water height \(h=0.5\) for the time \(t\le 300,\;h=1\) when \(t\ge 300\). We test our well-balanced positivity-preserving methods on this problem with triangulation of mesh size \(\tau _K=0.5\). The numerical results obtained at different times are shown in Fig. 7.

Fig. 7
figure 7

The water surface level in the flooding problem on a channel with three mounds at different times \(t=8,\,30,\,300\) and \(540\) (from top to bottom). Left 3D view, color spanning between 0 and 1.2; right the 2D contours with 30 uniformly spaced contour lines between 0 and 1.2

4.7 Flows in Converging–Diverging Channels

In the last example, we consider the water flow in an open converging–diverging channel. The test is first discussed in [19] and recently used in [8]. The gravitation constant \(g\) is taken as one in this test.

The computational domain is defined on the converging–diverging channel of length \(3\) with a half-cosine constriction centered at \(x=1.5\). It takes the form of \([0,\,3]\times [-y_b(x),\;y_b(x)]\), where

$$\begin{aligned} y_b(x)&= \left\{ \begin{array} {l l} 0.5-0.5(1-d)\cos ^2(\pi (x-1.5)), &{} \quad \text{ if} \; |x-1.5|\le 0.5, \\ 0.5, &{}\quad \text{ otherwise,} \end{array} \right. \end{aligned}$$
(4.8)

and \(d\) is the minimum channel breadth. Two values of the channel breadth \(d\), 0.9 and 0.6, are tested in this example. The computational domain with \(d=0.6\) is shown in Fig. 8, left.

We consider a bottom topography which consists of two elliptic Gausssian mounds:

$$\begin{aligned} b(x,y)&= B\left( \exp \big (-10(x-1.9)^2-50(y-0.2)^2 \big )\right. \nonumber \\&\quad +\left. \exp \big (-20(x-2.2)^2-50(y+0.2)^2 \big )\right) , \end{aligned}$$
(4.9)

where \(B\) will be specified later. This topography with \(B=1\) is shown in Fig. 8, right. The initial conditions are given by:

$$\begin{aligned} h(x,y,0)=\max \big (0,1-b(x,y)\big ), \quad hu(x,y,0)=2, \quad hv(x,y,0) = 0. \end{aligned}$$

We impose the reflecting boundary condition on the upper and lower boundaries in \(y\)-direction. The left \(x\)-boundary is set as an inflow boundary with \(u = 2\) and the right \(x\)-boundary is a zeroth-order outflow boundary.

Fig. 8
figure 8

Initial setup of the converging–diverging channels problem in Sect. 4.7. Left the computational domain with \(d=0.6\) and the unstructured triangular meshes with \(\tau _K=0.025\); right the contours of the bottom topography (4.9) with \(B=1\) and \(d=0.6\)

We first generate the triangular meshes on the rectangle domain \([0,\,3]\times [-0.5,\,0.5]\). Following the idea in [8], the triangulation on the converging–diverging channel is obtained through the mapping

$$\begin{aligned} (x,\,y) \rightarrow \left\{ \begin{array} {l l} (x,\,y-(1-d)\cos ^2 \big (\pi (x-1.5))y \big ), &{} \quad \text{ if} \; |x-1.5|\le 0.5, \\ (x,\,y), &{} \quad \text{ otherwise.} \end{array} \right. \end{aligned}$$

The resulting unstructured triangular mesh with \(\tau _K=0.025\) is shown in Fig. 8, left.

Our well-balanced positivity-preserving methods are tested on this problem. In all tests, the simulations are carried out on two triangulation with mesh sizes \(\tau _K=0.025\) and 6.25E\(-\)03 respectively. The stopping time is set as \(t=2\). We start with the parameters \(d=0.9\) and \(B=0\), i.e., a flat bottom. The numerical results are shown in Fig. 9, which agree well with the solutions in [8, 19].

Next, we keep the computational domain (\(d=0.9\)) and set the bottom topography as \(B=1\) in (9). The two mounds are set to reach the water surface. We repeat our simulations and show the results in Fig. 10. They are in good agreement with the results shown in [8], and we can conclude that our well-balanced methods capture the complicated solution well.

Fig. 9
figure 9

The contours of the water surface level of the converging–diverging channels problem in Sect. 4.7 with the parameters \(d=0.9\) and \(B=0\). Results are based on the triangulation with mesh sizes \(\tau _K=0.025\) (left) and 6.25E\(-\)03 (right), respectively

Fig. 10
figure 10

The contours of the water surface level of the converging–diverging channels problem in Sect. 4.7 with the parameters \(d=0.9\) and \(B=1\). Results are based on the triangulation with mesh sizes \(\tau _K=0.025\) (left) and 6.25E\(-\)03 (right), respectively

We also modify the width of the channel by setting \(d=0.6\). The bottom topography is kept as \(B=1\). The numerical results are shown in Fig. 11, which also agree well with the results in [8]. At the end, we increase the height of the mound to \(B=2\), to simulate the flows through two islands. Our positivity-preserving methods demonstrate to be robust and provide nice results, presented in Fig. 12.

Fig. 11
figure 11

The contours of the water surface level of the converging–diverging channels problem in Sect. 4.7 with the parameters \(d=0.6\) and \(B=1\). Results are based on the triangulation with mesh sizes \(\tau _K=0.025\) (left) and 6.25E\(-\)03 (right), respectively

Fig. 12
figure 12

The contours of the water surface level of the converging–diverging channels problem in Sect. 4.7 with the parameters \(d=0.9\) and \(B=2\). Results are based on the triangulation with mesh sizes \(\tau _K=0.025\) (left) and 6.25E\(-\)03 (right), respectively

5 Concluding Remarks

Positivity-preserving well-balanced discontinuous Galerkin methods have been presented in [36] for the shallow water equations on one-dimensional and two-dimensional problems with rectangular meshes. In this paper, we showed that such methods can be naturally extended to unstructured triangular meshes, with the introduction of a special quadrature rule from [39]. We have demonstrated that this positivity-preserving limiter can keep the water height non-negative under suitable CFL condition, can preserve the mass conservation, is easy to implement, and at the same time does not affect the high order accuracy for the general solutions. Extensive numerical examples are provided at the end to demonstrate the well-balanced property, accuracy, positivity-preserving property, and non-oscillatory shock resolution of the proposed numerical methods. The proposed methods are highly parallelizable and our ongoing work is to investigate their performance on high performance computers.