Skip to content
forked from milankl/swm

Shallow water equation solver, the same as in milankl/swm, but written at a slightly higher level where the model is contained in a single class.

License

Notifications You must be signed in to change notification settings

TomBolton/ShallowEddy

 
 

Repository files navigation

Shallow Water Model in Python

An adaption of the shallow water model found in this repo, with a detailed documentation found here. A thank you to Milan for writing the original model.

As in the original model, the shallow water equations are solved numerically using the Runge-Kutta 4th order method. However, there are some important differences:

  • Only no-slip boundary conditions are implemented here.
  • All numerical values are represented as float64.
  • The model is written as a single class in shallowwater.py.

I made this adaption so I could access and modify multiple instances of the model simultaneously. Exploring different machine learning eddy parameterisations becomes much easier in the class-based approach.

The code below shows how to create and run an instance of the model for a single timestep.

from shallowwater import ShallowWaterModel

my_model = ShallowWaterModel( init='rest', output=0 )

u, v, eta = my_model.set_init_cond()

u_new, v_new, eta_new = my_model.integrate_forward( u, v, eta )	

About

Shallow water equation solver, the same as in milankl/swm, but written at a slightly higher level where the model is contained in a single class.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%