Tsunami-like wave approaching a continental shelf

This one dimensional test problem consists of a flat ocean floor, linear continental slope, flat continental shelf, and a solid wall reflecting boundary.

It is designed to illustrate how a tsunami wave is modified as it moves from the deep ocean onto the continental shelf, and the manner in which some of the energy can be trapped on the shelf and bounce back and forth.

Note: For more about shoaling of tsunami waves on continental shelves, and the manner in which the width of the continental slope affects the transmission and reflection, see the recent paper:

  • Shoaling on Steep Continental Slopes: Relating Transmission and Reflection Coefficients to Green's Law by J. D. George, D. I. Ketcheson, and R. J. LeVeque, Pure and Applied Geophysics, 2019. DOI 10.1007/s00024-019-02316-y. (Other versions).

Additional examples from this paper, and Jupyter notebooks, can be found in this GitHub repository.

In [1]:
%pylab inline
Populating the interactive namespace from numpy and matplotlib

Check that the CLAW environment variable is set. (It must be set in the Unix shell before starting the notebook server).

In [2]:
try:
    import clawpack
    location = clawpack.__file__.replace('clawpack/__init__.pyc','')
    print("Using Clawpack from ",location)
except:
    print("*** Problem importing Clawpack -- check if environment variable set")
Using Clawpack from  /Users/rjl/clawpack_src/clawpack_master/clawpack/__init__.py

Import some modules needed below...

In [3]:
from clawpack.clawutil import nbtools
from IPython.display import FileLink
from clawpack.visclaw import animation_tools
from IPython.display import HTML
In [4]:
def show_anim(anim):
    html_version = HTML(anim.to_jshtml())
    #html_version = HTML(anim.to_html5_video())
    return html_version

Compile the Fortran code:

In [5]:
nbtools.make_exe(new=True)
Executing shell command:   make new
Done...  Check this file to see output:

Make documentation files:

In [6]:
nbtools.make_htmls()
See the README.html file for links to input files...

Set parameters, run code, and plot results...

The module setrun.py contains all the default parameters. See the README.html file for a link to setrun.py if you want to inspect this.

A few of the parameters will be redefined below for each example.

In [7]:
import setrun
rundata = setrun.setrun()  # initialize most run-time variables for clawpack

The cells below set the following parameters:

  • Bocean = depth of ocean (meters below sea level)
  • Bshelf = depth of continental shelf
  • width = width of continental slope (linear section connecting floor to shelf)
  • start = location of start of continental slope

The initial data is a hump of water with zero velocity everywhere. Note that the intial hump splits into left-going and right-going waves. The left-going wave leaves the domain (since "non-reflecting" boundary conditions are used at the left boundary).

The right-going wave hits the continental slope, where some of the wave energy is reflected and some is transmitted onto the shelf. The transmitted wave reflects off the coastline (a vertical wall in this model). The reflected wave hits the slope again and is partly transmitted out to the ocean, and partly reflected back towards shore. Depending on the relative depths and steepness of the slope, quite a bit of energy may be trapped on the shelf and bounce back and forth for some time.

Note that the wave propagates more slowly on the shelf than in the deep ocean. In the shallow water equations the wave propagation speed is $\sqrt{gh}$ where $g = 9.81 m/s^2$ is the gravitational acceleration and $h$ is the water depth. The wave form also gets compressed as it moves onto the shelf because of the slower wave speed.

Example 1.

The width of the slope is 1 m, so essentially a step discontinuity:

In [8]:
rundata.probdata.Bocean = -4000.
rundata.probdata.Bshelf = -400.
rundata.probdata.width = 1.
rundata.probdata.start = -30.e3  # 30 kilometers offshore
rundata.write()

outdir,plotdir = nbtools.make_output_and_plots(verbose=False)
In [9]:
anim = animation_tools.animate_from_plotdir(plotdir);
show_anim(anim)
Using figno = 2
Out[9]:

Example 2.

The width of the slope is 1 m, so essentially a step discontinuity.

In this example the shelf is shallower than before. Note that the wave on the shelf travels slower than in Example 1, and is more compressed and higher amplitude.

In [10]:
rundata.probdata.Bocean = -4000.
rundata.probdata.Bshelf = -50.
rundata.probdata.width = 1.
rundata.probdata.start = -30.e3
rundata.write()

outdir,plotdir = nbtools.make_output_and_plots(verbose=False)

anim = animation_tools.animate_from_plotdir(plotdir);
show_anim(anim)
Using figno = 2
Out[10]:

Example 3.

In this example, there is a wide continental slope instead of a step discontinuity. Note that there is much less reflection of energy at the slope in this case, and less energy trapped on the shelf.

In [11]:
rundata.probdata.Bocean = -4000.
rundata.probdata.Bshelf = -100.
rundata.probdata.width = 100.e3
rundata.probdata.start = -130.e3
rundata.write()

outdir,plotdir = nbtools.make_output_and_plots(verbose=False)

anim = animation_tools.animate_from_plotdir(plotdir, figno=2);
show_anim(anim)
Out[11]:

Try your own example...

Experiment with adjusting the parameters below and execute the cell to produce a new animation.

Note:

  • You must be running the notebook for this to work (not just viewing it via nbviewer)
  • The plotting routines expect parameters similar to those used above or the plots might not be scaled properly.
  • It may take a few minutes to run.
In [12]:
rundata.probdata.Bocean = -2000.
rundata.probdata.Bshelf = -1000.
rundata.probdata.width = 10.e3
rundata.probdata.start = -40.e3
rundata.write()

outdir,plotdir = nbtools.make_output_and_plots(label='new', verbose=True)

anim = animation_tools.animate_from_plotdir(plotdir, figno=2);
show_anim(anim)
Executing shell command:   make output OUTDIR=_output_new
Done...  Check this file to see output:
Executing shell command:   make plots OUTDIR=_output_new PLOTDIR=_plots_new
Done...  Check this file to see output:
+++  /Users/rjl/clawpack_src/clawpack_master/apps/tsunami/shelf1d
View plots created at this link:
Path (_plots_new/PlotIndex.html) doesn't exist. It may still be in the process of being generated, or you may have the incorrect path.
Note that some links may not work when opened on Juptyer
If you are running this locally, you should also be able to view
plots by copying and pasting this link into a new browser tab:
     file:///Users/rjl/clawpack_src/clawpack_master/apps/tsunami/shelf1d/_plots_new/PlotIndex.html
Out[12]:
In [ ]: