Skip to content
Snippets Groups Projects
Commit f4bc79da authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Remove the not schaye2004 option in threshold density for star formation and...

Remove the not schaye2004 option in threshold density for star formation and add the new star flag in the spart struct
parent 1c19a8a4
No related branches found
No related tags found
1 merge request!705Star formation following Schaye08
......@@ -259,6 +259,8 @@ INLINE static void star_formation_copy_properties(
/* Store the birth density in the star particle */
sp->birth_density = p->rho;
sp->new_star_flag = 1;
message("A star has been formed!");
}
......@@ -367,40 +369,25 @@ INLINE static void starformation_init_backend(
* pow(M_per_pc2, -starform->KS_high_den_power_law) * pow( hydro_gamma
* starform->fgas / G_newton, starform->SF_high_den_power_law);
/* Read what kind of critical density we need to use
* Schaye (2004) is metallicity dependent critical SF density*/
starform->schaye04 = parser_get_param_double(
parameter_file, "SchayeSF:Schaye2004");
if (!starform->schaye04) {
/* In the case that we do not use the Schaye (2004) critical
* density to form stars but a constant value */
starform->den_crit = parser_get_param_double(
parameter_file, "SchayeSF:thresh_norm_HpCM3");
starform->Z0 = 0.002;
starform->n_Z0 = 0.0;
} else {
/* Use the Schaye (2004) metallicity dependent critical density
* to form stars. */
/* Read the normalization of the metallicity dependent critical
* density*/
starform->den_crit = parser_get_param_double(
parameter_file, "SchayeSF:thresh_norm_HpCM3") *
conversion_numb_density;
/* Read the scale metallicity Z0 */
starform->Z0 = parser_get_param_double(
parameter_file, "SchayeSF:MetDep_Z0");
/* Read the power law of the critical density scaling */
starform->n_Z0 = parser_get_param_double(
parameter_file, "SchayeSF:MetDep_SFthresh_Slope");
/* Read the maximum allowed density for star formation */
starform->den_crit_max = parser_get_param_double(
parameter_file, "SchayeSF:thresh_max_norm_HpCM3");
}
/* Use the Schaye (2004) metallicity dependent critical density
* to form stars. */
/* Read the normalization of the metallicity dependent critical
* density*/
starform->den_crit = parser_get_param_double(
parameter_file, "SchayeSF:thresh_norm_HpCM3") *
conversion_numb_density;
/* Read the scale metallicity Z0 */
starform->Z0 = parser_get_param_double(
parameter_file, "SchayeSF:MetDep_Z0");
/* Read the power law of the critical density scaling */
starform->n_Z0 = parser_get_param_double(
parameter_file, "SchayeSF:MetDep_SFthresh_Slope");
/* Read the maximum allowed density for star formation */
starform->den_crit_max = parser_get_param_double(
parameter_file, "SchayeSF:thresh_max_norm_HpCM3");
/* Claculate 1 over the metallicity */
starform->Z0_inv = 1/starform->Z0;
......
......@@ -70,6 +70,9 @@ struct spart {
/*! Birth density */
float birth_density;
/*! New star flag */
int new_star_flag;
/*! Tracer structure */
struct tracers_xpart_data tracers_data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment