FEATool Multiphysics
v1.14
Finite Element Analysis Toolbox

SaintVenant shallow water equations is a simplified model of fluid flow with a free surface. The nonconservative form of the equations read
\[ \left\{\begin{array}{l} \frac{\partial h}{\partial t} + (u\frac{\partial h}{\partial x} + v\frac{\partial h}{\partial y} ) + (h+H)(\frac{\partial u}{\partial x} + \frac{\partial v}{\partial y}) = 0 \\ \frac{\partial u}{\partial t} + (u\frac{\partial u}{\partial x} + v\frac{\partial u}{\partial y} ) = g\frac{\partial h}{\partial x} \\ \frac{\partial v}{\partial t} + (u\frac{\partial v}{\partial x} + v\frac{\partial v}{\partial y} ) = g\frac{\partial h}{\partial y} \end{array}\right. \]
where h is the unknown free surface height relative to the mean level H.
This model is available as an automated tutorial by selecting Model Examples and Tutorials... > Classic PDE > Shallow Water Equations from the File menu. Or alternatively, follow the stepbystep instructions below.
Both the Custom Equation and Convection and Diffusion physics modes are used in this example.
h
into the Dependent Variable Names edit field.0
into the x_{min} edit field.5
into the x_{max} edit field.0
into the y_{min} edit field.1
into the y_{max} edit field.0.2
into the Grid Size edit field.Define the equation for the height with a small disturbance as initial condition.
h' + (u*hx_t + v*hy_t) + (h+H)*(ux_t+vy_t) = 0
into the Equation for h edit field.0.2*exp(((x4)^2))
into the Initial condition for h edit field.Add two Convection and Diffusion physics modes for the two velocity components. Although the Custom Equation physics mode could also be used, the Convection and Diffusion physics modes feature predefined equations and convective stabilization which is necessary for these equations.
u
into the Dependent Variable Names edit field.0
into the Diffusion coefficient edit field.u
into the Convection velocity in xdirection edit field.v
into the Convection velocity in ydirection edit field.g*hx
into the Reaction rate edit field.v
into the Dependent Variable Names edit field.0
into the Diffusion coefficient edit field.u
into the Convection velocity in xdirection edit field.v
into the Convection velocity in ydirection edit field.g*hy
into the Reaction rate edit field.Define the two constants for the mean fluid level H = 1, and the gravitational constant g = 9.8.
The height h should not be constrained and should therefore be prescribed homogeneous Neumann conditions everywhere
A wall with zero velocities is prescribed at the right end, and the top and bottom boundaries are assumed to be symmetric (zero normal flow).
Select the TimeDependent solver with the following parameters.
1e3
into the Nonlinear stopping criteria for solution differences (changes) between iterations edit field.0.01
into the Time step size edit field.1.5
into the Duration of timedependent simulation (maximum time) edit field.Once the solver is done, turn on the height plot for h and visualize the free surface for different times.
The shallow water equations fluid dynamics model has now been completed and can be saved as a binary (.fea) model file, or exported as a programmable MATLAB mscript text file, or GUI script (.fes) file.