1 Introduction

The two-layer shallow water equations (SWEs) studied in this paper describe the behavior of two superposed layers of inviscid fluid with different, constant densities flowing over a bottom topography. They have been widely applied to model the stratified flows that arise typically in large-scale hydrodynamic system, for example, in lake and ocean, upper layer heated by solar radiation is less dense than deep ocean water. Moreover, such applications constantly involve the wet–dry interfaces which require that the developed numerical models are capable to properly solve the governing equations at the wet–dry fronts.

The one-dimensional (1D) two-layer shallow water system of partial differential equations may be first introduced in Ovsyannikov (1979). It describes the flows of two superposed shallow layers of immiscible, incompressible and irrotational fluids. In this study, the system is written as

$$\begin{aligned} \begin{aligned}&\left( h_1\right) _t+\left( q_1\right) _x=0, \\&\left( q_1\right) _t+ \left( h_1 {u_1}^2+\frac{g}{2}{h_1}^2 \right) _x=-gh_1 \big (h_2+B\big )_x, \\&\left( h_2\right) _t+\left( q_2\right) _x=0, \\&\left( q_2\right) _t+ \left( h_2 {u_2}^2+\frac{g}{2}{h_2}^2 \right) _x=-gh_2 B_x-gh_2\left( rh_1\right) _x, \end{aligned} \end{aligned}$$
(1.1)

where the subscripts \(k=1\) and 2 represent the upper and lower layers, respectively, \(h_k\) is the fluid depth, \(q_k=h_k\cdot u_k\) is the flow discharge, \(u_k\) is the depth-averaged flow velocity in horizontal direction, \(\rho _k\) is the fluid density, \(r:=\rho _1/\rho _2\) is the density ratio which is considered as constant in this study and the regime \(r\approx 1\) is of particular interest for modeling stratified flows, g is the gravitational constant, t is the time, x is the horizontal position, and B is the bed level. The notation for the two-layer shallow water system is illustrated in Fig. 1, where \(\eta _1=\eta _2+h_1\) is the free surface level of the upper layer fluid which also represents the free surface level of the entire fluid column above B, and \(\eta _2=h_2+B\) represents the layer interface.

Fig. 1
figure 1

Schematic: two-layer shallow water model over irregular topography

A special class of the solutions of (1.1) are stationary steady-state solutions at which

$$\begin{aligned} (h_k)_t\equiv 0, \quad (q_k)_t\equiv 0, \quad q_k\equiv 0, \quad k=1,2 \end{aligned}$$
(1.2)

due to that the flux gradients in (1.1) are exactly balanced by the right-hand-sided (RHS) source terms. If such balance is realized by the fully discrete form and the steady-state solutions are maintained during the computation, the numerical method is called “well balanced”. Steady states are of great practical importance since many physically relevant solutions of (1.1) are, in fact, small perturbations of steady states.

The system (1.1) contains nonconservative products describing momentum exchange between the layers. The presence of these nonconservative products introduce major difficulties when theoretically and numerically solving nonlinear hyperbolic system with discontinuities because these nonconservative products are not well defined in the distributional framework and the usual concept of weak solution cannot be used. To overcome this difficulty, following the mathematical theory in Dal Maso et al. (1995), the path-conservative finite volume schemes have been presented in Castro et al. (2008); Dumbser et al. (2014); Muñoz-Ruiz and Parés (2011); Parés (2006); Diaz et al. (2019) for various nonconservative hyperbolic systems.

In Diaz et al. (2019), the nonconservative hyperbolic system is first rewritten into a quasilinear form in which the coefficient matrix include both conservative and nonconservative terms. By introducing a sufficiently smooth path connecting the left and right states at discontinuities, the coefficient matrix can be integrated on such a smooth path. Finally, a path-conservative central-upwind (PCCU) method accounting for the contribution of the jumps of the nonconservative products at the cell interfaces, is developed.

A well-balanced PCCU scheme is applied to a two-layer SWEs system (1.1) in Diaz et al. (2019). However, the developed scheme in Diaz et al. (2019) did not consider the well-balanced property and positivity of fluid depth in the presence of wet–dry fronts which commonly appears in the natural water system. It, thus, limits the application of the PCCU scheme in Diaz et al. (2019). This motivates this study in which a novel scheme in the framework of PCCU is designed to obtain the well-balanced property at the wet–dry fronts for the two-layer SWEs system.

To this end, in this study, the bottom topography is first replaced with its continuous, piecewise linear approximation. Then, the surface levels and velocities are linearly reconstructed instead of depths and discharges. Cells are classified based on the fluid mass they contain. Two auxiliary surface variables in non-dry cells are introduced to help to reconstruct the layer surfaces in under-resolved cells. Next, a new discretization of the source term is proposed to exactly preserve the stationary steady states. To guarantee the non-negativity of the fluid depth for each layer, the local drainage time step technique in Bollermann et al. (2011) is extended to the current two-layer system by applying local drainage constraints of fluxes at each cell interfaces for each layer. Accordingly, the discretization of source terms is correspondingly modified and the resulting fully discrete scheme is presented.

This paper is organized as follows. In Sect. 2, a well-balanced, positivity-preserving path-conservative finite volume method for two-layer shallow water system is developed and the well-balanced property of the discrete scheme is theoretically proved. In Sect. 3, several numerical experiments are conducted to verify the performance of the proposed numerical schemes. Some concluding remarks complete the study in Sect. 4.

2 Numerical schemes

In this section, a well-balanced path-conservative central-upwind method is designed for two-layer shallow water system with wet–dry fronts. To this end, we rewrite the governing system (1.1) in an equivalent form:

$$\begin{aligned} \begin{aligned}&(h_1)_t+\big (q_1\big )_x=0, \\&\big (q_1\big )_t+\Bigg ( \frac{q_1^2}{h_1}+\frac{g}{2}{h_1}^2 \Bigg )_x=-gh_1 (\eta _2)_x, \\&(\eta _2)_t+\big (q_2\big )_x=0, \\&\big (q_2\big )_t+\Bigg (\frac{q_2^2}{\eta _2-B}+\frac{g}{2}(\eta _2-B)^2 \Bigg )_x=-g(\eta _2-B){\partial _x}\left( rh_1\right) -g(\eta _2-B)B_x. \end{aligned} \end{aligned}$$
(2.1)

In the following, the system (2.1) is numerically solved over a computational domain discretized by finite volume cells \(I_j:=\big [ x_{j-\frac{1}{2}}, x_{j+\frac{1}{2}}\big ],\, j=1,\ldots ,N\) of uniform grid size \(\Delta x\) (an extension to a nonuniform grid is straightforward). It is denoted by \(x_j\) the cell center and \(x_j=(x_{j-\frac{1}{2}}+x_{j+\frac{1}{2}})/2\).

2.1 Bottom discretization

In this study, the original definition of bottom topography \({{\widehat{B}}}(x)\) is replaced with its continuous, piecewise linear approximation B(x) in which the linear pieces in cells j are connected at the cell-interface points \(x_{j-\frac{1}{2}}\) and \(x_{j+\frac{1}{2}}\). Therefore, one can define that

$$\begin{aligned} B_j(x)=B_{j-\frac{1}{2}}+\Big ( B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\Big )\cdot \frac{x-x_{j-\frac{1}{2}}}{\Delta x}, \quad x_{j-\frac{1}{2}}\le x \le x_{j+\frac{1}{2}}, \end{aligned}$$
(2.2)

in which the reconstructed bed level at cell interface is

$$\begin{aligned} B_{j+\frac{1}{2}}:=\frac{\widehat{B}(x_{j+\frac{1}{2}}+0)+\widehat{B}(x_{j+\frac{1}{2}}-0)}{2}. \end{aligned}$$
(2.3)

Using the piecewise linear bed reconstruction (2.2) and (2.3), one can obtain the point value of B at the cell center \(x=x_j\):

$$\begin{aligned} B_j:=B(x_j)=\frac{1}{\Delta x}\int _{I_j}B(x)\,\mathrm{d}x=\frac{B_{j+\frac{1}{2}}+B_{j-\frac{1}{2}}}{2}, \end{aligned}$$
(2.4)

and the bed slope of cell \(I_j\):

$$\begin{aligned} (B_x)_j:=\frac{B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}}{\Delta x}. \end{aligned}$$
(2.5)

Notice that replacing original bottom function \({{\widehat{B}}}(x)\) with B(x) will not affect the accuracy order of the proposed numerical scheme (Kurganov and Petrova 2009) since the piecewise linear interpolant (2.2) is a second-order approximation of \({{\widehat{B}}}\).

If a rapidly variable bed is considered, local grid refinement may be required to accurately resolve such an irregular bed. The proposed scheme in this paper can be directly applied to the nonuniform grids by replacing the uniform grid size \(\Delta x\) with a cell-dependent size \(\Delta x_j\).

2.2 Semi-discrete path-conservative central-upwind scheme

The system (2.1) can be written in the following vector form:

$$\begin{aligned} \varvec{U}_t+\varvec{F}(\varvec{U},B)_x=C({\varvec{U}},B){\varvec{U}}_x+\varvec{S}({\varvec{U}}, B), \end{aligned}$$
(2.6)

where the unknown variables \(\varvec{U} \in {\mathbb {R}}^N\), the flux \(\varvec{F}:{\mathbb {R}}^N \rightarrow {\mathbb {R}}^N\), the coefficient matrix \(C \in {\mathbb {R}}^{N\times N}\) of the nonconservative products, and the geometric source term \(\varvec{S}\in {\mathbb {R}}^N\) are:

$$\begin{aligned} \begin{aligned}&\varvec{U}=\left( \begin{array}{c}h_1\\ q_1 \\ \eta _2\\ q_2\\ \end{array}\right) , \quad \varvec{F}({\varvec{U}}, B)=\left( \begin{array}{c}q_1\\ \dfrac{q_1^2}{h_1}+\dfrac{g}{2}{h_1}^2 \\ q_2 \\ \dfrac{q_2^2}{\eta _2-B}+\dfrac{g}{2}(\eta _2-B)^2 \\ \end{array}\right) , \\&C({\varvec{U}}, B)=\left( \begin{array}{cccc}0&{}0&{}0&{}0\\ 0&{}0&{}-gh_1&{}0\\ 0&{}0&{}0&{}0\\ -rg(\eta _2-B)&{}0&{}0&{}0 \\ \end{array}\right) , \quad \varvec{S}({\varvec{U}}, B)=\left( \begin{array}{c}0\\ 0 \\ 0 \\ -g(\eta _2-B)B_x \\ \end{array}\right) . \end{aligned} \end{aligned}$$
(2.7)

The system (2.6) can be rewritten in the following quasilinear form:

$$\begin{aligned} \varvec{U}_t+{\mathcal {A}}(\varvec{U},B)\varvec{U}_x=\varvec{S}{(\varvec{U}, B)}. \end{aligned}$$
(2.8)

with the coefficient matrix

$$\begin{aligned} \begin{aligned}&{\mathcal {A}}(\varvec{U},B):=\frac{\partial {\varvec{F}}(\varvec{U},B)}{\partial {\varvec{U}}}-C(\varvec{U},B)= \left( \begin{array}{cccc}0&{}1&{}0&{}0\\ -{u_1}^2+gh_1&{}2{u_1}&{}gh_1&{}0\\ 0&{}0&{}0&{}1\\ rg(\eta _2-B)&{}0&{}-{u_2}^2+g(\eta _2-B)&{}2{u_2} \\ \end{array}\right) . \end{aligned} \end{aligned}$$
(2.9)

