Package: openmc-data-downloader
OpenMC data downloaderA Python package for downloading preprocessed cross section data in the h5 file
format for use with OpenMC.This package allows you to download a fully reproducible composite nuclear data
library with one command.There are several methods of obtaining complete data libraries for use with
OpenMC, for example:OpenMC.orghas entire libraries downloadable as compressed filesOpenMC data repository scriptshas scripts for automatically downloading ACE and ENDF files and generating h5 files from these inputs.HistoryThe package was originally conceived by Jonathan Shimwell as a means of
downloading a minimal selection of data for use on continuous integration
platforms.
The package can also used to produce traceable and reproducible
nuclear data distributions.System InstallationTo install the openmc_data_downloader you need to have Python3 installed,
OpenMC is also advisable if you want to run simulations using the h5 data files
but not actually mandatory if you just want to download the cross sections.pipinstallopenmc_data_downloaderFeaturesThe OpenMC data downloader is able to download cross section files for isotopes
from nuclear data libraries.The user specifies the nuclear data libraries in
order of their preference. When an isotope is found in multiple libraries it
will be downloaded from the highest preference library. This avoid duplication
of isotopes and provides a reproducible nuclear data environment.The nuclear data h5 file are downloaded from the OpenMC-data-storage
repository. Prior to being added to the repository they have been automatically
processed using scripts from OpenMC data repository, these scripts convert ACE
and ENDF file to h5 files.The resulting h5 files are then used in and automated test suite of simulations
to help ensure they are suitable for their intended purpose.Isotopes for downloading can be found in a variety of ways as demonstrated below.
When downloading a cross_section.xml file is automatically created and h5 files
are named with their nuclear data library and the isotope. This helps avoid
downloading files that already exist locally and theoverwriteargument
can be used to control if these files are downloaded again.Usage - command line usageGetting a description of the input optionsopenmc_data_downloader--helpDownloading a single isotope from the FENDL 3.1d nuclear libraryopenmc_data_downloader-lFENDL-3.1d-iLi6Downloading a multiple isotopes from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-iLi6Li7Downloading a single element from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-eLiDownloading a multiple element from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-eLiSiNaDownloading h5 files from the ENDF/B 7.1 NNDC library to a specific folder (destination)openmc_data_downloader-lENDFB-7.1-NNDC-iBe9-dmy_h5_filesDownloading a combination of isotopes and element from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-eLiSiNa-iFe56U235Downloading all the isotopes from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-iallDownloading all the stable isotopes from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-istableDownloading all the isotopes in a materials.xml file from the TENDL 2019 nuclear libraryopenmc_data_downloader-lTENDL-2019-mmaterials.xmlDownloading 3 isotopes from ENDF/B 7.1 NNDC (first choice) and TENDL 2019 (second choice) nuclear libraryopenmc_data_downloader-lENDFB-7.1-NNDCTENDL-2019-iLi6Li7Be9Downloading the photon only cross section for an element ENDF/B 7.1 NNDCopenmc_data_downloader-lENDFB-7.1-NNDC-eLi-pphotonDownloading the neutron and photon cross section for an element ENDF/B 7.1 NNDCopenmc_data_downloader-lENDFB-7.1-NNDC-eLi-pneutronphotonDownloading the neutron cross section for elements and an SaB cross sectionsopenmc_data_downloader-lENDFB-7.1-NNDC-eBeO-sc_Be_in_BeOUsage - within a Python environmentWhen using the Python API thejust_in_time_library_generator()function
provides similar capabilities to theopenmc_data_downloaderterminal
command. With one key difference being thatjust_in_time_library_generator()sets theOPENMC_CROSS_SECTIONSenvironmental variable to point to the
newly created cross_sections.xml by default.Downloading the isotopes present in an OpenMC materialimportopenmcimportopenmc_data_downloaderasoddmat1=openmc.Material()mat1.add_element('Fe',0.95)mat1.add_element('C',0.05)odd.just_in_time_library_generator(libraries='FENDL-3.1d',materials=mat1)Downloading the isotopes present in an OpenMC material from two libraries but with a preference for ENDF/B 7.1 NNDC library over TENDL 2019importopenmcimportopenmc_data_downloaderasoddmat1=openmc.Material()mat1.add_element('Fe',0.95)mat1.add_element('C',0.05)odd.just_in_time_library_generator(libraries=['ENDFB-7.1-NNDC','TENDL-2019'],materials=mat1)Downloading the isotopes in several OpenMC materialsimportopenmcimportopenmc_data_downloaderasoddmat1=openmc.Material()mat1.add_element('Fe',0.95)mat1.add_element('C',0.05)mat2=openmc.Material()mat2.add_element('H',0.66)mat2.add_element('0',0.33)# a list of openmc.Material objects can be usedodd.just_in_time_library_generator(libraries='ENDFB-7.1-NNDC',materials=[mat1,mat2])# alternatively an openmc.Materials() object can be usedmats=openmc.Materials([mat1,mat2])odd.just_in_time_library_generator(libraries='ENDFB-7.1-NNDC',materials=mats)Downloading neutron cross sections for a material with an SaBimportopenmcimportopenmc_data_downloaderasoddmy_mat=openmc.Material()my_mat.add_element('Be',0.5)my_mat.add_element('O',0.5)my_mat.add_s_alpha_beta('Be_in_BeO')odd.just_in_time_library_generator(libraries='ENDFB-7.1-NNDC',materials=my_matparticles=['neutron'],)Downloading photon and neutron cross sections for isotopes and elements from the TENDL 2019 libraryimportopenmcimportopenmc_data_downloaderasoddodd.just_in_time_library_generator(libraries='TENDL-2019',elements=['Li','Be'],particles=['photon','neutron'],isotopes=['Fe56','U235'],)