CenteredAdvection#
- class fridom.framework.modules.advection.centered_advection.CenteredAdvection[source]#
Bases:
AdvectionBaseCentered advection scheme.
Description#
For the centered advection scheme, we assume that the velocity field is divergence-free. The advection term can then be written as:
\[\mathcal{A}(\boldsymbol{v}, q) = -\boldsymbol{v} \cdot \nabla q = - \nabla \cdot (\boldsymbol{v} q)\]where \(q\) is the quantity to be advected and \(\boldsymbol{v}\) is the velocity field. The flux divergence \(\nabla \cdot (\boldsymbol{v} q)\) is calculated using forward or backward differences. For that the flux is interpolated to the cell faces of the quantity \(q\):
Position of the quantity q ↓ | x | x | x | ↑ Position of the flux Fx- __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
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.
msetThe model settings
required_haloscalingA scaling factor for the nonlinear terms (default: 1.0)
- name = 'Centered Advection'#
- advection(velocity: tuple[FieldVariable], quantity: FieldVariable) FieldVariable[source]#
Advect a quantity using the given velocity field.