Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use amu instead of 1/n_A for m_nucleon in gamma_law #1240

Merged
merged 11 commits into from
Jul 21, 2023
4 changes: 2 additions & 2 deletions EOS/gamma_law/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void actual_eos (I input, T& state)
{
static_assert(std::is_same<I, eos_input_t>::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<T>::value) {
if (eos_assume_neutral) {
Expand Down
4 changes: 2 additions & 2 deletions EOS/primordial_chem/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ void actual_eos (I input, T& state)
{
static_assert(std::is_same<I, eos_input_t>::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;
Expand Down
32 changes: 16 additions & 16 deletions unit_test/eos_cell/ci-benchmarks/eos_gamma_law.out
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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