From 7ea9d6824d362017609f2f35e85bfc1d7df23b86 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 28 Jun 2023 12:23:16 +0200 Subject: [PATCH 1/3] redefine gas constant and protonmass using microphysics constants --- EOS/primordial_chem/actual_eos.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EOS/primordial_chem/actual_eos.H b/EOS/primordial_chem/actual_eos.H index ec3a6dc6d5..650cb72636 100644 --- a/EOS/primordial_chem/actual_eos.H +++ b/EOS/primordial_chem/actual_eos.H @@ -139,8 +139,8 @@ void actual_eos (I input, T& state) { static_assert(std::is_same::value, "input must be either eos_input_rt or eos_input_re"); - const Real gasconstant = 8.3144725e7; - const Real protonmass = 1.672621637e-24; + const Real gasconstant = C::n_A * C::k_B; + const Real protonmass = C::m_p; // Special gamma factors Real sum_Abarinv = 0.0_rt; Real sum_gammasinv = 0.0_rt; From d7764eaf31a49726aabcaad442f0566929e32ec0 Mon Sep 17 00:00:00 2001 From: psharda Date: Wed, 28 Jun 2023 12:23:37 +0200 Subject: [PATCH 2/3] use m_u in place of 1/n_A for m_nucleon --- EOS/gamma_law/actual_eos.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EOS/gamma_law/actual_eos.H b/EOS/gamma_law/actual_eos.H index d82bf12857..1be67f41da 100644 --- a/EOS/gamma_law/actual_eos.H +++ b/EOS/gamma_law/actual_eos.H @@ -52,8 +52,8 @@ void actual_eos (I input, T& state) { static_assert(std::is_same::value, "input must be an eos_input_t"); - // Get the mass of a nucleon from Avogadro's number. - const Real m_nucleon = 1.0 / C::n_A; + // Get the mass of a nucleon from m_u. + const Real m_nucleon = C::m_u; if constexpr (has_xn::value) { if (eos_assume_neutral) { From e339ebe8b541356921ec14a33832809a42590f1b Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Wed, 5 Jul 2023 17:59:45 -0400 Subject: [PATCH 3/3] update eos_cell unit test benchmark --- .../eos_cell/ci-benchmarks/eos_gamma_law.out | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/unit_test/eos_cell/ci-benchmarks/eos_gamma_law.out b/unit_test/eos_cell/ci-benchmarks/eos_gamma_law.out index 076fc4f23c..bf346e3bde 100644 --- a/unit_test/eos_cell/ci-benchmarks/eos_gamma_law.out +++ b/unit_test/eos_cell/ci-benchmarks/eos_gamma_law.out @@ -1,24 +1,24 @@ -AMReX (22.10-75-g0a3ee1486cc3) initialized +AMReX (23.06-31-g9c256b12b89f) initialized calling the EOS on a single zone state... rho = 1000000 T = 1000000000 xn = 1 0 0 0 0 0 0 0 0 0 0 0 0 -p = 2.078615536e+22 -e = 3.117923305e+16 -h = 5.196538841e+16 -s = 315177040.1 -dpdT = 2.078615536e+13 -dpdr = 2.078615536e+16 -dedT = 31179233.05 +p = 2.078615354e+22 +e = 3.117923031e+16 +h = 5.196538385e+16 +s = 315177017.1 +dpdT = 2.078615354e+13 +dpdr = 2.078615354e+16 +dedT = 31179230.31 dedr = 0 -dhdT = 51965388.41 +dhdT = 51965383.85 dhdr = 0 -dsdT = 0.03117923305 -dsdr = -20.78615536 +dsdT = 0.03117923031 +dsdr = -20.78615354 dpde = 666666.6667 -dpdr_e = 2.078615536e+16 -cv = 31179233.05 -cp = 51965388.41 +dpdr_e = 2.078615354e+16 +cv = 31179230.31 +cp = 51965383.85 xne = 0 xnp = 0 eta = 0 @@ -28,10 +28,10 @@ mu = 4 mu_e = 2 y_e = 0.5 gam1 = 1.666666667 -cs = 186127892.2 +cs = 186127884.1 abar = 4 zbar = 2 Unused ParmParse Variables: [TOP]::unit_test.x4(nvals = 1) :: [0.0] -AMReX (22.10-75-g0a3ee1486cc3) finalized +AMReX (23.06-31-g9c256b12b89f) finalized