The ShallowWaterSolver is a solver for depth-integrated wave equations of shallow water type. Presently the following equations are supported:
| LinearSWE | Linearized SWE solver in primitive variables (constant still water depth) |
| NonlinearSWE | Nonlinear SWE solver in conservative variables (constant still water depth) |
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
where
is the flux vector and the vector of conserved variables read
Here
is the total water depth,
is the free surface elevation and
is the still water depth. The depth-averaged velocity is denoted by
, where
and
are the velocities in the
- and
-directions, respectively. The content of the flux vector is
in which
is the acceleration due to gravity. The source term
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.
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.
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>
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
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:
Rossby modon after 40 time units.
1.7.1