Skip to content

Commit

Permalink
remove change to mandatory parameters in yml file for feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexei Borissov committed Apr 8, 2019
1 parent d1824f6 commit 422568a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ EAGLEEntropyFloor:
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

EagleStellarEvolution:
EAGLEFeedback:
filename: /cosma5/data/Eagle/BG_Tables/YieldTables/
imf_model: Chabrier

EAGLEFeedback:
lifetime_flag: 2
continuous_heating_switch: 0
SNIa_timescale_Gyr: 2.0
SNIa_efficiency: 2.e-3
SNII_wind_delay_Gyr: 0.03
SNe_heating_temperature_K: 3.16228e7
8 changes: 5 additions & 3 deletions examples/StellarEvolution/stellar_evolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ EAGLEChemistry: # Solar abundances
init_abundance_Silicon: 0.0
init_abundance_Iron: 0.0

EagleStellarEvolution:
EAGLEFeedback:
filename: /cosma5/data/Eagle/BG_Tables/YieldTables/
imf_model: Chabrier

EAGLEFeedback:
continuous_heating_switch: 0
SNIa_timescale_Gyr: 2.0
SNIa_efficiency: 2.e-3
SNII_wind_delay_Gyr: 0.03
SNe_heating_temperature_K: 3.16228e7
1 change: 0 additions & 1 deletion src/engine_marktasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ void engine_marktasks_mapper(void *map_data, int num_elements,
*/
int engine_marktasks(struct engine *e) {

message("marktask");
struct scheduler *s = &e->sched;
const ticks tic = getticks();
int rebuild_space = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/stars/EAGLE/imf.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,7 @@ inline static double dying_mass_msun(double age_Gyr, float metallicity,
}

/**
* @brief Calculate lifetime of star poputlation in Gyr. Lifetime model is
* specified by stellar_lifetime_flag read in from yml file. Approach based on
* @brief Calculate lifetime of star poputlation in Gyr. Approach based on
* Portinari et al. 1998
*
* @param mass
Expand Down
4 changes: 2 additions & 2 deletions src/stars/EAGLE/stars.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,9 +809,9 @@ inline static void stars_evolve_init(struct swift_params* params,
stars->feedback.log10_SNIa_max_mass_msun = 0.90308999f; // log10(8).

/* Yield table filepath */
parser_get_param_string(params, "EagleStellarEvolution:filename",
parser_get_param_string(params, "EAGLEFeedback:filename",
stars->feedback.yield_table_path);
parser_get_param_string(params, "EagleStellarEvolution:imf_model",
parser_get_param_string(params, "EAGLEFeedback:imf_model",
stars->feedback.IMF_Model);

/* Initialise IMF */
Expand Down
19 changes: 9 additions & 10 deletions src/stars/EAGLE/stars_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,26 @@ INLINE static void stars_props_init(struct stars_props *sp,
sp->log_max_h_change = logf(powf(max_volume_change, hydro_dimension_inv));

/* Read SNIa timscale */
sp->feedback.SNIa_timescale_Gyr = parser_get_opt_param_float(
params, "EAGLEFeedback:SNIa_timescale_Gyr", 2.f);
sp->feedback.SNIa_timescale_Gyr = parser_get_param_float(
params, "EAGLEFeedback:SNIa_timescale_Gyr");

/* Read the efficiency of producing SNIa */
sp->feedback.SNIa_efficiency = parser_get_opt_param_float(
params, "EAGLEFeedback:SNIa_efficiency", 2.e-3);
sp->feedback.SNIa_efficiency = parser_get_param_float(
params, "EAGLEFeedback:SNIa_efficiency");

/* Are we doing continuous heating? */
sp->feedback.continuous_heating = parser_get_opt_param_int(
params, "EAGLEFeedback:continuous_heating_switch", 0);
sp->feedback.continuous_heating = parser_get_param_int(
params, "EAGLEFeedback:continuous_heating_switch");

/* Set the delay time before SNII occur */
const float Gyr_in_cgs = 3.154e16;
sp->feedback.SNII_wind_delay =
parser_get_opt_param_float(params, "EAGLEFeedback:SNII_wind_delay_Gyr",
0.03) *
parser_get_param_float(params, "EAGLEFeedback:SNII_wind_delay_Gyr") *
Gyr_in_cgs / units_cgs_conversion_factor(us, UNIT_CONV_TIME);

/* Read the temperature change to use in stochastic heating */
sp->feedback.SNe_deltaT_desired = parser_get_opt_param_float(
params, "EAGLEFeedback:SNe_heating_temperature_K", 3.16228e7);
sp->feedback.SNe_deltaT_desired = parser_get_param_float(
params, "EAGLEFeedback:SNe_heating_temperature_K");
sp->feedback.SNe_deltaT_desired /=
units_cgs_conversion_factor(us, UNIT_CONV_TEMPERATURE);

Expand Down
10 changes: 6 additions & 4 deletions tests/testFeedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.

EagleStellarEvolution:
EAGLEFeedback:
filename: /cosma5/data/Eagle/BG_Tables/YieldTables/
imf_model: Chabrier

EAGLEFeedback:
lifetime_flag: 2
continuous_heating_switch: 0
SNIa_timescale_Gyr: 2.0
SNIa_efficiency: 2.e-3
SNII_wind_delay_Gyr: 0.03
SNe_heating_temperature_K: 3.16228e7

0 comments on commit 422568a

Please sign in to comment.