Commit 8e668947 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'gear_cleanup' into 'master'

Small GEAR merge fixes

See merge request !1011
parents 94d7353f fea60c3f
......@@ -292,6 +292,7 @@ SineWavePotential:
timestep_limit: 1. # Time-step dimensionless pre-factor.
growth_time: 0. # (Optional) Time for the potential to grow to its final size.
# Parameters related to entropy floors ----------------------------------------------
EAGLEEntropyFloor:
......@@ -303,12 +304,14 @@ EAGLEEntropyFloor:
Cool_over_density_threshold: 10. # Overdensity above which the EAGLE Cool limiter entropy floor can kick in.
Cool_temperature_norm_K: 8000 # Temperature of the EAGLE Cool limiter entropy floor at the density threshold expressed in Kelvin.
Cool_gamma_effective: 1. # Slope the of the EAGLE Cool limiter entropy floor
# Parameters related to pressure floors ----------------------------------------------
GEARPressureFloor:
jeans_factor: 10. # Number of particles required to suppose a resolved clump and avoid the pressure floor.
# Parameters related to cooling function ----------------------------------------------
# Constant du/dt cooling function
......@@ -326,6 +329,7 @@ LambdaCooling:
EAGLECooling:
dir_name: ./coolingtables/ # Location of the Wiersma+08 cooling tables
H_reion_z: 8.5 # Redshift of Hydrogen re-ionization
H_reion_eV_p_H: 2.0 # Energy inject by Hydrogen re-ionization in electron-volt per Hydrogen atom
He_reion_z_centre: 3.5 # Redshift of the centre of the Helium re-ionization Gaussian
He_reion_z_sigma: 0.5 # Spread in redshift of the Helium re-ionization Gaussian
He_reion_eV_p_H: 2.0 # Energy inject by Helium re-ionization in electron-volt per Hydrogen atom
......@@ -336,16 +340,17 @@ EAGLECooling:
# Cooling with Grackle 3.0
GrackleCooling:
cloudy_table: CloudyData_UVB=HM2012.h5 # Name of the Cloudy Table (available on the grackle bitbucket repository)
with_UV_background: 1 # Enable or not the UV background
redshift: 0 # Redshift to use (-1 means time based redshift)
with_metal_cooling: 1 # Enable or not the metal cooling
provide_volumetric_heating_rates: 0 # (optional) User provide volumetric heating rates
provide_specific_heating_rates: 0 # (optional) User provide specific heating rates
with_UV_background: 1 # Enable or not the UV background
redshift: 0 # Redshift to use (-1 means time based redshift)
with_metal_cooling: 1 # Enable or not the metal cooling
provide_volumetric_heating_rates: 0 # (optional) User provide volumetric heating rates
provide_specific_heating_rates: 0 # (optional) User provide specific heating rates
max_steps: 10000 # (optional) Max number of step when computing the initial composition
convergence_limit: 1e-2 # (optional) Convergence threshold (relative) for initial composition
thermal_time_myr: 5 # (optional) Time (in Myr) for adiabatic cooling after a feedback event.
self_shielding_method: -1 # (optional) Grackle (1->3 for Grackle's ones, 0 for none and -1 for GEAR)
self_shielding_threshold_atom_per_cm3: 0.007 # Required only with GEAR's self shielding. Density threshold of the self shielding
self_shielding_method: -1 # (optional) Grackle (1->3 for Grackle's ones, 0 for none and -1 for GEAR)
self_shielding_threshold_atom_per_cm3: 0.007 # Required only with GEAR's self shielding. Density threshold of the self shielding
# Parameters related to chemistry models -----------------------------------------------
......@@ -365,16 +370,11 @@ EAGLEChemistry:
# GEAR chemistry model (Revaz and Jablonka 2018)
GEARChemistry:
initial_metallicity: 1 # Initial metallicity of the gas (mass fraction)
scale_initial_metallicity: 1 # Should we scale the initial metallicity with the solar one?
scale_initial_metallicity: 1 # Should we scale the initial metallicity with the solar one?
# Parameters related to star formation models -----------------------------------------------
# GEAR star formation model (Revaz and Jablonka 2018)
GEARStarFormation:
star_formation_efficiency: 0.01 # star formation efficiency (c_*)
maximal_temperature: 3e4 # Upper limit to the temperature of a star forming particle
# EAGLE star formation model (Schaye and Dalla Vecchia 2008)
EAGLEStarFormation:
EOS_density_norm_H_p_cm3: 0.1 # Physical density used for the normalisation of the EOS assumed for the star-forming gas in Hydrogen atoms per cm^3.
......@@ -392,7 +392,13 @@ EAGLEStarFormation:
threshold_Z0: 0.002 # Reference metallicity (metal mass fraction) for the metal-dependant threshold for star formation.
threshold_slope: -0.64 # Slope of the metal-dependant star formation threshold
threshold_max_density_H_p_cm3: 10.0 # Maximal density of the metal-dependant density threshold for star formation in Hydrogen atoms per cm^3.
# GEAR star formation model (Revaz and Jablonka 2018)
GEARStarFormation:
star_formation_efficiency: 0.01 # star formation efficiency (c_*)
maximal_temperature: 3e4 # Upper limit to the temperature of a star forming particle
# Parameters related to feedback models -----------------------------------------------
# EAGLE feedback model
......@@ -438,9 +444,10 @@ EAGLEFeedback:
# GEAR feedback model
GEARFeedback:
supernovae_energy_erg: 0.1e51 # Energy released by a single supernovae.
supernovae_energy_erg: 0.1e51 # Energy released by a single supernovae.
yields_table: chemistry-AGB+OMgSFeZnSrYBaEu-16072013.h5 # Table containing the yields.
discrete_yields: 0 # Should we use discrete yields or the IMF integrated one?
discrete_yields: 0 # Should we use discrete yields or the IMF integrated one?
# Parameters related to AGN models -----------------------------------------------
......
......@@ -77,7 +77,7 @@ if HAVEGRACKLECOOLING
GRACKLE_COOLING_SOURCES += cooling/grackle/cooling.c
endif
# source files for GRACKLE cooling
# source files for GEAR feedback
GEAR_FEEDBACK_SOURCES =
if HAVEGEARFEEDBACK
GEAR_FEEDBACK_SOURCES += feedback/GEAR/stellar_evolution.c feedback/GEAR/feedback.c \
......@@ -102,8 +102,8 @@ AM_SOURCES = space.c runner_main.c runner_doiact_hydro.c runner_doiact_limiter.c
chemistry.c cosmology.c restart.c mesh_gravity.c velociraptor_interface.c \
outputlist.c velociraptor_dummy.c logger_io.c memuse.c mpiuse.c memuse_rnodes.c fof.c \
hashmap.c pressure_floor.c \
$(EAGLE_COOLING_SOURCES) $(EAGLE_FEEDBACK_SOURCES) $(GRACKLE_COOLING_SOURCES) \
$(GEAR_FEEDBACK_SOURCES)
$(EAGLE_COOLING_SOURCES) $(EAGLE_FEEDBACK_SOURCES) \
$(GRACKLE_COOLING_SOURCES) $(GEAR_FEEDBACK_SOURCES)
# Include files for distribution, not installation.
nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h inline.h kernel_hydro.h kernel_gravity.h \
......
......@@ -136,9 +136,10 @@ __attribute__((always_inline)) INLINE static double Compton_cooling_rate_cgs(
* @param cooling The #cooling_function_data used in the run.
* @param p Pointer to the particle data.
* @param xp Pointer to the particle' extended data.
* @param time The current time.
* @param dt The time-step of this particle.
* @param dt_therm The time-step operator used for thermal quantities.
* @param time Time since Big Bang (or start of the simulation) in internal
* units.
*/
__attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const,
......@@ -147,8 +148,8 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct hydro_props* hydro_props,
const struct entropy_floor_properties* floor_props,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, const double time,
const float dt, const float dt_therm) {
struct part* restrict p, struct xpart* restrict xp, const float dt,
const float dt_therm, const double time) {
/* Nothing to do here? */
if (dt == 0.) return;
......
......@@ -372,10 +372,10 @@ INLINE static double bisection_iter(
* @param cooling The #cooling_function_data used in the run.
* @param p Pointer to the particle data.
* @param xp Pointer to the extended particle data.
* @param time The current time (since the Big Bang or start of the run) in
* internal units.
* @param dt The cooling time-step of this particle.
* @param dt_therm The hydro time-step of this particle.
* @param time The current time (since the Big Bang or start of the run) in
* internal units.
*/
void cooling_cool_part(const struct phys_const *phys_const,
const struct unit_system *us,
......@@ -384,8 +384,8 @@ void cooling_cool_part(const struct phys_const *phys_const,
const struct entropy_floor_properties *floor_props,
const struct cooling_function_data *cooling,
struct part *restrict p, struct xpart *restrict xp,
const double time, const float dt,
const float dt_therm) {
const float dt, const float dt_therm,
const double time) {
/* No cooling happens over zero time */
if (dt == 0.) return;
......
......@@ -44,7 +44,7 @@ void cooling_cool_part(const struct phys_const *phys_const,
const struct entropy_floor_properties *floor_props,
const struct cooling_function_data *cooling,
struct part *restrict p, struct xpart *restrict xp,
const double time, const float dt, const float dt_therm);
const float dt, const float dt_therm, const double time);
float cooling_timestep(const struct cooling_function_data *restrict cooling,
const struct phys_const *restrict phys_const,
......
......@@ -76,9 +76,10 @@ INLINE static void cooling_update(const struct cosmology* cosmo,
* @param cooling The #cooling_function_data used in the run.
* @param p Pointer to the particle data.
* @param xp Pointer to the extended particle data.
* @param time The current time.
* @param dt The time-step of this particle.
* @param dt_therm The time-step operator used for thermal quantities.
* @param time Time since Big Bang (or start of the simulation) in internal
* units.
*/
__attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const,
......@@ -87,8 +88,8 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct hydro_props* hydro_props,
const struct entropy_floor_properties* floor_props,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, const double time,
const float dt, const float dt_therm) {
struct part* restrict p, struct xpart* restrict xp, const float dt,
const float dt_therm, const double time) {
/* Internal energy floor */
const float u_floor = cooling->min_energy;
......
......@@ -106,9 +106,10 @@ __attribute__((always_inline)) INLINE static double cooling_rate_cgs(
* @param cooling The #cooling_function_data used in the run.
* @param p Pointer to the particle data.
* @param xp Pointer to the particle' extended data.
* @param time The current time.
* @param dt The time-step of this particle.
* @param dt_therm The time-step operator used for thermal quantities.
* @param time Time since Big Bang (or start of the simulation) in internal
* units.
*/
__attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const,
......@@ -117,8 +118,8 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct hydro_props* hydro_props,
const struct entropy_floor_properties* floor_props,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, const double time,
const float dt, const float dt_therm) {
struct part* restrict p, struct xpart* restrict xp, const float dt,
const float dt_therm, const double time) {
/* Nothing to do here? */
if (dt == 0.) return;
......
......@@ -748,9 +748,10 @@ void cooling_apply(struct part* restrict p, struct xpart* restrict xp,
* @param cooling The #cooling_function_data used in the run.
* @param p Pointer to the particle data.
* @param xp Pointer to the particle' extended data.
* @param time The current time.
* @param dt The time-step of this particle.
* @param dt_therm The time-step operator used for thermal quantities.
* @param time The current time (since the Big Bang or start of the run) in
* internal units.
*/
void cooling_cool_part(const struct phys_const* restrict phys_const,
const struct unit_system* restrict us,
......@@ -759,8 +760,8 @@ void cooling_cool_part(const struct phys_const* restrict phys_const,
const struct entropy_floor_properties* floor_props,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp,
const double time, const double dt,
const double dt_therm) {
const double dt, const double dt_therm,
const double time) {
/* Nothing to do here? */
if (dt == 0.) return;
......
......@@ -115,8 +115,8 @@ void cooling_cool_part(const struct phys_const* restrict phys_const,
const struct entropy_floor_properties* floor_props,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp,
const double time, const double dt,
const double dt_therm);
const double dt, const double dt_therm,
const double time);
float cooling_get_temperature(
const struct phys_const* restrict phys_const,
......
......@@ -63,9 +63,10 @@ INLINE static void cooling_update(const struct cosmology* cosmo,
* @param cooling The #cooling_function_data used in the run.
* @param p Pointer to the particle data.
* @param xp Pointer to the extended particle data.
* @param time The current time.
* @param dt The time-step of this particle.
* @param dt_therm The time-step operator used for thermal quantities.
* @param time The current time (since the Big Bang or start of the run) in
* internal units.
*/
__attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct phys_const* restrict phys_const,
......@@ -74,8 +75,8 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
const struct hydro_props* hydro_props,
const struct entropy_floor_properties* floor_props,
const struct cooling_function_data* restrict cooling,
struct part* restrict p, struct xpart* restrict xp, const double time,
const float dt, const float dt_therm) {}
struct part* restrict p, struct xpart* restrict xp, const float dt,
const float dt_therm, const double time) {}
/**
* @brief Computes the cooling time-step.
......
......@@ -145,6 +145,7 @@ void runner_do_grav_mesh(struct runner *r, struct cell *c, int timer) {
* @param timer 1 if the time is to be recorded.
*/
void runner_do_cooling(struct runner *r, struct cell *c, int timer) {
const struct engine *e = r->e;
const struct cosmology *cosmo = e->cosmology;
const int with_cosmology = (e->policy & engine_policy_cosmology);
......@@ -202,8 +203,8 @@ void runner_do_cooling(struct runner *r, struct cell *c, int timer) {
/* Let's cool ! */
cooling_cool_part(constants, us, cosmo, hydro_props,
entropy_floor_props, cooling_func, p, xp, time,
dt_cool, dt_therm);
entropy_floor_props, cooling_func, p, xp, dt_cool,
dt_therm, time);
/* Apply the effects of feedback on this particle
* (Note: Only used in schemes that have a delayed feedback mechanism
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment