Skip to content

Commit

Permalink
Fix adaptive-timestep IMEX for kinetic electrons
Browse files Browse the repository at this point in the history
Can (?) skip the problematic solve, that was run to update the electron
shape function without updating the electron pressure, on the 'explicit
first stage' of ESDIRK schemes. This might have the effect of reducing
the order of accuracy of the scheme somehow, as the qpar_e used for the
'explicit' calculation of the time derivative of electron_ppar is taken
from the most recent implicit solve rather than a solve updated with the
new ion/electron profiles. However, the change is probably small (?) and
at least the solver does run now - it is useful to have an adaptive ion
timestep as it may let the code recover by reducing the ion timestep
when an electron implicit solve fails to converge.
  • Loading branch information
johnomotani committed Nov 28, 2024
1 parent 027551e commit 1ff204e
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 194 deletions.
4 changes: 1 addition & 3 deletions moment_kinetics/src/time_advance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3116,9 +3116,7 @@ end
|| (istage == n_rk_stages && t_params.implicit_coefficient_is_zero[1])
|| t_params.implicit_coefficient_is_zero[istage+1])
update_electrons = (t_params.rk_coefs_implicit === nothing
|| !(t_params.implicit_electron_advance || t_params.implicit_electron_ppar)
|| (istage < n_rk_stages && t_params.implicit_coefficient_is_zero[istage+1])
|| (istage == n_rk_stages && t_params.implicit_coefficient_is_zero[1]))
|| !(t_params.implicit_electron_advance || t_params.implicit_electron_ppar))
diagnostic_moments = diagnostic_checks && istage == n_rk_stages
success = apply_all_bcs_constraints_update_moments!(
scratch[istage+1], pdf, moments, fields, boundary_distributions,
Expand Down
Loading

0 comments on commit 1ff204e

Please sign in to comment.