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

Add additional arguments to the star formation function such that we can use...

Add additional arguments to the star formation function such that we can use the function cooling_get_temperature()
parent 230d304b
Branches
Tags
1 merge request!705Star formation following Schaye08
......@@ -472,6 +472,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
struct part *restrict parts = c->hydro.parts;
struct xpart *restrict xparts = c->hydro.xparts;
const int with_cosmology = (e->policy & engine_policy_cosmology);
const struct hydro_props *restrict hydro_props = e->hydro_properties;
const struct unit_system *restrict us = e->internal_units;
struct cooling_function_data *restrict cooling = e->cooling_func;
TIMER_TIC;
......@@ -494,7 +497,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
if (part_is_active(p, e)) {
//const float rho = hydro_get_physical_density(p, cosmo);
if (star_formation_convert_to_star(starform, p, xp, constants, cosmo) ) {
if (star_formation_convert_to_star(starform, p, xp, constants, cosmo, hydro_props, us, cooling) ) {
star_formation_copy_properties(e, c, p, xp, starform, constants, cosmo, with_cosmology);
//struct spart *sp = cell_conert_part_to_spart(c, p, ...);
}
......
......@@ -124,7 +124,9 @@ struct star_formation {
INLINE static int star_formation_potential_to_become_star(
const struct star_formation* starform, const struct part* restrict p,
const struct xpart* restrict xp, const struct phys_const* const phys_const,
const struct cosmology* cosmo){
const struct cosmology* cosmo, const struct hydro_props *restrict hydro_props,
const struct unit_system *restrict us,
const struct cooling_function_data *restrict cooling){
/* Read the critical overdensity factor and the critical density of
* the universe to determine the critical density to form stars*/
......@@ -192,9 +194,11 @@ INLINE static int star_formation_potential_to_become_star(
INLINE static int star_formation_convert_to_star(
const struct star_formation* starform, const struct part* restrict p,
const struct xpart* restrict xp, const struct phys_const* const phys_const,
const struct cosmology* cosmo) {
const struct cosmology* cosmo, const struct hydro_props *restrict hydro_props,
const struct unit_system *restrict us,
const struct cooling_function_data *restrict cooling) {
if (star_formation_potential_to_become_star(starform, p, xp, phys_const, cosmo)){
if (star_formation_potential_to_become_star(starform, p, xp, phys_const, cosmo, hydro_props, us, cooling)){
/* Get the pressure */
const double pressure = starform->EOS_pressure_norm
* pow(p->rho/starform->EOS_den0, starform->polytropic_index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment