From 3d9f2c1a77b1808faa54fa8a7c7e66a5a4d9b56f Mon Sep 17 00:00:00 2001 From: Michael Buehlmann Date: Mon, 24 Aug 2020 16:11:19 -0500 Subject: [PATCH] fix mass/velocity units for HACC --- src/plugins/output_genericio.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/output_genericio.cc b/src/plugins/output_genericio.cc index fe58dd4..de0a450 100644 --- a/src/plugins/output_genericio.cc +++ b/src/plugins/output_genericio.cc @@ -25,7 +25,7 @@ public: { real_t astart = 1.0 / (1.0 + cf_.get_value("setup", "zstart")); lunit_ = cf_.get_value("setup", "BoxLength"); - vunit_ = lunit_; + vunit_ = lunit_/astart; hacc_hydro_ = cf_.get_value_safe("output", "GenericIO_HACCHydro", false); // initial smoothing length is mean particle seperation hh_value_ = lunit_ / cf_.get_value("setup", "GridRes"); @@ -33,7 +33,7 @@ public: const float primordial_x = 0.75; mu_value_ = 4.0 / (1.0 + 3.0*primordial_x); - double rhoc = 27.7519737; // in h^2 1e10 M_sol / Mpc^3 + double rhoc = 27.7519737 * 1e10; // in h^2 M_sol / Mpc^3 rho_value_ = cf_.get_value("cosmology", "Omega_b") * rhoc; munit_ = rhoc * std::pow(cf_.get_value("setup", "BoxLength"), 3); }