Variable-section channel characteristics (source code)

= Variable-section channel characteristics
{title2=$c^2=gS/S_h$}

For cross-sectional area $S(x,h)$ and cross-sectionally uniform velocity, <volume conservation> gives $S_h(h_t+uh_x)+Su_x+uS_x=0$, while hydrostatic inviscid momentum gives $u_t+uu_x+gh_x=0$. Their <characteristic speeds> are $u\pm c$. With $D_\pm=\partial_t+(u\pm c)\partial_x$, the robust compatibility equation is $(g/c)D_\pm h\pm D_\pm u=-ucS_x/S$. Replacing $D_\pm h$ by $D_\pm c/c_h$ requires $c_x=0$ at fixed height; otherwise an explicit geometry term remains.