Skip to content

Commit

Permalink
Merge branch 'development' into ROCK4
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Nov 22, 2023
2 parents 10e65b9 + 5ab809a commit 3960c31
Show file tree
Hide file tree
Showing 106 changed files with 77,842 additions and 46,896 deletions.
2 changes: 1 addition & 1 deletion EOS/gamma_law/_parameters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace: eos

eos_gamma real 5.d0/3.d0
eos_assume_neutral logical .true.
eos_assume_neutral integer 1
4 changes: 2 additions & 2 deletions EOS/helmholtz/_parameters
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@namespace: eos

# use the Coulomb corrections
use_eos_coulomb logical .true.
use_eos_coulomb integer 1

# Force the EOS output quantities to match input
eos_input_is_constant logical .true.
eos_input_is_constant integer 1

# Tolerance for iterations with respect to temperature
eos_ttol real 1.0d-8
Expand Down
56 changes: 26 additions & 30 deletions EOS/helmholtz/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ void apply_electrons (T& state)

// hash locate this temperature and density
int jat = int((std::log10(state.T) - tlo) * tstpi) + 1;
jat = amrex::max(1, amrex::min(jat, jtmax-1)) - 1;
jat = amrex::max(1, amrex::min(jat, jmax-1)) - 1;
int iat = int((std::log10(din) - dlo) * dstpi) + 1;
iat = amrex::max(1, amrex::min(iat, itmax-1)) - 1;
iat = amrex::max(1, amrex::min(iat, imax-1)) - 1;

Real fi[36];

Expand Down Expand Up @@ -477,9 +477,9 @@ void apply_ions (T& state)
{
using namespace helmholtz;

const Real pi = 3.1415926535897932384e0_rt;
const Real sioncon = (2.0e0_rt * pi * amu * kerg)/(h*h);
const Real kergavo = kerg * avo_eos;
constexpr Real pi = 3.1415926535897932384e0_rt;
constexpr Real sioncon = (2.0e0_rt * pi * amu * kerg)/(h*h);
constexpr Real kergavo = kerg * avo_eos;

Real deni = 1.0e0_rt / state.rho;
Real tempi = 1.0e0_rt / state.T;
Expand Down Expand Up @@ -553,14 +553,14 @@ void apply_radiation (T& state)
{
using namespace helmholtz;

const Real clight = 2.99792458e10_rt;
constexpr Real clight = 2.99792458e10_rt;
#ifdef RADIATION
const Real ssol = 0.0e0_rt;
constexpr Real ssol = 0.0e0_rt;
#else
const Real ssol = 5.67051e-5_rt;
constexpr Real ssol = 5.67051e-5_rt;
#endif
const Real asol = 4.0e0_rt * ssol / clight;
const Real asoli3 = asol/3.0e0_rt;
constexpr Real asol = 4.0e0_rt * ssol / clight;
constexpr Real asoli3 = asol/3.0e0_rt;

Real deni = 1.0e0_rt / state.rho;
Real tempi = 1.0e0_rt / state.T;
Expand Down Expand Up @@ -638,19 +638,19 @@ void apply_coulomb_corrections (T& state)
using namespace helmholtz;

// Constants used for the Coulomb corrections
const Real a1 = -0.898004e0_rt;
const Real b1 = 0.96786e0_rt;
const Real c1 = 0.220703e0_rt;
const Real d1 = -0.86097e0_rt;
const Real e1 = 2.5269e0_rt;
const Real a2 = 0.29561e0_rt;
const Real b2 = 1.9885e0_rt;
const Real c2 = 0.288675e0_rt;
const Real qe = 4.8032042712e-10_rt;
const Real esqu = qe * qe;
const Real onethird = 1.0e0_rt/3.0e0_rt;
const Real forth = 4.0e0_rt/3.0e0_rt;
const Real pi = 3.1415926535897932384e0_rt;
constexpr Real a1 = -0.898004e0_rt;
constexpr Real b1 = 0.96786e0_rt;
constexpr Real c1 = 0.220703e0_rt;
constexpr Real d1 = -0.86097e0_rt;
constexpr Real e1 = 2.5269e0_rt;
constexpr Real a2 = 0.29561e0_rt;
constexpr Real b2 = 1.9885e0_rt;
constexpr Real c2 = 0.288675e0_rt;
constexpr Real qe = 4.8032042712e-10_rt;
constexpr Real esqu = qe * qe;
constexpr Real onethird = 1.0e0_rt/3.0e0_rt;
constexpr Real forth = 4.0e0_rt/3.0e0_rt;
constexpr Real pi = 3.1415926535897932384e0_rt;

[[maybe_unused]] Real pcoul = 0.e0_rt;
[[maybe_unused]] Real dpcouldd = 0.e0_rt;
Expand Down Expand Up @@ -1242,7 +1242,7 @@ void actual_eos (I input, T& state)

using namespace helmholtz;

const int max_newton = 100;
constexpr int max_newton = 100;

bool single_iter, converged;
int var{}, dvar{}, var1, var2;
Expand Down Expand Up @@ -1306,7 +1306,6 @@ void actual_eos_init ()

Real dth, dt2, dti, dt2i;
Real dd, dd2, ddi, dd2i;
Real tsav, dsav;

// Read in the runtime parameters

Expand All @@ -1316,8 +1315,6 @@ void actual_eos_init ()
dtol = eos_dtol;

// read the helmholtz free energy table
itmax = imax;
jtmax = jmax;
tlo = 3.0e0_rt;
thi = 13.0e0_rt;
tstp = (thi - tlo) / ((Real) (jmax-1));
Expand All @@ -1328,10 +1325,10 @@ void actual_eos_init ()
dstpi = 1.0e0_rt / dstp;

for (int j = 0; j < jmax; ++j) {
tsav = tlo + j * tstp;
Real tsav = tlo + j * tstp;
t[j] = std::pow(10.0e0_rt, tsav);
for (int i = 0; i < imax; ++i) {
dsav = dlo + i * dstp;
Real dsav = dlo + i * dstp;
d[i] = std::pow(10.0e0_rt, dsav);
}
}
Expand Down Expand Up @@ -1508,4 +1505,3 @@ bool is_input_valid (I input)
}

#endif

16 changes: 8 additions & 8 deletions EOS/helmholtz/actual_eos_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

namespace helmholtz
{
extern AMREX_GPU_MANAGED bool do_coulomb;
extern AMREX_GPU_MANAGED bool input_is_constant;
extern AMREX_GPU_MANAGED int do_coulomb;
extern AMREX_GPU_MANAGED int input_is_constant;

// for the tables

const int imax = 541;
const int jmax = 201;
constexpr int imax = 541;
constexpr int jmax = 201;

extern AMREX_GPU_MANAGED int itmax;
extern AMREX_GPU_MANAGED int jtmax;
Expand Down Expand Up @@ -57,10 +57,10 @@ namespace helmholtz
extern AMREX_GPU_MANAGED amrex::Real dd2i_sav[imax];

// 2006 CODATA physical constants
const amrex::Real h = 6.6260689633e-27;
const amrex::Real avo_eos = 6.0221417930e23;
const amrex::Real kerg = 1.380650424e-16;
const amrex::Real amu = 1.66053878283e-24;
constexpr amrex::Real h = 6.6260689633e-27;
constexpr amrex::Real avo_eos = 6.0221417930e23;
constexpr amrex::Real kerg = 1.380650424e-16;
constexpr amrex::Real amu = 1.66053878283e-24;
}

#endif
4 changes: 2 additions & 2 deletions EOS/helmholtz/actual_eos_data.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <actual_eos_data.H>

AMREX_GPU_MANAGED bool helmholtz::do_coulomb;
AMREX_GPU_MANAGED bool helmholtz::input_is_constant;
AMREX_GPU_MANAGED int helmholtz::do_coulomb;
AMREX_GPU_MANAGED int helmholtz::input_is_constant;

AMREX_GPU_MANAGED int helmholtz::itmax;
AMREX_GPU_MANAGED int helmholtz::jtmax;
Expand Down
1 change: 0 additions & 1 deletion Make.Microphysics
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ endif
EXTERN_PARAMETERS := $(shell $(MICROPHYSICS_HOME)/util/build_scripts/findparams.py $(EXTERN_SEARCH))


$(MICROPHYSICS_AUTO_SOURCE_DIR)/extern.F90: $(MICROPHYSICS_AUTO_SOURCE_DIR)/extern_parameters.H
$(MICROPHYSICS_AUTO_SOURCE_DIR)/extern_parameters.cpp: $(MICROPHYSICS_AUTO_SOURCE_DIR)/extern_parameters.H

$(MICROPHYSICS_AUTO_SOURCE_DIR)/extern_parameters.H: $(EXTERN_PARAMETERS) $(EXTERN_TEMPLATE)
Expand Down
5 changes: 2 additions & 3 deletions Make.Microphysics_extern
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ifeq ($(USE_NSE_TABLE),TRUE)
endif

nsetable:
@if [ ! -f nse.tbl ]; then echo Linking nse.tbl; ln -s $(NETWORK_PATH)/nse.tbl .; fi
@if [ ! -f $(NSE_TABLE_NAME) ]; then echo Linking $(NSE_TABLE_NAME); ln -s $(NETWORK_PATH)/$(NSE_TABLE_NAME) .; fi


# include the network
Expand Down Expand Up @@ -148,5 +148,4 @@ endif
clean::
@if [ -L helm_table.dat ]; then rm -f helm_table.dat; fi
@if [ -L reaclib_rate_metadata.dat ]; then rm -f reaclib_rate_metadata.dat; fi
@if [ -L nse.tbl ]; then rm -f nse.tbl; fi
$(foreach t, $(wildcard *_betadecay.dat *_electroncapture.dat), $(shell if [ -L $t ]; then rm -f $t; fi))
$(foreach t, $(wildcard *_betadecay.dat *_electroncapture.dat nse*.tbl), $(shell if [ -L $t ]; then rm -f $t; fi))
8 changes: 4 additions & 4 deletions integration/VODE/actual_integrator_simplified_sdc.H
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ void actual_integrator (BurnT& state, Real dt)
std::cout << "temp start = " << std::setprecision(16) << T_in << std::endl;
std::cout << "rhoe start = " << std::setprecision(16) << rhoe_in << std::endl;
std::cout << "xn start = ";
for (int n = 0; n < NumSpec; ++n) {
std::cout << std::setprecision(16) << xn_in[n] << " ";
for (auto X : xn_in) {
std::cout << std::setprecision(16) << X << " ";
}
std::cout << std::endl;
#ifdef AUX_THERMO
std::cout << "aux start = ";
for (int n = 0; n < NumAux; ++n) {
std::cout << std::setprecision(16) << aux_in[n] << " ";
for (auto aux : aux_in) {
std::cout << std::setprecision(16) << aux << " ";
}
std::cout << std::endl;
#endif
Expand Down
14 changes: 7 additions & 7 deletions integration/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# the current internal energy. This is done with an EOS call, which can
# be turned off if desired. This will freeze the temperature and specific heat
# to the values at the beginning of the burn, which is inaccurate but cheaper.
call_eos_in_rhs logical .true.
call_eos_in_rhs integer 1

# Allow the energy integration to be disabled by setting the RHS to zero.
integrate_energy logical .true.
integrate_energy integer 1

# Whether to use an analytical or numerical Jacobian.
# 1 == Analytical
Expand All @@ -18,7 +18,7 @@ integrate_energy logical .true.
jacobian integer 1

# Should we print out diagnostic output after the solve?
burner_verbose logical .false.
burner_verbose integer 0

# Tolerances for the solver (relative and absolute), for the
# species and energy equations.
Expand All @@ -30,7 +30,7 @@ atol_enuc real 1.d-6

# Whether to renormalize the mass fractions at each step in the evolution
# so that they sum to unity.
renormalize_abundances logical .false.
renormalize_abundances integer 0

# The absolute cutoff for species -- note that this might be larger
# than ``small_x``, but the issue is that we need to prevent underflow
Expand All @@ -51,7 +51,7 @@ ode_max_steps integer 150000
ode_max_dt real 1.d30

# Whether to use Jacobian caching in VODE
use_jacobian_caching logical .true.
use_jacobian_caching integer 1

# Inputs for generating a Nonaka Plot (TM)
nonaka_i integer 0
Expand All @@ -65,10 +65,10 @@ nonaka_file character "nonaka_plot.dat"
do_species_clip integer 1

# flag for turning on the use of number densities for all species
use_number_densities logical .false.
use_number_densities integer 0

# flag for tuning on the subtraction of internal energy
subtract_internal_energy logical .true.
subtract_internal_energy integer 1

# SDC iteration tolerance adjustment factor
sdc_burn_tol_factor real 1.d0
Expand Down
Loading

0 comments on commit 3960c31

Please sign in to comment.