SadournyAdvection#

class fridom.shallowwater.modules.advection.sadourny_advection.SadournyAdvection[source]#

Bases: AdvectionBase

Advection scheme based on Sadourny [1975] that conserves the total energy.

The nonlinear advection terms for the shallow water equations are given by:

\[ \begin{align}\begin{aligned}\partial_t \boldsymbol{u} = - (\boldsymbol{u} + \boldsymbol{u}_b) \cdot \nabla \boldsymbol{u} = - \underset{\neg}{\boldsymbol{u}} \zeta - \frac{1}{2} \nabla \boldsymbol{u}^2 - \nabla \left( \boldsymbol{u_b} \cdot \boldsymbol{u} \right)\\\partial_t p = - \nabla \left\[ (\boldsymbol{u} + \boldsymbol{u}_b) p \right\]\\\partial_t C = - (\boldsymbol{u} + \boldsymbol{u}_b) \cdot \nabla C\end{aligned}\end{align} \]

where \(\boldsymbol{u_b}\) is a divergence free background flow that can be set with the background attribute of this module, \(\zeta\) is the relative vorticity, and \(C\) is a passive tracer. We express the rotational part of the momentum advection with the potential vorticity \(q\):

\[\underset{\neg}{\boldsymbol{u}} \zeta = \underset{\neg}{\boldsymbol{f_u}} q\]

with

\[\boldsymbol{f_u} = (c^2 + Ro~ p) \boldsymbol{u} ~, \quad q = \frac{\zeta}{c^2 + Ro~ p}\]
__init__() None#

Methods

__init__()

advect_state(z, dz)

Advect the state vector.

advection(velocity, quantity)

Advect a quantity using the given velocity field.

disable()

Disable the module.

enable()

Enable the module.

is_enabled()

Whether the module is enabled or not.

reset()

Stop and start the module.

setup(mset[, setup_mode])

Set the module up.

start()

Start the module.

stop()

Stop the module.

update(mz)

Update the model state.

Attributes

background

The background state.

diff_module

The differentiation module to be used by this module.

disable_nonlinear

Whether to disable advection by the state vector itself.

grid

The grid of the model settings.

info

Return a dictionary with information about the time stepper.

interp_module

The interpolation module to be used by this module.

is_setup

Whether the module is set up.

mset

The model settings.

name

required_halo

The required halo points for this module.

scaling

A scaling factor for the nonlinear terms (default: 1.0).

name = 'Sadourny Advection'#
advect_state(z: State, dz: State) State[source]#

Advect the state vector.