Skip to content

Commit

Permalink
Merge branch 'development' into nse_neutrinos
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Nov 14, 2023
2 parents 2ff615f + 2383aa2 commit eff8960
Show file tree
Hide file tree
Showing 20 changed files with 69 additions and 41 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
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
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
10 changes: 5 additions & 5 deletions integration/nse_update_simplified_sdc.H
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ void sdc_nse_burn(BurnT& state, const Real dt) {
// the new mass fractions are just those that come from the table
// make sure they are normalized
Real sum_X{0.0_rt};
for (int n = 0; n < NumSpec; ++n) {
X[n] = amrex::max(small_x, amrex::min(1.0_rt, X[n]));
sum_X += X[n];
for (auto & xn : X) {
xn = amrex::max(small_x, amrex::min(1.0_rt, xn));
sum_X += xn;
}

for (int n = 0; n < NumSpec; ++n) {
X[n] /= sum_X;
for (auto & xn : X) {
xn /= sum_X;
}

for (int n = 0; n < NumSpec; ++n) {
Expand Down
11 changes: 7 additions & 4 deletions networks/CNO_extras/CNO_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
comp = pyna.Composition(rc.get_nuclei())
comp.set_solar_like()

rc.plot(outfile="cno_extras.png", rho=1.e6, T=1.e8, comp=comp, Z_range=[1,13], N_range=[1,13])
rc.plot(outfile="cno_extras_hide_alpha.png", rho=1.e6, T=1.e8, comp=comp, Z_range=[1,13], N_range=[1,13],
rotated=True, highlight_filter_function=lambda r: r.Q > 0,
curved_edges=True, hide_xalpha=True)
rho = 1.e6
T = 1.e8

rc.plot(rho, T, comp, outfile="cno_extras.png", Z_range=[1,13], N_range=[1,13])
rc.plot(rho, T, comp, outfile="cno_extras_hide_alpha.png", Z_range=[1,13], N_range=[1,13],
rotated=True, highlight_filter_function=lambda r: r.Q > 0,
curved_edges=True, hide_xalpha=True)
2 changes: 1 addition & 1 deletion networks/He-C-Fe-group/He-C-Fe-group.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
comp.set_all(1.0)
comp.normalize()

fig = net.plot(rho=rho, T=T, comp=comp,
fig = net.plot(rho, T, comp,
rotated=True, curved_edges=True, hide_xalpha=True,
size=(1800, 900),
node_size=500, node_shape="s", node_font_size=10)
Expand Down
4 changes: 2 additions & 2 deletions networks/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
small_x real 1.d-30

# Should we use rate tables if they are present in the network?
use_tables logical .false.
use_tables integer 0

# Should we use Deboer + 2017 rate for c12(a,g)o16?
use_c12ag_deboer17 logical .false.
use_c12ag_deboer17 integer 0
5 changes: 4 additions & 1 deletion networks/ase/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def doit():
comp.set_nuc("he4", 0.95)
comp.normalize()

net.plot(outfile="ase.png", rho=1.e7, T=6.e9, comp=comp,
rho = 1.e7
T = 6.e9

net.plot(rho, T, comp, outfile="ase.png",
rotated=True, hide_xalpha=True, curved_edges=True,
size=(1500, 450),
node_size=500, node_font_size=11, node_color="#337dff", node_shape="s",
Expand Down
5 changes: 4 additions & 1 deletion networks/nova/network_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
comp = pyna.Composition(rc.get_nuclei())
comp.set_solar_like()

rc.plot(outfile="nova.png", rho=1.e4, T=9.e7, comp=comp)
rho = 1.e4
T = 9.e7

rc.plot(rho, T, comp, outfile="nova.png")
4 changes: 3 additions & 1 deletion networks/nova/nova.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
comp = Composition(rc.get_nuclei())
comp.set_solar_like()

rc.plot(outfile="nova.png", rho=1.e4, T=9.e7, comp=comp)
rho = 1.e4
T = 9.e7

rc.plot(rho, T, comp, outfile="nova.png")
4 changes: 3 additions & 1 deletion networks/nova2/nova2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
comp = pyna.Composition(rc.get_nuclei())
comp.set_solar_like()

rc.plot(outfile="nova.png", rho=1.e4, T=9.e7, comp=comp)
rho = 1.e4
T = 9.e7

rc.plot(rho, T, comp, outfile="nova.png")
5 changes: 4 additions & 1 deletion networks/subch_approx/subch_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def doit():
comp.set_nuc("he4", 0.95)
comp.normalize()

net.plot(outfile="subch_approx.png", rho=1.e6, T=1.e9, comp=comp,
rho = 1.e6
T = 1.e9

net.plot(rho, T, comp, outfile="subch_approx.png",
rotated=True, hide_xalpha=True, curved_edges=True,
size=(1500, 450),
node_size=500, node_font_size=11, node_color="#337dff", node_shape="s",
Expand Down
5 changes: 4 additions & 1 deletion networks/subch_full/network_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
comp.set_nuc("he4", 0.95)
comp.normalize()

rc.plot(outfile="subch2.pdf", rho=1.e6, T=1.e9, comp=comp, hide_xalpha=True,
rho = 1.e6
T = 1.e9

rc.plot(rho, T, comp, outfile="subch2.pdf", hide_xalpha=True,
size=(1500, 650), node_size=500, node_font_size=11, node_color="#337dff", node_shape="s",
Z_range=(1,29), rotated=True, curved_edges=True)
5 changes: 4 additions & 1 deletion networks/subch_full/subch_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def doit():
comp.set_nuc("he4", 0.95)
comp.normalize()

rc.plot(outfile="subch_full.png", rho=1.e6, T=1.e9, comp=comp,
rho = 1.e6
T = 1.e9

rc.plot(rho, T, comp, outfile="subch_full.png",
rotated=True, hide_xalpha=True, curved_edges=True,
size=(1500, 450),
node_size=500, node_font_size=11, node_color="#337dff", node_shape="s",
Expand Down
5 changes: 4 additions & 1 deletion networks/subch_simple/subch_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def doit():
comp.set_nuc("he4", 0.95)
comp.normalize()

net.plot(outfile="subch_simple.png", rho=1.e6, T=1.e9, comp=comp,
rho = 1.e6
T = 1.e9

net.plot(rho, T, comp, outfile="subch_simple.png",
rotated=True, hide_xalpha=True, curved_edges=True,
size=(1500, 450),
node_size=500, node_font_size=11, node_color="#337dff", node_shape="s",
Expand Down
6 changes: 3 additions & 3 deletions nse_solver/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
max_nse_iters integer 500
use_hybrid_solver integer 1
ase_tol real 0.1
nse_dx_independent logical .false.
nse_molar_independent logical .false.
nse_skip_molar logical .false.
nse_dx_independent integer 0
nse_molar_independent integer 0
nse_skip_molar integer 0
T_nse_net real -1.0
4 changes: 2 additions & 2 deletions unit_test/burn_cell_sdc/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ void burn_cell_c()
state_over_time << std::setw(10) << t;
state_over_time << std::setw(12) << burn_state.rho;
state_over_time << std::setw(12) << burn_state.T;
for (int x = 0; x < NumSpec; ++x){
state_over_time << std::setw(12) << burn_state.xn[x];
for (auto X : burn_state.xn) {
state_over_time << std::setw(12) << X;
}
state_over_time << std::endl;

Expand Down
6 changes: 5 additions & 1 deletion util/build_scripts/write_probin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
max_step integer 1
small_dt real 1.d-10
xlo_boundary_type character ""
octant logical .false.
This specifies the runtime parameter name, datatype, and default
value.
Expand Down Expand Up @@ -107,6 +106,11 @@ def parse_param_file(params_list, param_file, use_namespace=False):
dtype = fields[1]
default = fields[2]

if dtype == "logical":
print("write_probin.py: ERROR: logical type no longer supported in _parameter files.")
err = 1
continue

if use_namespace:
skip_namespace_in_declare = False
else:
Expand Down

0 comments on commit eff8960

Please sign in to comment.