which contains the flux gradients and the nonconservative products.

Assuming that, at certain time level t, the approximations of the cell averages of the solution:

$$\begin{aligned} \overline{\varvec{U}}_j(t) \approx \frac{1}{\Delta x}\int _{I_j}{\varvec{U}}(x,t)\,\mathrm{d}x \end{aligned}$$
(2.10)

are available. Notice that, in the following descriptions of the proposed scheme, the time dependence of all indexed quantities are dropped for brevity.

Then, applying the semi-discrete path-conservative central upwind scheme (Diaz et al. 2019) to the nonconservative system (2.8), one can obtain that

$$\begin{aligned} \begin{aligned} \frac{\mathrm{d}}{\mathrm{d}t}\overline{\varvec{U}}_j =&-\frac{1}{\Delta x}\bigg [{\varvec{{\mathcal {F}}}}_{j+\frac{1}{2}}-{\varvec{{\mathcal {F}}}}_{j-\frac{1}{2}}-{\varvec{K}}_j-\frac{a^{+}_{j-\frac{1}{2}}}{a^{+}_{j-\frac{1}{2}}-a^{-}_{j-\frac{1}{2}}}{\varvec{C}}_{{\varvec{\Psi }},{j-\frac{1}{2}}} \\&\quad +\frac{a^{-}_{j+\frac{1}{2}}}{a^{+}_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}} {\varvec{C}}_{{\varvec{\Psi }},{j+\frac{1}{2}}} \bigg ], \end{aligned} \end{aligned}$$
(2.11)

where the numerical flux \({\varvec{{\mathcal {F}}}}_{j+\frac{1}{2}}\) is given by the original central-upwind scheme (Kurganov and Tadmor 2000; Kurganov et al. 2001):

$$\begin{aligned} {\varvec{{\mathcal {F}}}}_{j+\frac{1}{2}}=\frac{a^{+}_{j+\frac{1}{2}}{\varvec{F}}({\varvec{U}}^{-}_{j+\frac{1}{2}}) - a^{-}_{j+\frac{1}{2}}{\varvec{F}}({\varvec{U}}^{+}_{j+\frac{1}{2}}) }{a^{+}_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}}+\frac{a^{+}_{j+\frac{1}{2}}a^{-}_{j+\frac{1}{2}}}{a^{+}_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}}\Bigg ( {\varvec{U}}^{+}_{j+\frac{1}{2}}- {\varvec{U}}^{-}_{j+\frac{1}{2}}\Bigg ), \end{aligned}$$
(2.12)

in which \(a^{\pm }_{j+\frac{1}{2}}\) are the one-sided local speeds; \({\varvec{U}}^{\pm }_{j+\frac{1}{2}}\) are the right/left-sided values at \(x=x_{j+\frac{1}{2}}\) of the piecewise polynomial reconstruction \(\widetilde{\varvec{U}}\):

(2.13)

where is a characteristic function and \(P_j^{(i)}\) are polynomials of a certain degree satisfying the conservation:

$$\begin{aligned} \frac{1}{\Delta x}\int _{I_j} {\varvec{P}}_j (x) \mathrm{d}x=\overline{\varvec{U}}_j \end{aligned}$$
(2.14)

and (formal) accuracy requirements. Therefore, one has that

$$\begin{aligned} {\varvec{U}}^-_{j+\frac{1}{2}}={\varvec{P}}_j(x_{j+\frac{1}{2}}), \quad {\varvec{U}}^+_{j+\frac{1}{2}}={\varvec{P}}_{j+1}(x_{j+\frac{1}{2}}). \end{aligned}$$
(2.15)

In (2.11), term \({\varvec{K}}_j\) consists of the nonconservative products and geometric source

$$\begin{aligned} {\varvec{K}}_j:=\int _{I_j}C({\varvec{P}}_j(x),B(x))\frac{\mathrm{d}{\varvec{P}}_j(x)}{\mathrm{d}x}+{\varvec{S}}_j({\varvec{P}}_j(x),B(x)) \,\mathrm{d}x. \end{aligned}$$
(2.16)

The last two RHS terms of (2.11) account for the contribution of the jumps of the nonconservative products at the cell interfaces. To estimate these terms, one can consider a sufficiently smooth path \({\varvec{\Psi }_{j+\frac{1}{2}}(s)}:={\varvec{\Psi }}(s;{\varvec{U}}^-_{j+\frac{1}{2}},{\varvec{U}}^+_{j+\frac{1}{2}})\) connecting the states \({\varvec{U}}^-_{j+\frac{1}{2}}\) and \({\varvec{U}}^+_{{j+\frac{1}{2}}}\), it is,

$$\begin{aligned}&{\varvec{\Psi }}:[0,1]\times {\mathbb {R}}^N \times {\mathbb {R}}^N\rightarrow {\mathbb {R}}^N, \quad {\varvec{\Psi }}(0;{\varvec{U}}^-_{j+\frac{1}{2}},{\varvec{U}}^+_{j+\frac{1}{2}})={\varvec{U}}^-_{j+\frac{1}{2}}, \quad {\varvec{\Psi }}(1;{\varvec{U}}^-_{j+\frac{1}{2}},{\varvec{U}}^+_{j+\frac{1}{2}})\nonumber \\&\qquad ={\varvec{U}}^+_{j+\frac{1}{2}}. \end{aligned}$$
(2.17)

Accordingly, \({\varvec{C}}_{\varvec{\Psi }}\) at cell interfaces can be estimated by

$$\begin{aligned} {\varvec{C}}_{{\varvec{\Psi }},{j+\frac{1}{2}}}:=\int \limits ^1_0 C\big ({\varvec{\Psi }}_{j+\frac{1}{2}}(s)\big )\frac{\mathrm{d}{\varvec{\Psi }}_{j+\frac{1}{2}}}{\mathrm{d}s}\mathrm{d}s. \end{aligned}$$
(2.18)

For the importance of \({\varvec{C}}_{{\varvec{\Psi }},{j+\frac{1}{2}}}\) to the two-layer shallow water system with nonconservative products, the readers are referred to (Diaz et al. 2019) for more details and justifications.

One can find that no simple analytical expression for the eigenstructure of the matrix (2.9) can be provided. One can obtain approximate expressions for the eigenvalues of \({\mathcal {A}}(\varvec{U})\) using the first-order expansions in \(u_2-u_1\) (Long 1956; Schijf and Schönfled 1953),

$$\begin{aligned} \begin{aligned}&\lambda ^\pm _{ext}=u_m \pm \sqrt{g(h_1+h_2)} \\&\lambda ^\pm _{int}=u_c \pm \sqrt{ (1-r)g\frac{h_1 h_2}{h_1+h_2}\left[ 1-\frac{(u_2-u_1)^2}{(1-r)g(h_1+h_2)} \right] }, \end{aligned} \end{aligned}$$
(2.19)

where

$$\begin{aligned} u_m:=\frac{q_1+q_2}{h_1+h_2}, \quad u_c:=\frac{h_1 u_2+h_2 u_1}{h_1+h_2}. \end{aligned}$$
(2.20)

Accordingly, using only the external eigenvalues \(\lambda ^\pm _{ext}\) in (2.19)–(2.20) in the central-upwind methods, the one-sided local speeds can be obtained as:

