---
# System prepended metadata

title: '*Computational Hydraulics*'
tags: [HW01]

---

---
tags: HW01
---
# *Computational Hydraulics*
## Group 01: N88071053 洪豪男 N88091011 黃彥鈞
## HW01: Derivation of the shallow water equations (1D)
### What ar they??
* 淺水波方程式是用於描述海洋（有時），海岸地區（通常），河口（幾乎總是），河流和渠道（幾乎總是）的流體之雙曲/拋物線偏微分方程式。
The SWE are a system of hyperbolic/parabolic PDEs governing fluid flow in the oceans (sometimes), coastal regions (usually), estuaries (almost always), rivers and channels (almost always).
* 淺水流的一般特徵是垂直方向遠小於水平方向尺寸。 在這種情況下，我們可以對深度進行平均以消除垂直尺寸。
The general characteristic of shallow water flows is that the vertical dimension is much smaller than the typical horizontal scale. In this case we can average over the depth to get rid of the vertical dimension.
* 淺水波方程式可用於預測潮汐，暴潮位和颶風或洋流所引起的海岸線變化及疏濬可行性的研究。
The SWE can be used to predict tides, storm surge levels and coastline changes from hurricanes, ocean currents, and to study dredging feasibility.
* 淺水波方程式也適用在大氣和土石流。
SWE also arise in atmospheric flows and debris flows.
### How do they arise??
* 淺水波方程式是從Navier-Stokes方程式推導而得，該方程描述流體運動。
The SWE are derived from the Navier-Stokes equations, which describe the motion of fluids.
* Navier-Stokes方程式本身是從線性動量和質量守恆方程式推導出的。
The Navier-Stokes equations are themselves derived from the equations for conservation of mass and linear momentum.
- Conservation of Mass

$\quad\quad\frac{\partial \rho}{\partial t}+\nabla\cdot(\rho \vec{v})=0$

where ρ is fluid density

- Conservation of Linear Momentum

$\quad\quad\frac{\partial }{\partial t}(\rho \vec{v})+\nabla\cdot(\rho \vec{v}\vec{v})=\rho b +\nabla\cdot T$

where b is body force ;T is Cauchy stress tensor
### DEPTH-AVERAGED SHALLOW WATER EQUATIONS
* The following conditions have to be met:
1. The vertical momentum exchange is negligible and the vertical velocity component w is a lot smaller than the horizontal components u.
2. The pressure gain is linear with the depth.
* Kinematical boundary condition at the free surface:

$\quad\quad z_s=z_b+h$

$\quad\quad w|_{z_b+h}=\frac{D(z_b+h)}{D t}$ ,where $(z_b+h)=f(x,t)$

$\quad\quad\Rightarrow w|_{z_b+h}=\frac{\partial (z_b+h)}{\partial t}+\frac{\partial x}{\partial t}\frac{\partial (z_b+h)}{\partial x}$

$\quad\quad\Rightarrow w|_{z_b+h}=\frac{\partial z_b}{\partial t}+\frac{\partial h}{\partial t}+u|_{z_b+h}\frac{\partial (z_b+h)}{\partial x}$

$\quad\quad\Rightarrow w|_{z_s}=\frac{\partial h}{\partial t}+u|_{z_s}\frac{\partial (z_s)}{\partial x}$

$\quad\quad\Rightarrow \frac{\partial h}{\partial t}=w|_{z_s}-u|_{z_s}\frac{\partial (z_s)}{\partial x}$

* Kinematical boundary condition at the river bed:
Ground is impermeable ⇒ no mass flux perpendicular to bed.

$\quad\quad\Rightarrow w|_{z_b}=u|_{z_b}\frac{\partial z_b}{\partial x}$

* Salinity and temperature are assumed to be constant throughout our domain, so we can just take ρ as a constant.

$\quad\quad\frac{\partial \rho}{\partial t}+\nabla\cdot(\rho \vec{v})=0$

$\quad\quad\Rightarrow\nabla\cdot(\rho \vec{v})=0$

$\quad\quad\Rightarrow\frac{\partial u}{\partial x}+\frac{\partial w}{\partial z}=0$

* Integrate the continuity equation about the vertical axis between the bed z~b~ and the free surface z~s~=z~b~+h (with h being the water depth):

$\quad\quad\int^{z_s}_{z_b}(\frac{\partial u}{\partial x}+\frac{\partial w}{\partial z})dz=0$

$\quad\quad\int^{z_s}_{z_b}\frac{\partial u}{\partial x}dz+\int^{z_s}_{z_b}\frac{\partial w}{\partial z}dz=0$

$\quad\quad\Rightarrow\frac{\partial }{\partial x}\int^{z_s}_{z_b} udz-u|_{z_s}\frac{\partial z_s}{\partial x}+u|_{z_b}\frac{\partial z_b}{\partial x}+w|_{z_s}-w|_{z_b}=0$

