moment_constraints
moment_kinetics.moment_constraints — Module
Functions for enforcing integral constraints on the normalised distribution function. Ensures consistency of evolution split into moments and normalised distribution function.
sourcemoment_kinetics.moment_constraints.electron_implicit_constraint_forcing! — Method
electron_implicit_constraint_forcing!(f_out, f_in, constraint_forcing_rate, vperp,
vpa, dt, ir)Add terms to the electron kinetic equation that force the moment constraints to be approximately satisfied. Needed to avoid large errors when taking large, implicit timesteps that do not guarantee accurate time evolution.
sourcemoment_kinetics.moment_constraints.get_electron_implicit_constraint_forcing_term — Method
get_electron_implicit_constraint_forcing_term(
f::AbstractArray{mk_float,3}, zeroth_moment::AbstractVector{mk_float},
first_moment::AbstractVector{mk_float},
second_moment::AbstractVector{mk_float}, z::coordinate, vperp::coordinate,
vpa::coordinate, constraint_forcing_rate::mk_float, ir::mk_int,
include::Symbol=:all)Add the contributions corresponding to electron_implicit_constraint_forcing! to jacobian_matrix.
moment_kinetics.moment_constraints.hard_force_moment_constraints! — Method
hard_force_moment_constraints!(f, moments, vpa)Force the moment constraints needed for the system being evolved to be applied to f. Not guaranteed to be a small correction, if f does not approximately obey the constraints to start with, but can be useful at initialisation to ensure a consistent initial state, and when applying boundary conditions.
Note this function assumes the input is given at a single spatial position.
sourcemoment_kinetics.moment_constraints.hard_force_moment_constraints_neutral! — Method
hard_force_moment_constraints_neutral!(f, moments, vz)Force the moment constraints needed for the system being evolved to be applied to f. Not guaranteed to be a small correction, if f does not approximately obey the constraints to start with, but can be useful at initialisation to ensure a consistent initial state, and when applying boundary conditions.
Notes:
- this function assumes the input is given at a single spatial position.
- currently only works with '1V' runs, where vz is the only velocity-space dimension
moment_kinetics.moment_constraints.moment_constraints_on_residual! — Method
moment_constraints_on_residual!(residual, f, moments, vpa)A 'residual' (used in implicit timestepping) is an update to the distribution function $f_\mathrm{new} = f_\mathrm{old} + \mathtt{residual}$. $f_\mathrm{new}$ should obey the moment constraints (Constraints on normalized distribution function), and $f_\mathrm{old}$ already obeys the constraints, which means that the first 3 moments of residual should be zero. We impose this constraint by adding corrections proportional to f.
\[r = \hat{r} + (A + B w_{\|} + C w_{\|}^2) f\]
Note this function assumes the input is given at a single spatial position.
source