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

Rename a few variable to make the variables more clear

parent 46743f8c
Branches
Tags
1 merge request!705Star formation following Schaye08
...@@ -43,6 +43,9 @@ struct star_formation { ...@@ -43,6 +43,9 @@ struct star_formation {
/*! Normalization of the KS star formation law */ /*! Normalization of the KS star formation law */
double KS_normalization; double KS_normalization;
/*! Normalization of the KS star formation law in user units */
float KS_normalization_MSUNpYRpKPC2;
/*! Slope of the KS law */ /*! Slope of the KS law */
double KS_power_law; double KS_power_law;
...@@ -59,7 +62,7 @@ struct star_formation { ...@@ -59,7 +62,7 @@ struct star_formation {
double min_over_den; double min_over_den;
/*! Critical temperature */ /*! Critical temperature */
double T_crit; double Temperature_threshold;
/*! gas fraction */ /*! gas fraction */
double fgas; double fgas;
...@@ -80,10 +83,10 @@ struct star_formation { ...@@ -80,10 +83,10 @@ struct star_formation {
double inv_RAND_MAX; double inv_RAND_MAX;
/*! Critical density to form stars */ /*! Critical density to form stars */
double den_crit; double density_threshold;
/*! Maximum critical density to form stars */ /*! Maximum critical density to form stars */
double den_crit_max; double density_threshold_max;
/*! Scaling metallicity */ /*! Scaling metallicity */
double Z0; double Z0;
...@@ -95,7 +98,7 @@ struct star_formation { ...@@ -95,7 +98,7 @@ struct star_formation {
double n_Z0; double n_Z0;
/*! Normalization of critical SF density of Schaye (2004) */ /*! Normalization of critical SF density of Schaye (2004) */
double den_crit_star; double density_threshold_star;
/*! Polytropic index */ /*! Polytropic index */
double polytropic_index; double polytropic_index;
...@@ -108,6 +111,7 @@ struct star_formation { ...@@ -108,6 +111,7 @@ struct star_formation {
/*! EOS density norm */ /*! EOS density norm */
double EOS_density_norm; double EOS_density_norm;
}; };
/* /*
...@@ -151,12 +155,12 @@ INLINE static int star_formation_potential_to_become_star( ...@@ -151,12 +155,12 @@ INLINE static int star_formation_potential_to_become_star(
* the appropriate limit */ * the appropriate limit */
/* Check if it exceeded the maximum density */ /* Check if it exceeded the maximum density */
if (p->rho > starform->den_crit_max) { if (p->rho > starform->density_threshold_max) {
/* double tempp = cooling_get_temperature() */ /* double tempp = cooling_get_temperature() */
tempp = cooling_get_temperature(phys_const, hydro_props, us, cosmo, tempp = cooling_get_temperature(phys_const, hydro_props, us, cosmo,
cooling, p, xp); cooling, p, xp);
/* Check the last criteria, if the temperature is satisfied */ /* Check the last criteria, if the temperature is satisfied */
if (tempp < starform->T_crit) { if (tempp < starform->Temperature_threshold) {
return 1; return 1;
} else { } else {
return 0; return 0;
...@@ -167,14 +171,14 @@ INLINE static int star_formation_potential_to_become_star( ...@@ -167,14 +171,14 @@ INLINE static int star_formation_potential_to_become_star(
/* Get the metallicity from the chemistry struct /* Get the metallicity from the chemistry struct
* Do we use SMOOTHED OR NON SMOOTHED IN EAGLE???*/ * Do we use SMOOTHED OR NON SMOOTHED IN EAGLE???*/
double Z = p->chemistry_data.smoothed_metal_mass_fraction_total; double Z = p->chemistry_data.smoothed_metal_mass_fraction_total;
double den_crit_current = double density_threshold_current =
starform->den_crit * pow(Z * starform->Z0_inv, starform->n_Z0); starform->density_threshold * pow(Z * starform->Z0_inv, starform->n_Z0);
if (p->rho > den_crit_current) { if (p->rho > density_threshold_current) {
/* double tempp = cooling_get_temperature() */ /* double tempp = cooling_get_temperature() */
tempp = cooling_get_temperature(phys_const, hydro_props, us, cosmo, tempp = cooling_get_temperature(phys_const, hydro_props, us, cosmo,
cooling, p, xp); cooling, p, xp);
/* Check the last criteria, if the temperature is satisfied */ /* Check the last criteria, if the temperature is satisfied */
if (tempp < starform->T_crit) { if (tempp < starform->Temperature_threshold) {
return 1; return 1;
} else { } else {
return 0; return 0;
...@@ -326,7 +330,7 @@ INLINE static void starformation_init_backend( ...@@ -326,7 +330,7 @@ INLINE static void starformation_init_backend(
parser_get_param_double(parameter_file, "SchayeSF:thresh_MinOverDens"); parser_get_param_double(parameter_file, "SchayeSF:thresh_MinOverDens");
/* Read the critical temperature from the parameter file */ /* Read the critical temperature from the parameter file */
starform->T_crit = starform->Temperature_threshold =
parser_get_param_double(parameter_file, "SchayeSF:thresh_temp"); parser_get_param_double(parameter_file, "SchayeSF:thresh_temp");
/* Read the gas fraction from the file */ /* Read the gas fraction from the file */
...@@ -336,6 +340,8 @@ INLINE static void starformation_init_backend( ...@@ -336,6 +340,8 @@ INLINE static void starformation_init_backend(
const double normalization_MSUNpYRpKPC2 = parser_get_param_double( const double normalization_MSUNpYRpKPC2 = parser_get_param_double(
parameter_file, "SchayeSF:SchmidtLawCoeff_MSUNpYRpKPC2"); parameter_file, "SchayeSF:SchmidtLawCoeff_MSUNpYRpKPC2");
starform->KS_normalization_MSUNpYRpKPC2 = normalization_MSUNpYRpKPC2;
/* Read the Kennicutt-Schmidt power law exponent */ /* Read the Kennicutt-Schmidt power law exponent */
starform->KS_power_law = starform->KS_power_law =
parser_get_param_double(parameter_file, "SchayeSF:SchmidtLawExponent"); parser_get_param_double(parameter_file, "SchayeSF:SchmidtLawExponent");
...@@ -405,7 +411,7 @@ INLINE static void starformation_init_backend( ...@@ -405,7 +411,7 @@ INLINE static void starformation_init_backend(
* to form stars. */ * to form stars. */
/* Read the normalization of the metallicity dependent critical /* Read the normalization of the metallicity dependent critical
* density*/ * density*/
starform->den_crit = starform->density_threshold =
parser_get_param_double(parameter_file, "SchayeSF:thresh_norm_HpCM3") * parser_get_param_double(parameter_file, "SchayeSF:thresh_norm_HpCM3") *
conversion_numb_density; conversion_numb_density;
...@@ -417,7 +423,7 @@ INLINE static void starformation_init_backend( ...@@ -417,7 +423,7 @@ INLINE static void starformation_init_backend(
parser_get_param_double(parameter_file, "SchayeSF:MetDep_SFthresh_Slope"); parser_get_param_double(parameter_file, "SchayeSF:MetDep_SFthresh_Slope");
/* Read the maximum allowed density for star formation */ /* Read the maximum allowed density for star formation */
starform->den_crit_max = starform->density_threshold_max =
parser_get_param_double(parameter_file, "SchayeSF:thresh_max_norm_HpCM3"); parser_get_param_double(parameter_file, "SchayeSF:thresh_max_norm_HpCM3");
/* Claculate 1 over the metallicity */ /* Claculate 1 over the metallicity */
...@@ -425,7 +431,7 @@ INLINE static void starformation_init_backend( ...@@ -425,7 +431,7 @@ INLINE static void starformation_init_backend(
/* Calculate the prefactor that is always common */ /* Calculate the prefactor that is always common */
/* !!!DONT FORGET TO DO THE CORRECT UNIT CONVERSION!!!*/ /* !!!DONT FORGET TO DO THE CORRECT UNIT CONVERSION!!!*/
starform->den_crit_star = starform->den_crit / starform->density_threshold_star = starform->density_threshold /
pow(starform->Z0, starform->n_Z0) * pow(starform->Z0, starform->n_Z0) *
conversion_numb_density; conversion_numb_density;
} }
...@@ -442,14 +448,14 @@ INLINE static void starformation_print_backend( ...@@ -442,14 +448,14 @@ INLINE static void starformation_print_backend(
" with properties, normalization = %e, slope of the Kennicutt" " with properties, normalization = %e, slope of the Kennicutt"
"-Schmidt law = %e, gas fraction = %e, critical " "-Schmidt law = %e, gas fraction = %e, critical "
"density = %e and critical temperature = %e", "density = %e and critical temperature = %e",
starform->KS_normalization, starform->KS_power_law, starform->fgas, starform->KS_normalization_MSUNpYRpKPC2, starform->KS_power_law, starform->fgas,
starform->den_crit, starform->T_crit); starform->density_threshold, starform->Temperature_threshold);
message( message(
"Density threshold to form stars is given by Schaye " "Density threshold to form stars is given by Schaye "
"(2004), the normalization of the star formation law is given by" "(2004), the normalization of the star formation law is given by"
" %e, with metallicity slope of %e, and metallicity normalization" " %e, with metallicity slope of %e, and metallicity normalization"
"of %e", "of %e",
starform->den_crit_star, starform->n_Z0, starform->Z0); starform->density_threshold_star, starform->n_Z0, starform->Z0);
} }
#endif /* SWIFT_SCHAYE_STARFORMATION_H */ #endif /* SWIFT_SCHAYE_STARFORMATION_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment