From 6e5189be61609c7bf932d00956365d228e84d3ed Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Mon, 17 Sep 2018 15:30:20 +0200
Subject: [PATCH] Added the primoridal abundance of Helium to the list of
 physical constants.

---
 src/physical_constants.c     | 5 +++++
 src/physical_constants.h     | 3 +++
 src/physical_constants_cgs.h | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/src/physical_constants.c b/src/physical_constants.c
index 3936d07f42..ed25ff1b2b 100644
--- a/src/physical_constants.c
+++ b/src/physical_constants.c
@@ -126,6 +126,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
   internal_const->const_T_CMB_0 =
       const_T_CMB_0_cgs /
       units_general_cgs_conversion_factor(us, dimension_temperature);
+
+  const float dimension_Yp[5] = {0, 0, 0, 0, 0}; /* [ - ] */
+  internal_const->const_primordial_He_fraction =
+      const_primordial_He_fraction_cgs /
+      units_general_cgs_conversion_factor(us, dimension_Yp);
 }
 
 /**
diff --git a/src/physical_constants.h b/src/physical_constants.h
index 16628bfd68..a1b5e9c243 100644
--- a/src/physical_constants.h
+++ b/src/physical_constants.h
@@ -93,6 +93,9 @@ struct phys_const {
 
   /*! Temperature of the CMB at present day */
   double const_T_CMB_0;
+
+  /*! Primordial Helium fraction */
+  double const_primordial_He_fraction;
 };
 
 void phys_const_init(const struct unit_system* us, struct swift_params* params,
diff --git a/src/physical_constants_cgs.h b/src/physical_constants_cgs.h
index 40eef2c992..59e36e288e 100644
--- a/src/physical_constants_cgs.h
+++ b/src/physical_constants_cgs.h
@@ -95,4 +95,7 @@ const double const_earth_mass_cgs = 5.9724e27;
 /*! Temperature of the CMB at present day [K] */
 const double const_T_CMB_0_cgs = 2.7255;
 
+/*! Primordial Helium fraction */
+const double const_primordial_He_fraction_cgs = 0.245;
+
 #endif /* SWIFT_PHYSICAL_CONSTANTS_CGS_H */
-- 
GitLab