Shallow Water Equation Solver

The ShallowWaterSolver is a solver for depth-integrated wave equations of shallow water type. Presently the following equations are supported:

LinearSWELinearized SWE solver in primitive variables (constant still water depth)
NonlinearSWENonlinear SWE solver in conservative variables (constant still water depth)

Shallow Water Equations

The shallow water equations (SWE) is a two-dimensional system of nonlinear partial differential equations of hyperbolic type that are fundamental in hydraulic, coastal and environmental engineering. In deriving the SWE the vertical velocity is considered negligible and the horizontal velocities are assumed uniform with depth. The SWE are hence valid when the water depth can be considered small compared to the characteristic length scale of the problem, as typical for flows in rivers and shallow coastal areas. Despite the limiting restrictions the SWE can be used to describe many important phenomena, for example storm surges, tsunamis and river flooding.

The two-dimensional SWE is stated in conservation form as

\[ \frac{\partial {\bf U}}{\partial t} + \nabla \cdot {\bf F(U)} = {\bf S(U)}\,, \label{eq:SWE} \]

where ${\bf F(U)} = \left[{\bf E(U)}\,, {\bf G(U)} \right]$ is the flux vector and the vector of conserved variables read ${\bf U}=\left[H\,,Hu\,,Hv \right]^\mathrm{T}\,.$ Here $H({\bf x},t)=\zeta({\bf x},t) + d({\bf x})$ is the total water depth, $\zeta({\bf x},t)$ is the free surface elevation and $d({\bf x})$ is the still water depth. The depth-averaged velocity is denoted by ${\bf u} = \left[u({\bf x},t)\,, v({\bf x},t)\right]^\mathrm{T}$, where $u$ and $v$ are the velocities in the $x$- and $y$-directions, respectively. The content of the flux vector is

\[ {\bf E(U)} = \left[ \begin{array}{c} Hu\\Hu^2 + gH^2/2\\Huv\end{array}\right]\,, \qquad {\bf G(U)} = \left[ \begin{array}{c} Hv\\Hvu\\Hv^2 + gH^2/2\end{array}\right]\,, \]

in which $g$ is the acceleration due to gravity. The source term ${\bf S(U)}$ accounts for, e.g., forcing due to bed friction, bed slope, Coriolis force and higher-order dispersive effects (Boussinesq terms). In the distributed version of the ShallowWaterSolver only the Coriolis force is included.

An example: the Rossby modon case

In the following we will look closer on the file

 Nektar++/solvers/ShallowWaterSolver/Examples/Rossby_Nonlinear_DG.xml

which gives the input data for performing a discontinuous Galerkin simulation of the westward propagation of an equatorial Rossby modon.

Input Options

A detailed description of the input file for Nektar++ can be found in Nektar++ XML File Format. For what concern the ShallowWaterSolver the <SOLVERINFO> section allows us to specify the solver, the type of projection (continuous or discontinuous), the explicit time integration scheme to use and (in the case the discontinuous Galerkin method is used) the choice of numerical flux. A typical example would be:

 <SOLVERINFO>      
   <I PROPERTY="EqType" VALUE="NonlinearSWE">
   <I PROPERTY="Projection" VALUE="DisContinuous">
   <I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4">
   <I PROPERTY="UpwindType" VALUE="HLLC">
 </SOLVERINFO>

In the <PARAMETERS> section we, in addition to the normal setting of time step etc., also define the acceleration of gravity by setting the parameter "Gravity":

 <PARAMETERS>
    <P> TimeStep       = 0.04             </P>
    <P> NumSteps       = 1000             </P>
    <P> IO_CheckSteps  = 100              </P>
    <P> IO_InfoSteps   = 100              </P>
    <P> Gravity        = 1.0              </P>
 </PARAMETERS>

In the <USERDEFINEDEQNS> we specify "f" which is the Coriolis parameter and "d" denoting the still water depth:

 <USERDEFINEDEQNS>
    <F LHS="f" VALUE="0+1*y" />
    <F LHS="d" VALUE="1"     />
 </USERDEFINEDEQNS>   

Initial values and boundary conditions are given in terms of primitive variables (please note that also the output files are given in terms of primitive variables). For the discontinuous Galerkin we typically enforce any slip wall boundaries weakly using symmetry technique. This is given by the USERDEFINEDTYPE="Wall" choice in the <BOUNDARYCONDITIONS> section:

 <BOUNDARYCONDITIONS>
   <REGION REF="0">
    <D VAR="eta"  USERDEFINEDTYPE="Wall"  VALUE="0" />
    <D VAR="u"    USERDEFINEDTYPE="Wall"  VALUE="0" />
    <D VAR="v"    USERDEFINEDTYPE="Wall"  VALUE="0" />
   </REGION>
 </BOUNDARYCONDITIONS>

Running the code

After the input file has been copied to the build directory of the ShallowWaterSolver the code can be executed by:

 ./ShallowWaterSolver Rossby_Nonlinear_DG.xml

Post-proceesing

After the final time step the solver will write an output file RossbyModon_Nonlinear_DG.fld. We can convert it to tecplot format by using the FldToTecplot utility. Thus we execute the following command:

 ../../../utilities/builds/PostProcessing/FldToTecplot RossbyModon_Nonlinear_DG.xml RossbyModon_Nonlinear_DG.fld 

This will generate a file called RossbyModon_Nonlinear_DG.dat that can be loaded directly into tecplot:

RossbyModon.png

Rossby modon after 40 time units.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines