Skip to content

Commit

Permalink
Merge branch 'development' into convert_triple_alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz authored Jul 21, 2023
2 parents 26ffd7a + 9edc7c1 commit 1281f03
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
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
8 changes: 4 additions & 4 deletions Make.Microphysics_extern
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ ifeq ($(USE_NONAKA_PLOT),TRUE)
endif

SCREEN_METHOD ?= screen5
ifeq ($(SCREEN_METHOD), screen5)
ifeq ($(SCREEN_METHOD), null)
DEFINES += -DSCREEN_METHOD=0
else ifeq ($(SCREEN_METHOD), chugunov2007)
else ifeq ($(SCREEN_METHOD), screen5)
DEFINES += -DSCREEN_METHOD=1
else ifeq ($(SCREEN_METHOD), chugunov2009)
else ifeq ($(SCREEN_METHOD), chugunov2007)
DEFINES += -DSCREEN_METHOD=2
else ifeq ($(SCREEN_METHOD), null)
else ifeq ($(SCREEN_METHOD), chugunov2009)
DEFINES += -DSCREEN_METHOD=3
else ifeq ($(SCREEN_METHOD), chabrier1998)
DEFINES += -DSCREEN_METHOD=4
Expand Down
4 changes: 2 additions & 2 deletions nse_solver/nse_solver.H
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void apply_nse_exponent(T& nse_state) {
// if we use a non-null screening method.
// Get the required terms to calculate coulomb correction term, u_c

#if SCREEN_METHOD != 3
#if SCREEN_METHOD != 0

// three unit-less constants for calculating coulomb correction term
// see Calder 2007, doi:10.1086/510709 for more detail
Expand Down Expand Up @@ -119,7 +119,7 @@ void apply_nse_exponent(T& nse_state) {
// term for calculating u_c

// if use non-null screening, calculate the coulomb correction term
#if SCREEN_METHOD != 3
#if SCREEN_METHOD != 0
gamma = std::pow(zion[n], 5.0_rt/3.0_rt) * Gamma_e;

// chemical potential for coulomb correction
Expand Down
20 changes: 10 additions & 10 deletions screening/screen.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ using namespace amrex;
using namespace integrator_rp;

#if SCREEN_METHOD == 0
const std::string screen_name = "screen5";
const std::string screen_name = "null";
#elif SCREEN_METHOD == 1
const std::string screen_name = "chugunov2007";
const std::string screen_name = "screen5";
#elif SCREEN_METHOD == 2
const std::string screen_name = "chugunov2009";
const std::string screen_name = "chugunov2007";
#elif SCREEN_METHOD == 3
const std::string screen_name = "null";
const std::string screen_name = "chugunov2009";
#elif SCREEN_METHOD == 4
const std::string screen_name = "chabrier1998";
#endif
Expand Down Expand Up @@ -977,16 +977,16 @@ void actual_screen(const plasma_state_t& state,
Real& scor, Real& scordt)
{
#if SCREEN_METHOD == 0
actual_screen5<do_T_derivatives>(state, scn_fac, scor, scordt);
#elif SCREEN_METHOD == 1
chugunov2007<do_T_derivatives>(state, scn_fac, scor, scordt);
#elif SCREEN_METHOD == 2
chugunov2009<do_T_derivatives>(state, scn_fac, scor, scordt);
#elif SCREEN_METHOD == 3
// null screening
amrex::ignore_unused(state, scn_fac);
scor = 1.0_rt;
scordt = 0.0_rt;
#elif SCREEN_METHOD == 1
actual_screen5<do_T_derivatives>(state, scn_fac, scor, scordt);
#elif SCREEN_METHOD == 2
chugunov2007<do_T_derivatives>(state, scn_fac, scor, scordt);
#elif SCREEN_METHOD == 3
chugunov2009<do_T_derivatives>(state, scn_fac, scor, scordt);
#elif SCREEN_METHOD == 4
chabrier1998<do_T_derivatives>(state, scn_fac, scor, scordt);
#endif
Expand Down
8 changes: 4 additions & 4 deletions sphinx_docs/source/screening.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ The options are:
This includes the portion in the appendix that blends in the weak
screening limit.

* ``chabrier1998``:

This implements the screening of :cite:`Chabrier_1998` as well as the quantum corrections for strong screening according to screen5. This is suggested in the appendix of :cite:`Calder_2007`. This screening is compatible with NSE calculations unlike ``screen5``, ``chugunov2007``, and ``chugunov2009``. This screening should be valid in the weak screening regime, :math:`\Gamma < 0.1`, and strong screening regime, :math:`1 \lesssim \Gamma \lesssim 160`.

* ``null`` :

This disables screening by always returning 1 for the screening
enhancement factor.

* ``chabrier1998``:

This implements the screening of :cite:`Chabrier_1998` as well as the quantum corrections for strong screening according to screen5. This is suggested in the appendix of :cite:`Calder_2007`. This screening is compatible with NSE calculations unlike ``screen5``, ``chugunov2007``, and ``chugunov2009``. This screening should be valid in the weak screening regime, :math:`\Gamma < 0.1`, and strong screening regime, :math:`1 \lesssim \Gamma \lesssim 160`.
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

0 comments on commit 1281f03

Please sign in to comment.