SKYNET
2.5 Implementation details
bands collapse to a line at largeZ, because there the abundances of all isotopes are essentially zero. In the strongest screening case (T = 3 GK), the screening effect ranges from 0.1% to 70%. ForT = 8 GK, it ranges from about 0.02% to 10%. And forT =13 GK, the screening effect is much less than 1% except for very largeZ.
clide library class that contains all nuclear data, and a reaction network class that implements the actual nuclear reaction network. There are various other types of classes that implement specific functionalities. For example, there are different func- tion interpolation classes, ODE integrators, and general numerical method classes (bisection, line search). On the physics side, there are different classes that are responsible for different pieces of physics. The NSE class computes NSE given an electron fraction and two of the following properties: temperature, density, entropy, or internal energy. And there are separate classes that are responsible for the EOS and screening corrections.
Since SkyNet is built in an object-oriented fashion, different parts of the code are separated from each other and only interact via well-defined interfaces. This makes SkyNet extremely modular, because the implementation of a certain class can be changed or extended, without having to modify the rest of the code. For example, one could easily extend the nuclide library class to support reading in nuclear data from a different file format. Since all the nuclear data is handled by this one class, only this class has to be modified to support the new file format.
Furthermore, some classes are implemented as abstract base classes, meaning they only specify the interface for a particular physics module without tying it to a specific implementation. Examples of this are the EOS class and the screening corrections class. For both of these, SkyNet currently has one implementation, namely the extended Timmes EOS described in Section 2.A.2 and the screening corrections discussed in Section 2.4. One can easily add a new EOS class that implements a different EOS but has the same interface as the abstract EOS base class. This new EOS class then plugs into the existingSkyNetframework. In a similar way, one can add additional screening implementations toSkyNet.
The various classes provided inSkyNetcan be used individually through the Python bindings. For instance, one can use the NSE class in Python to compute NSE in various conditions, or use the nuclide library class to access the nuclear data and partition functions from Python.
2.5.2 Nuclear reaction libraries
SkyNetsupports different types of nuclear reactions. Reactions of the same type or from the same data source are grouped into reaction library classes. The network class contains an arbitrary list of reaction library classes that collectively contain all the reactions that are evolved in the network. The reaction library classes have
a common interface that allows the network to be agnostic to how the reaction rate is determined. Via this interface, the network can tell the reaction libraries to recompute the reaction rates for a given thermodynamic state (temperature, density, electron fraction, electron degeneracy parameter, etc.), to get the contributions to all YÛi from the reactions in the network, and to get the contributions to ∂YÛi/∂Yj. This makes SkyNet extremely flexible because many different types of reactions can be evolved at the same time, and furthermore, the data for reactions of the same type can be split across multiple files, allowing the user to quickly switch out certain reactions. Finally, thanks to the abstract interface of reaction library classes, it is easy to add new types of reactions toSkyNet.
The following reaction types of nuclear reactions are currently implemented in SkyNet.
• Constant: These reactions have a constant rate that does not depend on any properties of the thermodynamic state.
• REACLIB:These are reactions that come from the REACLIB database (Cy- burt et al.,2010). The rates of these reactions are given by parametric fitting formulae that depend on temperature and density.
• FFN:This reaction library contains the tabulated β-decay (both β− and β+) and electron/positron capture rates from Fuller et al. (1982). The rates are tabulated as a function of temperature andYeρ.
• Neutrino interactions: These are neutrino emission and absorption reac- tions on free neutrons and protons. The rates are calculated according to Equations (2.184) to (2.187) given the electron neutrino and electron antineu- trino distribution functions.
• Arbitrary rate functions: This reaction library contains reactions whose rates are given by arbitrary, user-specified functions. This can be used to quickly test a new or modified reaction rate that can depend on various ther- modynamic quantities and also time.
Since the different reaction types and rate sources can be used concurrently in SkyNet, care must be taken to ensure that no reaction rate is contained multiple times in the network, since that would effectively multiply the reaction rate by the number of times it occurs. SkyNetprovides a facility to remove all reactions in one
reaction library that also occur in another library. However, in some cases, there are supposed to be multiple rates for the same reaction. In this case, the total reaction rate is the sum of the individual rates. REACLIB uses this mechanism to capture different resonant and non-resonant parts of a reaction rate with its limited fitting formula.