time_advance
moment_kinetics.time_advance
— Modulemoment_kinetics.time_advance.adaptive_timestep_update!
— Methodadaptive_timestep_update!(scratch, scratch_implicit, scratch_electron,
t_params, pdf, moments, fields, boundary_distributions,
composition, collisions, geometry,
external_source_settings, spectral_objects,
advect_objects, gyroavs, num_diss_params,
nl_solver_params, advance, scratch_dummy, r, z, vperp,
vpa, vzeta, vr, vz, success, nl_max_its_fraction)
Check the error estimate for the embedded RK method and adjust the timestep if appropriate.
moment_kinetics.time_advance.apply_all_bcs_constraints_update_moments!
— MethodApply boundary conditions and moment constraints to updated pdfs and calculate derived moments and moment derivatives
moment_kinetics.time_advance.euler_time_advance!
— Methodeulertimeadvance! advances the vector equation dfvec/dt = G[f] that includes the kinetic equation + any evolved moment equations using the forward Euler method: fvecout = fvecin + dt*fvecin, with fvecin an input and fvec_out the output
moment_kinetics.time_advance.implicit_ion_advance!
— Methodimplicit_ion_advance!(fvec_out, fvec_in, pdf, fields, moments, advect_objects,
vz, vr, vzeta, vpa, vperp, gyrophase, z, r, t, dt,
spectral_objects, composition, collisions, geometry,
scratch_dummy, manufactured_source_list,
external_source_settings, num_diss_params,
nl_solver_params, advance, fp_arrays, istage)
Do a backward-Euler timestep for all terms in the ion kinetic equation.
moment_kinetics.time_advance.normalize_pdf!
— Methodif evolving the density via continuity equation, redefine the normalised f → f/n if evolving the parallel pressure via energy equation, redefine f -> f * vth / n 'scratch' should be a (nz,nspecies) array
moment_kinetics.time_advance.rk_update!
— MethodUse the result of the forward-Euler timestep and the previous Runge-Kutta stages to compute the updated pdfs, and any evolved moments.
moment_kinetics.time_advance.setup_advance_flags
— Methodcreate the 'advance_info' struct to be used in later Euler advance to indicate which parts of the equations are to be advanced concurrently. if no splitting of operators, all terms advanced concurrently; else, will advance one term at a time.
moment_kinetics.time_advance.setup_implicit_advance_flags
— Methodcreate the 'advanceinfo' struct to be used in the time advance to indicate which parts of the equations are to be advanced implicitly (using `backwardeuler!()`).
moment_kinetics.time_advance.setup_scratch_arrays
— Methodcreate an array of structs containing scratch arrays for the normalised pdf and low-order moments that may be evolved separately via fluid equations
moment_kinetics.time_advance.setup_time_advance!
— Methodcreate arrays and do other work needed to setup the main time advance loop. this includes creating and populating structs for Chebyshev transforms, velocity space moments, EM fields, and advection terms
moment_kinetics.time_advance.setup_time_info
— Methodsetup_time_info(t_input; electrons=nothing)
Create a input_structs.time_info
struct using the settings in t_input
.
If something is passed in electron
, it is stored in the electron_t_params
member of the returned time_info
.
moment_kinetics.time_advance.ssp_rk!
— Methodmoment_kinetics.time_advance.time_advance!
— Methodsolve ∂f/∂t + v(z,t)⋅∂f/∂z + dvpa/dt ⋅ ∂f/∂vpa= 0 define approximate characteristic velocity v₀(z)=vⁿ(z) and take time derivative along this characteristic df/dt + δv⋅∂f/∂z = 0, with δv(z,t)=v(z,t)-v₀(z) for prudent choice of v₀, expect δv≪v so that explicit time integrator can be used without severe CFL condition
moment_kinetics.time_advance.time_advance_no_splitting!
— Methodmoment_kinetics.time_advance.time_advance_split_operators!
— Methodmoment_kinetics.time_advance.update_solution_vector!
— Methodupdate the vector containing the pdf and any evolved moments of the pdf for use in the Runge-Kutta time advance