From af7818ed9d6e9e2e2bbc293948797215df113392 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 21 Jan 2019 16:14:11 +0800 Subject: clusters/helper: Add density_gas() function --- fg21sim/extragalactic/clusters/helper.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fg21sim/extragalactic/clusters/helper.py b/fg21sim/extragalactic/clusters/helper.py index e9fa338..ad43f32 100644 --- a/fg21sim/extragalactic/clusters/helper.py +++ b/fg21sim/extragalactic/clusters/helper.py @@ -257,6 +257,14 @@ def density_number_thermal(mass, z=0.0): return n_th +def density_gas(mass, z=0.0): + """ + Calculate the mean gas density. + Unit: [g/cm^3] + """ + return density_number_thermal(M_main, z) * AC.mu*AC.u # [g/cm^3] + + def density_energy_thermal(mass, z=0.0, configs=CONFIGS): """ Calculate the thermal energy density of the ICM. -- cgit v1.2.2