Location: Source/hydro/Castro_mol_hydro.cpp:547-559.
Finding
The second-order MOL branch calls fill_temp_cond and mol_diffusive_flux
whenever DIFFUSION is compiled in. Unlike both fourth-order diffusion calls, it
does not test the runtime flag castro.diffuse_temp.
A diffusion-capable executable therefore conducts heat with diffuse_temp=0
when using SDC2. The runtime-disabled case can also lose its diffusion timestep
restriction while retaining the explicit diffusive update.
Evidence
The call is guarded only by #ifdef DIFFUSION.
Source/diffusion/diffusion_util.cpp:13-63 computes conductivity without
checking diffuse_temp, and Source/hydro/Castro_mol.cpp:317-350 adds the
resulting energy flux without checking it either. The fourth-order branch
explicitly tests diffuse_temp == 1.
A fresh 1-D debug executable also reproduced the ignored switch. With hydro
enabled to avoid report 02 and a fixed dt=1e-8, diffuse_temp=0 and
diffuse_temp=1 gave identical final printed diagnostics. Maximum temperature was
1.940592276 in both runs. Keeping diffuse_temp=0 but setting
diffuse_cond_scale_fac=0 changed that maximum to 1.940595995. README.md records
the inputs and commands.
Proposed fix
Wrap conductivity evaluation and mol_diffusive_flux in if (diffuse_temp).
Keep this independent of do_hydro, so diffusion-only runs remain supported.
The out-of-bounds zeroing in report 02 must also be fixed for that case.
Validation after fixing
Use the diffusion problem with a nonuniform temperature and zero velocity. With
hydro disabled, diffuse_temp=0 must leave energy unchanged, while
diffuse_temp=1 must diffuse. Test SDC2 and SDC4 using the same executable and
a small fixed timestep.
Location:
Source/hydro/Castro_mol_hydro.cpp:547-559.Finding
The second-order MOL branch calls
fill_temp_condandmol_diffusive_fluxwhenever DIFFUSION is compiled in. Unlike both fourth-order diffusion calls, it
does not test the runtime flag
castro.diffuse_temp.A diffusion-capable executable therefore conducts heat with
diffuse_temp=0when using SDC2. The runtime-disabled case can also lose its diffusion timestep
restriction while retaining the explicit diffusive update.
Evidence
The call is guarded only by
#ifdef DIFFUSION.Source/diffusion/diffusion_util.cpp:13-63computes conductivity withoutchecking
diffuse_temp, andSource/hydro/Castro_mol.cpp:317-350adds theresulting energy flux without checking it either. The fourth-order branch
explicitly tests
diffuse_temp == 1.A fresh 1-D debug executable also reproduced the ignored switch. With hydro
enabled to avoid report 02 and a fixed dt=1e-8, diffuse_temp=0 and
diffuse_temp=1 gave identical final printed diagnostics. Maximum temperature was
1.940592276 in both runs. Keeping diffuse_temp=0 but setting
diffuse_cond_scale_fac=0 changed that maximum to 1.940595995. README.md records
the inputs and commands.
Proposed fix
Wrap conductivity evaluation and
mol_diffusive_fluxinif (diffuse_temp).Keep this independent of
do_hydro, so diffusion-only runs remain supported.The out-of-bounds zeroing in report 02 must also be fixed for that case.
Validation after fixing
Use the diffusion problem with a nonuniform temperature and zero velocity. With
hydro disabled,
diffuse_temp=0must leave energy unchanged, whilediffuse_temp=1must diffuse. Test SDC2 and SDC4 using the same executable anda small fixed timestep.