SadournyAdvection#
- class fridom.shallowwater.modules.advection.sadourny_advection.SadournyAdvection[source]#
Bases:
AdvectionBaseAdvection 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
backgroundThe background state.
diff_moduleThe differentiation module to be used by this module.
disable_nonlinearWhether to disable advection by the state vector itself.
gridThe grid of the model settings.
infoReturn a dictionary with information about the time stepper.
interp_moduleThe interpolation module to be used by this module.
is_setupWhether the module is set up.
msetThe model settings.
required_haloThe required halo points for this module.
scalingA scaling factor for the nonlinear terms (default: 1.0).
- name = 'Sadourny Advection'#