# Solving a simple Shallow Water model

Hi. I have a question at Mathematics and they suggested post here, once it's not common. I transcript as following. Many thanks

I need to solve with basic methods this simple Shallow Water Model:

$$\begin{bmatrix}h\\ hv\end{bmatrix}_t+\begin{bmatrix}hv\\ hv^2+\frac{1}{2}gh^2\end{bmatrix}_x=\begin{bmatrix}0\\ 0\end{bmatrix}$$

where $$h$$ is the height of the water, $$v$$ is the horizontal velocity of the fluid and $$g$$ is the gravitational constant.

Writing in quasilinear form, I've got

$$\begin{bmatrix}h\\ hv\end{bmatrix}_t+\begin{bmatrix}0&1\\ gh-v^2&2v\end{bmatrix}\begin{bmatrix}h\\ hv\end{bmatrix}_x=\begin{bmatrix}0\\ 0\end{bmatrix}$$

The Jacobian can be diagonalized as $$J=RDR^{-1}$$ where

$$R=\begin{bmatrix}\dfrac{1}{v-\sqrt{gh}}&\dfrac{1}{v+\sqrt{gh}}\\ 1&1\end{bmatrix}$$

$$R^{-1}=\begin{bmatrix}\dfrac{v^2-gh}{2\sqrt{gh}}&\dfrac{1}{2}-\dfrac{v}{2\sqrt{gh}}\\ \dfrac{gh-v^2}{2\sqrt{gh}}&\dfrac{1}{2}\bigg(\dfrac{v}{\sqrt{gh}}+1\bigg)\end{bmatrix}$$

$$D=\begin{bmatrix} v-\sqrt{gh}&0 \\ 0 & v+\sqrt{gh}\end{bmatrix}$$

I've done the change of variables

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}=R^{-1}\begin{bmatrix}h\\ hv\end{bmatrix}$$

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}=\begin{bmatrix}\frac{h}{2}(v+\sqrt{gh})\\ \frac{h}{2}(v-\sqrt{gh})\end{bmatrix}$$

Geting the system

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}_t+\begin{bmatrix}v-\sqrt{gh}&0\\0&v+\sqrt{gh}\end{bmatrix}\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}_x=\begin{bmatrix}0\\ 0\end{bmatrix}$$

ie

$$\overline{h}_t+(v-\sqrt{gh})\overline{h}_x=0\\ \overline{k}_t+(v+\sqrt{gh})\overline{k}_x=0$$

Trying to solve this conservation laws by the characteristic method, I've got to the first

$$x(t)=(v_0(x_0)-\sqrt{gh_0(x_0)})t+x_0\qquad (i)$$

and to the second

$$x(t)=(v_0(\overline{x}_0)+\sqrt{gh_0(\overline{x}_0)})t+\overline{x}_0\qquad (ii)$$

where $$v_0,h_0$$ are the initial conditions.

To find the solution at time $$(x,t)$$, I need to solve $$(i)$$ for $$x_0$$ and take $$\overline{h}(x,t)=\overline{h}_0(x_0)$$ and solve $$(ii)$$ for $$\overline{x}_0$$, taking $$\overline{k}(x,t)=\overline{k}_0(\overline{x}_0)$$.

The solution in time $$(x,t)$$ may be the solution of the system

$$\begin{bmatrix}\overline{h}_0(x_0)\\ \overline{k}_0(\overline{x}_0)\end{bmatrix}=\begin{bmatrix}\frac{h}{2}(v+\sqrt{gh})\\ \frac{h}{2}(v-\sqrt{gh})\end{bmatrix}$$

That is

$$hv(x,t)=\overline{h}_0(x_0)+\overline{k}_0(\overline{x}_0)$$

$$h(x,t)=\bigg(\dfrac{\overline{h}_0(x_0)-\overline{k}_0(\overline{x}_0)}{\sqrt{g}}\bigg)^{2/3}$$

