MHD Cooling Issue #1883
-
|
I found a cooling-related issue when testing an MHD run with resampled cooling in QUOKKA. My setup is:
The main issue seems to be in the cooling path: In cooling/ResampledCooling.hpp, cooling updates use However, in src/radiation/radiation_system.hpp, the implementation is currently const double Ekin = p_sq / (2.0 * density);
const double Eint = Etot - Ekin; and the inverse function is This is valid for pure hydro, but not for MHD, because magnetic energy is not included. For MHD, the gas internal energy should instead be recovered as Because ResampledCooling.hpp uses ComputeEintFromEgas() to obtain the thermal energy before cooling integration, this means that in MHD runs the cooling module may be evolving an incorrect internal energy. This likely causes inconsistent thermodynamics in MHD + cooling runs. In my outputs, I observed:
So the cooling-related concern is: ResampledCooling.hpp currently relies on RadSystem<problem_t>::ComputeEintFromEgas(), but that function appears to assume pure hydro and does not subtract magnetic energy. Therefore, the cooling update may be using the wrong gas internal energy in MHD runs.` This suggests that the current resampled cooling path is not MHD-safe unless internal energy recovery is modified to include magnetic energy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Your analysis is correct — That said, there's currently a compile-time static_assert(!(Physics_Traits<problem_t>::is_mhd_enabled &&
Physics_Traits<problem_t>::is_radiation_enabled),
"MHD + Radiation is not supported yet.");Since If cooling is indeed reachable without Notably, the original MHD implementation (PR #900) explicitly flagged a TODO to "audit the code to make sure magnetic energy is subtracted whenever (Etot - KE) is computed" [6], which suggests this particular path was not yet audited. To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Beta Was this translation helpful? Give feedback.
@YaoguangPei Can you try this fix in #1886? This is now merged into the development branch.