initial_conditions
moment_kinetics.initial_conditions
— Modulemoment_kinetics.initial_conditions.allocate_pdf_and_moments
— MethodCreates the structs for the pdf and the velocity-space moments
moment_kinetics.initial_conditions.convert_full_f_ion_to_normalised!
— FunctionTake the full ion distribution function, calculate the moments, then normalise and shift to the moment-kinetic grid.
Uses input value of f
and modifies in place to the normalised distribution functions. Input density
, upar
, p
, and vth
are not used, the values are overwritten with the moments of f
.
Inputs/outputs depend on z, vperp, and vpa (should be inside loops over species, r).
The velocity grid that the input f
is defined on can be scaled by vgrid_scale_factor
: f
is given on a velocity grid vperp.grid .* vgrid_scale_factor
and vpa.grid .* vgrid_scale_factor
.
moment_kinetics.initial_conditions.convert_full_f_neutral_to_normalised!
— FunctionTake the full neutral-particle distribution function, calculate the moments, then normalise and shift to the moment-kinetic grid.
Uses input value of f
and modifies in place to the normalised distribution functions. Input density
, uz
, p
, and vth
are not used, the values are overwritten with the moments of f
.
Inputs/outputs depend on z, vzeta, vr and vz (should be inside loops over species, r).
The velocity grid that the input f
is defined on can be scaled by vgrid_scale_factor
: f
is given on a velocity grid vzeta.grid .* vgrid_scale_factor
, vr.grid .* vgrid_scale_factor
, and vz.grid .* vgrid_scale_factor
.
moment_kinetics.initial_conditions.create_pdf
— MethodAllocate arrays for pdfs
moment_kinetics.initial_conditions.init_density!
— Methodmoment_kinetics.initial_conditions.init_electron_density!
— Methodinitialise the electron density
moment_kinetics.initial_conditions.init_electron_pdf_over_density_and_boundary_phi!
— Methodinitelectronpdfoverdensityandboundaryphi initialises the normalised electron pdf = pdfe * vthe / dense and the boundary values of the electrostatic potential phi; care is taken to ensure that the parallel boundary condition is satisfied; NB: as the electron pdf is obtained via a time-independent equation, this 'initital' value for the electron will just be the first guess in an iterative solution
moment_kinetics.initial_conditions.init_electron_upar!
— Methodinitialise the electron parallel flow density
moment_kinetics.initial_conditions.init_electron_vth!
— Methodinitialise the electron thermal speed profile. For Boltzmann electrons returns vth0 = sqrt(2*Ts/Tref/meovermi) For Braginskii or kinetic electrons, sets Te=Ti, so returns vthi/sqrt(meovermi).
moment_kinetics.initial_conditions.init_ion_pdf_over_density!
— Methodmoment_kinetics.initial_conditions.init_neutral_pdf_over_density!
— Methodmoment_kinetics.initial_conditions.init_pdf_and_moments!
— Methodcreates the normalised pdfs and the velocity-space moments and populates them with a self-consistent initial condition
moment_kinetics.initial_conditions.init_upar!
— Methodmoment_kinetics.initial_conditions.init_uz!
— Methodmoment_kinetics.initial_conditions.init_vth!
— Methodfor now the only initialisation option for the temperature is constant in z returns vth0 = sqrt(2Ts/ms) / sqrt(Tref/mref) = sqrt(2Ts/T_ref)
moment_kinetics.initial_conditions.initialize_pdf!
— Method