Or better

$$hv(x,t)=\frac{h_0(x_0)(v_0(x_0)+\sqrt{gh_0(x_0)})+h_0(\overline{x}_0)(v_0(\overline{x}_0)-\sqrt{gh_0(\overline{x}_0)})}{2}$$

$$h(x,t)=\bigg(\dfrac{h_0(x_0)(v_0(x_0)+\sqrt{gh_0(x_0)})-h_0(\overline{x}_0)(v_0(\overline{x}_0)-\sqrt{gh_0(\overline{x}_0)})}{2\sqrt{g}}\bigg)^{2/3}$$

I would like to know:

1) If my idea is correct (mainly about characteristics: is it valid? I think there is troubles with this part)

2) If these calculus are sufficient to "solve" the system. In other words, what mean the "solution" of the system? The question that I am dealing is only the following:

Find the solution to the model.

I think this is something vague once I don't have any data. What do you understand as the "solution of the system"?

3) And if the characteristics crosses or occur some problem with this method? Or if (i) and (ii) don't have solutions? With some simulations that I've tried the equations (i) and (ii) don't had solutions for a great number of points $$(x,t)$$. Without the initial conditions, how can I know about possible troubles?

Many thanks.

==========================

Edit

If we wish to study waves with very small amplitude, then we can linearize these equations around some constant state $$(\hat{h},\hat{h}\hat{v})$$ to obtain a linear system.

$$\begin{bmatrix}h\\ hv\end{bmatrix}_t+\begin{bmatrix}0&1\\ g\hat{h}-\hat{v}^2&2\hat{v}\end{bmatrix}\begin{bmatrix}h\\ hv\end{bmatrix}_x=\begin{bmatrix}0\\ 0\end{bmatrix}$$

Getting the system

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}_t+\begin{bmatrix}\hat{v}-\sqrt{g\hat{h}}&0\\0&\hat{v}+\sqrt{g\hat{h}}\end{bmatrix}\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}_x=\begin{bmatrix}0\\ 0\end{bmatrix}$$

where

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}=R^{-1}\begin{bmatrix}h\\ hv\end{bmatrix}=\begin{bmatrix}\dfrac{\hat{v}^2-g\hat{h}}{2\sqrt{g\hat{h}}}&\dfrac{1}{2}-\dfrac{\hat{v}}{2\sqrt{g\hat{h}}}\\ \dfrac{g\hat{h}-\hat{v}^2}{2\sqrt{g\hat{h}}}&\dfrac{1}{2}\bigg(\dfrac{\hat{v}}{\sqrt{g\hat{h}}}+1\bigg)\end{bmatrix}\begin{bmatrix}h\\ hv\end{bmatrix}$$

The solution is

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}(x,t)=\begin{bmatrix}\overline{h}_0(x-(\hat{v}-\sqrt{g\hat{h}})t)\\ \overline{k}_0(x-(\hat{v}+\sqrt{g\hat{h}})t)\end{bmatrix}$$

Or better

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=R\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}(x,t)$$

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=\begin{bmatrix}\dfrac{1}{\hat{v}-\sqrt{g\hat{h}}}&\dfrac{1}{\hat{v}+\sqrt{g\hat{h}}}\\ 1&1\end{bmatrix}\begin{bmatrix}\overline{h}_0(x-(\hat{v}-\sqrt{g\hat{h}})t)\\ \overline{k}_0(x-(\hat{v}+\sqrt{g\hat{h}})t)\end{bmatrix}$$

For instance, let take $$\hat{h}=1$$ and $$\hat{v}=0$$, considering $$g=1$$ (in some dimension).

So,

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}=\begin{bmatrix}\dfrac{-1}{2}&\dfrac{1}{2}\\ \dfrac{1}{2}&\dfrac{1}{2}\end{bmatrix}\begin{bmatrix}h\\ hv\end{bmatrix}=\begin{bmatrix}\dfrac{(hv-h)}{2}\\ \dfrac{(h+hv)}{2}\end{bmatrix}$$

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}_t+\begin{bmatrix}-1&0\\0&1\end{bmatrix}\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}_x=\begin{bmatrix}0\\ 0\end{bmatrix}$$

The solution is

$$\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}(x,t)=\begin{bmatrix}\overline{h}_0(x+t)\\ \overline{k}_0(x-t)\end{bmatrix}=\begin{bmatrix}\dfrac{(h_0v_0-h_0)(x+t)}{2}\\ \dfrac{(h_0v_0+h_0)(x-t)}{2}\end{bmatrix}$$

Or better

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=R\begin{bmatrix}\overline{h}\\ \overline{k}\end{bmatrix}(x,t)=\begin{bmatrix}-1&1\\1&1 \end{bmatrix}\begin{bmatrix}\dfrac{(h_0v_0-h_0)(x+t)}{2}\\ \dfrac{(h_0v_0+h_0)(x-t)}{2}\end{bmatrix}$$

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=\begin{bmatrix}\dfrac{(-h_0v_0+h_0)(x+t)+(h_0v_0+h_0)(x-t)}{2}\\ \dfrac{(h_0v_0-h_0)(x+t)+(h_0v_0+h_0)(x-t)}{2}\end{bmatrix}$$

Taking $$v_0\equiv0$$ and $$h_0=1+\frac{2}{5}e^{-5x^2}$$ as in 1, we have

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=\begin{bmatrix}\dfrac{h_0(x+t)+h_0(x-t)}{2}\\ \dfrac{-h_0(x+t)+h_0(x-t)}{2}\end{bmatrix}$$

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=\begin{bmatrix}\dfrac{1+\frac{2}{5}e^{-5(x+t)^2}+1+\frac{2}{5}e^{-5(x-t)^2}}{2}\\ \dfrac{-1-\frac{2}{5}e^{-5(x+t)^2}+1+\frac{2}{5}e^{-5(x-t)^2}}{2}\end{bmatrix}$$

$$\begin{bmatrix}h\\ hv\end{bmatrix}(x,t)=\begin{bmatrix}1+\frac{1}{5}(e^{-5(x+t)^2}+e^{-5(x-t)^2})\\ \frac{1}{5}(-e^{-5(x+t)^2}+e^{-5(x-t)^2})\end{bmatrix}$$

1 CROWHURST, Peter. Numerical Solutions of One-Dimensional Shallow Water Equations. Australian Mathematical Science Institute, School Of Computing And Mathematics, Charles Sturt University, Feb

• There's a few incorrect assumptions in your approach, most notably entropy conditions for whether you have a shock or rarefaction. I would highly suggest taking a look at LeVeque's red book [1] that goes through a very careful solution process for the shallow water equations. 1. LeVeque, R. Finite Volume Methods for Hyperbolic Problems. (Cambridge University Press, 2002). Aug 1 '19 at 18:31
• Hi, many thanks. I've taked a look at some LeVeque's books and I'm only with a little doubt about have as you said shock and rarefactions, I mean, and if I did not have a Riemann problem (for instance with the initial conditions that I've cited, from article and the same of the LeVeque)? Many thanks! Aug 1 '19 at 20:32
• Your questions are all about analytical properties of PDE solutions. That's a math question, not a Computational Science question. Aug 2 '19 at 4:02
• @WolfgangBangerth, right... On Math I could get anwers so one said there's some experts on that over here, so I've tried. Many thanks! Aug 2 '19 at 21:32
• @Na'omi The reason we generally stick to the Riemann problem is that it provides the fundamental kernel in a numerical approach to the problem. Even in this simplistic case though the characteristic fields will interact, which was one of the issues with your original solution approach. Also note that even with smooth initial conditions the solution may not remain so, something you need to be careful from an analytical point-of-view. Aug 3 '19 at 22:30