$\quad\quad\Rightarrow\frac{\partial }{\partial x}\int^{z_s}_{z_b} udz+(w|_{z_s}-u|_{z_s}\frac{\partial z_s}{\partial x})+(u|_{z_b}\frac{\partial z_b}{\partial x}-w|_{z_b})=0$

$\quad\quad\Rightarrow\frac{\partial }{\partial x}\int^{z_s}_{z_b} udz+\frac{\partial h}{\partial t}=0$

* Introduction of discharge as an integral of the flow velocity over the depth, and the depth-averaged flow velocities u we get:

$\quad\quad\ Q_x=\int^{z_s}_{z_b}udz=\overline{u}h$

$\quad\quad\Rightarrow\frac{\partial h}{\partial t}+\frac{\partial }{\partial x}(h\overline{u})=0$

* The depth-integrated continuity equation shows that the difference between the flow into and out of a volume of water comes with a change of the water depth.

* The depth-integration of the momentum equations

$\quad\quad\rho(\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+w\frac{\partial u}{\partial z})=\rho g_x+(\frac{\partial }{\partial x}\tau_{xx}+\frac{\partial }{\partial z}\tau_{xz})$

$\quad\quad\Rightarrow(\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+w\frac{\partial u}{\partial z})=g_x+\frac{1}{\rho}(\frac{\partial \tau_{xx}}{\partial x}+\frac{\partial \tau_{xz}}{\partial z})$

$\quad\quad\int^{z_s}_{z_b}(\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+w\frac{\partial u}{\partial z})dz=g_x\int^{z_s}_{z_b}dz+\frac{1}{\rho}\int^{z_s}_{z_b}(\frac{\partial \tau_{xx}}{\partial x}+\frac{\partial \tau_{xz}}{\partial z})dz$

$\quad\quad\int^{z_s}_{z_b}(\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+w\frac{\partial u}{\partial z})dz=\frac{\partial }{\partial t}\int^{z_s}_{z_b}udz+\frac{\partial }{\partial x}\int^{z_s}_{z_b}u^2dz-u|_{z_s}\frac{\partial z_s}{\partial t}-u^2|_{z_s}\frac{\partial z_s}{\partial x}+(uw)|_{z_s}+u|_{z_b}\frac{\partial z_b}{\partial t}+u^2|_{z_b}\frac{\partial z_b}{\partial x}-(uw)|_{z_b}$

$\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\Rightarrow=\frac{\partial }{\partial t}\int^{z_s}_{z_b}udz+\frac{\partial }{\partial x}\int^{z_s}_{z_b}u^2dz-u|_{z_s}[(\frac{\partial z_b}{\partial t}+\frac{\partial h}{\partial t})-(w|_{z_s}-u|_{z_s}\frac{\partial z_s}{\partial x})]+u|_{z_b}(\frac{\partial z_b}{\partial t}+u|_{z_b}\frac{\partial z_b}{\partial x}-w|_{z_b})$

$\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\Rightarrow=\frac{\partial }{\partial t}(h\overline{u})+\frac{\partial }{\partial x}(h\overline u^2)$


$\quad\quad\ g_x\int^{z_s}_{z_b}dz=g_xh$

$\quad\quad\int^{z_s}_{z_b}\frac{\partial \tau_{xx}}{\partial x}dz=\frac{\partial }{\partial x}\int^{z_s}_{z_b}\tau_{xx}dz-\tau_{xx}|_{z_s}\frac{\partial z_s}{\partial x}+\tau_{xx}|_{z_b}\frac{\partial z_b}{\partial x}$

$\quad\quad\quad\quad\quad\quad\Rightarrow=\frac{\partial }{\partial x}(h\overline{\tau}_{xx})-\tau_{xx}|_{z_s}\frac{\partial z_s}{\partial x}+\tau_{xx}|_{z_b}\frac{\partial z_b}{\partial x}$

$\quad\quad\int^{z_b}_{z_s}\frac{\partial \tau_{xz}}{\partial z}dz={\tau_{xz_s}}-\tau_{xz_b}$

$\quad\quad\Rightarrow\frac{\partial }{\partial t}(h\overline{u})+\frac{\partial }{\partial x}(h\overline u^2)=g_xh+\frac{1}{\rho}\frac{\partial }{\partial x}({h}\overline{\tau}_{xx})-\frac{1}{\rho}\tau_{xz_b}$

$\quad\quad \tau_{xx}=-p,\quad \overline{p}=\frac{1}{2}\rho g_zh,\quad$ 

$\quad\quad\Rightarrow\frac{\partial }{\partial t}(h\overline{u})+\frac{\partial }{\partial x}(h\overline u^2+\frac{1}{2}g_zh^2)=hg_x-\frac{\tau_{xz_b}}{\rho}$**