Skip to content

Commit

Permalink
add a slightly larger Urca net
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Oct 22, 2023
1 parent 43779f1 commit 129da1c
Show file tree
Hide file tree
Showing 21 changed files with 20,874 additions and 0 deletions.
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

0 comments on commit 129da1c

Please sign in to comment.