Solution (source code)

= Solution

Let states $1$ and $2$ be just left and right of a <hydraulic bore> moving at speed $s$, and let $[f]=f_2-f_1$. Integrating the conservative <prismatic-channel shallow water equations> across it gives the <Rankine-Hugoniot condition>
$$
\boxed{s[A]=[Au],\qquad s[Au]=[Au^2+P],\qquad
A=\frac23h^{3/2},\quad P=\frac4{15}gh^{5/2}.}
$$
Equivalently the discharge in the <shock frame> is common on the two sides,
$$
j=A_1(u_1-s)=A_2(u_2-s),
\qquad
j^2\left(\frac1{A_1}-\frac1{A_2}\right)=P_2-P_1.
$$
Thus, for unequal positive depths,
$$
s=\frac{A_2u_2-A_1u_1}{A_2-A_1},\qquad
j^2=\frac{A_1A_2(P_2-P_1)}{A_2-A_1}.
$$
<Momentum> is conserved through the bore in this ideal model, but mechanical energy is dissipated; an energy-conservation jump must not be imposed as well.

For a stationary bore with rightward flow, $s=0$, $A_1u_1=A_2u_2>0$, and the momentum jump must still hold. A compressive <hydraulic jump> has $h_2>h_1$ and
$$
\boxed{u_1-c_1>0>u_2-c_2,\qquad u_1+c_1>0,\quad u_2+c_2>0.}
$$
The $u-c$ <characteristic curves> approach the stationary bore from both sides: upstream flow is <supercritical flow>, while downstream flow is <subcritical flow> using the local wave speed $c_i=\sqrt{2gh_i/3}$. The $u+c$ family travels downstream on both sides. These characteristic directions accompany, rather than replace, the two stationary conservation jumps.