Could not find nuclide C13 in the nuclear data library

hello everyone
i use openmc python but something quite weird happened
here is part of my code
image
when i run it with pycharm,it get materials.xml :
image
but when i run it with sublime text,it get materials.xml :
image
you must have noticed that the element carbon is described as two forms:
c0 and c12+c13
but the hdf5 cross_sections i use just have c0.h5 here
image
so when the code run in sublime-text it give error :


is this something new in openmc version update or some other problem?
could anyone give me some suggestions
many thx

Carbon nuclear data is often a little different to the other elements, particularly in some of the older cross section libraries. Newer cross section libraries tend to have separate files for each isotope.

c0 indicates natural carbon and OpenMC will split this into C12 and C13

There are a few work arounds

The easy option is to add carbon 12 nuclide instead of carbon element

uzrc.add_nuclide('C12', 0.92)

Another option is to make use of a cross section library that has both C12 and C13 nuclides such as
TENDL

You could download the entire TENDL library and then combine cross_section.xml libraries with NNDC.

I’ve actually just been working on making this easier for users so if you are interested in some under development nuclear data software then you could try the following…

pip install openmc_data
convert_tendl --release 2021
download_nndc.py --release b7.1
combine_libraries --libraries tendl-2021-hdf5/cross_sections.xml  nndc-b7.1-hdf5/cross_sections.xml  --outputfilename new_cross_sections.xml

This will make a new cross section xml file which contains TENDL preferentially and NNDC (ENDF) as well. The Carbon 12 and 13 from TENDL should then be found by OpenMC

To use this cross section file the environmental variable will need updating

export OPENMC_CROSS_SECTIONS=/path_to_your/cross_sections.xml 
1 Like

@flowersoul When you run Material.add_element, OpenMC will look at the file indicated by your OPENMC_CROSS_SECTIONS environment variable to determine what naturally occurring isotopes are available. It seems that in your case, pycharm does see the environment variable whereas sublime text does not. You could try starting sublime text using subl from a terminal and then it should inherit your environment variables.

thank you paul , it indeed works
sublime-text seems not to read environment variable except PATH when it is opened with shortcut
only when it is opened from terminal it does

many thx for your reply
the problem has been solved