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)

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

Advect a quantity using the given velocity field.

log_level: str | int | None#