diff --git a/doc/RTD/source/SubgridModels/EAGLE/index.rst b/doc/RTD/source/SubgridModels/EAGLE/index.rst index aab9de72ab1cd9dd029f7a4bb999de8ff1724295..0587f3f2e0f5295d1eab91ef53f902e8757c0b77 100644 --- a/doc/RTD/source/SubgridModels/EAGLE/index.rst +++ b/doc/RTD/source/SubgridModels/EAGLE/index.rst @@ -26,9 +26,9 @@ low-density high-metallicity particles to cool below the warm phase because of over-cooling induced by the absence of metal diffusion. This limit plays only a small role in practice. The second limit, labelled as ``Jeans``, is used to prevent the fragmentation of high-density gas into clumps that -cannot be resolved by the solver. The two limits are sketched on the -following figure. An additional over-density criterion is applied to -prevent gas not collapsed into structures from being affected. +cannot be resolved by the coupled hydro+gravity solver. The two limits are +sketched on the following figure. An additional over-density criterion is +applied to prevent gas not collapsed into structures from being affected. .. figure:: EAGLE_entropy_floor.svg :width: 400px @@ -69,6 +69,9 @@ EAGLE run, that section of the parameter file reads: Cool_gamma_effective: 1. # Slope the of the EAGLE Cool limiter entropy floor +Note that the model only makes sense if the ``Cool`` threshold is at a lower +density than the ``Jeans`` threshold. + .. _EAGLE_chemical_tracers: Chemical tracers diff --git a/src/entropy_floor/EAGLE/entropy_floor.h b/src/entropy_floor/EAGLE/entropy_floor.h index 8ea1e8631c4a9c5c14d7c0221a02f7178a3209d5..ab6413a8b09cdd65a0cb1f7c1d612c4b13d480ef 100644 --- a/src/entropy_floor/EAGLE/entropy_floor.h +++ b/src/entropy_floor/EAGLE/entropy_floor.h @@ -168,6 +168,17 @@ static INLINE void entropy_floor_init(struct entropy_floor_properties *props, props->Cool_gamma_effective = parser_get_param_float(params, "EAGLEEntropyFloor:Cool_gamma_effective"); + /* Cross-check that the input makes sense */ + if (props->Cool_density_threshold_H_p_cm3 >= + props->Jeans_density_threshold_H_p_cm3) { + error( + "Invalid values for the entrop floor density thresholds. The 'Jeans' " + "threshold (%e cm^-3) should be at a higher density than the 'Cool' " + "threshold (%e cm^-3)", + props->Jeans_density_threshold_H_p_cm3, + props->Cool_density_threshold_H_p_cm3); + } + /* Initial Hydrogen abundance (mass fraction) */ const double X_H = hydro_props->hydrogen_mass_fraction;