You are on page 1of 4

Chapter 16

Shallow Water Equations

The shallow water equations model tsunamis and waves in bathtubs.

This chapter is more advanced mathematically than earlier chapters, but you
might still find it interesting even if you do not master the mathematical details.
The shallow water equations model the propogation of disturbances in water
and other incompressible fluids. The underlying assumption is that the depth of
the fluid is small compared to the wave length of the disturbance. For example, we
do not ordinary think of the Indian Ocean as being shallow. The depth is two or
three kilometers. But the devastating tsunami in the Indian Ocean on December
26, 2004 involved waves that were dozens or hundred of kilometers long. So the
shallow water approximation provides a reasonable model in this situation.
The equations are derived from the principles of conservation of mass and
conservation of momemtum. The independent variables are time, t, and two space
coordinates, x and y. The dependent variables are the fluid height or depth, h, and
the two-dimensional fluid velocity field, u and v. With the proper choice of units, the
conserved quantities are mass, which is proportional to h, and momentum, which
is proportional to uh and vh. The force acting on the fluid is gravity, represented
by the gravitational constant, g. The partial differential equations are:
∂h ∂(uh) ∂(vh)
+ + =0
∂t ∂x ∂y
∂(uh) ∂(u2 h + 12 gh2 ) ∂(uvh)
+ + =0
∂t ∂x ∂y
∂(vh) ∂(uvh) ∂(v 2 h + 12 gh2 )
+ + =0
∂t ∂x ∂x

Copyright ° c 2008 Cleve Moler


Matlab° R
is a registered trademark of The MathWorks, Inc.TM
April 6, 2008

1
2 Chapter 16. Shallow Water Equations

In order to write the equations in a compact form, introduce three vectors.


 
h
U =  uh 
vh
 
uh
F (U ) =  u2 h + 12 gh2 
uvh
 
vh
G(U ) =  uvh 
v 2 h + 12 gh2
With this notation, the shallow water equations are an instance of a hyperbolic
conservation law.
∂U ∂F (U ) ∂G(U )
+ + =0
∂t ∂x ∂y
One delicate aspect of this model is the boundary conditions, especially if we
intend to model a real world geometry such as the Indian Ocean. For our simple
experiment, we confine ourselves to a square region and specify reflective boundary
conditions, u = 0 on the vertical sides of the square and v = 0 on the horizontal
sides. These conditions cause any waves that reach the boundary to be reflected
back into the region.
More realistic models of oceans and tsunamis include terms that describe the
topography of the ocean floor, the coriolis force resulting the earth’s rotation, and
possibly other external forces. But the equations we are considering here are still
the basis of such models.

Figure 16.1. At the beginning of a time step, the variables represent the
solution at the centers of the finite difference grid.

We will use the Lax-Wendroff method to compute a numerical approximation


to the solution. Introduce a regular square finite difference grid with a vector-valued
solution centered in the grid cells, as shown in figure 16.1. The quantity
n
Ui,j
3

represents a three component vector at each grid cell i, j that evolves with time step
n.
Each time step involves two stages, something like a two-stage Runge Kutta
method for ordinary differential equations. The first stage is a half step; it defines
values of U at time step n + 12 and the midpoints of the edges of the grid, as shown
in figure 16.2.
n+ 1 1 n n ∆t
Ui+ 12,j = (U + Ui,j )− (F n n
− Fi,j )
2 2 i+1,j 2∆x i+1,j
n+ 1 1 n n ∆t
Ui,j+21 = (Ui,j+1 + Ui,j )− (Gn − Gni,j )
2 2 2∆y i,j+1

Figure 16.2. The first stage computes values that represent the solution
at the midpoints of the edges in the finite difference grid.

The second stage completes the time step by using the values computed in the
first stage to compute new values at the centers of the cells, returning to figure 16.1.
n+1 n ∆t n+ 12 n+ 1 ∆t n+ 21 n+ 1
Ui,j = Ui,j − (Fi+ 1 ,j − Fi− 12,j ) − (Gi,j+ 1 − Gi,j−2 1 )
∆x 2 2 ∆y 2 2

Our MATLAB program, exm/shallow_water, uses Lax-Wendroff to solve the


shallow water equations on a square region with reflective boundary conditions.
Initially, h = 1, u = 0, v = 0 over the entire region, so the solution is static. Then,
at repeated intervals, a two dimensional Gaussian shaped peak is added to h, simu-
lating an impulsive disturbance like a water drop hitting the surface. The resulting
waves propogate back and forth over the region. A few snapshots of the dynamic
graphic are shown in figure 16.3. The Lax-Wendroff scheme amplifies artificial, non-
physical oscillations. Eventually the numerical values overflow, producing floating
point Infs and NaNs, which cause the surface plot to disappear.
CLAPACK, which stands for Conservation Law Package, is a large collection
of Fortran subroutines developed by Randy LeVeque and his colleagues at the Uni-
versity of Washington. A version of the package specialized to modeling tsunamis
has been developed by David George. See:
http://www.amath.washington.edu/~claw
http://www.amath.washington.edu/~dgeorge/tsunamimodeling.html
4 Chapter 16. Shallow Water Equations

Figure 16.3. A water drop initiates a wave that reflects off the boundary.

You might also like