Governing equations

GeoSWE solves the 2D nonlinear shallow-water equations (SWE) in conservative form. With water depth \(h\), depth-averaged velocity \(\mathbf{u}=(u,v)\), and momenta \(hu, hv\), the state vector is

\[\begin{split} \mathbf{q} = \begin{pmatrix} h \\ hu \\ hv \end{pmatrix}, \end{split}\]

and the system reads

\[ \partial_t \mathbf{q} + \partial_x \mathbf{F}(\mathbf{q}) + \partial_y \mathbf{G}(\mathbf{q}) = \mathbf{S}_b + \mathbf{S}_f + \mathbf{S}_r . \]

The fluxes are

\[\begin{split} \mathbf{F} = \begin{pmatrix} hu \\ hu^2 + \tfrac12 g h^2 \\ huv \end{pmatrix}, \qquad \mathbf{G} = \begin{pmatrix} hv \\ huv \\ hv^2 + \tfrac12 g h^2 \end{pmatrix}, \end{split}\]

where \(g\) is gravity (default \(9.81\,\mathrm{m\,s^{-2}}\), Config.g). In the arrays, q[0]=h, q[1]=hu, q[2]=hv.

Source terms

The right-hand side carries three sources. The bed slope enters the residual together with the fluxes; friction and the depth sinks are applied after it (see numerical methods).

Bed slope \(\mathbf{S}_b\): the topographic forcing,

\[\begin{split} \mathbf{S}_b = \begin{pmatrix} 0 \\ -g h\, \partial_x b \\ -g h\, \partial_y b \end{pmatrix}, \end{split}\]

with bed elevation \(b(x,y)\). Discretizing \(\mathbf{S}_b\) so that it exactly balances the pressure flux for still water is the well-balanced property (see well-balanced schemes).

Friction \(\mathbf{S}_f\): Manning bed friction, treated point-implicitly for stability (see friction):

\[\begin{split} \mathbf{S}_f = \begin{pmatrix} 0 \\ -C_f\,u\,|\mathbf{u}| \\ -C_f\,v\,|\mathbf{u}| \end{pmatrix}, \qquad C_f = \frac{g\,n^2}{h^{1/3}}, \end{split}\]

with Manning roughness \(n\) and \(|\mathbf{u}| = \sqrt{u^2+v^2}\). The term is stiff in thin films, which is why it is integrated point-implicitly.

Mass source \(\mathbf{S}_r\): the gridded rainfall rate \(R\) (m/s), added to the depth equation only,

\[\begin{split} \mathbf{S}_r = \begin{pmatrix} R \\ 0 \\ 0 \end{pmatrix}. \end{split}\]

Rain adds depth but no horizontal momentum, so discharge is unchanged and velocity falls as depth rises. Infiltration (Green-Ampt) and the uniform recession sink are not entries in \(\mathbf{S}_r\): they are operator-split depth sinks applied after the residual update, and they remove water at the local velocity by scaling \((hu, hv)\) by the remaining-depth ratio (see forcings).

Wetting and drying

A cell with \(h < h_\min\) is treated as dry: its momentum is zeroed and it contributes no outgoing flux, but any positive sub-threshold depth is retained, so the cell can still be wetted by a neighbouring flux. The threshold is Config.h_min (default \(10^{-10}\) in float64; automatically raised to \(10^{-6}\) in float32). The floor used in the velocity estimate of the CFL condition, Config.h_min_cfl, may be set to a different value; every run reported in the paper uses the same value for both. See configuration.