You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #130 introduced decoupling of the heating and cooling terms. However, there are inconsistencies when the user supplies custom heating and/or cooling functions.
Assuming a user-specified cooling function $\Lambda(T)$ and heating function $H_0$ is always supplied (and cooling/heating is controlled through the parfile), then the following gives an overview:
cooling
heating
forced thermal balance
what happens
what should happen
correct?
no
no
-
user-defined heating + cooling functions are set, but non-adiabatic matrix elements are not added. Spectrum is still adiabatic and correct.
heating + cooling functions should return zero.
❌
yes
yes
yes
behaviour as expected.
-
✅
yes
yes
no
behaviour as expected.
-
✅
yes
no
yes/no
custom heating function is set and returns non-zero.
heating function should return zero.
❌
no
yes
yes/no
heating function set but non-adiabatic elements are not added, spectrum is adiabatic
custom heating function should be used, system should be non-adiabatic, no thermal balance
Traced this down to the fact that users can still set custom physics functions in mod_physics, while Legolas checks for enabled physics when adding the matrix elements in mod_matrix_manager -- element blocks corresponding to disabled physics are simply skipped.
However, in the case of heating/cooling we only check if cooling is enabled, regardless of heating, which is also contained in mod_heatloss. Should be an easy fix:
do not allow setting custom functions if the corresponding settings instance is not enabled.
add an additional check for enabled heating when adding heatloss matrix elements.
Issue description
PR #130 introduced decoupling of the heating and cooling terms. However, there are inconsistencies when the user supplies custom heating and/or cooling functions.
Assuming a user-specified cooling function$\Lambda(T)$ and heating function $H_0$ is always supplied (and cooling/heating is controlled through the parfile), then the following gives an overview:
Bug report
Minimal example for reproduction
Version info
The text was updated successfully, but these errors were encountered: