Skip to content

Commit 72a663f

Browse files
committed
Merge branch 'development' into nse_check_update
2 parents 562454a + d9b6774 commit 72a663f

File tree

4 files changed

+53
-59
lines changed

4 files changed

+53
-59
lines changed

nse_solver/nse_compatibility/ci-benchmarks/nse_net_integration_unit_test.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Initializing AMReX (26.01-26-g667b7362c88c)...
2-
AMReX (26.01-26-g667b7362c88c) initialized
1+
Initializing AMReX (26.01-40-gbac24575699e)...
2+
AMReX (26.01-40-gbac24575699e) initialized
33
starting the single zone burn...
44
reading in network electron-capture / beta-decay tables...
55
------------------------------------
@@ -11,11 +11,11 @@ reading in network electron-capture / beta-decay tables...
1111
------------------------------------
1212
Element Burn Xs NSE Xs abs err rel err
1313
H1 5.38909747e-02 5.38909747e-02 6.52256027e-16 1.21032516e-14
14-
He4 5.17680679e-01 5.17680679e-01 3.01425551e-13 5.82261543e-13
14+
He4 5.17680679e-01 5.17680679e-01 3.01314529e-13 5.82047082e-13
1515
C12 1.31566442e-05 1.31566442e-05 2.80655897e-17 2.13318756e-12
1616
N13 2.54374035e-09 2.54374035e-09 3.71734967e-21 1.46137151e-12
1717
O16 3.19225352e-05 3.19225352e-05 3.83333231e-17 1.20082327e-12
18-
F17 1.49115081e-09 1.49115081e-09 5.86884645e-22 3.93578331e-13
18+
F17 1.49115081e-09 1.49115081e-09 5.87298235e-22 3.93855694e-13
1919
Ne20 7.33589878e-07 7.33589878e-07 2.50912335e-18 3.42033529e-12
2020
Na23 3.67457204e-08 3.67457204e-08 1.62928111e-19 4.43393432e-12
2121
Mg24 1.00775502e-04 1.00775502e-04 7.83417385e-16 7.77388718e-12
@@ -30,4 +30,4 @@ Element Burn Xs NSE Xs abs err rel er
3030
Fe52 5.86021446e-02 5.86021446e-02 4.66057748e-13 7.95291283e-12
3131
Ni56 2.30043480e-01 2.30043480e-01 1.34600664e-12 5.85109667e-12
3232
------------------------------------
33-
AMReX (26.01-26-g667b7362c88c) finalized
33+
AMReX (26.01-40-gbac24575699e) finalized

nse_solver/nse_eqns.H

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#include <AMReX_REAL.H>
55
#include <AMReX_Algorithm.H>
66
#include <extern_parameters.H>
7+
#include <actual_network.H>
8+
#include <partition_functions.H>
79

810
///
911
/// This file contains routines needed to solve:
@@ -35,12 +37,11 @@ T get_T_independent_nse_state(const T& state) {
3537
constexpr amrex::Real kBGK_2PiHbar2 = (C::k_B * 1.0e9_rt) / (2.0_rt * M_PI * C::hbar * C::hbar);
3638
const amrex::Real rho_inv = 1.0_rt / state.rho;
3739

38-
amrex::constexpr_for<0, NumSpec>([&] (auto n)
39-
{
40+
for (int n = 0; n < NumSpec; ++n) {
4041
// Absorb mion into kBGK_2PiHbar2 to prevent underflow at compile time.
41-
nse_state.xn[n] = network::mion<n+1>() * get_spin_state<n+1>() *
42-
gcem::sqrt(amrex::Math::powi<3>(network::mion<n+1>() * kBGK_2PiHbar2)) * rho_inv;
43-
});
42+
nse_state.xn[n] = network::mion(n+1) * get_spin_state(n+1) *
43+
std::sqrt(amrex::Math::powi<3>(network::mion(n+1) * kBGK_2PiHbar2)) * rho_inv;
44+
}
4445

4546
return nse_state;
4647
}
@@ -74,18 +75,11 @@ void compute_coulomb_contribution(amrex::Array1D<amrex::Real, 1, NumSpec>& u_c,
7475
C::q_e * C::q_e * gcem::pow(4.0_rt * M_PI / 3.0_rt, 1.0_rt / 3.0_rt) / (C::k_B * 1.0e9_rt);
7576
const amrex::Real Gamma_e = gamma_e_constants * std::cbrt(n_e) * T9i;
7677

77-
// Precompute Z^{5/3}
78-
amrex::Array1D<amrex::Real, 1, NumSpec> Z_53;
79-
amrex::constexpr_for<1, NumSpec+1>([&] (auto n)
80-
{
81-
Z_53(n) = gcem::pow(NetworkProperties::zion(n), 5.0_rt / 3.0_rt);
82-
});
83-
8478
for (int n = 1; n <= NumSpec; ++n) {
8579

8680
// term for calculating u_c
87-
88-
amrex::Real Gamma = Z_53(n) * Gamma_e;
81+
amrex::Real Z_53 = amrex::Math::powi<5>(std::cbrt(NetworkProperties::zion(n)));
82+
amrex::Real Gamma = Z_53 * Gamma_e;
8983

9084
// chemical potential for coulomb correction
9185
// see appendix of Calder 2007, doi:10.1086/510709 for more detail

unit_test/nse_net_cell/ci-benchmarks/nse_net_unit_test.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Initializing AMReX (26.01-26-g667b7362c88c)...
2-
AMReX (26.01-26-g667b7362c88c) initialized
1+
Initializing AMReX (26.01-40-gbac24575699e)...
2+
AMReX (26.01-40-gbac24575699e) initialized
33
starting the single zone burn...
44
reading in network electron-capture / beta-decay tables...
55
chemical potential of proton is -3
@@ -32,14 +32,14 @@ Using nse.solve_nse_e_mode == 1 :
3232
change in T: 6000000000 6069144727
3333
change in abar: 7.026880148 6.26238884
3434
recovered energy: 2.784234255e+18 2.784234255e+18
35-
Constraint Eqns using solved input are: 2.861599846e-14 1.221245327e-15 -1.998401444e-15
35+
Constraint Eqns using solved input are: 6.175615574e-14 2.997602166e-15 1.33226763e-15
3636
Constraint Jacobian using solved input are: 19.70206532 19.80498652 3.069602949 9.82702147 9.875043853 1.533907452 0.2616834419 0.2616834419 0.7450188201
3737
-----------------------------------------------
3838
Using nse.solve_nse_e_mode == 2 :
3939
change in T: 6000000000 6069144727
4040
change in abar: 7.026880148 6.26238884
4141
recovered energy: 2.784234255e+18 2.784234255e+18
42-
Constraint Eqns using solved input are: -6.303013667e-13 -2.770006446e-14 -3.76254583e-13
42+
Constraint Eqns using solved input are: -7.35966843e-13 -3.319566844e-14 -4.042322033e-13
4343
Constraint Jacobian using solved input are: 19.70206532 19.80498652 3.069602949 9.82702147 9.875043853 1.533907452 0.2616834419 0.2616834419 0.7450188201
4444
-----------------------------------------------
45-
AMReX (26.01-26-g667b7362c88c) finalized
45+
AMReX (26.01-40-gbac24575699e) finalized

0 commit comments

Comments
 (0)