Solution (source code)

= Solution

Let $\ell$ and $\mathcal T$ denote longitudinal length and time scales, and let $U$ be a typical streamwise <velocity>. The <shallow water> approximation requires $h/\ell\ll1$, slow changes in the channel geometry $h|B'/B|\ll1$, and small longitudinal slopes. The vertical <velocity> is then of order $Uh/\ell$; its acceleration must be small compared with the restoring acceleration, for example $Uh/(\mathcal T\ell)+U^2h/\ell^2\ll g'$ in a reduced-gravity layer. The leading <pressure> is <hydrostatic pressure>, and cross-sectional horizontal <velocity> is approximated by $u(x,t)$. High <Reynolds number> permits negligible interior viscous terms but does not itself guarantee the geometric or hydrostatic assumptions. We also require $B>0$ and $h>0$ in the wetted interior. The dimensionless $B$ need not be small: it measures the cross-section's opening angle, while the smallness condition concerns streamwise variation.

The cross-sectional area and volume transport are
$$
A(x,t)=\int_0^h B(x)z\,dz=\frac{Bh^2}{2},\qquad q=Au.
$$
For an impermeable bed and no <fluid entrainment>, <volume conservation> gives
$$
\boxed{\partial_t\left(\frac{Bh^2}{2}\right)+\partial_x\left(\frac{Bh^2u}{2}\right)=0,}
$$
or, equivalently,
$$
h_t+uh_x+\frac h2u_x=-\frac{uh}{2}\frac{B'}B.
$$
The geometrical source term expresses the depth change needed when a moving layer encounters a wider or narrower triangular section.