Skip to content
Snippets Groups Projects
Commit bc822c3f authored by Loic Hausammann's avatar Loic Hausammann
Browse files

GEAR: implement correctly cosmology

parent b6dfbb37
No related branches found
No related tags found
1 merge request!885Gear merge pressure floor and GEAR star formation
...@@ -53,11 +53,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_pressure_floor( ...@@ -53,11 +53,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_pressure_floor(
/* Delta v */ /* Delta v */
float dv[3] = {pi->v[0] - pj->v[0], pi->v[1] - pj->v[1], pi->v[2] - pj->v[2]}; float dv[3] = {pi->v[0] - pj->v[0], pi->v[1] - pj->v[1], pi->v[2] - pj->v[2]};
/* Norms at power 2 */ /* Norms */
const float norm_v2 = dv[0] * dv[0] + dv[1] * dv[1] + dv[2] * dv[2]; const float norm_v2 = dv[0] * dv[0] + dv[1] * dv[1] + dv[2] * dv[2];
const float norm_v = sqrtf(norm_v2);
const float r = sqrtf(r2);
/* Compute the velocity dispersion */ /* Compute the velocity dispersion */
const float sigma2 = norm_v2 + H * r2; const float sigma2 = norm_v2 + H * H * r2 + 2 * H * r * norm_v;
/* Compute the velocity dispersion */ /* Compute the velocity dispersion */
pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj); pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj);
......
...@@ -70,7 +70,7 @@ INLINE static int star_formation_is_star_forming( ...@@ -70,7 +70,7 @@ INLINE static int star_formation_is_star_forming(
} }
/* Get the required variables */ /* Get the required variables */
const float sigma2 = p->pressure_floor_data.sigma2; const float sigma2 = p->pressure_floor_data.sigma2 * cosmo->a * cosmo->a;
const float n_jeans_2_3 = starform->n_jeans_2_3; const float n_jeans_2_3 = starform->n_jeans_2_3;
const float h = p->h; const float h = p->h;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment