SadournyAdvection#

class fridom.shallowwater.modules.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)

advection(velocity, quantity)

Advect a quantity using the given velocity field.

disable()

Enabling the module means that it will be executed at each time step.

enable()

Enabling the module means that it will be executed at each time step.

is_enabled()

Return whether the module is enabled or not.

reset()

Stop and start the module.

setup(mset)

Start the module

start()

Start the module

stop()

Stop the module

update(mz)

Update the module

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.

mset

The model settings

name

required_halo

scaling

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

name = 'Sadourny Advection'#
setup(mset: ModelSettings) None[source]#

Start the module

Description#

This method is called by the ModelSettings.setup() and sets the ModelSettings as well as the differentiation and interpolation modules.

advect_state(z: State, dz: State) State[source]#