From 41436dcbe2b9689df7fa6fd67c3dab88fb19b60e Mon Sep 17 00:00:00 2001
From: Loic Hausammann <loic_hausammann@hotmail.com>
Date: Thu, 2 Apr 2020 09:56:09 +0200
Subject: [PATCH] GEAR: remove sigma in SFR

---
 src/pressure_floor/GEAR/pressure_floor.h | 4 ++--
 src/star_formation/GEAR/star_formation.h | 8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/pressure_floor/GEAR/pressure_floor.h b/src/pressure_floor/GEAR/pressure_floor.h
index 26862e71c8..10fd38f32e 100644
--- a/src/pressure_floor/GEAR/pressure_floor.h
+++ b/src/pressure_floor/GEAR/pressure_floor.h
@@ -103,8 +103,8 @@ pressure_floor_get_comoving_pressure(const struct part* p,
 
   /* Compute the pressure floor */
   float floor = kernel_gamma * kernel_gamma * p->h * p->h * rho *
-                pressure_floor_props.constants;
-  floor -= p->pressure_floor_data.sigma2 * cosmo->a * cosmo->a;
+                pressure_floor_props.constants * cosmo->a_inv;
+  floor -= p->pressure_floor_data.sigma2;
   floor *= a_coef * rho * hydro_one_over_gamma;
 
   return fmaxf(pressure_comoving, floor);
diff --git a/src/star_formation/GEAR/star_formation.h b/src/star_formation/GEAR/star_formation.h
index 251d1335d9..d53f828a34 100644
--- a/src/star_formation/GEAR/star_formation.h
+++ b/src/star_formation/GEAR/star_formation.h
@@ -75,11 +75,10 @@ INLINE static int star_formation_is_star_forming(
   }
 
   /* Get the required variables */
-  const float sigma2 = p->pressure_floor_data.sigma2 * cosmo->a * cosmo->a;
+  const float density = hydro_get_physical_density(p, cosmo);
   const float n_jeans_2_3 = starform->n_jeans_2_3;
 
   const float h = p->h * kernel_gamma * cosmo->a;
-  const float density = hydro_get_physical_density(p, cosmo);
 
   // TODO use GRACKLE */
   const float mu = hydro_props->mu_neutral;
@@ -88,9 +87,8 @@ INLINE static int star_formation_is_star_forming(
   const float coef =
       M_PI_4 / (phys_const->const_newton_G * n_jeans_2_3 * h * h);
   const float density_criterion =
-      coef * (hydro_gamma * phys_const->const_boltzmann_k * temperature /
-              (mu * phys_const->const_proton_mass) +
-              sigma2);
+      coef * hydro_gamma * phys_const->const_boltzmann_k * temperature /
+    (mu * phys_const->const_proton_mass);
 
   /* Check the density criterion */
   return density > density_criterion;
-- 
GitLab