Loading [MathJax]/jax/output/HTML-CSS/jax.js

Shallow Water Equations in MATLAB / Python

Overview

This page is adapted from Robin Hogan's webpage on Shallow Water Equations in MATLAB. The model can be used to illustrate the following phenomena:

  • Gravity waves
  • Tsunamis
  • Orographic Rossby waves
  • Upscale energy cascades
  • Barotropic instability and frontal cyclogenesis
  • Equatorial Rossby and Kelvin waves
  • Numerical instability and numerical artifacts
More info...

Instructions

Download the files to your directory in MATLAB. They should all be downloaded to your working directory.

MATLAB Files:Python Files:

Because of some incompatibilities GNU Octave users will want to replace the animate.m script with animate_octave.m
Examples

Above shows the height of the fluid, with wind vectors superimposed as well as vorticity of the fluid plotted in the lower graph. We start with a jet and this breaks down into barotropic instability.


Above shows easterly flow at the equator. Similar to barotropic instability the flow breaks down, but is guided by the change of sign of the Coriolis parameter.


The above shows how a uniform westerly flow can develop into a Rossby wave downwind of high mountains.

Shallow Water Equations
The shallow water equations do not necessarily have to describe the flow of water. They can describe the behaviour of other fluids under certain situations. For example we can think of the atmosphere as a fluid. The equations governing its behaviour are the Navier-Stokes equations; however, these are notoriously difficult to solve. The shallow water equations can be thought of as an approximation to the Navier-Stokes equations and are solved more readily. There are four points we need to consider (click on the info tabs below for details)

Equation of continuity...

Equation for pressure...

Non-conservative Horizontal Momentum Equations...

Conservative Horizontal Momentum Equations...
Running the model

You should have downloaded the files to your working directory in MATLAB or Python. This exercise guides you through setting up and running the model for different scenarios. We will consider:

  • Gravity waves
  • Tsunamis
  • Barotropic instability
  • Orographic Rossby waves
  • Jupiter's Great Red Spot
  • Equatorially trapped waves (Rossby-Gravity waves)
  • Equatorial Kelvin wave
  • Weather forecast
Download the practical sheet here and work through it: