diff --git a/src/pressure_floor/GEAR/pressure_floor_iact.h b/src/pressure_floor/GEAR/pressure_floor_iact.h index ff4dfc3b3a661b8b5258f671ebd420ef90dad120..1ecf8c29ea34089ab0e62e3bf6114d018bfecac3 100644 --- a/src/pressure_floor/GEAR/pressure_floor_iact.h +++ b/src/pressure_floor/GEAR/pressure_floor_iact.h @@ -53,11 +53,13 @@ __attribute__((always_inline)) INLINE static void runner_iact_pressure_floor( /* Delta v */ 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_v = sqrtf(norm_v2); + const float r = sqrtf(r2); /* 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 */ pi->pressure_floor_data.sigma2 += sigma2 * wi * hydro_get_mass(pj); diff --git a/src/star_formation/GEAR/star_formation.h b/src/star_formation/GEAR/star_formation.h index 499594b937d63cd472acd340f181cad25601fc5c..5fc3380fe6869bd5bcb9435fb0c129ac6fc0aad2 100644 --- a/src/star_formation/GEAR/star_formation.h +++ b/src/star_formation/GEAR/star_formation.h @@ -70,7 +70,7 @@ INLINE static int star_formation_is_star_forming( } /* 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 h = p->h;