Skip to content

Commit

Permalink
Update electron qpar to be saved in debug output file
Browse files Browse the repository at this point in the history
Update will be done at the beginning of the next timestep, but without
this explicit update the saved qpar would be inconsistent with the saved
(current) g_e.
  • Loading branch information
johnomotani committed Jan 11, 2025
1 parent 4d9eb97 commit 72488ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions moment_kinetics/src/electron_kinetic_equation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,15 @@ function electron_backward_euler_pseudotimestepping!(scratch, pdf, moments, phi,
# For now can only do I/O within the pseudo-timestepping loop when there
# is no r-dimension, because different points in r would take different
# number and length of timesteps to converge.

# Update the electron heat flux for output. This will be done anyway
# before using qpar in the next residual_func!() call, but there is no
# convenient way to include that calculation in this debug output.
moments.electron.qpar_updated[] = false
@views calculate_electron_qpar_from_pdf_no_r!(moments.electron.qpar[:,ir],
electron_ppar_new,
moments.electron.vth[:,ir],
f_electron_new, vpa, ir)
begin_serial_region()
t_params.moments_output_counter[] += 1
@serial_region begin
Expand Down

0 comments on commit 72488ed

Please sign in to comment.