Commit d0ad4a5b authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Update stars after rebase

parent cb40e538
......@@ -64,6 +64,7 @@
#include "task.h"
#include "timers.h"
#include "timestep.h"
#include "tracers.h"
#include "starformation.h"
#define TASK_LOOP_DENSITY 0
......@@ -496,20 +497,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
if (star_formation_convert_to_star(starform, p, xp, constants, cosmo) ) {
star_formation_copy_properties(e, c, p, xp, starform, constants, cosmo, with_cosmology);
//struct spart *sp = cell_conert_part_to_spart(c, p, ...);
//
//
//
//
// star_formation_copy_properties(p, xp, sp);
}
// MATTHIEU: Temporary star-formation law
// Do not use this at home.
//if (rho > 1.5e7 && e->step > 2) {
// message("Removing particle id=%lld rho=%e", p->id, rho);
// cell_convert_part_to_gpart(e, c, p, xp);
//}
}
}
}
......
......@@ -27,6 +27,7 @@
#include "cosmology.h"
#include "physical_constants.h"
#include "units.h"
#include "engine.h"
#include "parser.h"
#include "equation_of_state.h"
#include "part.h"
......@@ -224,11 +225,15 @@ INLINE static void star_formation_copy_properties(
sp->mass = p->mass;
sp->mass_init = p->mass;
if (with_cosmology) {
sp->age = cosmo->a;
sp->birth_time = cosmo->a;
} else {
sp->age = cosmo->a;
sp->birth_time = e->time;
}
message("Copy Properties");
sp->chemistry_data = p->chemistry_data;
//sp->tracers_data = p->tracers_data;
//sp->birth_density = p->density;
}
......@@ -329,37 +334,12 @@ INLINE static void starformation_init_backend(
"SchayeSF:T_crit");
/* Read the gas fraction from the file */
starform->fg = parser_get_param_double(parameter_file,
starform->fgas = parser_get_param_double(parameter_file,
"SchayeSF:fg");
/* Read the normalization */
const double normalization = parser_get_opt_param_double(
parameter_file, "SchayeSF:A", normalization_default);
/* Read the Kennicutt-Schmidt power law exponent */
starform->nks = parser_get_opt_param_double(
parameter_file, "SchayeSF:nks", KS_power_law_default);
/* Read the heat capacity ratio gamma */
starform->gamma = parser_get_opt_param_double(
parameter_file, "SchayeSF:gamma", gamma_default);
/* Calculate the power law of the star formation */
starform->nstar = (starform->nks - 1.f)/2.f;
/* Calculate inverse of RAND_MAX */
starform->inv_RAND_MAX = 1.f / RAND_MAX;
/* Get the appropriate constant to calculate the
* star formation constant */
const double KS_const = phys_const->const_kennicutt_schmidt_units;
/* Get the Gravitational constant */
const double G_newton = phys_const->const_newton_G;
/* Get the surface density unit M_\odot / pc^2 */
const double M_per_pc2 = phys_const->const_solar_mass_per_parsec2;
/* Calculate the SF high density normalization */
starform->SF_high_den_normalization = starform->KS_high_den_normalization
* pow(M_per_pc2, -starform->KS_high_den_power_law) * pow( hydro_gamma
......
......@@ -25,6 +25,7 @@
/* Read chemistry */
#include "chemistry_struct.h"
//#include "tracers.h"
/**
* @brief Particle fields for the star particles.
......@@ -57,8 +58,14 @@ struct spart {
/*! Initial star mass */
float mass_init;
/*! Stellar age */
float age;
/*! Birth time */
float birth_time;
/*! Birth density */
float birth_density;
/*! Tracer structure */
//struct tracers_xpart_data tracers_data;
/* Particle cutoff radius. */
float h;
......
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