$$\begin{aligned} \begin{aligned} a^+_{j+\frac{1}{2}}=&\max \Big \{\big (u_m\big )^+_{j+\frac{1}{2}}+\sqrt{g\big [(h_1)^+_{j+\frac{1}{2}}+(\eta _2)^+_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big ]}, \\&\big (u_m\big )^-_{j+\frac{1}{2}}+\sqrt{g\bigg [(h_1)^-_{j+\frac{1}{2}}+(\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\bigg ]},\,10^{-10}\,\Big \},\\ a^-_{j+\frac{1}{2}}=&\min \Big \{\big (u_m\big )^+_{j+\frac{1}{2}}-\sqrt{g\bigg [(h_1)^+_{j+\frac{1}{2}}+(\eta _2)^+_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\bigg ]}, \\&\big (u_m\big )^-_{j+\frac{1}{2}}-\sqrt{g\bigg [(h_1)^-_{j+\frac{1}{2}}+(\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\bigg ]},\,-10^{-10}\,\Big \}, \end{aligned} \end{aligned}$$
(2.21)

where, to avoid division by very small total fluid depth \(h_1+h_2\). In the current study, we extend the desingularization formula in Kurganov and Petrova (2007) to estimate \((u_m\big )^+_{j+\frac{1}{2}}\) at cell interface as

$$\begin{aligned} (u_m\big )^+_{j+\frac{1}{2}}=\frac{\sqrt{2} \, \Big [ (q_1)^+_{j+\frac{1}{2}}+(q_2)^+_{j+\frac{1}{2}}\Big ]}{\sqrt{\Big [ (h_1)^+_{j+\frac{1}{2}}+(h_2)^+_{j+\frac{1}{2}}\Big ]^2+\max \bigg \{ \Big [ (h_1)^+_{j+\frac{1}{2}}+(h_2)^+_{j+\frac{1}{2}}\Big ]^2,\xi ^2 \bigg \} }} \end{aligned}$$
(2.22)

in which \(\xi >0\) is a prescribed small and positive fluid depth triggering the desingularization procedure (2.22). In the current study, we use that \(\xi =1\times 10^{-3}\). Notice that \((u_m\big )^-_{j+\frac{1}{2}}\) in (2.21) can be estimated similarly.

The expressions (2.19)–(2.20) indicate that the system (2.1) is only hyperbolic provided

$$\begin{aligned} (u_1-u_2)^2<(1-r)g(h_1+h_2). \end{aligned}$$
(2.23)

Violation of this condition (2.23) leads to Kelvin–Helmholtz interfacial instability associated with shear flows (Abgrall and Karni 2009), for which the vertical averaged two-layer shallow water model (1.1) and (2.1) is not suitable any more. However, as explained in Berthon et al. (2015), it is agreed that the elliptic region has a repulsive role and the solution approaching this region is rapidly evacuated to the its boundary. Therefore, the system is expected to be well posed with strong enough nonlinearity even if condition (2.23) is violated.

Notice that the numerical experiments in this study basically lie in the flow regime with (2.23).

2.3 New well-balanced semi-discrete scheme for the two-layer SWEs with wet–dry fronts

In this section, to preserve the stationary steady states in the presence of wet–dry fronts for two-layer SWEs (2.1), the following novel special treatments are designed for completing the semi-discrete scheme (2.11)–(2.21).

2.3.1 Piecewise linear reconstruction of the secondary variables

To obtain the well-balanced property and stably deal with the wetting and drying process, it is proposed in the currently developed model to reconstruct the secondary variables \({\varvec{V}}=[\eta _1, u_1, \eta _2, u_2]^\top \) instead of the primary variables \({\varvec{U}}=[h_1, q_1, \eta _2, q_2]^\top \) of (2.1).

Reconstructing \(\eta _1\) and \(\eta _2\) using (2.24)–(2.29) help to obtain the well-balanced property since they are equilibrium variables of the stationary steady states. Reconstructing \(u_1\) and \(u_2\) instead of \(q_1\) and \(q_2\) avoid singularities when computing \((q_1)_{j+\frac{1}{2}}/(h_1)_{j+\frac{1}{2}}\) with \((h_1)_{j+\frac{1}{2}}\rightarrow 0\) and \((q_2)_{j+\frac{1}{2}}/\big [(\eta _2)_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big ]\) with \((\eta _2)_{j+\frac{1}{2}}\rightarrow B_{j+\frac{1}{2}}\) with very small layer depths.

Considering only the second-order schemes, the point values of \({\varvec{V}}\) are given using a linear function:

$$\begin{aligned} {\varvec{V}}_j(x)=\overline{\varvec{V}}_j+({\varvec{V}}_x)_j(x)(x-x_j), \end{aligned}$$
(2.24)

where

$$\begin{aligned} ({\overline{\eta }}_1)_j=({{\overline{h}}}_1)_j+({\overline{\eta }}_2)_j, \end{aligned}$$
(2.25)

and the following desingularization formula (Kurganov and Petrova 2007) is used to avoid the division by very small layer depth,

$$\begin{aligned} ({{\overline{u}}}_k)_j=\frac{\sqrt{2} \, {{\overline{q}}}_k }{\sqrt{\big ({{\overline{h}}}_k\big )^2+\max \big [\big ({\overline{h}}_k\big )^2,\xi \big ]}}, \quad k=1,2 \end{aligned}$$
(2.26)

in which

$$\begin{aligned} ({{\overline{h}}}_2)_j= ({\overline{\eta }}_2)_j-B_j. \end{aligned}$$
(2.27)

The piecewise constant slopes \(({\varvec{V}}_x)_j\) in (2.24) are computed in a non-oscillatory manner using a nonlinear limiter. In the current study, the generalized minmod limiter (see, e.g., Lie and Noelle 2003; Nessyahu and Tadmor 1990; Sweby 1984; van Leer 1979) is adopted:

(2.28)

with the minmod function

$$\begin{aligned} \mathrm{minmod}(\phi _1,\phi _2,\cdots ):=\left\{ \begin{aligned}&\mathrm{min}(\phi _1,\phi _2,\cdots ),&\hbox {if} \phi _j>0~~\forall j,\\&\mathrm{max}(\phi _1,\phi _2,\cdots ),&\hbox {if} \phi _j<0~~\forall j,\\&0,&\text {otherwise}. \end{aligned}\right. \end{aligned}$$
(2.29)

The parameter \(\theta \in [1,2]\) controls the amount of numerical dissipation: the larger the \(\theta \), the smaller the numerical dissipation. In this study, it is set \(\theta =1.2\).

In a dry cell, one can simply set that \(({\varvec{V}}_x)_j=0\).

2.3.2 Correction of surface reconstruction for two-layer fluids

It is proposed in §2.3.1 to reconstruct the surface levels \(\eta _1\) and \(\eta _2\) for both upper and lower layer fluids, respectively; however, such reconstructions may fail to ensure either well-balanced property or positive point value of depths in the presence of wet–dry fronts. Typical examples of such fails at the stationary steady states can be illustrated in Fig. 2. One can observe that, in Fig. 2, the piecewise linear reconstructions for fluid surfaces in §2.3.1 lead to the following issues:

  1. (1)

    At \(x=x_{j-\frac{1}{2}}\), the discontinuity \((\eta _2)^-_{j-\frac{1}{2}}\ne (\eta _2)^+_{j-\frac{1}{2}}\) introduces spurious waves that disturb the stationary equilibrium.

  2. (2)

    At \(x=x_{j+\frac{1}{2}}\), \((\eta _2)^-_{j+\frac{1}{2}}<B_{j+\frac{1}{2}}\) introduces negative fluid depth of lower layer fluid at cell interfaces,

  3. (3)

    Same problems as (1) and (2) also happen at \(x=x_{j+\frac{1}{2}}\) and \(x=x_{j+\frac{3}{2}}\) for upper layer fluid in cell \(I_{j+1}\),

  4. (4)

    Non-physical surface reconstruction in the dry cell \(I_{j+2}\) which introduce artificial waves and negative fluid depths.

Fig. 2
figure 2

The reconstructed surface levels of upper layer fluid (\(\eta _1\): blue dashed line) and lower layer fluid (\(\eta _2\): red solid line) over bottom topography (B: green solid line) at stationary steady states

To overcome the above issues without refining the local mesh, it is proposed in the current study to further correct the piecewise linear reconstruction (2.24)–(2.46). To this end, it is first defined the following six types of computational cells at a certain time level t, which are

$$\begin{aligned} \begin{aligned}&\mathbf{For the lower layer: } \\&\quad {{{\textit{\textbf{Type 1}}}}}: \hbox {Fully flooded cell }: \quad&({{\overline{h}}}_2)_j \, \Delta x\ge \frac{\Delta x}{2}\left| B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\right| , \\&\quad {{{\varvec{Type 2}}}}: \hbox {Partially flooded cell}: \quad&\frac{\Delta x}{2}\left| B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\right|> ({{\overline{h}}}_j)_2 \, \Delta x>0,\\&\quad {{{\varvec{Type 3}}}}: \hbox {Dry cell}: \quad&({{\overline{h}}}_2)_j \, \Delta x=0,\\&\mathbf{For the entire fluid column: } \\&\quad {{{\varvec{Type 4}}}}: \hbox {Fully flooded cell}: \quad&\left[ \,({{\overline{h}}}_1)_j+({{\overline{h}}}_2)_j\,\right] \Delta x\ge \frac{\Delta x}{2}\left| B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\right| , \\&\quad {{{\varvec{Type 5}}}}: \hbox {Partially flooded cell}: \quad&\frac{\Delta x}{2}\left| B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\right|> \left[ \,({{\overline{h}}}_1)_j+({{\overline{h}}}_2)_j\,\right] \Delta x>0,\\&\quad {{{\varvec{Type 6}}}}: \hbox {Dry cell}: \quad&\left[ \,({{\overline{h}}}_1)_j+({{\overline{h}}}_2)_j\,\right] \Delta x=0, \end{aligned} \end{aligned}$$
(2.30)

where \({{\overline{h}}}_2 \, \Delta x\) is the volume of the lower layer fluid stored in a cell, \(\left( \,{{\overline{h}}}_1+{\overline{h}}_2\,\right) \Delta x\) is the total volume of both lower and upper layer fluids stored in a cell, and \(\frac{1}{2}\big |B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\big |\,\Delta x\) represents the critical volume distinguishing between fully and partially flooded cells.

Remark 2.1

It is considered in (2.30) different types of cells for the entire fluid column rather than the upper layer fluid. Such cell classification avoids more complicated upper+lower layer fluid combination, and it is one of the key ideas of the currently proposed numerical scheme.

Remark 2.2

Notice that each computational cell is of two types, i.e., one of the first three types (Types 13) as well as one of the last three types (Types 46) due to the presence of two-layer fluids. For example, the cell j in Fig. 2 is both Type 2 and Type 4.

In the following, it is then corrected the piecewise surface reconstruction (2.24)–(2.46) in the presence of wet–dry fronts. Such corrections need to satisfy both mass conservation and positivity of depth in each cell. In this study, the auxiliary variables \(({\widehat{\eta }}_1)_j\) and \((\widehat{\eta }_2)_j\) representing the actual water surface levels at each cell center are introduced. One can see that such auxiliary variables only make sense in non-dry cells. In a dry cell (Types 3 or 6), the value of \(({\widehat{\eta }}_1)_j\) or \(({\widehat{\eta }}_2)_j\) are introduced only for the purpose of generalization and convenience in programming, they are not used in any computation. Therefore, in dry cells, they can be defined arbitrarily only if their values are non-greater than the lowest bed level in cell \(I_j\). Accordingly, the cell classification (2.30) can be equivalently rewritten as follows with respect to \(({\widehat{\eta }}_1)_j\) or \(({\widehat{\eta }}_2)_j\):

$$\begin{aligned} \begin{aligned}&\mathbf{For the lower layer: } \\&\quad {{{\varvec{Type 1}}}}: \hbox {Fully flooded cell }: \quad&({\widehat{\eta }}_2)_j \ge \max \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right) , \\&\quad {{{\varvec{Type 2}}}}: \hbox {Partially flooded cell}: \quad&\max \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right)> ({\widehat{\eta }}_2)_j> \min \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right) ,\\&\quad {{{\varvec{Type 3}}}}: \hbox {Dry cell}: \quad&({\widehat{\eta }}_2)_j \le \min \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right) ,\\&\mathbf{For the entire fluid column: } \\&\quad {{{\varvec{Type 4}}}}: \hbox {Fully flooded cell}: \quad&({\widehat{\eta }}_1)_j \ge \max \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right) , \\&\quad {{{\varvec{Type 5}}}}: \hbox {Partially flooded cell}: \quad&\max \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right)> ({\widehat{\eta }}_1)_j > \min \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right) ,\\&\quad {{{\varvec{Type 6}}}}: \hbox {Dry cell}: \quad&({\widehat{\eta }}_1)_j \le \min \left( B_{j+\frac{1}{2}}, B_{j-\frac{1}{2}}\right) , \end{aligned} \end{aligned}$$
(2.31)

Notice that the auxiliary water level \(({\widehat{\eta }}_1)_j\) or \(({\widehat{\eta }}_2)_j\) may be lower than \(B_j\) in a partially flooded cell.

Remark 2.3

The cell classification (2.31) is equivalent to (2.30). The readers are suggested to define the initial/boundary conditions through \(({\widehat{\eta }}_1)_j\) and \(({\widehat{\eta }}_2)_j\) since they are more relevant to the“real-world” physics than the cell-averaged surface levels \((\overline{\eta }_1)_j\) and \((\overline{\eta }_2)_j\) in a non-well-resolved finite volume discretization, e.g., partially flooded cells. And they are easier to be defined/measured in field and laboratory applications.

In the following, the surface reconstruction for the lower layer fluid is first corrected.

\(\bigstar \) For the Type 1 cells, in the case of negative reconstructed fluid depth at cell interface, say \((\eta _2)_{j+\frac{1}{2}}<B_{j+\frac{1}{2}}\), as in (Kurganov and Petrova 2007), the surface is then corrected by setting that

$$\begin{aligned} (\eta _2)_{j+\frac{1}{2}}=B_{j+\frac{1}{2}}, \quad (\eta _2)_{j-\frac{1}{2}}=2({\overline{h}}_2)_j+B_{j-\frac{1}{2}}\,. \end{aligned}$$
(2.32)

Thus, the \((V_x)^{(3)}_j\) in (2.24) should be then replaced by

$$\begin{aligned} (V_x)^{(3)}_j(x)=\big ((\eta _2)_x\big )_j(x)=\frac{(\eta _2)_{j+\frac{1}{2}}-(\eta _2)_{j-\frac{1}{2}}}{\Delta x}. \end{aligned}$$
(2.33)

One also has \(({\widehat{\eta }}_2)_j=({\overline{\eta }}_2)_j\) in this type of cells.

\(\bigstar \) For each Type 2 cell, based on the mass conservation, similar to that in (Bollermann et al. 2013), the surface reconstruction \((\eta _2 )_j(x)\) is divided into two connecting segments, i.e., one horizontal segment and one linear “dry bed” segment (see Fig. 3). For the sake of simplicity, it is assumed that \(B_{j-\frac{1}{2}}<B_{j+\frac{1}{2}}\) in the following description. The case \(B_{j-\frac{1}{2}}>B_{j+\frac{1}{2}}\) is analogous.

Fig. 3
figure 3

The original (left, red solid line) and corrected (right, red dashed line) surface reconstruction of \(\eta _2\) for Type 2 cells

