This project decays nuclear abundances on specified timescales and computes overabundances.
If you have not previously done so, install the necessary [libraries]. Next, if you have not previously done so, create a projects directory:
** mkdir projects
**
Change into the projects directory:
** cd projects
**
Now you can checkout the project:
** svn checkout svn://svn.code.sf.net/p/nucnet-projects/code/trunk/projects/nuclear_decay
**
Change into the project directory:
** cd nuclear_decay
**
and compile the codes:
** ./project_make
**
The project compiled successfully if you see Make succeeded. Otherwise, please submit a Ticket or make a post to the Discussion board (see links above).
You will need an XML zone file. As an example, consider the post-supernova file s25a28d_expl.xml created in the [rauscher_xml] tutorial. We assume this file sits in the projects/nucnet-tools-code/data_pub directory. To decay all radioactive species with decay timescale less than 10,000 seconds to their daughter species, type
** ./compute_decayed_abundances ../nucnet-tools-code/data_pub/s25a28d_expl.xml 10000. "" s25a28d_expl_decayed.xml
**
The XPath expression ""
selects all zones in the input file. The file s25a28d_expl_decayed.xml is the output. Properties in this file may be examined with the codes in the ../nucnet-tools-code/examples/analysis directory.
If the zone file does not have reaction data in it, it is possible to specify that on the command line. For example, for the above, we could have typed:
** ./compute_decayed_abundances ../nucnet-tools-code/data_pub/my_net.xml ../nucnet-tools-code/data_pub/s25a28d_expl.xml 10000. "" s25a28d_expl_decayed.xml
**
Decay rates for this calculation would have been taken from the file ../nucnet-tools-code/data_pub/my_net.xml. Note that the code will update the decay rates with those in the file added_reactions.xml; thus, if the input zone or network xml file is missing certain reactions, add them to added_reactions.xml.
To decay the abundances over a specified time interval, use the decay_abundances code. For example, to decay the abundances in the above created s25a28d_expl_decayed.xml over the time interval 200,000 seconds, type
** ./decay_abundances s25a28d_expl_decayed.xml 200000. "" decayed.xml
**
The ""
is again an XPath expression for selecting zones. The output is decayed.xml. Again, if the input zone XML
file does not have decay data, we can use another file. For example, we could have run
** ./decay_abundances ../nucnet-tools-code/data_pub/my_net.xml s25a28d_expl_decayed.xml 200000. "" decayed.xml
**
We could, of course, have run the decay_abundances code on the original file ../nucnet-tools-code/data_pub/s25a28d_exp.xml. By "pre-decaying" the abundances over the 10,000 seconds, we speed up the decay_abundances calculation dramatically because we do not have to worry about species with decay timescales less than 10,000 seconds.
To compute overabundances, that is, abundances relative to solar abundances, one must first obtain an appropriate decayed zone xml file. For example, we will consider the s25a28d_expl_full.xml file discussed in the [rauscher_xml] tutorial. We decay the abundances for 1010 years = 1010 years x 3.15 x 107 seconds per year = 3.15 x 1017 seconds. We will use the compute_decayed_abundances code. We type:
./compute_decayed_abundances ../nucnet-tools-code/data_pub/s25a28d_expl_full.xml 3.15e17 "" decayed_3.15e17.xml
Once this is done, we may compute the overabundances in the "wind"
and "total"
zones by typing
./compute_overabundances decayed_3.15e17.xml ../nucnet-tools-code/data_pub/Anders.xml "[@label1 = "total" or @label1 = "wind"]"
The output overabundances are printed to the screen. Note that we use the Anders and Grevesse solar abundances because these were the initial abundances for the stellar models. Anders.xml (and Anders_0.xml, the abundances at solar system formation) are downloaded when one types
make data
Also downloaded are the similar abundances from Lodders as well as text file versions. The blog post Modifying calculation input with NucNet Tools example codes shows how to create XML files from the text files in case you want to modify them.
To compute the ultimate daughters of the decay of a subset of species, use the daughters code. For example, to find the ultimate daughters of the N = 82 nuclei, type
./daughters ../nucnet-tools-code/data_pub/my_net.xml "[a - z = 82]"
The output shows, for one nucleus of each N = 82 radioactive species in the data file, how many ultimate daughters would be produced. In many cases, more than one neutron will result due to multiple beta-delayed neutron emissions. If any back edges are reported, there is a decay loop i -> j -> i present.
To print out the abundances versus nucleon number and radioactive fraction, use the rad_vs_nucleon_number code. For example, to compute the elemental abundances in the tenth time dump of the file my_alpha_output.xml file (assumed copied into the nuclear_decay directory) that was produced in the blog post, type
./rad_vs_nucleon_number my_alpha_output.xml z "[position() = 10]"
After the first line giving physical conditions at the timestep, the columns give the Z, abundance per nucleon for that element, and fraction of that abundance that is radioactive.
You may find it desirable to decay the abundances in multiple xml files at one time. For example, you may wish to run compute_decayed_abundances for 104 years (3.15 x 1011 seconds) on multiple files created as described in the Downloading multiple files section of [rauscher_xml]. To do so, you can download the script many_exec.sh to your nuclear_decay directory. Make sure the script is executable by typing
** chmod +x many_exec.sh
**
Now edit the script to change the line
EXECUTABLE=./the_executable
to
EXECUTABLE=./compute_decayed_abundances
Now create a file input.txt with lines like
../nucnet-tools-code/data_pub/s15a28c_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s15a28c_decayed.xml
../nucnet-tools-code/data_pub/s19a28g_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s19a28g_decayed.xml
../nucnet-tools-code/data_pub/s20a28n_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s20a28n_decayed.xml
../nucnet-tools-code/data_pub/s21a28g_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s21a28g_decayed.xml
../nucnet-tools-code/data_pub/s25a28d_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s25a28d_decayed.xml
../nucnet-tools-code/data_pub/s30a28A_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s30a28A_decayed.xml
../nucnet-tools-code/data_pub/s35a28A_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s35a28A_decayed.xml
../nucnet-tools-code/data_pub/s40a28A_expl_full.xml 3.15e11 \"[ . ]\" ../nucnet-tools-code/data_pub/s40a28A_decayed.xml
Execute the script by typing
./many_exec.sh input.txt
This will execute compute_decayed_abundances once for each line in input.txt using the input in each line as the input arguments to compute_decayed_abundances. The input \"[ . ]\" gives an XPath expression selecting out all zones--you can of course choose a different XPath expression to select the zones by placing the appropriate expression inside the square brackets. If you use the above input.txt, upon successful completion, you will have eight _decayed.xml files in your ../nucnet-tools-code/data_pub directory. You can similarly run the decay_abundances code multiple times by appropriately changing EXECUTABLE and the input file and then running many_exec.sh.