From d22c41b831054c87c01f8c43e72c187a99aa4c67 Mon Sep 17 00:00:00 2001
From: Folkert Nobels <nobels@strw.leidenuniv.nl>
Date: Wed, 23 Jan 2019 14:36:42 +0100
Subject: [PATCH] Make the pressure floor consistent with the pressure floor

---
 src/starformation/schaye08/starformation.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/starformation/schaye08/starformation.h b/src/starformation/schaye08/starformation.h
index 6def6504a9..8eaa9bbf01 100644
--- a/src/starformation/schaye08/starformation.h
+++ b/src/starformation/schaye08/starformation.h
@@ -418,10 +418,16 @@ INLINE static void starformation_init_backend(
   starform->EOS_density_norm =
       starform->EOS_density_norm_HpCM3 * conversion_numb_density;
 
+  /* Initial Hydrogen abundance (mass fraction) */
+  const double X_H = hydro_props->hydrogen_mass_fraction;
+
+  /* We assume neutral gas */
+  const float mean_molecular_weight = hydro_props->mu_neutral;
+
   /* Calculate the EOS pressure normalization */
   starform->EOS_pressure_norm = starform->EOS_density_norm *
                                 starform->EOS_temperature_norm *
-                                phys_const->const_boltzmann_k;
+                                phys_const->const_boltzmann_k / mean_molecular_weight / X_H;
 
   const double EOS_high_den_pressure =
       starform->EOS_pressure_norm *
-- 
GitLab