Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a new, slightly larger Urca net #1365

Merged
merged 11 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,934 changes: 5,934 additions & 0 deletions networks/ignition_reaclib/URCA-medium/23mg-23na_electroncapture.dat

Large diffs are not rendered by default.

5,935 changes: 5,935 additions & 0 deletions networks/ignition_reaclib/URCA-medium/23na-23ne_electroncapture.dat

Large diffs are not rendered by default.

5,933 changes: 5,933 additions & 0 deletions networks/ignition_reaclib/URCA-medium/23ne-23na_betadecay.dat

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions networks/ignition_reaclib/URCA-medium/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CEXE_headers += network_properties.H

ifeq ($(USE_REACT),TRUE)
CEXE_sources += actual_network_data.cpp
CEXE_headers += actual_network.H
CEXE_headers += tfactors.H
CEXE_headers += partition_functions.H
CEXE_headers += actual_rhs.H
CEXE_headers += reaclib_rates.H
CEXE_headers += table_rates.H
CEXE_sources += table_rates_data.cpp
USE_SCREENING = TRUE
USE_NEUTRINOS = TRUE
endif
2 changes: 2 additions & 0 deletions networks/ignition_reaclib/URCA-medium/_parameters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@namespace: network

107 changes: 107 additions & 0 deletions networks/ignition_reaclib/URCA-medium/actual_network.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#ifndef actual_network_H
#define actual_network_H

#include <AMReX_REAL.H>
#include <AMReX_Array.H>

#include <fundamental_constants.H>
#include <network_properties.H>

using namespace amrex;

void actual_network_init();

const std::string network_name = "pynucastro-cxx";

namespace network
{
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> bion;
extern AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> mion;
}

namespace Rates
{

enum NetworkRates
{
k_p_C12_to_N13 = 1,
k_He4_C12_to_O16 = 2,
k_He4_O16_to_Ne20 = 3,
k_He4_Ne20_to_Mg24 = 4,
k_p_Na23_to_Mg24 = 5,
k_n_Mg23_to_Mg24 = 6,
k_C12_C12_to_n_Mg23 = 7,
k_C12_C12_to_p_Na23 = 8,
k_C12_C12_to_He4_Ne20 = 9,
k_He4_N13_to_p_O16 = 10,
k_C12_O16_to_He4_Mg24 = 11,
k_He4_Ne20_to_p_Na23 = 12,
k_p_Na23_to_He4_Ne20 = 13,
k_n_Mg23_to_p_Na23 = 14,
k_n_Mg23_to_He4_Ne20 = 15,
k_n_Mg23_to_C12_C12 = 16,
k_He4_He4_He4_to_C12 = 17,
k_Na23_to_Ne23 = 18,
k_Ne23_to_Na23 = 19,
k_Mg23_to_Na23 = 20,
k_n_to_p = 21,
k_p_to_n = 22,
NumRates = k_p_to_n
};

// number of reaclib rates

const int NrateReaclib = 17;

// number of tabular rates

const int NrateTabular = 5;

// 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
// NetworkRates enum

static const std::vector<std::string> rate_names = {
"", // 0
"p_C12_to_N13", // 1,
"He4_C12_to_O16", // 2,
"He4_O16_to_Ne20", // 3,
"He4_Ne20_to_Mg24", // 4,
"p_Na23_to_Mg24", // 5,
"n_Mg23_to_Mg24", // 6,
"C12_C12_to_n_Mg23", // 7,
"C12_C12_to_p_Na23", // 8,
"C12_C12_to_He4_Ne20", // 9,
"He4_N13_to_p_O16", // 10,
"C12_O16_to_He4_Mg24", // 11,
"He4_Ne20_to_p_Na23", // 12,
"p_Na23_to_He4_Ne20", // 13,
"n_Mg23_to_p_Na23", // 14,
"n_Mg23_to_He4_Ne20", // 15,
"n_Mg23_to_C12_C12", // 16,
"He4_He4_He4_to_C12", // 17,
"Na23_to_Ne23", // 18,
"Ne23_to_Na23", // 19,
"Mg23_to_Na23", // 20,
"n_to_p", // 21,
"p_to_n" // 22,
};

}