As shown in Fig. 3, for the lower layer fluid, the connecting point at \(x^{*}_j\) splits the partially flooded cell into a wet part under a horizontal surface and a dry part with fluid surface overlaps the bed.

The level of the horizontal segment is set to be \((\widehat{\eta }_2)_j\) which can be deemed as the flat surface of stationary water body in a reservoir bounded below by \(B_j(x)\). The volume of the lower layer fluid, i.e., the area of the red triangle in Fig. 3 should be equal to \(({{\overline{h}}_2})_j\Delta x\) based on the requirement of mass conservation. Thus, the auxiliary surface level \(({\widehat{\eta }}_2)_j\) is related to \((\overline{\eta }_2)_j\) through

$$\begin{aligned} ({\widehat{\eta }}_2)_j =B_{j-\frac{1}{2}}+\sqrt{2\big [({\overline{\eta }_2})_j-B_j\big ] \big ( B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\Big )}. \end{aligned}$$
(2.34)

Accordingly, the surface reconstruction (2.24) for \(V^{(3)}_j(x)\) in the Type 2 cells should be replaced by

$$\begin{aligned} V^{(3)}_j(x)=(\eta _2)_j(x)=\left\{ \begin{aligned}&({\widehat{\eta }}_2)_j,&\hbox {if} x_{j-\frac{1}{2}}\le x\le x^{*}_j,\\&B_j(x),&\hbox {if} x^{*}_j < x\le x_{j+\frac{1}{2}}, \end{aligned}\right. \end{aligned}$$
(2.35)

and

$$\begin{aligned} (V_x)^{(3)}_j(x)=\big ((\eta _2)_x\big )_j(x)=\left\{ \begin{aligned}&0,&\hbox {if} x_{j-\frac{1}{2}}\le x\le x^{*}_j,\\&(B_x)_j,&\hbox {if }x^{*}_j < x\le x_{j+\frac{1}{2}}. \end{aligned}\right. \end{aligned}$$
(2.36)

Remark 2.4

Unlike the surface reconstruction proposed in Bollermann et al. (2013), \((\eta _2)^+_{j-\frac{1}{2}}=(\eta _2)^-_{j-\frac{1}{2}}\) is not forced when the neighboring cell is fully flooded in the currently proposed method. Using the spatial constant surface level \((\widehat{\eta }_2)_j\) in the wet part as shown in Fig. 3 avoids suppressing the small physical gravity waves between the Type 2 cells and their neighboring flooded cells, and is crucial to guarantee the well-balanced property of the semi-discrete (2.11) in the currently proposed numerical scheme.

Remark 2.5

It is noticed that the exact location of \(x^{*}_j\) is not needed to be computed in the proposed scheme since only the reconstructed values at cell interfaces are needed in the discrete scheme.

\(\bigstar \) For the Type 3 cells, it is set

$$\begin{aligned} V^{(3)}_j(x)=(\eta _2)_j(x)=B_j(x), \end{aligned}$$
(2.37)

and

$$\begin{aligned} (V_x)^{(3)}_j(x)=\big ((\eta _2)_x\big )_j(x)=(B_x)_j . \end{aligned}$$
(2.38)

Next, the water surface reconstruction for the upper layer fluid is corrected.

\(\bigstar \) For the Type 4 cell, it can be combined with any one of the first three types (Types 13) cells. In the case of negative reconstructed fluid depth at cell interface, say \((\eta _1)_{j+\frac{1}{2}}<(\eta _2)_{j+\frac{1}{2}}\), the surface is then corrected by setting that

$$\begin{aligned} (\eta _1)_{j+\frac{1}{2}}=(\eta _2)_{j+\frac{1}{2}}, \quad (\eta _1)_{j-\frac{1}{2}}=2{\overline{h}}_1+(\eta _2)_{j-\frac{1}{2}}. \end{aligned}$$
(2.39)

Thus, the \((V_x)^{(1)}_j\) in (2.24) should be replaced by

$$\begin{aligned} (V_x)^{(1)}_j(x)=\big ((\eta _1)_x\big )_j(x)=\frac{(\eta _1)_{j+\frac{1}{2}}-(\eta _1)_{j-\frac{1}{2}}}{\Delta x}. \end{aligned}$$
(2.40)

One has that \(({\widehat{\eta }}_1)_j=({\overline{\eta }}_1)_j\) in this type of cells.

\(\bigstar \) For the Type 5 cell, it can be combined with either Types 2 or Types 3 cell. Similar to the surface correction for the Types 2 cells, the surface reconstruction of \((\eta _1)_j(x)\) is proposed to be divided into two connecting pieces, i.e., one horizontal piece and one linear “dry bed” piece (see Fig. 4). For the sake of simplicity, we assume that \(B_{j-\frac{1}{2}}<B_{j+\frac{1}{2}}\) in the following description. The case \(B_{j-\frac{1}{2}}>B_{j+\frac{1}{2}}\) is analogous.

The level of the horizontal piece is set to be \(({\widehat{\eta }}_1)_j\) which is related to \(({\overline{h}}_1)_j\) and \((\overline{\eta }_2)_j\) through

$$\begin{aligned} ({\widehat{\eta }}_1)_j =B_{j-\frac{1}{2}}+\sqrt{2\Big [({\overline{h}_1})_j+({\overline{\eta }_2})_j-B_j\Big ] \big ( B_{j+\frac{1}{2}}-B_{j-\frac{1}{2}}\big )}. \end{aligned}$$
(2.41)

based on the mass conservation, i.e., the blue area in Fig. 4 is equal to \(\big [({{\overline{h}}_1})_j+({\overline{h}_2})_j\big ]\Delta x\).

Therefore, the surface reconstruction (2.24) for \(V^{(1)}_j(x)\) in the Type 5 cells should be replaced by

$$\begin{aligned} V^{(1)}_j(x)=(\eta _1)_j(x)=\left\{ \begin{aligned}&({\widehat{\eta }}_1)_j,&\hbox {if} x_{j-\frac{1}{2}}\le x\le x^{**}_j,\\&B_j(x),&\hbox {if} x^{**}_j < x\le x_{j+\frac{1}{2}}. \end{aligned}\right. \end{aligned}$$
(2.42)

where \(x^{**}_j\) is the location of the connecting point in cell \(I_j\).

Fig. 4
figure 4

The original (left, blue dashed line) and corrected (right, blue solid line) surface reconstruction of \(\eta _1\) for Type 5 cells

And the slopes of reconstructed surface \((\eta _1)_j\) in \([x_{j-\frac{1}{2}}, x_{j+\frac{1}{2}}]\) is estimated by

$$\begin{aligned} (V_x)^{(1)}_j(x)=\big ((\eta _1)_x\big )_j(x)=\left\{ \begin{aligned}&0,&\hbox {if} x_{j-\frac{1}{2}}\le x\le x^{**}_j,\\&(B_x)_j,&\hbox {if} x^{**}_j < x\le x_{j+\frac{1}{2}}. \end{aligned}\right. \end{aligned}$$
(2.43)

\(\bigstar \) For the Type 6 cells, they can be only combined with Type 3 cells. Therefore, it is set in this type of cell that

$$\begin{aligned} V^{(1)}_j(x)=(\eta _1)_j(x)=B_j(x), \end{aligned}$$
(2.44)

and

$$\begin{aligned} (V_x)^{(1)}_j(x)=\big ((\eta _1)_x\big )_j(x)=(B_x)_j. \end{aligned}$$
(2.45)

Finally, applying above corrections of surface reconstruction to Types 16 cells, the original piecewise linear reconstructions (2.24)–(2.46) for fluid surfaces demonstrated in Fig. 2 are corrected as in Fig. 5 in the stationary equilibrium. One can see that the above surface corrections guarantee that the lower and upper layer fluid depths at cell interfaces are equal under the stationary equilibrium and nonnegative. These features avoid the spurious waves generated by the second term of (2.12) at stationary steady states.

Fig. 5
figure 5

The corrected reconstructions of the surface levels of upper layer fluid (\(\eta _1\): blue) and lower layer fluid (\(\eta _2\): red) over bottom topography (B:green solid line) at stationary steady states

Consequently, the polynomial pieces in (2.13) are given as:

$$\begin{aligned} {\varvec{P}}_j(x)= \left( \begin{array}{c} V^{(1)}_j(x)- V^{(3)}_j(x) \\ V^{(2)}_j(x) \Big [ V^{(1)}_j(x)- V^{(3)}_j(x) \Big ] \\ V^{(3)}_j(x)\\ V^{(4)}_j(x)\Big [ V^{(3)}_j(x)-B_j(x) \Big ]\\ \end{array}\right) =\left( \begin{array}{c} (\eta _1)_j(x)-(\eta _2)_j(x) \\ (u_1)_j(x) \Big [ (\eta _1)_j(x)-(\eta _2)_j(x) \Big ] \\ (\eta _2)_j(x)\\ (u_2)_j(x)\Big [(\eta _2)_j(x)-B_j(x) \Big ].\\ \end{array}\right) . \end{aligned}$$
(2.46)

2.3.3 Numerical discretization of \({{K}}_j\) in (2.16)

To guarantee the RHS of formula (2.11) vanish in stationary equilibrium, the cell integral \({\varvec{K}}_j\) must exactly balance the numerical fluxes \({\varvec{H}}_{j+\frac{1}{2}}\) and \({\varvec{H}}_{j-\frac{1}{2}}\). To this end, it is proposed in the current study to estimate the terms \({\varvec{K}}_j\) in a special form. It is first written that

$$\begin{aligned} \begin{aligned} {\varvec{K}}_j:&=\int _{I_j}C({\varvec{P}}_j(x),B(x))\frac{\mathrm{d}{\varvec{P}}_j(x)}{\mathrm{d}x}+{\varvec{S}}_j({\varvec{P}}_j(x),B(x)) \,\mathrm{d}x\\&=\left( \begin{array}{c}0\\ \displaystyle \int _{I_j} \Big (\frac{g}{2}h_1^2\Big )_x \,\mathrm{d} x -\int _{I_j} gh_1 \big (h_1+\eta _2\big )_x\,\mathrm{d}x \\ 0\\ \displaystyle \int _{I_j}\Big [ \frac{g}{2}(\eta _2-B)^2 \Big ]_x\,\mathrm{d} x -\int _{I_j} g\big (\eta _2-B\big )\Big [r\big (h_1+\eta _2\big )_x+(1-r)(\eta _2)_x\Big ] \,\mathrm{d}x \\ \end{array}\right) . \end{aligned} \end{aligned}$$
(2.47)

Next, applying divergence theorem and trapezoidal rule to the first and second integrals in (2.47) in each component of \({\varvec{K}}_j\), respectively, one obtains that

$$\begin{aligned} \begin{aligned} {\varvec{K}}^{(2)}_j=\,&\frac{g}{2}\Bigg \{ \Big [(h_1)^-_{j+\frac{1}{2}}\Big ]^2- \Big [(h_1)^+_{j-\frac{1}{2}}\Big ]^2 \Bigg \}-\frac{g}{2}\Delta x\Bigg \{(h_1)^+_{j-\frac{1}{2}}\Big [\big (h_1+\eta _2\big )_x\Big ]^+_{j-\frac{1}{2}}\\&+ (h_1)^-_{j+\frac{1}{2}}\Big [\big (h_1+\eta _2\big )_x\Big ]^-_{j+\frac{1}{2}}\Bigg \}, \end{aligned} \end{aligned}$$
(2.48)

and

$$\begin{aligned} {\varvec{K}}^{(4)}_j= & {} \frac{g}{2}\Bigg \{ \Big [(\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big ]^2- \Big [(\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\Big ]^2 \Bigg \} -\frac{g}{2}\Delta x\Bigg \{ \Big [(\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\Big ] \nonumber \\&\bigg [r\Big (\big (h_1+\eta _2\big )_x\Big )^+_{j-\frac{1}{2}}+(1-r)\Big ((\eta _2)_x\Big )^+_{j-\frac{1}{2}}\,\bigg ] + \Big [(\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big ] \nonumber \\&\bigg [r\Big [\big (h_1+\eta _2\big )_x\Big ]^-_{j+\frac{1}{2}}+(1-r)\left( (\eta _2)_x\right) ^-_{j+\frac{1}{2}}\,\bigg ] \Bigg \}. \end{aligned}$$
(2.49)

To further compute \({\varvec{K}}^{(2)}_j\) (2.48) and \({\varvec{K}}^{(4)}_j\) (2.49), it is crucial to estimate in (2.48) and (2.49) the derivatives which represent the slopes of fluid surfaces at both ends of cell \(I_j\). To guarantee the well-balanced property, according to the surface corrections in Sect. 2.3.2, we propose in the current study to estimate them by

$$\begin{aligned} \Big [\big (h_1+\eta _2\big )_x\Big ]^-_{j+\frac{1}{2}}=\big [(\eta _1)_x\big ]^-_{j+\frac{1}{2}}\,, \quad \Big [\big (h_1+\eta _2\big )_x\Big ]^+_{j-\frac{1}{2}}=\big [(\eta _1)_x\big ]^+_{j-\frac{1}{2}}\,, \end{aligned}$$
(2.50)

where \(\big [(\eta _1)_x\big ]^-_{j+\frac{1}{2}}\) and \(\big [(\eta _1)_x\big ]^+_{j-\frac{1}{2}}\) are computed using that (2.40), (2.43) and (2.45). Moreover, the surface slopes of the lower layer fluid \(\big [(\eta _2)_x\big ]^-_{j+\frac{1}{2}}\) and \(\big [(\eta _2)_x\big ]^+_{j-\frac{1}{2}}\) are estimated by (2.33), (2.36) and (2.38).

2.3.4 Numerical discretization of \({{C}}_{{{\Psi }},{j+\frac{1}{2}}}\) in (2.18)

As demonstrated in §2.2, \({\varvec{C}}_{{\varvec{\Psi }},{j+\frac{1}{2}}}\) and \({\varvec{C}}_{{\varvec{\Psi }},{j-\frac{1}{2}}}\) in (2.11) account for the contribution of the jump of the nonconservative products at cell interfaces. Therefore, they should vanish in the stationary equilibrium. In this study, a simplest linear segment path is chosen

$$\begin{aligned} {\varvec{\Psi }}_{j+\frac{1}{2}}(s)={\varvec{U}}^-_{j+\frac{1}{2}}+s\Big ({\varvec{U}}^+_{j+\frac{1}{2}}-{\varvec{U}}^-_{j+\frac{1}{2}}\Big ), \end{aligned}$$
(2.51)

which leads to the following discretization of the integral in (2.18), that is

$$\begin{aligned} {\varvec{C}}_{{\varvec{\Psi }},{j+\frac{1}{2}}}:=\left( \begin{array}{c}0\\ -\dfrac{g}{2}\Big [(h_1)^{+}_{j+\frac{1}{2}}+(h_1)^{-}_{j+\frac{1}{2}}\Big ]\Big [(\eta _2)^{+}_{j+\frac{1}{2}}-(\eta _2)^{-}_{j+\frac{1}{2}}\Big ] \\ 0\\ -\dfrac{gr}{2}\Big [(\eta _2)^{+}_{j+\frac{1}{2}}+(\eta _2)^{-}_{j+\frac{1}{2}}-2B_{j+\frac{1}{2}}\Big ]\Big [(h_1)^{+}_{j+\frac{1}{2}}-(h_1)^{-}_{j+\frac{1}{2}}\Big ] \\ \end{array}\right) , \end{aligned}$$
(2.52)

and \({\varvec{C}}_{{\varvec{\Psi }},{j-\frac{1}{2}}}\) can be computed analogously.

It is noticed that \({\varvec{C}}_{{\varvec{\Psi }},{j+\frac{1}{2}}}\) and \({\varvec{C}}_{{\varvec{\Psi }},{j-\frac{1}{2}}}\) should vanish at the stationary steady states since no jump of nonconservative products exist in this case. Thanks to the reformulation (2.1) of the governing system, reconstructing \(\eta _2\) can guarantee these two terms vanish when bottom topography is fully submerged in the lower layer fluid. However, in the presence of the wet–dry interfaces, one needs to use the proposed surface corrections in §2.3.2 to ensure that these two terms vanish at the stationary steady states.

2.4 Fully discrete numerical scheme for (2.11)

In this section, the numerical approximation of the time dependent derivatives is presented to obtain the fully discrete numerical scheme for (2.11). To avoid the numerical instabilities, the global time step size \(\Delta t\) can be estimated by a CFL like condition:

$$\begin{aligned} \Delta t=\mu \,\frac{\Delta x}{\max \limits _{j}\left( \,\big |a^+_{j+\frac{1}{2}}\big |,\big |a^-_{j+\frac{1}{2}}\big |\,\right) }, \end{aligned}$$
(2.53)

where a relatively small CFL number \(\mu =0.3\) is used in the current study to help to mitigate the potential layer-interfacial instability.

To obtain the second order accuracy, the strong-stability-preserving two-staged Runge–Kutta method (SSP-RK2) from (Gottlieb et al. 2001) is used in this study for time evolution. The SSP-RK2 is briefly described in (2.54), it reads

$$\begin{aligned} \begin{aligned}&{\varvec{U}}^*={\varvec{U}}^n+\Delta t\,{\varvec{{\mathcal {L}}}}({\varvec{U}}^n) \\&{\varvec{U}}^{n+1}=\frac{1}{2}{\varvec{U}}^n+\frac{1}{2}\left[ {\varvec{U}}^*+\Delta t\,{\varvec{{\mathcal {L}}}}({\varvec{U}}^*) \right] , \end{aligned} \end{aligned}$$
(2.54)

where \(\varvec{{\mathcal {L}}}({\varvec{U}})\) is the spatial discretization of the forcing terms, i.e., all the right-hand-sided (RHS) terms of the semi-discrete scheme (2.11), the superscript n and \(n+1\) represent time level \(t=t^n\) and \(t=t^{n+1}=t^n+\Delta t\), respectively, \({\varvec{U}}^*\) represents the intermediate values of variables obtained from the first stage of SSP-RK2.

It is noticed that for the adopted two-staged Runge–Kutta methods, the global time step \(\Delta t\) is only estimated in the first stage.

2.4.1 Positivity-preserving time evolution

One desired feature of a robust numerical model is preserving the positivity of fluid depth for each layer, that is

$$\begin{aligned} \begin{aligned}&({{\overline{h}}}_1)^{\,n+1}_j=({{\overline{h}}}_1)^{\,n}_j-\frac{\Delta t}{\Delta x} \Big [\,{{\mathcal {F}}}^{\,(1)}_{j+\frac{1}{2}}-{{\mathcal {F}}}^{\,(1)}_{j-\frac{1}{2}}\,\Big ]\ge 0,\qquad ({\overline{\eta }}_2)^{\,n+1}_j=({\overline{\eta }}_2)^{\,n}_j\\&\quad \quad -\frac{\Delta t}{\Delta x} \Big [\,{{\mathcal {F}}}^{\,(3)}_{j+\frac{1}{2}}-{{\mathcal {F}}}^{\,(3)}_{j-\frac{1}{2}}\,\Big ]\ge B_j, \end{aligned} \end{aligned}$$
(2.55)

providing that \(({{\overline{h}}}_1)^{\,n}_j \ge 0\) and \(({\overline{h}}_2)^{\,n}_j \ge 0\) at \(t=t^n\).

However, the global time step \(\Delta t\) estimated by stability constraint (2.53) can not guarantee (2.55) are satisfied. Therefore, in the presence of wet–dry fronts, one has to use very small global time step \(\Delta t\) to enforce the positivity of fluid depth for each layer. This could in turn lead to very expensive computational cost. To overcome such numerical difficulty and guarantee the positivity of layer depth, the “draining” time-step strategy proposed in (Bollermann et al. 2011) is extended to the currently study. Instead of using a global time step \(\Delta t\) for all cell interfaces, such strategy defines time step size \(\Delta t_{j+\frac{1}{2}}\) for each cell interface based on \(\Delta t\) and the local draining time step size \(\Delta t^{\,drain}_j,\, \forall {j}\).

The basic idea of such a method is to cut off the outgoing fluxes as soon as the fluid originally contained in the cell has completely left the cell via the outgoing fluxes during a certain global time step \(\Delta t\). To apply this idea, one can first introduce the local draining time step for each layer in a cell, i.e.,

$$\begin{aligned}&(\Delta t_1)_j^{\mathrm{drain}}=\frac{({{\overline{h}}}_1)^{\,n}_j \Delta x}{\max \big (0,{{\mathcal {F}}}^{\,(1),n}_{j+\frac{1}{2}}\big )+\max \big (0,-{{\mathcal {F}}}^{\,(1),n}_{j-\frac{1}{2}}\big )}, \end{aligned}$$
(2.56)
$$\begin{aligned}&(\Delta t_2)_j^{\mathrm{drain}}=\frac{({{\overline{h}}}_2)^{\,n}_j \Delta x}{\max \big (0,{\mathcal F}^{\,(3),n}_{j+\frac{1}{2}}\big )+\max \big (0,-{\mathcal F}^{\,(3),n}_{j-\frac{1}{2}}\big )}, \end{aligned}$$
(2.57)

which represent the time for completely draining the water originally stored in a cell \(I_j\) via out-going flow though cell interfaces at \(t=t^n\) for the upper and lower layers, respectively.

Next, based on \((\Delta t_1)_j^{\mathrm{drain}}\) and \((\Delta t_2)_j^{\mathrm{drain}}\), and the upwind direction of the fluxes \({{\mathcal {F}}}^{\,(1),n}_{j+\frac{1}{2}}\) and \({{\mathcal {F}}}^{\,(3),n}_{j+\frac{1}{2}}\), the interfacial draining time step \((\Delta t_k)_{j+\frac{1}{2}},\, k=1,2\) for each cell interface can be estimated by

$$\begin{aligned} \begin{aligned}&(\Delta t_1)_{j+\frac{1}{2}}=\left\{ \begin{aligned}&\min \Big [\,\Delta t, (\Delta t_1)_j^{\mathrm{drain}}\,\Big ],&\hbox {if} {{\mathcal {F}}}^{\,(1),n}_{j+\frac{1}{2}}\ge 0,\\&\min \Big [\,\Delta t, (\Delta t_1)_{j+1}^{\mathrm{drain}}\,\Big ],&\hbox {if} {{\mathcal {F}}}^{\,(1),n}_{j+\frac{1}{2}}<0, \end{aligned}\right. \\&(\Delta t_2)_{j+\frac{1}{2}}=\left\{ \begin{aligned}&\min \Big [\,\Delta t, (\Delta t_2)_j^{\mathrm{drain}}\,\Big ],&\hbox {if} {{\mathcal {F}}}^{\,(3),n}_{j+\frac{1}{2}}\ge 0,\\&\min \Big [\,\Delta t, (\Delta t_2)_{j+1}^{\mathrm{drain}}\,\Big ],&\hbox {if} {{\mathcal {F}}}^{\,(3),n}_{j+\frac{1}{2}}<0, \end{aligned}\right. \end{aligned} \end{aligned}$$
(2.58)

respectively.

Notice that (2.58) should be updated in each Runge–Kutta stage (2.54).

Finally, one can accordingly modify the discretization \(\varvec{{\mathcal {L}}}({\varvec{U}})\) in (2.54) to guarantee the positivity-preserving and well-balanced properties. The modified \(\varvec{{\mathcal {L}}}({\varvec{U}})\) is given by

$$\begin{aligned} {{\mathcal {L}}}^{(1)}({\varvec{U}})=&-\frac{1 }{\Delta x} \left[ \,\frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(1)}_{j+\frac{1}{2}}- \frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(1)}_{j-\frac{1}{2}}\,\right] , \end{aligned}$$
(2.59)
$$\begin{aligned} {{\mathcal {L}}}^{(2)}({\varvec{U}})=&-\frac{1}{\Delta x} \Bigg \{\,\frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(2)}_{j+\frac{1}{2}}- \frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(2)}_{j-\frac{1}{2}}-\frac{g}{2}\bigg [ \frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}\big ((h_1)^-_{j+\frac{1}{2}}\big )^2 \nonumber \\&-\frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}\big ((h_1)^+_{j-\frac{1}{2}}\big )^2 \bigg ] +\frac{g\Delta x}{2} \bigg [ (h_1)^+_{j-\frac{1}{2}}\Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}\nonumber \\&+ (h_1)^-_{j+\frac{1}{2}}\Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}\bigg ] \nonumber \\&-\frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}\frac{a^{+}_{j-\frac{1}{2}}}{a^{+}_{j-\frac{1}{2}}-a^{-}_{j-\frac{1}{2}}} C^{(2)}_{{\Psi },{j-\frac{1}{2}}} +\frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}\frac{a^{-}_{j+\frac{1}{2}}}{a^{+}_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}} C^{(2)}_{{ \Psi },{j+\frac{1}{2}}} \Bigg \}, \end{aligned}$$
(2.60)
$$\begin{aligned} {{\mathcal {L}}}^{(3)}({\varvec{U}})=&-\frac{1 }{\Delta x} \left[ \,\frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(3)}_{j+\frac{1}{2}}- \frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(3)}_{j-\frac{1}{2}}\,\right] , \end{aligned}$$
(2.61)
$$\begin{aligned} {{\mathcal {L}}}^{(4)}({\varvec{U}})=&-\frac{1}{\Delta x} \left\{ \,\frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(4)}_{j+\frac{1}{2}}- \frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}{{\mathcal {F}}}^{\,(4)}_{j-\frac{1}{2}}-\frac{g}{2}\bigg [\, \frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}\big ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big )^2 \right. \nonumber \\&\left. - \frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}\big ((\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\big )^2 \bigg ] +\frac{g\Delta x}{2} \bigg [ \Big ((\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\Big ) \Big (r\big ((h_1+\eta _2)_x\big )^+_{j-\frac{1}{2}}\right. \nonumber \\&+(1-r)\big ((\eta _2)_x\big )^+_{j-\frac{1}{2}}\Big ) + \Big ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big ) \Big (r\big ((h_1+\eta _2)_x\big )^-_{j+\frac{1}{2}}\nonumber \\&\left. +(1-r)\big ((\eta _2)_x\big )^-_{j+\frac{1}{2}}\Big ) \bigg ] \right. \nonumber \\&\left. -\frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}\frac{a^{+}_{j-\frac{1}{2}}}{a^{+}_{j-\frac{1}{2}}-a^{-}_{j-\frac{1}{2}}} C^{(4)}_{{\varvec{\Psi }},{j-\frac{1}{2}}}+\frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}\frac{a^{-}_{j+\frac{1}{2}}}{a^{+}_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}} C^{(4)}_{{\varvec{\Psi }},{j+\frac{1}{2}}} \right\} , \end{aligned}$$
(2.62)

