Fortran

Guide To Learn

Shallow water equations

Shallow water equations are a simple system of equations derived from Navier-Stokes equations. They are also known as the Saint-Venant equations, after the French engineer and mathematician A. J. C. Barre de Saint-Venant, who derived them in pursuit of his interest in hydraulic engineering and open-channel flows. SWEs are powerful because they can reproduce many observed motions in the atmosphere and the ocean:

  • Large-scale weather, such as cyclones and anticyclones
  • Western boundary currents, such as the Gulf Stream in the Atlantic and the Kuroshio in the Pacific
  • Long gravity waves, such as tsunamis and tidal bores
  • Watershed from rainfall and snow melt over land
  • Wind-generated (surf) waves
  • Ripples in a pond

This system consists of only a few terms, as shown in figure 1.7.

Figure 1.7 Shallow water equations. The top equation is the momentum (velocity) conservation law, and the bottom is the mass (water level) conservation law. u is the 2-d velocity vector, g is the gravitational acceleration, h is the water elevation, H is the unperturbed water depth, and t is time. The “nabla” symbol (upside-down triangle) is a vector differentiation operator.

What’s the physical interpretation of this system? The top equation states that where there’s slope along the water surface, water will accelerate and move toward a region of lower water level because of the pressure gradient. The advection term is nonlinear and causes chaotic behavior in fluids (turbulence). The bottom equation states that where there’s convergence (water coming together), the water level will increase. This is because water has to go somewhere, and it’s why we also call it conservation of mass. Similarly, if water is diverging, its level will decrease in response.

Comfortable with math?

If you’re experienced with calculus and partial differential equations, great! There’s more for you in appendix B. Otherwise, don’t worry! This book won’t dwell on math much more than this; it will focus on programming.

Shallow water equations are dear to me because I first learned Fortran programming by modeling these equations in my undergraduate meteorology program at the University of Belgrade. In a way, I go back to my roots as I write this book. Despite my Fortran code looking (and working) much differently now than back then, I still find this example an ideal case study for teaching parallel Fortran programming. I hope you enjoy the process as much as I did.

Shallow water equations

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top