time_advance

moment_kinetics.time_advance.adaptive_timestep_update!Method
adaptive_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.

source
moment_kinetics.time_advance.euler_time_advance!Method

eulertimeadvance! 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

source
moment_kinetics.time_advance.implicit_ion_advance!Method
implicit_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.

source
moment_kinetics.time_advance.normalize_pdf!Method

if 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

source
moment_kinetics.time_advance.setup_advance_flagsMethod

create 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.

source
moment_kinetics.time_advance.time_advance!Method

solve ∂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

source