where \(C^{(i=1,4)}_{{\varvec{\Psi }},{j-\frac{1}{2}}}\) and \(C^{(i=1,4)}_{{\varvec{\Psi }},{j+\frac{1}{2}}}\) are computed by (2.52).

Thus, a fully discrete numerical scheme can be obtained using (2.54) and (2.59)–(2.62) with (2.12) and (2.52).

2.5 Well-balanced property of the proposed scheme

In this section, the well-balanced property of the proposed numerical scheme is proved.

In the presence of wet–dry fronts, the stationary steady-state solutions for two-layer system can be defined by

$$\begin{aligned} (q_1)\equiv (q_2)\equiv 0, \quad \eta _1:=h_1+\eta _2\equiv \max \left( \mathrm{Const}_1, \eta _2 \right) , \quad \eta _2\equiv \max \left( \mathrm{Const}_2, B \right) . \end{aligned}$$
(2.63)

The proposed fully discrete scheme ((2.54) and (2.59)–(2.62)) is well balanced if the forcing terms \({\varvec{{\mathcal {L}}}}({\varvec{U}}^n)\) vanish provided (2.63) at \(t=t^n\), and one obtains \({\varvec{U}}^{n+1}\equiv {\varvec{U}}^{n}\).

For the sake of brevity, we only prove the well-balanced property for the first stage in an SSP-RK2 evolution in the following. However, the proof for the second stage is analogous.