#ifdef NSE_NET
namespace NSE_INDEX
{
constexpr int H1_index = 1;
constexpr int N_index = 0;
constexpr int He4_index = 2;

// Each row corresponds to the rate in NetworkRates enum
// First 3 row indices for reactants, followed by 3 product indices
// last index is the corresponding reverse rate index.

extern AMREX_GPU_MANAGED amrex::Array2D<int, 1, Rates::NumRates, 1, 7, Order::C> rate_indices;
}
#endif

#endif
70 changes: 70 additions & 0 deletions networks/ignition_reaclib/URCA-medium/actual_network_data.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#include <actual_network.H>


namespace network
{
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> bion;
AMREX_GPU_MANAGED amrex::Array1D<amrex::Real, 1, NumSpec> mion;
}

#ifdef NSE_NET
namespace NSE_INDEX
{
AMREX_GPU_MANAGED amrex::Array2D<int, 1, Rates::NumRates, 1, 7, Order::C> rate_indices {
-1, 1, 3, -1, -1, 4, -1,
-1, 2, 3, -1, -1, 5, -1,
-1, 2, 5, -1, -1, 6, -1,
-1, 2, 6, -1, -1, 10, -1,
-1, 1, 8, -1, -1, 10, -1,
-1, 0, 9, -1, -1, 10, -1,
-1, 3, 3, -1, 0, 9, -1,
-1, 3, 3, -1, 1, 8, -1,
-1, 3, 3, -1, 2, 6, -1,
-1, 2, 4, -1, 1, 5, -1,
-1, 3, 5, -1, 2, 10, -1,
-1, 2, 6, -1, 1, 8, -1,
-1, 1, 8, -1, 2, 6, 12,
-1, 0, 9, -1, 1, 8, -1,
-1, 0, 9, -1, 2, 6, -1,
-1, 0, 9, -1, 3, 3, 7,
2, 2, 2, -1, -1, 3, -1,
-1, -1, 8, -1, -1, 7, -1,
-1, -1, 7, -1, -1, 8, 18,
-1, -1, 9, -1, -1, 8, -1,
-1, -1, 0, -1, -1, 1, -1,
-1, -1, 1, -1, -1, 0, -1
};
}
#endif

void actual_network_init()
{
using namespace Species;
using namespace network;

// binding energies per nucleon in MeV
amrex::Array1D<amrex::Real, 1, NumSpec> ebind_per_nucleon;

ebind_per_nucleon(N) = 0.0_rt;
ebind_per_nucleon(H1) = 0.0_rt;
ebind_per_nucleon(He4) = 7.073915_rt;
ebind_per_nucleon(C12) = 7.680144_rt;
ebind_per_nucleon(N13) = 7.238863_rt;
ebind_per_nucleon(O16) = 7.976206_rt;
ebind_per_nucleon(Ne20) = 8.03224_rt;
ebind_per_nucleon(Ne23) = 7.955256_rt;
ebind_per_nucleon(Na23) = 8.111493000000001_rt;
ebind_per_nucleon(Mg23) = 7.901115_rt;
ebind_per_nucleon(Mg24) = 8.260709_rt;

// convert to binding energies per nucleus in MeV
for (int i = 1; i <= NumSpec; ++i) {
bion(i) = ebind_per_nucleon(i) * aion[i-1];
}

// Set the mass -- this will be in grams
for (int i = 1; i <= NumSpec; ++i) {
mion(i) = (aion[i-1] - zion[i-1]) * C::Legacy::m_n + zion[i-1] * (C::Legacy::m_p + C::Legacy::m_e) - bion(i) * C::Legacy::MeV2gr;
}

}
Loading