GEAR sink : update the temperature and density thresholds criterion
In this MR, I updated the sink density-temperature threshold criterion. In the previous implementation, the gas must verify \rho < \rho_{\text{threshold}} and T < T_{\text{threshold}}. Typical threshold values are 1000 hydrogen atoms/cm^3 and 100 K.
However, in some cases, the gas can reach densities many orders of magnitude (between 10^3 to 10^8) higher than the density threshold and still does not pass the temperature check. Also, gas adiabatic heating might slow down the cooling. Such high densities are problematic for two reasons:
- they require very small timesteps and thus slow down the whole simulation volume;
- the sink philosophy is to represent regions of collapse by a sink to speed up computations and avoid modelling the details of the collapse.
Since in GEAR we do not study the collapse of individual stars to the smallest scales (not in these cosmo simulations at least), I changed the temperature and density criterion in the following way:
- if \rho_{\text{threshold}} \leq \rho_{\text{gas}} \leq \rho_{\text{max}} and T < T_{\text{threshold}}, check the other sink criteria;
- if \rho_\text{gas} > \rho_\text{max}, forget the temperature criterion but check the other ones.
This maximal density threshold is a user-defined parameter. This new set of criteria is still compatible with the previous implementation if we set \rho_\text{max} = + \infty.