The stationary steady-state solutions (2.63) is first substituted into (2.21), one obtains that

$$\begin{aligned}&a^+_{j+\frac{1}{2}}=\max \Big \{\sqrt{g\big [(h_1)^+_{j+\frac{1}{2}}+(\eta _2)^+_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big ]},\,\nonumber \\&\quad \sqrt{g\big [(h_1)^-_{j+\frac{1}{2}}+(\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big ]},\,10^{-10}\,\Big \},\nonumber \\&a^-_{j+\frac{1}{2}}=\min \Big \{-\sqrt{g\big [(h_1)^+_{j+\frac{1}{2}}+(\eta _2)^+_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big ]},\nonumber \\&\quad -\sqrt{g\big [(h_1)^-_{j+\frac{1}{2}}+(\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\big ]},\,-10^{-10}\,\Big \}. \end{aligned}$$
(2.64)

Thanks to the piecewise linear reconstruction of the secondary variables \(\varvec{V}\) in §2.3.1 and the surface corrections in §2.3.2, one, thus, obtains that

$$\begin{aligned} (\eta _2)^+_{j+\frac{1}{2}}=(\eta _2)^-_{j+\frac{1}{2}}, \quad (h_1)^+_{j+\frac{1}{2}}=(h_1)^-_{j+\frac{1}{2}}, \end{aligned}$$
(2.65)

through (2.46).

Substituting (2.65) into (2.64) and (2.52), it leads to

$$\begin{aligned} a^{+}_{j+\frac{1}{2}}=-a^{-}_{j+\frac{1}{2}}\ge 0, \quad \hbox {and} \quad {\varvec{C}}_{{\Psi },{j+\frac{1}{2}}}=\big [\,0,\,0,\,0,\,0\,\big ]^\top ,\,\, \forall j. \end{aligned}$$
(2.66)

Then, (2.63) and (2.66) are substituted into the forcing terms \({\varvec{{\mathcal {L}}}}({\varvec{U}})\) (2.59)–(2.62) with (2.12) and (2.52) at the first stage of the proposed fully discrete numerical scheme (2.54), one obtains that

$$\begin{aligned} {{\mathcal {L}}}^{(1)}({\varvec{U}}_j)= & {} -\frac{1}{\Delta x}\Bigg \{ \frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t} \dfrac{a^+_{j+\frac{1}{2}}a^-_{j+\frac{1}{2}}}{a^+_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}}\Big [ (h_1)^+_{j+\frac{1}{2}}- (h_1)^-_{j+\frac{1}{2}}\Big ] \nonumber \\&-\frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}\dfrac{a^+_{j-\frac{1}{2}}a^-_{j-\frac{1}{2}}}{a^+_{j-\frac{1}{2}}-a^-_{j-\frac{1}{2}}}\Big [ (h_1)^+_{j-\frac{1}{2}}- (h_1)^-_{j-\frac{1}{2}}\Big ] \Bigg \}\nonumber \\ {{\mathcal {L}}}^{(2)}({\varvec{U}}_j)= & {} -\frac{1}{\Delta x}\Bigg \{ \frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}\dfrac{g}{4}\Big [\left( (h_1)^-_{j+\frac{1}{2}}\right) ^2 + \left( (h_1)^+_{j+\frac{1}{2}}\right) ^2 \Big ] - \frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}\dfrac{g}{4}\Big [\left( (h_1)^-_{j-\frac{1}{2}}\right) ^2 \nonumber \\&+ \left( (h_1)^+_{j-\frac{1}{2}}\right) ^2 \Big ] -\frac{g}{2}\bigg [ \frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}\big ((h_1)^-_{j+\frac{1}{2}}\big )^2 -\frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}\big ((h_1)^+_{j-\frac{1}{2}}\big )^2 \bigg ]\nonumber \\&+\frac{g\Delta x}{2} \bigg [ (h_1)^+_{j-\frac{1}{2}}\Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}+ (h_1)^-_{j+\frac{1}{2}}\Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}\bigg ]\nonumber \\&-\frac{(\Delta t_1)_{j-\frac{1}{2}}}{\Delta t}\frac{1}{2} C^{(2)}_{{\Psi },{j-\frac{1}{2}}}-\frac{(\Delta t_1)_{j+\frac{1}{2}}}{\Delta t}\frac{1}{2} C^{(2)}_{{\Psi },{j+\frac{1}{2}}} \Bigg \} \nonumber \\ {{\mathcal {L}}}^{(3)}({\varvec{U}}_j)= & {} -\frac{1}{\Delta x}\left[ \frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t} \dfrac{a^+_{j+\frac{1}{2}}a^-_{j+\frac{1}{2}}}{a^+_{j+\frac{1}{2}}-a^{-}_{j+\frac{1}{2}}}\Big ( (\eta _2)^+_{j+\frac{1}{2}}- (\eta _2)^-_{j+\frac{1}{2}}\Big ) \right. \nonumber \\&\left. -\frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}\dfrac{a^+_{j-\frac{1}{2}}a^-_{j-\frac{1}{2}}}{a^+_{j-\frac{1}{2}}-a^-_{j-\frac{1}{2}}}\Big ( (\eta _2)^+_{j-\frac{1}{2}}- (\eta _2)^-_{j-\frac{1}{2}}\Big ) \right] \nonumber \\ {{\mathcal {L}}}^{(4)}({\varvec{U}}_j)= & {} -\frac{1}{\Delta x} \left\{ \,\frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}\frac{g}{4}\left[ \bigg ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\bigg )^2+\bigg ((\eta _2)^+_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\bigg )^2 \right] \right. \nonumber \\&\left. - \frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}\frac{g}{4}\left[ \bigg ((\eta _2)^-_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\bigg )^2+\bigg ((\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\bigg )^2 \right] \right. \nonumber \\&\left. -\frac{g}{2}\bigg [\, \frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}\left( (\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\right) ^2 - \frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}\left( (\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\right) ^2 \bigg ] \right. \nonumber \\&\left. +\frac{g\Delta x}{2} \Bigg [ \Big ((\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\Big ) \bigg (r\Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}+(1-r)\Big ((\eta _2)_x\Big )^+_{j-\frac{1}{2}}\bigg ) \right. \nonumber \\&\left. + \Big ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big ) \bigg (r\Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}+(1-r)\Big ((\eta _2)_x\Big )^-_{j+\frac{1}{2}}\bigg ) \Bigg ] \right. \nonumber \\&\left. -\frac{(\Delta t_2)_{j-\frac{1}{2}}}{\Delta t}\frac{1}{2} C^{(4)}_{{\Psi },{j-\frac{1}{2}}} -\frac{(\Delta t_2)_{j+\frac{1}{2}}}{\Delta t}\frac{1}{2} C^{(4)}_{{\Psi },{j+\frac{1}{2}}} \right\} . \end{aligned}$$
(2.67)

