Discretization

Finite-volume step

With \(U = (h, hu, hv)\), a first-order step (flume.order = 1, the default) updates cell \((i, j)\) in one stage, without splitting the directions:

\[U_{ij}^{n+1} = U_{ij}^{n} - \frac{\Delta t}{\Delta x}\left(F_{i+1/2,j} - F_{i-1/2,j}\right) - \frac{\Delta t}{\Delta y}\left(G_{i,j+1/2} - G_{i,j-1/2}\right) + \Delta t\, S_{ij} .\]

\(F\) and \(G\) are the face fluxes and \(S\) the bed-slope term. Each face has one flux, used by both of its cells. Rain and friction act after the step (Source terms).

Hydrostatic reconstruction

The bed is a step at each face. A cell with depth \(h\) and bed \(z_b\) presents to a neighbour with bed \(z_b'\) the depth (Audusse et al., 2004)

\[h^{*} = \max\bigl(0,\; h - \max(0,\; z_b' - z_b)\bigr) ,\]

the part of its water above the higher of the two beds. The flux on the face is computed from \(h^{*}\) on each side and the velocities of the two cells. With \(h^{*}_{E}\), \(h^{*}_{W}\), \(h^{*}_{N}\), \(h^{*}_{S}\) the depths a cell presents to its four faces, the bed-slope term is

\[S^{hu}_{ij} = \frac{g}{2\,\Delta x}\left(h^{*2}_{E} - h^{*2}_{W}\right) , \qquad S^{hv}_{ij} = \frac{g}{2\,\Delta y}\left(h^{*2}_{N} - h^{*2}_{S}\right) .\]

Well balanced. Under a level surface the two cells at a face present the same \(h^{*}\): the mass flux is zero and \(S\) cancels the difference of the momentum fluxes. Water at rest stays at rest to round-off over any bed.

Limitation. Where the bed rises at a face by at least the depth of the lower cell, \(h^{*} = 0\) and the face sees less of the bed step than there is. Shallow water moving down a steep bed is then driven too weakly: the velocity is low and the depth high (Delestre et al., 2012). The effect falls with the cell size. Water at rest is not affected.

HLLC flux

At a face, let L and R be the low and high sides, \(u_n\) and \(u_t\) the velocities normal to and along the face, and \(c = \sqrt{g h^{*}}\). The wave speeds are estimated from the middle state of two rarefactions (Satyaprasad et al., 2024, section 3.4):

\[s_L = \min(u_{n,L} - c_L,\; u^{\star} - c^{\star}) , \qquad s_R = \max(u_{n,R} + c_R,\; u^{\star} + c^{\star}) ,\]
\[u^{\star} = \tfrac{1}{2}(u_{n,L} + u_{n,R}) + c_L - c_R , \qquad c^{\star} = \max\bigl(0,\; \tfrac{1}{2}(c_L + c_R) + \tfrac{1}{4}(u_{n,L} - u_{n,R})\bigr) .\]

With one side dry the speeds are those of a front on a dry bed: \(s_L = u_{n,L} - c_L\), \(s_R = u_{n,L} + 2 c_L\) with the high side dry, and \(s_L = u_{n,R} - 2 c_R\), \(s_R = u_{n,R} + c_R\) with the low side dry. A face dry on both sides has no flux.

With \(q = (h^{*},\; h^{*} u_n)\) and \(f = (h^{*} u_n,\; h^{*} u_n^2 + \tfrac{1}{2} g h^{*2})\):

\[\begin{split}f^{\mathrm{HLL}} = \begin{cases} f_L , & s_L \ge 0 , \\ \dfrac{s_R f_L - s_L f_R + s_L s_R (q_R - q_L)}{s_R - s_L} , & s_L < 0 < s_R , \\ f_R , & s_R \le 0 . \end{cases}\end{split}\]

The momentum along the face is carried by the mass flux from its upwind side (Delestre et al., 2014, section 4.4):

\[\begin{split}f_{t} = f^{\mathrm{HLL}}_{h}\; \times \begin{cases} u_{t,L} , & f^{\mathrm{HLL}}_{h} \ge 0 , \\ u_{t,R} , & f^{\mathrm{HLL}}_{h} < 0 . \end{cases}\end{split}\]

For the shallow-water equations the middle wave of the HLLC flux moves with the sign of the HLL mass flux, so this is the HLLC flux written without the speed of that wave.

Limitation. The speed estimates are exact for two rarefactions. For a shock into much shallower water they are below the exact shock speed: 1.5 times the celerity of the deep side for still water next to a very thin layer, where the exact front moves at about 1.7 times.

Second order

flume.order = 2 replaces the constant state of a cell by a linear one in each direction and the single stage by two.

Limited differences. Along x (and y alike), with \(\eta = h + z_b\):

\[\delta h_i = \mathrm{mm}(h_i - h_{i-1},\; h_{i+1} - h_i) , \qquad \delta \eta_i = \mathrm{mm}(\eta_i - \eta_{i-1},\; \eta_{i+1} - \eta_i) ,\]

and \(\delta u_i\), \(\delta v_i\) alike, where \(\mathrm{mm}(a, b)\) is the minmod function: the smaller of \(a\) and \(b\) in magnitude when they have the same sign, zero otherwise. A dry cell is not reconstructed, and the velocity of a dry neighbour counts as zero.

Sides of a cell. The cell presents to its low-x face (W) and high-x face (E)

\[h_{W,E} = h_i \mp \tfrac{1}{2}\delta h_i , \qquad z_{W,E} = z_{b,i} \mp \tfrac{1}{2}(\delta\eta_i - \delta h_i) , \qquad u_{W} = u_i - \frac{h_{E}}{2 h_i}\,\delta u_i , \qquad u_{E} = u_i + \frac{h_{W}}{2 h_i}\,\delta u_i ,\]

and \(v_W\), \(v_E\) alike. The side depths are at least \(h_i / 2\), the mean of the two side discharges is \(h_i u_i\), and under a level surface the surface is level on both sides.

Faces. The hydrostatic reconstruction and the HLLC flux are applied to the E side of cell \(i\) and the W side of cell \(i+1\).

Bed-slope term. (Audusse et al., 2004)

\[S^{hu}_{i} = \frac{g}{2\,\Delta x}\left(h^{*2}_{E} - h^{*2}_{W}\right) - \frac{g}{\Delta x}\, h_i\,\delta\eta_i .\]

The first part is the first-order term with the depths of the sides; the second is the weight of the water on the slope of the surface inside the cell. Under a level surface \(\delta\eta_i = 0\) and the scheme is well balanced as at first order.

Two stages. With \(\mathcal{E}(U, \Delta t)\) one first-order step with the fluxes and bed-slope term above (Heun’s method):

\[U^{(1)} = \mathcal{E}(U^{n}, \Delta t) , \qquad U^{(2)} = \mathcal{E}(U^{(1)}, \Delta t) , \qquad U^{n+1} = \tfrac{1}{2}\left(U^{n} + U^{(2)}\right) .\]

\(\Delta t\) is computed once, from \(U^{n}\). Each stage keeps the depth non-negative and conserves mass, so the mean does.

Limitations. The minmod limiter is first order at a maximum or minimum of a field, so the error of a smooth solution falls at a rate below 2 in the largest norm (1.9 measured, Verification). Next to a dry cell the scheme is close to first order.