moment_constraints
moment_kinetics.moment_constraints
— ModuleFunctions for enforcing integral constraints on the normalised distribution function. Ensures consistency of evolution split into moments and normalised distribution function.
moment_kinetics.moment_constraints.add_electron_implicit_constraint_forcing_to_Jacobian!
— Functionadd_electron_implicit_constraint_forcing_to_Jacobian!(jacobian_matrix, f,
z_speed, z, vperp, vpa,
constraint_forcing_rate,
dt, ir, include=:all;
f_offset=0)
Add the contributions corresponding to electron_implicit_constraint_forcing!
to jacobian_matrix
.
moment_kinetics.moment_constraints.electron_implicit_constraint_forcing!
— Methodelectron_implicit_constraint_forcing!(f_out, f_in, constraint_forcing_rate, 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.
moment_kinetics.moment_constraints.hard_force_moment_constraints!
— Methodhard_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.
moment_kinetics.moment_constraints.hard_force_moment_constraints_neutral!
— Methodhard_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!
— Methodmoment_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.