Using (2.65), one can easily prove that \({\mathcal L}^{(1)}({\varvec{U}}_j)={{\mathcal {L}}}^{(3)}({\varvec{U}}_j)=0\), and the first two RHS rows of \({{\mathcal {L}}}^{(2)}({\varvec{U}}_j)\), as well as the first three RHS rows of \({{\mathcal {L}}}^{(4)}({\varvec{U}}_j)\) are canceled in (2.67).

With (2.66), \({{\mathcal {L}}}^{(2)}({\varvec{U}}_j)\) and \({\mathcal L}^{(4)}({\varvec{U}}_j)\) in (2.67) can be further simplified to

$$\begin{aligned} {{\mathcal {L}}}^{(2)}({\varvec{U}}_j)= & {} -\frac{g}{2} \bigg [ (h_1)^+_{j-\frac{1}{2}}\Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}+ (h_1)^-_{j+\frac{1}{2}}\Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}\bigg ],\end{aligned}$$
(2.68)
$$\begin{aligned} {{\mathcal {L}}}^{(4)}({\varvec{U}}_j)= & {} -\frac{g}{2} \Bigg \{ \Big ((\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\Big ) \bigg [r\Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}+(1-r)\Big ((\eta _2)_x\Big )^+_{j-\frac{1}{2}}\bigg ]\nonumber \\&+ \Big ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big ) \bigg [r\Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}+(1-r)\Big ((\eta _2)_x\Big )^-_{j+\frac{1}{2}}\bigg ] \Bigg \}. \end{aligned}$$
(2.69)

Remark 2.6

Above cancellations and simplifications are valid for any type of cells (see Sect. 2.3.2), provided the stationary steady-state solutions (2.63).

We then prove that the RHS terms of (2.69) vanish for any one of the Types 13 cells (see Sect. 2.3.2) provided the stationary steady-state solutions (2.63).

For a Types 1 cell, it can only be combined with a Types 4 cell. Therefore, providing stationary steady-state solutions (2.63), one obtains that

$$\begin{aligned} \Big ((\eta _2)_x\Big )^+_{j-\frac{1}{2}}=\Big ((\eta _2)_x\Big )^-_{j+\frac{1}{2}}=0, \quad \Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}=\Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}=0,\nonumber \\ \end{aligned}$$
(2.70)

which lead to \({{\mathcal {L}}}^{(4)}({\varvec{U}}_j)=0\).

For a Types 2 cell, assuming \(B_{j-\frac{1}{2}}<B_{j+\frac{1}{2}}\), using that (2.36), one has that

$$\begin{aligned} \Big ((\eta _2)_x\Big )^+_{j-\frac{1}{2}}=0, \quad \Big ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big )=0. \end{aligned}$$
(2.71)

Moreover, for either a Types 4 or Types 5 cell combined with a Types 2 cell, one always has that

$$\begin{aligned} \Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}=0. \end{aligned}$$
(2.72)

Thus, (2.71) and (2.72) lead to \({\mathcal L}^{(4)}({\varvec{U}}_j)=0\).

For a Types 3 cell, it obviously yields that

$$\begin{aligned} \Big ((\eta _2)^+_{j-\frac{1}{2}}-B_{j-\frac{1}{2}}\Big )=\Big ((\eta _2)^-_{j+\frac{1}{2}}-B_{j+\frac{1}{2}}\Big )=0, \end{aligned}$$
(2.73)

which lead to \({{\mathcal {L}}}^{(4)}({\varvec{U}}_j)=0\).

Next, one can prove that the RHS terms of (2.68) vanish for any one of Types 46 cells (see Sect. 2.3.2) providing the stationary steady state solutions (2.63).

For a Types 4 cell, no matter which type of cell (Types 13) it is combined with, providing stationary steady state solutions (2.63), one has that

$$\begin{aligned} \Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}= \Big ((h_1+\eta _2)_x\Big )^-_{j+\frac{1}{2}}=0, \end{aligned}$$
(2.74)

which lead to \({{\mathcal {L}}}^{(2)}({\varvec{U}}_j)=0\).

For a Types 5 cell, assuming \(B_{j-\frac{1}{2}}<B_{j+\frac{1}{2}}\), no matter which one of Types 23 cells it is combined with, one has that

$$\begin{aligned} \Big ((h_1+\eta _2)_x\Big )^+_{j-\frac{1}{2}}=0, \quad (h_1)^-_{j+\frac{1}{2}}=0, \end{aligned}$$
(2.75)

which lead to \({{\mathcal {L}}}^{(2)}({\varvec{U}}_j)=0\).

For a Types 6 cell, obviously, it yields that

$$\begin{aligned} (h_1)^+_{j-\frac{1}{2}}=0, \quad (h_1)^-_{j+\frac{1}{2}}=0, \end{aligned}$$
(2.76)

which lead to \({{\mathcal {L}}}^{(2)}({\varvec{U}}_j)=0\).

Thus, for any type of cell classified in a two-layer shallow water system, the proposed numerical schemes guarantee the forcing terms \({\varvec{{\mathcal {L}}}}({\varvec{U}})\) vanish at the stationary steady states (2.63).

Accordingly, one can conclude that the proposed numerical schemes guarantee the well-balanced property in the presence of wet–dry fronts.

3 Numerical experiments

In this section, the currently proposed numerical scheme is tested on a number of numerical examples. In the following experiments, \(r=0.9\) is set unless otherwise specified, and \(g=9.81\) is used for all the tests. The \(L^1\)- and \(L^\infty \)-norm of errors in this section are computed by

$$\begin{aligned} L^1\hbox {-error}=\frac{1}{N}\sum _{1}^{N}|U_j-U^{\mathrm{ref}}_j|, \quad L^\infty \hbox {-error}=\max _j|U_j-U^{\mathrm{ref}}_j|, \end{aligned}$$

where \(U^{\mathrm{ref}}\) represents the reference or exact solution.

3.1 Experiment 1—Numerical accuracy order

In this test, the accuracy of the proposed numerical scheme is first investigated by computing the \(L^1\)-error and experimental order of convergence (EOC) of the variables. As given in Kurganov and Petrova (2009), the initial conditions are

$$\begin{aligned} \begin{aligned}&\widehat{\eta }_1(x,0)=10,\quad&\widehat{\eta }_2(x,0)=5-e^{\cos (2\pi x)}, \\&q_1(x,0)\equiv q_2(x,0)\equiv 0, \quad&B(x)=\sin ^2(\pi x), \quad \quad x\in [\,0,1\,]. \end{aligned} \end{aligned}$$
(3.1)

The periodic boundary conditions are applied on both boundaries. It is computed up to \(t=0.1\) over the computational domain \([\,0,1\,]\). The reference solution is obtained with \(N=32000\) grids. The \(L^1\)-errors and the experimental order of convergence of variables \(\varvec{U}\) are shown in Table 1. One can find that the proposed numerical model is second order accurate as expected.

Table 1 Experiment 1: \(L^1\)-errors and experimental order of convergence (EOC)

3.2 Experiment 2—Stationary steady-state solutions

In this numerical experiment, we test the well-balanced property by computing the stationary steady states over the computational domain \([\,0,10\,]\). The bottom topography with a 0.8 high hump is defined by

