diff --git a/networks/ignition_reaclib/URCA-simple/actual_network.H b/networks/ignition_reaclib/URCA-simple/actual_network.H index e3c8577cab..f83ed5f7ff 100644 --- a/networks/ignition_reaclib/URCA-simple/actual_network.H +++ b/networks/ignition_reaclib/URCA-simple/actual_network.H @@ -28,19 +28,20 @@ namespace Rates k_C12_C12_to_n_Mg23 = 2, k_C12_C12_to_p_Na23 = 3, k_He4_C12_to_O16 = 4, - k_n_to_p_weak_wc12 = 5, - k_Na23_to_Ne23 = 6, - k_Ne23_to_Na23 = 7, - NumRates = k_Ne23_to_Na23 + k_Na23_to_Ne23 = 5, + k_Ne23_to_Na23 = 6, + k_n_to_p = 7, + k_p_to_n = 8, + NumRates = k_p_to_n }; // number of reaclib rates - const int NrateReaclib = 5; + const int NrateReaclib = 4; // number of tabular rates - const int NrateTabular = 2; + const int NrateTabular = 4; // rate names -- note: the rates are 1-based, not zero-based, so we pad // this vector with rate_names[0] = "" so the indices line up with the @@ -52,9 +53,10 @@ namespace Rates "C12_C12_to_n_Mg23", // 2, "C12_C12_to_p_Na23", // 3, "He4_C12_to_O16", // 4, - "n_to_p_weak_wc12", // 5, - "Na23_to_Ne23", // 6, - "Ne23_to_Na23" // 7, + "Na23_to_Ne23", // 5, + "Ne23_to_Na23", // 6, + "n_to_p", // 7, + "p_to_n" // 8, }; } diff --git a/networks/ignition_reaclib/URCA-simple/actual_network_data.cpp b/networks/ignition_reaclib/URCA-simple/actual_network_data.cpp index 4a7e7368ae..39fcc09e09 100644 --- a/networks/ignition_reaclib/URCA-simple/actual_network_data.cpp +++ b/networks/ignition_reaclib/URCA-simple/actual_network_data.cpp @@ -15,9 +15,10 @@ namespace NSE_INDEX -1, 3, 3, -1, 0, 8, -1, -1, 3, 3, -1, 1, 7, -1, -1, 2, 3, -1, -1, 4, -1, - -1, -1, 0, -1, -1, 1, -1, -1, -1, 7, -1, -1, 6, -1, - -1, -1, 6, -1, -1, 7, 6 + -1, -1, 6, -1, -1, 7, 5, + -1, -1, 0, -1, -1, 1, -1, + -1, -1, 1, -1, -1, 0, -1 }; } #endif diff --git a/networks/ignition_reaclib/URCA-simple/actual_rhs.H b/networks/ignition_reaclib/URCA-simple/actual_rhs.H index 97f78124f3..a5768da770 100644 --- a/networks/ignition_reaclib/URCA-simple/actual_rhs.H +++ b/networks/ignition_reaclib/URCA-simple/actual_rhs.H @@ -151,6 +151,22 @@ void evaluate_rates(const burn_t& state, T& rate_eval) { } rate_eval.enuc_weak += C::Legacy::n_A * Y(Ne23) * (edot_nu + edot_gamma); + tabular_evaluate(j_n_p_meta, j_n_p_rhoy, j_n_p_temp, j_n_p_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_n_to_p) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_n_to_p) = drate_dt; + } + rate_eval.enuc_weak += C::Legacy::n_A * Y(N) * (edot_nu + edot_gamma); + + tabular_evaluate(j_p_n_meta, j_p_n_rhoy, j_p_n_temp, j_p_n_data, + rhoy, state.T, rate, drate_dt, edot_nu, edot_gamma); + rate_eval.screened_rates(k_p_to_n) = rate; + if constexpr (std::is_same::value) { + rate_eval.dscreened_rates_dT(k_p_to_n) = drate_dt; + } + rate_eval.enuc_weak += C::Legacy::n_A * Y(H1) * (edot_nu + edot_gamma); + } @@ -163,12 +179,14 @@ void rhs_nuc(const burn_t& state, using namespace Rates; ydot_nuc(N) = - -screened_rates(k_n_to_p_weak_wc12)*Y(N) + + -screened_rates(k_n_to_p)*Y(N) + + screened_rates(k_p_to_n)*Y(H1) + 0.5*screened_rates(k_C12_C12_to_n_Mg23)*std::pow(Y(C12), 2)*state.rho; ydot_nuc(H1) = 0.5*screened_rates(k_C12_C12_to_p_Na23)*std::pow(Y(C12), 2)*state.rho + - screened_rates(k_n_to_p_weak_wc12)*Y(N); + screened_rates(k_n_to_p)*Y(N) + + -screened_rates(k_p_to_n)*Y(H1); ydot_nuc(He4) = 0.5*screened_rates(k_C12_C12_to_He4_Ne20)*std::pow(Y(C12), 2)*state.rho + @@ -254,15 +272,21 @@ void jac_nuc(const burn_t& state, Real scratch; - scratch = -screened_rates(k_n_to_p_weak_wc12); + scratch = -screened_rates(k_n_to_p); jac.set(N, N, scratch); + scratch = screened_rates(k_p_to_n); + jac.set(N, H1, scratch); + scratch = 1.0*screened_rates(k_C12_C12_to_n_Mg23)*Y(C12)*state.rho; jac.set(N, C12, scratch); - scratch = screened_rates(k_n_to_p_weak_wc12); + scratch = screened_rates(k_n_to_p); jac.set(H1, N, scratch); + scratch = -screened_rates(k_p_to_n); + jac.set(H1, H1, scratch); + scratch = 1.0*screened_rates(k_C12_C12_to_p_Na23)*Y(C12)*state.rho; jac.set(H1, C12, scratch); diff --git a/networks/ignition_reaclib/URCA-simple/n-p_betadecay.dat b/networks/ignition_reaclib/URCA-simple/n-p_betadecay.dat new file mode 100644 index 0000000000..31ddea3b8d --- /dev/null +++ b/networks/ignition_reaclib/URCA-simple/n-p_betadecay.dat @@ -0,0 +1,148 @@ +!n -> p, beta-decay +!Q=-1.2933 MeV +! +!Log(rhoY) Log(temp) mu dQ VS Log(beta-decay-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -2.958959 -9.072290e+00 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -2.957841 -9.067290e+00 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -2.941107 -8.997290e+00 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -2.874417 -8.765290e+00 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -2.540055 -8.086290e+00 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -1.720786 -7.027290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -0.414110 -5.490290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.802004 -2.852290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -2.958984 -9.072290e+00 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -2.957898 -9.067290e+00 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -2.941192 -8.997290e+00 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -2.874417 -8.765290e+00 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -2.540055 -8.086290e+00 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -1.720786 -7.027290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -0.414110 -5.490290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.802004 -2.852290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -2.959000 -9.072290e+00 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -2.958998 -9.072290e+00 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -2.958314 -9.069290e+00 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -2.941776 -9.000290e+00 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -2.874975 -8.767290e+00 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -2.540055 -8.087290e+00 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -1.721736 -7.027290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -0.414110 -5.490290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.802004 -2.852290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -2.961000 -9.076290e+00 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -2.961000 -9.075290e+00 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -2.961000 -9.075290e+00 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -2.961000 -9.075290e+00 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -2.960000 -9.074290e+00 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -2.959896 -9.073290e+00 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -2.947722 -9.020290e+00 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -2.881381 -8.783290e+00 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -2.544233 -8.091290e+00 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -1.721736 -7.028290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -0.414110 -5.491290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.802004 -2.852290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -2.980000 -9.105290e+00 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -2.979000 -9.104290e+00 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -2.979000 -9.103290e+00 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -2.978000 -9.100290e+00 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -2.975000 -9.096290e+00 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -2.972990 -9.092290e+00 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -2.967462 -9.076290e+00 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -2.925218 -8.906290e+00 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -2.577269 -8.139290e+00 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -1.729383 -7.036290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -0.415108 -5.491290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.802004 -2.852290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -3.140000 -9.345290e+00 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -3.140000 -9.343290e+00 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -3.138000 -9.340290e+00 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -3.131000 -9.325290e+00 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -3.116000 -9.295290e+00 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -3.097999 -9.262290e+00 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -3.069766 -9.215290e+00 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -3.041782 -9.153290e+00 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -2.813017 -8.512290e+00 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -1.806664 -7.116290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -0.423096 -5.500290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.801004 -2.852290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -5.499000 -1.257129e+01 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -5.442000 -1.246129e+01 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -5.306000 -1.221829e+01 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -4.989000 -1.170729e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -4.592000 -1.112229e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -4.297000 -1.071129e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -3.954978 -1.025629e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.726186 -9.962290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -3.408689 -9.420290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.366458 -7.714290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.508967 -5.587290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.798004 -2.855290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.347000 1.987104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -65.570000 -7.295929e+01 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -35.616000 -4.271029e+01 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -20.209000 -2.701829e+01 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -13.299000 -1.988929e+01 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -10.394000 -1.685929e+01 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -8.019984 -1.436829e+01 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -6.772438 -1.305429e+01 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -5.436532 -1.153729e+01 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -3.791028 -9.205290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -1.150873 -6.234290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.768005 -2.886290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.346000 1.977104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 -54.663000 -6.147129e+01 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 -33.000000 -3.959029e+01 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 -24.198000 -3.066429e+01 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 -17.245984 -2.359429e+01 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 -13.715440 -1.999829e+01 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 -10.109646 -1.621129e+01 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 -6.677964 -1.209729e+01 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 -2.765936 -7.852290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 1.478006 -3.179290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.338000 1.897104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 -75.759000 -8.234929e+01 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 -54.136000 -6.060229e+01 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 -37.214984 -4.356329e+01 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 -28.703440 -3.498629e+01 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 -20.122703 -2.622429e+01 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 -12.726964 -1.814629e+01 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 -5.885901 -1.097129e+01 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 0.277010 -4.383290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.255000 1.057104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 -80.281984 -8.663029e+01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 -61.008440 -6.729129e+01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 -41.669646 -4.777129e+01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 -25.673964 -3.109329e+01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 -12.403901 -1.748929e+01 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 -2.049990 -6.710290e+00 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 3.625000 -5.272896e-01 -100.00 diff --git a/networks/ignition_reaclib/URCA-simple/p-n_electroncapture.dat b/networks/ignition_reaclib/URCA-simple/p-n_electroncapture.dat new file mode 100644 index 0000000000..21f333657d --- /dev/null +++ b/networks/ignition_reaclib/URCA-simple/p-n_electroncapture.dat @@ -0,0 +1,148 @@ +!p -> n, e- capture +!Q=1.2933 MeV +! +!Log(rhoY) Log(temp) mu dQ Vs Log(e-cap-rate) Log(nu-energy-loss) Log(gamma-energy) +!Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) +1.000000 7.000000 -4.806530e-09 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +1.000000 8.000000 -9.292624e-08 0.00 0.00 -49.750000 -5.712729e+01 -100.00 +1.000000 8.301030 -2.146917e-07 0.00 0.00 -29.580000 -3.665029e+01 -100.00 +1.000000 8.602060 -4.902661e-07 0.00 0.00 -19.262000 -2.602029e+01 -100.00 +1.000000 8.845098 -8.058948e-07 0.00 0.00 -14.019000 -2.051929e+01 -100.00 +1.000000 9.000000 -8.187123e-07 0.00 0.00 -10.766000 -1.709829e+01 -100.00 +1.000000 9.176091 -8.187123e-07 0.00 0.00 -7.990000 -1.412829e+01 -100.00 +1.000000 9.301030 -8.187123e-07 0.00 0.00 -6.458000 -1.245629e+01 -100.00 +1.000000 9.477121 -8.187123e-07 0.00 0.00 -4.715000 -1.051429e+01 -100.00 +1.000000 9.698970 -8.187123e-07 0.00 0.00 -2.968000 -8.516290e+00 -100.00 +1.000000 10.000000 -8.187123e-07 0.00 0.00 -1.035000 -6.245290e+00 -100.00 +1.000000 10.477121 -8.187123e-07 0.00 0.00 1.600000 -3.099290e+00 -100.00 +1.000000 11.000000 -8.187123e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +2.000000 7.000000 -1.602177e-09 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +2.000000 8.000000 -6.088271e-08 0.00 0.00 -48.749000 -5.612529e+01 -100.00 +2.000000 8.301030 -1.522068e-07 0.00 0.00 -28.580000 -3.564929e+01 -100.00 +2.000000 8.602060 -3.636941e-07 0.00 0.00 -18.262000 -2.502029e+01 -100.00 +2.000000 8.845098 -7.145708e-07 0.00 0.00 -13.606000 -2.010629e+01 -100.00 +2.000000 9.000000 -8.107014e-07 0.00 0.00 -10.744000 -1.707729e+01 -100.00 +2.000000 9.176091 -8.187123e-07 0.00 0.00 -7.989000 -1.412729e+01 -100.00 +2.000000 9.301030 -8.187123e-07 0.00 0.00 -6.458000 -1.245629e+01 -100.00 +2.000000 9.477121 -8.187123e-07 0.00 0.00 -4.715000 -1.051429e+01 -100.00 +2.000000 9.698970 -8.187123e-07 0.00 0.00 -2.968000 -8.516290e+00 -100.00 +2.000000 10.000000 -8.187123e-07 0.00 0.00 -1.035000 -6.245290e+00 -100.00 +2.000000 10.477121 -8.187123e-07 0.00 0.00 1.600000 -3.099290e+00 -100.00 +2.000000 11.000000 -8.187123e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +3.000000 7.000000 3.204353e-09 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +3.000000 8.000000 -2.883918e-08 0.00 0.00 -47.732000 -5.510929e+01 -100.00 +3.000000 8.301030 -8.811971e-08 0.00 0.00 -27.574000 -3.464429e+01 -100.00 +3.000000 8.602060 -2.355200e-07 0.00 0.00 -17.260000 -2.401829e+01 -100.00 +3.000000 8.845098 -5.030835e-07 0.00 0.00 -12.658000 -1.915829e+01 -100.00 +3.000000 9.000000 -7.450121e-07 0.00 0.00 -10.538000 -1.687029e+01 -100.00 +3.000000 9.176091 -8.107014e-07 0.00 0.00 -7.974000 -1.411229e+01 -100.00 +3.000000 9.301030 -8.171101e-07 0.00 0.00 -6.454000 -1.245329e+01 -100.00 +3.000000 9.477121 -8.187123e-07 0.00 0.00 -4.714000 -1.051429e+01 -100.00 +3.000000 9.698970 -8.187123e-07 0.00 0.00 -2.968000 -8.515290e+00 -100.00 +3.000000 10.000000 -8.187123e-07 0.00 0.00 -1.035000 -6.245290e+00 -100.00 +3.000000 10.477121 -8.187123e-07 0.00 0.00 1.600000 -3.099290e+00 -100.00 +3.000000 11.000000 -8.187123e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +4.000000 7.000000 1.922612e-08 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +4.000000 8.000000 8.010883e-09 0.00 0.00 -46.572000 -5.394829e+01 -100.00 +4.000000 8.301030 -2.082830e-08 0.00 0.00 -26.519000 -3.358929e+01 -100.00 +4.000000 8.602060 -1.073458e-07 0.00 0.00 -16.243000 -2.300029e+01 -100.00 +4.000000 8.845098 -2.787787e-07 0.00 0.00 -11.652000 -1.815229e+01 -100.00 +4.000000 9.000000 -4.838573e-07 0.00 0.00 -9.716000 -1.604929e+01 -100.00 +4.000000 9.176091 -7.434100e-07 0.00 0.00 -7.833000 -1.397129e+01 -100.00 +4.000000 9.301030 -7.962818e-07 0.00 0.00 -6.423000 -1.242129e+01 -100.00 +4.000000 9.477121 -8.123036e-07 0.00 0.00 -4.709000 -1.050829e+01 -100.00 +4.000000 9.698970 -8.171101e-07 0.00 0.00 -2.967000 -8.515290e+00 -100.00 +4.000000 10.000000 -8.187123e-07 0.00 0.00 -1.035000 -6.245290e+00 -100.00 +4.000000 10.477121 -8.187123e-07 0.00 0.00 1.600000 -3.099290e+00 -100.00 +4.000000 11.000000 -8.187123e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +5.000000 7.000000 8.491536e-08 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +5.000000 8.000000 8.331318e-08 0.00 0.00 -44.223000 -5.160029e+01 -100.00 +5.000000 8.301030 7.530230e-08 0.00 0.00 -25.017000 -3.208629e+01 -100.00 +5.000000 8.602060 4.165659e-08 0.00 0.00 -15.072000 -2.182929e+01 -100.00 +5.000000 8.845098 -4.165659e-08 0.00 0.00 -10.585000 -1.708529e+01 -100.00 +5.000000 9.000000 -1.570133e-07 0.00 0.00 -8.685000 -1.501729e+01 -100.00 +5.000000 9.176091 -3.941355e-07 0.00 0.00 -7.099000 -1.323729e+01 -100.00 +5.000000 9.301030 -6.136337e-07 0.00 0.00 -6.134000 -1.213329e+01 -100.00 +5.000000 9.477121 -7.626361e-07 0.00 0.00 -4.656000 -1.045529e+01 -100.00 +5.000000 9.698970 -8.042927e-07 0.00 0.00 -2.959000 -8.506290e+00 -100.00 +5.000000 10.000000 -8.155079e-07 0.00 0.00 -1.034000 -6.244290e+00 -100.00 +5.000000 10.477121 -8.187123e-07 0.00 0.00 1.600000 -3.099290e+00 -100.00 +5.000000 11.000000 -8.187123e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +6.000000 7.000000 3.444680e-07 0.00 0.00 -99.697970 -1.057943e+02 -100.00 +6.000000 8.000000 3.428658e-07 0.00 0.00 -36.029000 -4.340629e+01 -100.00 +6.000000 8.301030 3.412636e-07 0.00 0.00 -20.834000 -2.790429e+01 -100.00 +6.000000 8.602060 3.316506e-07 0.00 0.00 -12.798000 -1.955529e+01 -100.00 +6.000000 8.845098 3.028114e-07 0.00 0.00 -9.036000 -1.553629e+01 -100.00 +6.000000 9.000000 2.579504e-07 0.00 0.00 -7.382000 -1.371429e+01 -100.00 +6.000000 9.176091 1.490024e-07 0.00 0.00 -5.962000 -1.210029e+01 -100.00 +6.000000 9.301030 1.602177e-09 0.00 0.00 -5.168000 -1.116629e+01 -100.00 +6.000000 9.477121 -3.396614e-07 0.00 0.00 -4.214000 -1.001329e+01 -100.00 +6.000000 9.698970 -6.729142e-07 0.00 0.00 -2.876000 -8.424290e+00 -100.00 +6.000000 10.000000 -7.866687e-07 0.00 0.00 -1.025000 -6.235290e+00 -100.00 +6.000000 10.477121 -8.155079e-07 0.00 0.00 1.601000 -3.098290e+00 -100.00 +6.000000 11.000000 -8.187123e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +7.000000 7.000000 1.140750e-06 0.00 0.00 -46.082000 -5.446429e+01 -100.00 +7.000000 8.000000 1.139148e-06 0.00 0.00 -10.983000 -1.835929e+01 -100.00 +7.000000 8.301030 1.139148e-06 0.00 0.00 -8.290000 -1.535929e+01 -100.00 +7.000000 8.602060 1.134341e-06 0.00 0.00 -6.487000 -1.324229e+01 -100.00 +7.000000 8.845098 1.123126e-06 0.00 0.00 -5.363000 -1.185729e+01 -100.00 +7.000000 9.000000 1.103900e-06 0.00 0.00 -4.733000 -1.105829e+01 -100.00 +7.000000 9.176091 1.060641e-06 0.00 0.00 -4.066000 -1.019629e+01 -100.00 +7.000000 9.301030 9.965539e-07 0.00 0.00 -3.616000 -9.607290e+00 -100.00 +7.000000 9.477121 8.171101e-07 0.00 0.00 -3.010000 -8.803290e+00 -100.00 +7.000000 9.698970 2.996070e-07 0.00 0.00 -2.270000 -7.815290e+00 -100.00 +7.000000 10.000000 -5.046856e-07 0.00 0.00 -0.937000 -6.147290e+00 -100.00 +7.000000 10.477121 -7.850666e-07 0.00 0.00 1.604000 -3.095290e+00 -100.00 +7.000000 11.000000 -8.155079e-07 0.00 0.00 4.293000 1.317104e-01 -100.00 +8.000000 7.000000 3.101814e-06 0.00 0.00 -1.350000 -7.185290e+00 -100.00 +8.000000 8.000000 3.101814e-06 0.00 0.00 -1.349000 -7.185290e+00 -100.00 +8.000000 8.301030 3.100212e-06 0.00 0.00 -1.348000 -7.183290e+00 -100.00 +8.000000 8.602060 3.098610e-06 0.00 0.00 -1.345000 -7.176290e+00 -100.00 +8.000000 8.845098 3.093803e-06 0.00 0.00 -1.335000 -7.158290e+00 -100.00 +8.000000 9.000000 3.085792e-06 0.00 0.00 -1.320000 -7.129290e+00 -100.00 +8.000000 9.176091 3.064964e-06 0.00 0.00 -1.285000 -7.065290e+00 -100.00 +8.000000 9.301030 3.036125e-06 0.00 0.00 -1.240000 -6.983290e+00 -100.00 +8.000000 9.477121 2.954414e-06 0.00 0.00 -1.128000 -6.787290e+00 -100.00 +8.000000 9.698970 2.693259e-06 0.00 0.00 -0.875000 -6.369290e+00 -100.00 +8.000000 10.000000 1.573337e-06 0.00 0.00 -0.301000 -5.502290e+00 -100.00 +8.000000 10.477121 -4.838573e-07 0.00 0.00 1.635000 -3.064290e+00 -100.00 +8.000000 11.000000 -7.882709e-07 0.00 0.00 4.294000 1.327104e-01 -100.00 +9.000000 7.000000 7.480563e-06 0.00 0.00 0.831000 -4.464290e+00 -100.00 +9.000000 8.000000 7.480563e-06 0.00 0.00 0.831000 -4.464290e+00 -100.00 +9.000000 8.301030 7.480563e-06 0.00 0.00 0.832000 -4.464290e+00 -100.00 +9.000000 8.602060 7.480563e-06 0.00 0.00 0.832000 -4.463290e+00 -100.00 +9.000000 8.845098 7.477358e-06 0.00 0.00 0.833000 -4.461290e+00 -100.00 +9.000000 9.000000 7.474154e-06 0.00 0.00 0.835000 -4.458290e+00 -100.00 +9.000000 9.176091 7.464541e-06 0.00 0.00 0.838000 -4.451290e+00 -100.00 +9.000000 9.301030 7.450121e-06 0.00 0.00 0.844000 -4.442290e+00 -100.00 +9.000000 9.477121 7.413271e-06 0.00 0.00 0.859000 -4.414290e+00 -100.00 +9.000000 9.698970 7.291506e-06 0.00 0.00 0.904000 -4.333290e+00 -100.00 +9.000000 10.000000 6.724335e-06 0.00 0.00 1.074000 -4.035290e+00 -100.00 +9.000000 10.477121 2.340780e-06 0.00 0.00 1.922000 -2.772290e+00 -100.00 +9.000000 11.000000 -5.191052e-07 0.00 0.00 4.302000 1.407104e-01 -100.00 +10.000000 7.000000 1.699429e-05 0.00 0.00 2.676000 -2.211290e+00 -100.00 +10.000000 8.000000 1.699429e-05 0.00 0.00 2.676000 -2.211290e+00 -100.00 +10.000000 8.301030 1.699429e-05 0.00 0.00 2.676000 -2.211290e+00 -100.00 +10.000000 8.602060 1.699429e-05 0.00 0.00 2.676000 -2.211290e+00 -100.00 +10.000000 8.845098 1.699269e-05 0.00 0.00 2.676000 -2.211290e+00 -100.00 +10.000000 9.000000 1.699108e-05 0.00 0.00 2.676000 -2.210290e+00 -100.00 +10.000000 9.176091 1.698628e-05 0.00 0.00 2.677000 -2.209290e+00 -100.00 +10.000000 9.301030 1.697987e-05 0.00 0.00 2.678000 -2.208290e+00 -100.00 +10.000000 9.477121 1.696224e-05 0.00 0.00 2.680000 -2.203290e+00 -100.00 +10.000000 9.698970 1.690617e-05 0.00 0.00 2.688000 -2.188290e+00 -100.00 +10.000000 10.000000 1.664181e-05 0.00 0.00 2.725000 -2.122290e+00 -100.00 +10.000000 10.477121 1.386203e-05 0.00 0.00 3.006000 -1.638290e+00 -100.00 +10.000000 11.000000 2.164541e-06 0.00 0.00 4.385000 2.237104e-01 -100.00 +11.000000 7.000000 3.752778e-05 0.00 0.00 4.416000 -1.062896e-01 -100.00 +11.000000 8.000000 3.752778e-05 0.00 0.00 4.416000 -1.062896e-01 -100.00 +11.000000 8.301030 3.752778e-05 0.00 0.00 4.416000 -1.062896e-01 -100.00 +11.000000 8.602060 3.752778e-05 0.00 0.00 4.416000 -1.062896e-01 -100.00 +11.000000 8.845098 3.752618e-05 0.00 0.00 4.416000 -1.062896e-01 -100.00 +11.000000 9.000000 3.752618e-05 0.00 0.00 4.416000 -1.052896e-01 -100.00 +11.000000 9.176091 3.752298e-05 0.00 0.00 4.416000 -1.052896e-01 -100.00 +11.000000 9.301030 3.752137e-05 0.00 0.00 4.416000 -1.052896e-01 -100.00 +11.000000 9.477121 3.751176e-05 0.00 0.00 4.417000 -1.042896e-01 -100.00 +11.000000 9.698970 3.748613e-05 0.00 0.00 4.419000 -1.012896e-01 -100.00 +11.000000 10.000000 3.736436e-05 0.00 0.00 4.426000 -8.828961e-02 -100.00 +11.000000 10.477121 3.605538e-05 0.00 0.00 4.499000 4.271039e-02 -100.00 +11.000000 11.000000 2.244810e-05 0.00 0.00 4.989000 8.437104e-01 -100.00 diff --git a/networks/ignition_reaclib/URCA-simple/reaclib_rates.H b/networks/ignition_reaclib/URCA-simple/reaclib_rates.H index 1e72dfcf2f..3cc069c026 100644 --- a/networks/ignition_reaclib/URCA-simple/reaclib_rates.H +++ b/networks/ignition_reaclib/URCA-simple/reaclib_rates.H @@ -168,37 +168,6 @@ void rate_He4_C12_to_O16(const tf_t& tfactors, Real& rate, Real& drate_dT) { } -template -AMREX_GPU_HOST_DEVICE AMREX_INLINE -void rate_n_to_p_weak_wc12(const tf_t& tfactors, Real& rate, Real& drate_dT) { - - // n --> p - - rate = 0.0; - drate_dT = 0.0; - - Real ln_set_rate{0.0}; - Real dln_set_rate_dT9{0.0}; - Real set_rate{0.0}; - - // wc12w - ln_set_rate = -6.78161; - amrex::ignore_unused(tfactors); - - if constexpr (do_T_derivatives) { - dln_set_rate_dT9 = 0.0; - } - - // avoid underflows by zeroing rates in [0.0, 1.e-100] - ln_set_rate = std::max(ln_set_rate, -230.0); - set_rate = std::exp(ln_set_rate); - rate += set_rate; - if constexpr (do_T_derivatives) { - drate_dT += set_rate * dln_set_rate_dT9 / 1.0e9; - } - -} - template @@ -234,12 +203,6 @@ fill_reaclib_rates(const tf_t& tfactors, T& rate_eval) rate_eval.dscreened_rates_dT(k_He4_C12_to_O16) = drate_dT; } - rate_n_to_p_weak_wc12(tfactors, rate, drate_dT); - rate_eval.screened_rates(k_n_to_p_weak_wc12) = rate; - if constexpr (std::is_same::value) { - rate_eval.dscreened_rates_dT(k_n_to_p_weak_wc12) = drate_dT; - - } } diff --git a/networks/ignition_reaclib/URCA-simple/table_rates.H b/networks/ignition_reaclib/URCA-simple/table_rates.H index 20da307673..43ca83dc25 100644 --- a/networks/ignition_reaclib/URCA-simple/table_rates.H +++ b/networks/ignition_reaclib/URCA-simple/table_rates.H @@ -20,7 +20,7 @@ void init_tabular(); // Log(g/cm^3) Log(K) erg erg erg Log(1/s) Log(erg/s) Log(erg/s) // -const int num_tables = 2; +const int num_tables = 4; enum TableVars { @@ -65,6 +65,16 @@ namespace rate_tables extern AMREX_GPU_MANAGED Array1D j_Ne23_Na23_rhoy; extern AMREX_GPU_MANAGED Array1D j_Ne23_Na23_temp; + extern AMREX_GPU_MANAGED table_t j_n_p_meta; + extern AMREX_GPU_MANAGED Array3D j_n_p_data; + extern AMREX_GPU_MANAGED Array1D j_n_p_rhoy; + extern AMREX_GPU_MANAGED Array1D j_n_p_temp; + + extern AMREX_GPU_MANAGED table_t j_p_n_meta; + extern AMREX_GPU_MANAGED Array3D j_p_n_data; + extern AMREX_GPU_MANAGED Array1D j_p_n_rhoy; + extern AMREX_GPU_MANAGED Array1D j_p_n_temp; + } template diff --git a/networks/ignition_reaclib/URCA-simple/table_rates_data.cpp b/networks/ignition_reaclib/URCA-simple/table_rates_data.cpp index 2e7b8130be..12ed4a635a 100644 --- a/networks/ignition_reaclib/URCA-simple/table_rates_data.cpp +++ b/networks/ignition_reaclib/URCA-simple/table_rates_data.cpp @@ -18,6 +18,16 @@ namespace rate_tables AMREX_GPU_MANAGED Array1D j_Ne23_Na23_rhoy; AMREX_GPU_MANAGED Array1D j_Ne23_Na23_temp; + AMREX_GPU_MANAGED table_t j_n_p_meta; + AMREX_GPU_MANAGED Array3D j_n_p_data; + AMREX_GPU_MANAGED Array1D j_n_p_rhoy; + AMREX_GPU_MANAGED Array1D j_n_p_temp; + + AMREX_GPU_MANAGED table_t j_p_n_meta; + AMREX_GPU_MANAGED Array3D j_p_n_data; + AMREX_GPU_MANAGED Array1D j_p_n_rhoy; + AMREX_GPU_MANAGED Array1D j_p_n_temp; + } @@ -45,5 +55,21 @@ void init_tabular() init_tab_info(j_Ne23_Na23_meta, "23ne-23na_betadecay.dat", j_Ne23_Na23_rhoy, j_Ne23_Na23_temp, j_Ne23_Na23_data); + j_n_p_meta.ntemp = 13; + j_n_p_meta.nrhoy = 11; + j_n_p_meta.nvars = 6; + j_n_p_meta.nheader = 5; + + init_tab_info(j_n_p_meta, "n-p_betadecay.dat", j_n_p_rhoy, j_n_p_temp, j_n_p_data); + + + j_p_n_meta.ntemp = 13; + j_p_n_meta.nrhoy = 11; + j_p_n_meta.nvars = 6; + j_p_n_meta.nheader = 5; + + init_tab_info(j_p_n_meta, "p-n_electroncapture.dat", j_p_n_rhoy, j_p_n_temp, j_p_n_data); + + } diff --git a/networks/ignition_reaclib/URCA-simple/urca.py b/networks/ignition_reaclib/URCA-simple/urca.py index 5db0666b34..4c8e1c8288 100644 --- a/networks/ignition_reaclib/URCA-simple/urca.py +++ b/networks/ignition_reaclib/URCA-simple/urca.py @@ -1,14 +1,18 @@ # C-burning with A=23 URCA rate module generator -from pynucastro.networks import AmrexAstroCxxNetwork +import pynucastro as pyna -files = ["c12-c12a-ne20-cf88", - "c12-c12n-mg23-cf88", - "c12-c12p-na23-cf88", - "c12-ag-o16-nac2", - "na23--ne23-toki", - "ne23--na23-toki", - "n--p-wc12"] +rl = pyna.ReacLibLibrary() +rl_rates = rl.get_rate_by_name(["c12(c12,a)ne20", + "c12(c12,n)mg23", + "c12(c12,p)na23", + "c12(a,g)o16"]) -urca_net = AmrexAstroCxxNetwork(files) +tl = pyna.TabularLibrary() +tl_rates = tl.get_rate_by_name(["na23(,)ne23", + "ne23(,)na23", + "n(,)p", + "p(,)n"]) + +urca_net = pyna.AmrexAstroCxxNetwork(rates=rl_rates+tl_rates) urca_net.write_network()