@@ -292,7 +292,8 @@ void EvolvePressure::finally(const Options& state) {
292292 ddt (P) -= FV::Div_par_mod<hermes::Limiter>(P, V, fastest_wave, flow_ylow_advection);
293293
294294 // Work done. This balances energetically a term in the momentum equation
295- ddt (P) -= (2 . / 3 ) * Pfloor * Div_par (V);
295+ E_PdivV = -Pfloor * Div_par (V);
296+ ddt (P) += (2 . / 3 ) * E_PdivV;
296297
297298 } else {
298299 // Use V * Grad(P) form
@@ -301,7 +302,8 @@ void EvolvePressure::finally(const Options& state) {
301302 // Caused heating of charged species near sheath like p_div_v
302303 ddt (P) -= (5 . / 3 ) * FV::Div_par_mod<hermes::Limiter>(P, V, fastest_wave, flow_ylow_advection);
303304
304- ddt (P) += (2 . / 3 ) * V * Grad_par (P);
305+ E_VgradP = V * Grad_par (P);
306+ ddt (P) += (2 . / 3 ) * E_VgradP;
305307 }
306308 flow_ylow_advection *= 5 . / 2 ; // Energy flow
307309 flow_ylow = flow_ylow_advection;
@@ -651,6 +653,30 @@ void EvolvePressure::outputVars(Options& state) {
651653 {" species" , name},
652654 {" source" , " evolve_pressure" }});
653655
656+ if (p_div_v) {
657+
658+ set_with_attrs (state[" E" + name + " _PdivV" ], E_PdivV,
659+ {{" time_dimension" , " t" },
660+ {" units" , " W / m^-3" },
661+ {" conversion" , Pnorm * Omega_ci},
662+ {" standard_name" , " energy source" },
663+ {" long_name" , name + " energy source due to pressure gradient" },
664+ {" species" , name},
665+ {" source" , " evolve_pressure" }});
666+ } else {
667+
668+ set_with_attrs (state[" E" + name + " _VgradP" ], E_VgradP,
669+ {{" time_dimension" , " t" },
670+ {" units" , " W / m^-3" },
671+ {" conversion" , Pnorm * Omega_ci},
672+ {" standard_name" , " energy source" },
673+ {" long_name" , name + " energy source due to pressure gradient" },
674+ {" species" , name},
675+ {" source" , " evolve_pressure" }});
676+
677+ }
678+
679+
654680 if (flow_xlow.isAllocated ()) {
655681 set_with_attrs (state[fmt::format (" ef{}_tot_xlow" , name)], flow_xlow,
656682 {{" time_dimension" , " t" },
0 commit comments