PDF

The Shallow Water Equations
Introduction
The shallow water equations are frequently used for modeling both oceanographic and atmospheric fluid flow. Models of such systems lead to the prediction of areas eventually affected by pollution, coastal erosion, and polar ice-cap melting.
Comprehensive modeling of such phenomena using physical descriptions such as the Navier-Stokes equations can often be problematic, due to the scale of the modeling domains as well as through resolving free surfaces. The shallow water equations, of which there are a number of representations, provide an easier description of such phenomena.
This 1D model investigates the settling of a wave over a variable bed as a function of time. The initial wave and the shape of the bed are represented by mathematical relations so that it is easy to change parameters such as the wave amplitude or the bed’s shape.
This example uses the Saint-Venant’s shallow water equations, which are the following:
and
where z is the thickness of the water layer (m), v is the velocity (m/s), g is the gravity constant (m/s2), and ν is the kinematic viscosity (m2/s). The definition of the thickness of the water layer, z, is zs − zf, where zs and zf are the measures in Figure 1 below. For further details, see Ref. 1.
Figure 1: Representative vertical section through the fluid domain showing the bed of a lake and the water surface.
Artificial Stabilization
With time, the flow develops discontinuities known as hydraulic jumps. Use artificial stabilization to replace the jumps by steep fronts that can be resolved on the grid. Small amplitude waves on still water of depth z move with velocity . The maximal propagation velocity is for water waves.
Stabilize the solution by adding artificial viscosity chosen to make the cell Reynolds number of order unity. To do so, add the term tunevphaseh  to the kinematic viscosity ν. Here, tune is an O(1) tuning parameter and h is the local element size. You add the contribution to the divergence term of the conservation law so that it does not affect the shock speeds. The modification is first order in element size.
Model Definition
This application studies a simple example of shallow water in a channel with bottom topography shown in Figure 1. Notice the difference in scale between the x and directions.
Figure 2: Sea bed profile, zf, used in the model.
Constraints (v = 0) are implemented at both ends, while the physics are described by the equations above. The initial condition is a wave profile, which the following expression defines:
where zf is the analytical expression for the sea bed profile (see Figure 2). The elevation of the water surface is z + zf, while Figure 3 shows z0 + zf.
Figure 3: The initial water surface profile, z0 + zf, and the sea bed profile, zf.
Results and Discussion
The simulation runs for 60 seconds. Figure 4 shows the water surface and slope of the sea bed at six output times toward the beginning of the simulation.
Figure 4: The water level and the slope of the sea bed at six output times. Time spans from t = 0 to t = 15 at steps of 3 seconds.
The simulation clearly shows the influence of the topography of the sea bed on the elevation of the water surface. Another interesting visualization of the results is an animation, which is easy to create using COMSOL Multiphysics.
Notes About the COMSOL Implementation
The modeling procedure is straightforward using the General Form PDE interface with two dependent variables: Z and V. It is easy to define expressions, such as the one that describes the initial wave profile, z0, as a variable in the model.
Reference
1. O. Pironneau, Finite Element Methods for Fluids, John Wiley & Sons, 1989.
Application Library path: COMSOL_Multiphysics/Equation_Based/shallow_water_equations
Modeling Instructions
From the File menu, choose New.
New
In the New window, click  Model Wizard.
Model Wizard
1
In the Model Wizard window, click  1D.
2
In the Select Physics tree, select Mathematics>PDE Interfaces>General Form PDE (g).
3
Click Add.
4
Click  Add Dependent Variable.
5
In the Dependent variables table, enter the following settings:
6
Click  Study.
7
In the Select Study tree, select General Studies>Time Dependent.
8
Root
1
In the Model Builder window, click the root node.
2
In the root node’s Settings window, locate the Unit System section.
3
From the Unit system list, choose None.
Because the dependent variables, Z and V, are of different dimensions, it is convenient to switch off unit support and keep track of the units by hand instead.
Global Definitions
Parameters 1
1
In the Model Builder window, under Global Definitions click Parameters 1.
2
In the Settings window for Parameters, locate the Parameters section.
3
Geometry 1
Interval 1 (i1)
1
In the Model Builder window, under Component 1 (comp1) right-click Geometry 1 and choose Interval.
2
In the Settings window for Interval, locate the Interval section.
3
4
Click  Build All Objects.
Definitions
Variables 1
1
In the Home toolbar, click  Variables and choose Local Variables.
2
In the Settings window for Variables, locate the Variables section.
3
Here, g_const is a predefined constant for the acceleration of gravity; with unit support turned off, it just takes the numeric value in SI units.
General Form PDE (g)
General Form PDE 1
1
In the Model Builder window, under Component 1 (comp1)>General Form PDE (g) click General Form PDE 1.
2
In the Settings window for General Form PDE, locate the Conservative Flux section.
3
In the Γ text-field array, type V*Z on the first row.
4
In the Γ text-field array, type -nu*Vx on the second row.
5
Locate the Source Term section. In the f text-field array, type 0 on the first row.
6
In the f text-field array, type -g_const*(Zx+dZfdx)-V*Vx+nu*Vx*Zx/Z on the second row.
Initial Values 1
1
In the Model Builder window, click Initial Values 1.
2
In the Settings window for Initial Values, locate the Initial Values section.
3
In the Z text field, type Z0.
Constraint 1
1
In the Physics toolbar, click  Boundaries and choose Constraint.
2
Click in the Graphics window and then press Ctrl+A to select both boundaries.
3
In the Settings window for Constraint, locate the Constraint section.
4
In the R text-field array, type -V on the second row.
Mesh 1
Edge 1
In the Mesh toolbar, click  Edge.
Size
1
In the Model Builder window, click Size.
2
In the Settings window for Size, locate the Element Size section.
3
Click the Custom button.
4
Locate the Element Size Parameters section. In the Maximum element size text field, type 0.05.
5
Click  Build All.
Study 1
Step 1: Time Dependent
1
In the Model Builder window, under Study 1 click Step 1: Time Dependent.
2
In the Settings window for Time Dependent, locate the Study Settings section.
3
In the Output times text field, type range(0,60).
4
From the Tolerance list, choose User controlled.
5
In the Relative tolerance text field, type 1e-5.
Solution 1 (sol1)
1
In the Study toolbar, click  Show Default Solver.
2
In the Model Builder window, expand the Solution 1 (sol1) node, then click Time-Dependent Solver 1.
3
In the Settings window for Time-Dependent Solver, click to expand the Absolute Tolerance section.
4
From the Tolerance method list, choose Manual.
5
In the Absolute tolerance text field, type 1e-7.
6
In the Study toolbar, click  Compute.
Results
1D Plot Group 1
1
In the Settings window for 1D Plot Group, locate the Legend section.
2
From the Position list, choose Lower right.
Line Graph 1
1
In the Model Builder window, expand the 1D Plot Group 1 node, then click Line Graph 1.
2
In the Settings window for Line Graph, locate the Data section.
3
From the Dataset list, choose Study 1/Solution 1 (sol1).
4
From the Time selection list, choose From list.
5
In the Times (s) list, select 0.
6
Click Replace Expression in the upper-right corner of the y-Axis Data section. From the menu, choose Component 1 (comp1)>Definitions>Variables>Zf - Sea bed profile.
7
Click to expand the Legends section. Select the Show legends check box.
8
From the Legends list, choose Manual.
9
10
In the 1D Plot Group 1 toolbar, click  Plot.
The most interesting part of the results is obtained by looking at the global variable Zs, corresponding to the surface topography, at different times compared to the topography of the bottom.
Line Graph 2
1
Right-click Results>1D Plot Group 1>Line Graph 1 and choose Duplicate.
2
In the Settings window for Line Graph, click Replace Expression in the upper-right corner of the y-Axis Data section. From the menu, choose Component 1 (comp1)>Definitions>Variables>Zs - Sea surface level.
3
Locate the Legends section. In the table, enter the following settings:
4
In the 1D Plot Group 1 toolbar, click  Plot.
5
Locate the Data section. In the Times (s) list, select 3.
6
Locate the Legends section. In the table, enter the following settings:
7
In the 1D Plot Group 1 toolbar, click  Plot.
8
Locate the Data section. In the Times (s) list, select 6.
9
Locate the Legends section. In the table, enter the following settings:
10
In the 1D Plot Group 1 toolbar, click  Plot.
11
Locate the Data section. In the Times (s) list, select 9.
12
Locate the Legends section. In the table, enter the following settings:
13
In the 1D Plot Group 1 toolbar, click  Plot.
14
Locate the Data section. In the Times (s) list, select 12.
15
Locate the Legends section. In the table, enter the following settings:
16
In the 1D Plot Group 1 toolbar, click  Plot.
17
Locate the Data section. In the Times (s) list, select 15.
18
Locate the Legends section. In the table, enter the following settings:
19
In the 1D Plot Group 1 toolbar, click  Plot.