CenteredAdvection#

class fridom.framework.modules.advection.centered_advection.CenteredAdvection[source]#

Bases: AdvectionBase

Centered 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

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 = 'Centered Advection'#
advection(velocity: tuple[FieldVariable], quantity: FieldVariable) FieldVariable[source]#

Advect a quantity using the given velocity field.