FluxDivergenceBase#
- class fridom.nonhydro.modules.advection.flux_divergence_base.FluxDivergenceBase[source]#
Bases:
AdvectionBaseBase class for flux divergence advection schemes.
Description#
Assuming that the velocity field is divergence-free, then we can write the advection of the momentum flux tensor as:
\[(\mathbf{u} \cdot \nabla) \mathbf{u} = \nabla \cdot \mathbf{F}\]where \(\mathbf{F}\) is the momentum flux tensor:
\[\begin{split}\mathbf{F} = \mathbf{u}^T \mathbf{u} = \begin{bmatrix} u^2 & uv & uw \\ uv & v^2 & vw \\ uw & vw & w^2 \end{bmatrix}\end{split}\]Child classes must implement the compute_momentum_flux_tensor method.
- __init__() None#
Methods
__init__()advect_state(z, dz)Advect the state vector.
advection(velocity, quantity)Advect a quantity using the given velocity field.
compute_momentum_flux_tensor(velocity)Compute the momentum flux tensor.
compute_tracer_advection(velocity, field)Compute the advection of a tracer 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.
namerequired_haloThe required halo points for this module.
scalingA scaling factor for the nonlinear terms (default: 1.0).
- abstract compute_momentum_flux_tensor(velocity: VectorField) tuple[VectorField][source]#
Compute the momentum flux tensor.
Parameters#
- velocitynh.VectorField
Velocity field (u, v, w).
Returns#
- tuple[nh.VectorField]
Momentum flux tensor (vel*u, vel*v, vel*w).
- abstract compute_tracer_advection(velocity: VectorField, field: ScalarField) ScalarField[source]#
Compute the advection of a tracer field.
Parameters#
- velocitynh.VectorField
Velocity field (u, v, w).
- fieldnh.ScalarField
Tracer field to be advected.
Returns#
- nh.ScalarField
Advection term for the tracer field.