$$\begin{aligned} B(x)=\left\{ \begin{aligned}&0.8-0.2(x-5)^2,&\hbox {if}~~3\le x\le 7,\\ {}&0,&\hbox {otherwise}.\end{aligned}\right. \end{aligned}$$
(3.2)

Due to the presence of two layers, the proposed numerical schemes are tested based on the following three steady-state cases:

(a):

Upper layer: Wholly flooded; Lower layer: Wholly flooded,

$$\begin{aligned} \widehat{\eta }_1(x,0)=1.2,\quad \widehat{\eta }_2(x,0)=1, \quad q_1(x,0)\equiv q_2(x,0)\equiv 0, \end{aligned}$$
(3.3)
(b):

Upper layer: Wholly flooded; Lower layer: Partly flooded,

$$\begin{aligned} \widehat{\eta }_1(x,0)=1.0,\quad \widehat{\eta }_2(x,0)=\max \big [\,0.6, B(x)\,\big ], \quad q_1(x,0)\equiv q_2(x,0)\equiv 0, \end{aligned}$$
(3.4)
(c):

Upper layer: Partly flooded;    Lower layer: Partly flooded,

$$\begin{aligned} \widehat{\eta }_1(x,0)=0.6,\quad \widehat{\eta }_2(x,0)=0.3, \quad q_1(x,0)\equiv q_2(x,0)\equiv 0, \end{aligned}$$
(3.5)

The steady-state solutions are computed up to \(t=10\) over a relatively coarse mesh with \(\Delta x=\) 0.5, 0.1 and 0.01, respectively, for above three different cases. The simulated water surfaces and discharges with \(\Delta x=0.1\) at \(t=10\) are shown in Fig. 6. In the left column of Fig. 6, one can observe that the computed surface of each layer remains constant during the simulation even in the presence of wet–dry fronts. In the right column of Fig. 6, it can be seen that the computed two-layer fluids remain stationary in different above-described cases, the observed small disturbations are only of the same magnitude as machine error. The errors of different cases with different grid sizes are further shown in Table 2 which confirms that the proposed numerical schemes guarantee the well-balanced property in the presence of wet–dry fronts as expected.

Fig. 6
figure 6

Experiment 2: Computed surface levels (left) and discharges (right) of both fluid layers for case a (first row), b (second row), and c (third row), respectively, with \(\Delta x=0.1\) at \(t=10\)

Table 2 Experiment 2: \(L^1\) and \(L^\infty \)-errors of different variables

3.3 Experiment 3—Small perturbation of a stationary steady-state solutions

In this test, the ability of accurately capturing small perturbations of the stationary steady-state solutions is verified using the proposed numerical schemes. To this end, the numerical test in (Kurganov and Petrova 2009) is modified in this study.

The bottom topography is defined by

$$\begin{aligned} B(x)=\left\{ \begin{aligned}&0.25\big [\cos (10\pi (x-0.5))+1\big ]-2,&\hbox {if} 0.1<x<0.2,\\&-2,&\hbox {otherwise}, \end{aligned}\right. \end{aligned}$$
(3.6)

over the computational domain \([\,0,1\,]\)

It is considered in this experiment two sets of initial conditions, i.e., case (a) (see Fig. 7, left):

$$\begin{aligned}&\Big ( \widehat{\eta }_1(x,0),\ \widehat{\eta }_2(x,0),\ q_1(x,0),\ q_2(x,0) \Big )\nonumber \\&\quad =\left\{ \begin{aligned}&\big (0.00001,\, -1,\, 0,\, 0 \big ),&\hbox {if} 0.1<x<0.2,\\&\big (0,\, -1,\, 0,\, 0 \big ),&\hbox {otherwise}, \end{aligned}\right. \end{aligned}$$
(3.7)

and case (b) (see Fig. 7, right):

$$\begin{aligned}&\Big ( \widehat{\eta }_1(x,0),\ \widehat{\eta }_2(x,0),\ q_1(x,0),\ q_2(x,0) \Big )\nonumber \\&\quad =\left\{ \begin{aligned}&\big (0.00001,\, -1.6,\, 0,\, 0 \big ),&\hbox {if} 0.1<x<0.2,\\&\big (0,\, -1.6,\, 0,\, 0 \big ),&\hbox {otherwise}. \end{aligned}\right. \end{aligned}$$
(3.8)
Fig. 7
figure 7

Experiment 3: Initial conditions of case a (left) and case b (right)

The transport of the small perturbation is then simulated (3.7) and (3.8), respectively, up to \(t=0.15\) on different grid sizes, i.e., \(\Delta x=1/100\), \(\Delta x=1/200\), and \(\Delta x=1/1600\). Notice that the solution with \(\Delta x=1/1600\) can serve as a reference solution. The results are presented in Figs. 8 and 9, respectively. One can see that the proposed numerical model is capable to accurately capture small physical perturbations and no numerical oscillations are produced thanks to the well-balanced property.

Fig. 8
figure 8

Experiment 3 (case (a)): Computed surface perturbations of the upper layer (left) and bottom layer (right) with different grid sizes at \(t=0.15\)

Fig. 9
figure 9

Experiment 3 (case (b)): Computed surface perturbations of the upper layer (left) and bottom layer (right) with different grid sizes at \(t=0.15\)

3.4 Experiment 4—Dam break flows with wetting–drying

This experiment is designed to verify the ability of the currently proposed scheme to preserve the positivity of the fluid depth during the wetting and drying process. The bottom topography is defined by

$$\begin{aligned} B(x)=\left\{ \begin{aligned}&0.5-0.5(x-1.5)^2,&\hbox {if}~~0.5\le x\le 02.5,\\&0.225-0.4(x-3.75)^2,&\hbox {if}~~3\le x\le 4.5,\\&0,&\hbox {otherwise}.\end{aligned}\right. \end{aligned}$$

over the computational domain \([\,0,5\,]\) discretized by 500 uniform grids.

The following three different cases are considered. Case (a) considers the wetting–drying process only for the upper layer fluid, it demonstrates a dam-break flow of the upper layer fluid over an initially flat fluid interface. Thus, the initial conditions (Fig. 10, first row) are defined by

$$\begin{aligned}&\hbox {Case (a):}\qquad \Big ( \widehat{\eta }_1(x,0),\ \widehat{\eta }_2(x,0),\ q_1(x,0),\ q_2(x,0) \Big )\nonumber \\&\quad =\left\{ \begin{aligned}&\big (1.1,\, 0.6,\, 0,\, 0 \big ),&\hbox {if} x\le 3,\\&\big (0.6,\, 0.6,\, 0,\, 0 \big ),&\hbox {otherwise}. \end{aligned}\right. \end{aligned}$$
(3.9)

The computed results at different times of case (a) are shown in Fig. 10. One can observe that no negative fluid depth or non-physically high flow rate is generated for the upper layer fluid during the simulation.

Fig. 10
figure 10

Experiment 4 (case (a)): Computed surface levels, discharges and fluid depths at different times

In case (b), the wetting–drying process is considered only for the bottom layer fluid over irregular bottom, its initial conditions (Fig. 11, first row) are given by

$$\begin{aligned}&\hbox {Case (b):}\qquad \Big ( \widehat{\eta }_1(x,0),\ \widehat{\eta }_2(x,0),\ q_1(x,0),\ q_2(x,0) \Big )\nonumber \\&\quad =\left\{ \begin{aligned}&\big (1.5,\, 0.5,\, 0,\, 0 \big ),&\hbox {if} x\le 2.5,\\&\big (1.5,\, 0,\, 0,\, 0 \big ),&\hbox {otherwise}. \end{aligned}\right. \end{aligned}$$
(3.10)

The computed results at different times of case (b) are presented in Fig. 11. One can see that no negative fluid depth or non-physically high flow rate is produced for the lower layer fluid near the wet–dry fronts. A quasi steady state is obtained at the end of simulation.

Fig. 11
figure 11

Experiment 4 (case (b)): Computed surface levels, discharges and fluid depths at different times

In the case (c), the wetting–drying process is considered for the entire two-layer fluid body over an irregular bed. It demonstrates a dam-break flow over an initially dry bed. The initial conditions (Fig. 12, first row) are defined by

$$\begin{aligned}&\hbox {Case (c):}\qquad \Big ( \widehat{\eta }_1(x,0),\ \widehat{\eta }_2(x,0),\ q_1(x,0),\ q_2(x,0) \Big )\nonumber \\&\quad =\left\{ \begin{aligned}&\big (0.5,\, 0.3,\, 0,\, 0 \big ),&\hbox {if} x\le 3.2,\\&\big (0,\, 0,\, 0,\, 0 \big ),&\hbox {otherwise}. \end{aligned}\right. \end{aligned}$$
(3.11)

Figure 12 shows the computed results of case (c) at different times. One can see that the fluid depth of each layer remains non-negative during the computation, and no oscillation is generated near the wet–dry fronts. A quasi steady state is obtained at the end of the simulation.

Fig. 12
figure 12

Experiment 4 (case (c)): Computed surface levels, discharges and fluid depths at different times

3.5 Experiment 5—Barotropic tidal flow

In this experiment, the test in (Diaz et al. 2019) is repeated. It mimics a tidal wave by imposing a barotropic periodic perturbation as the inflow boundary condition.

The initial conditions with a internal shock are defined by

$$\begin{aligned} \begin{aligned}&\Big ( h_1(x,0),\ q_1(x,0),\ h_2(x,0),\ q_2(x,0) \Big )=\Big ( \left( h_1\right) _R,\ \left( q_1\right) _R,\ \left( h_2\right) _R,\ \left( q_2\right) _R \Big ) \\&\quad = \big (0.37002,\, -0.18684,\, 1.5931,\, 0.17416 \big ), \quad \hbox {if} x>0, \end{aligned} \end{aligned}$$
(3.12)

and

$$\begin{aligned} \begin{aligned}&\Big ( h_1(x,0),\ q_1(x,0),\ h_2(x,0),\ q_2(x,0) \Big )=\Big ( \left( h_1\right) _L,\ \left( q_1\right) _L,\ \left( h_2\right) _L,\ \left( q_2\right) _L \Big ) \\&\quad = \big (0.69914,\, -0.21977,\, 1.26932,\, 0.20656 \big ), \quad \hbox {if} x\le 0, \end{aligned} \end{aligned}$$
(3.13)

to construct the Hugoniot curve.

Following (Diaz et al. 2019), a flat bed is considered in this test by defining

$$\begin{aligned} B(x)\equiv B_{\mathrm{ref}}=-\frac{1}{2}\Big ( \left( h_1\right) _R+ \left( h_2\right) _R+ \left( h_1\right) _L + \left( h_2\right) _L \Big ). \end{aligned}$$
(3.14)
Fig. 13
figure 13

Experiment 5: Computed surface levels \(\eta _1\) (left column) and \(\eta _2\) (right column) using different numerical schemes at different times

The simulation is conducted over the computational domain \([\,-10,10\,]\) discretized by 1000 uniform cells. The density ratio is set to be \(r=0.98\) in this test. The open boundary condition is applied to the boundary at \(x=10\), and the periodic boundary condition is imposed on the left boundary at \(x=-10\) for components \(h_1\) and \(h_2\) by

$$\begin{aligned} \begin{aligned}&h_1(-10,t) = \left( h_1\right) _L+ \left( h_1\right) _L \frac{0.03}{|B_{\mathrm{ref}}|}\sin \left( \frac{\pi t}{50}\right) , \\&h_2(-10,t) = \left( h_2\right) _L+ \left( h_1\right) _L \frac{0.03}{|B_{\mathrm{ref}}|}\sin \left( \frac{\pi t}{50}\right) . \end{aligned} \end{aligned}$$
(3.15)

The components \(q_1\) and \(q_2\) on the left boundary at \(x=-10\) are obtained using a zero-order extrapolation.

This test is computed until \(t=64\). In Fig. 13, the results simulated by the currently proposed schemes are compared with the PCCU scheme developed by Castro Díaz et al. (Diaz et al. 2019) and the original central-upwind method for two-layer system developed by Kurganov and Petrova (Kurganov and Petrova 2009). One can observe that, as expected, the proposed new scheme with the novel well-balanced design Sect. 2.3 yields almost the same results as the PCCU scheme developed in (Diaz et al. 2019) as expected. Moreover, as stated in Diaz et al. (2019), the original central-upwind method in Kurganov and Petrova (2009) begins to develop some spurious oscillations and eventually becomes unstable at larger times. This verifies the importance of the path-conservative method.

3.6 Experiment 6—Subgrid-scale fluctuation

In this test, we design a challenging numerical experiment modeling the fluctuation that is not well resolved by the discretized grids.

The test is conducted over the computational domain \([\,-1,1\,]\), which is divided into only two cells. Both cells are partially flooded cells given the initial condition that

$$\begin{aligned} \Big ( \widehat{\eta }_1(x,0),\ \widehat{\eta }_2(x,0),\ q_1(x,0),\ q_2(x,0) \Big )=\left\{ \begin{aligned}&\big (0.4,\, 0.23,\, 0,\, 0 \big ),&\hbox {in cell 1},\\&\big (0.24,\, 0.15,\, 0,\, 0 \big ),&\hbox {in cell 2}, \end{aligned}\right. \end{aligned}$$
(3.16)

and the bottom topography that

$$\begin{aligned} B_{\frac{1}{2}}=0.5, \quad B_{\frac{3}{2}}=0, \quad B_{\frac{5}{2}}=0.5, \end{aligned}$$
(3.17)

as illustrated in Fig. 14.

Fig. 14
figure 14

Experiment 6: Schematic: two adjacent partially flooded cells with upper (red) and lower (blue) layer fluids

As the computation starts, a dam-break wave is generated at the cell interfaces and then fluctuate between two partially flooded cells. Figure 15 shows the computed surface levels of two layers in both cells at different times.

Fig. 15
figure 15

Experiment 6: Computed surface levels at different times

One can observe that the proposed numerical scheme allows for subgrid-scale modeling of small fluctuation in a stable manner.

4 Conclusion

In this paper, a well-balanced and positivity-preserving path-conservative finite volume method has been successfully developed for the two-layer shallow water equations. The well-balanced property has been achieved in the presence of the wet–dry fronts thanks to (i) the special surface reconstruction for each layer (see Sect. 2.3.2), (ii) the new numerical discretization of the cell integral of source terms (2.47). The positivity of each layer has been guaranteed by applying the local draining constraints of outgoing fluxes. Finally, a special fully discrete scheme has been developed. The numerical experiments have proved that the proposed numerical scheme is capable to guarantee the non-negative water depths for each fluid layer, and well-balanced property even in the presence of wet–dry fronts.