Setting cross-section file for ONIX with OpenMC

I wanted to use ONIX for my simulation, but I had a problem with the cross-section file. I use ENDF/B-VIII.0 in HDF5 format from official data libraries from https://openmc.org/official-data-libraries/ by setting “OPENMC_CROSS_SECTIONS” to the path of cross-seciton.xml on bashrc for OpenMC and tried to run onix on this settings but it failed. Then I used the ENDF/B-VIII.0 library of ACE format from https://openmc.org/lanl-data-libraries/ by changing the “OPENMC_CROSS_SECTIONS” path to this new cross-section file and ran this example from onix documentation but it resulted in the same error.
How should I add the cross-section library for ONIX with OpenMC?

The output of couple.burn() command is given below

.*#############*        #####,        #####    ####.   #####,       #####,

######* ###########* #######. ##### ####. .##### #####*
######## # ############ ######### ##### ####. .#####, #####*
######## ##*.##.#########, ########## ##### ####. ########
#######,### ,… ######## ##### ,##### ##### ####. #####
####### ##### ### ####### ##### #####,##### ####. .########,
,####
*######## .##### ##### ######### ####. ,#####, #####.
*####### * ###### ##### *####### ####. ###### *#####
############, ##### .###### ####. #####. #####

===============================================================================

An open-source depletion code for reactor simulation and nuclear archaeology

{}
=== OpenMC pre-run ===

                            %%%%%%%%%%%%%%%
                       %%%%%%%%%%%%%%%%%%%%%%%%
                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
               %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                %%%%%%%%%%%%%%%%%%%%%%%%
                                 %%%%%%%%%%%%%%%%%%%%%%%%
             ###############      %%%%%%%%%%%%%%%%%%%%%%%%
            ##################     %%%%%%%%%%%%%%%%%%%%%%%
            ###################     %%%%%%%%%%%%%%%%%%%%%%%
            ####################     %%%%%%%%%%%%%%%%%%%%%%
            #####################     %%%%%%%%%%%%%%%%%%%%%
            ######################     %%%%%%%%%%%%%%%%%%%%
            #######################     %%%%%%%%%%%%%%%%%%
             #######################     %%%%%%%%%%%%%%%%%
             ######################     %%%%%%%%%%%%%%%%%
              ####################     %%%%%%%%%%%%%%%%%
                #################     %%%%%%%%%%%%%%%%%
                 ###############     %%%%%%%%%%%%%%%%
                   ############     %%%%%%%%%%%%%%%
                      ########     %%%%%%%%%%%%%%
                                  %%%%%%%%%%%

               | The OpenMC Monte Carlo Code
     Copyright | 2011-2020 MIT and OpenMC contributors
       License | https://docs.openmc.org/en/latest/license.html
       Version | 0.12.0
      Git SHA1 | 599a722a542ede426c3f1390a88ddb4e4e0045d3
     Date/Time | 2020-12-14 01:40:20
OpenMP Threads | 4

Reading settings XML file…
Reading cross sections XML file…
Reading materials XML file…
Reading geometry XML file…
Reading U234 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/U234.h5
Reading U235 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/U235.h5
Reading U238 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/U238.h5
Reading Zr90 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Zr90.h5
Reading Zr91 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Zr91.h5
Reading Zr92 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Zr92.h5
Reading Zr94 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Zr94.h5
Reading Zr96 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Zr96.h5
Reading Pu238 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pu238.h5
Reading Pu239 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pu239.h5
Reading Pu240 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pu240.h5
Reading Pu241 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pu241.h5
Reading Pu242 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pu242.h5
Reading Pb204 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pb204.h5
Reading Pb206 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pb206.h5
Reading Pb207 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pb207.h5
Reading Pb208 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Pb208.h5
Reading Bi209 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Bi209.h5
Reading C12 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/C12.h5
Reading Mn55 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mn55.h5
Reading Si28 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Si28.h5
Reading P31 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/P31.h5
Reading Ti46 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ti46.h5
Reading Ti47 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ti47.h5
Reading Ti48 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ti48.h5
Reading Ti49 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ti49.h5
Reading Ti50 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ti50.h5
Reading Cr50 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Cr50.h5
Reading Cr52 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Cr52.h5
Reading Cr53 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Cr53.h5
Reading Cr54 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Cr54.h5
Reading Ni58 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ni58.h5
Reading Ni60 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ni60.h5
Reading Ni61 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ni61.h5
Reading Ni62 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ni62.h5
Reading Ni64 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Ni64.h5
Reading B10 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/B10.h5
Reading B11 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/B11.h5
Reading Mo100 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo100.h5
Reading Mo92 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo92.h5
Reading Mo94 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo94.h5
Reading Mo95 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo95.h5
Reading Mo96 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo96.h5
Reading Mo97 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo97.h5
Reading Mo98 from /home/fuad/code/libraries/lib80x/lib80x_hdf5/Mo98.h5
Minimum neutron data temperature: 250.000000 K
Maximum neutron data temperature: 294.000000 K
Preparing distributed cell instances…
Writing summary.h5 file…

=================> STOCHASTIC VOLUME CALCULATION <=================

Running volume calculation 1…
Cell 1: 100638.72 +/- 5688.650455386375 cm^3
Cell 2: 471260.16 +/- 12238.824119398389 cm^3
Cell 3: 861557.76 +/- 16446.314277899404 cm^3
Cell 4: 6128.64 +/- 1405.872866271166 cm^3
Cell 5: 38062.08 +/- 3501.8305649275408 cm^3
Cell 6: 64512.0 +/- 4557.123296396532 cm^3
Cell 7: 70318.08 +/- 4757.347323987512 cm^3
Cell 8: 307722.24 +/- 9915.238573251469 cm^3
Cell 9: 485775.36000000004 +/- 12423.040011115183 cm^3
Cell 10: 917683.2 +/- 16958.374581202574 cm^3
Cell 11: 206760.96 +/- 8140.350994385855 cm^3
Cell 12: 940262.3999999999 +/- 17159.548535304253 cm^3
Cell 13: 1651507.2000000002 +/- 22481.89053695177 cm^3
Cell 14: 3323658.24 +/- 31009.871991532003 cm^3
Elapsed time: 0.020483444 s


TypeError Traceback (most recent call last)
in
----> 1 couple.import_openmc(root_cell)

~/miniconda3/lib/python3.8/site-packages/onix/couple/couple_openmc.py in import_openmc(self, root_cell)
304 # prerun to access cells and materials objects, to set cell volumes and if chosen
305 # add 0 density nuclides
–> 306 self._pre_run(root_cell)
307
308 bucell_dict = self._get_bucell_from_cell()

~/miniconda3/lib/python3.8/site-packages/onix/couple/couple_openmc.py in _pre_run(self, root_cell)
454 self._set_cross_sections_path(pre_run_path)
455 # Read cross sections xml files, create MC_XS_nucl_list
–> 456 self._set_MC_XS_nucl_list()
457 self._set_root_universe()
458 root_cell_name = ‘root cell’ # need to be specified by the user at some point

~/miniconda3/lib/python3.8/site-packages/onix/couple/couple_openmc.py in _set_MC_XS_nucl_list(self)
790
791 #path_to_xs_xml = os.environ[‘OPENMC_CROSS_SECTIONS’]
–> 792 path_to_xs_xml = self._cross_sections_path + ‘/cross_sections.xml’
793
794 self.MC_XS_nucl_list = []

TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘str’

Regards,
Fuad

@fuad Welcome to the forum.

How did you set decay_lib Path?

Try to run again with the following updates


couple.set_default_decay_lib()
couple.set_default_fy_lib()

I added those lines you mentioned after the declaration of couple. The first line produced this error message below,

---------------------------------------------------------------------------

AttributeError Traceback (most recent call last)
in
1 couple = onix.couple.Couple_openmc()
----> 2 couple.set_default_decay_lib()
3 couple.set_default_fy_lib()

~/miniconda3/lib/python3.8/site-packages/onix/couple/couple_openmc.py in set_default_decay_lib(self)
1212 “”"
1213
-> 1214 system = self.system
1215 self._decay_lib_set = ‘yes’
1216 #system.set_default_decay_for_all_no_add()

~/miniconda3/lib/python3.8/site-packages/onix/couple/couple_openmc.py in system(self)
252 “”“Returns the system object of the simulation.
253 “””
–> 254 return self._system
255
256 @system.setter

AttributeError: ‘Couple_openmc’ object has no attribute ‘_system’

Can you share your script if you have no problem?

Yes.
full_core _onix.py (6.3 KB)

Ahh! You didn’t give volume information for BurnCell. Take a look at the pin cell problem.

Hope this will help!

1 Like

It worked! I thought it was optional.
Thank you very much.

@fuad, Sounds great!

By default, ONIX will use ENDF/B-VIII.0 libraries for decay and fission yields data.

If you want to use other libraries, use the following commands:

couple.set_decay_lib('$HOME/miniconda3/lib/python3.8/site-packages/onix/data/other_libs/jeff33/decay_lib')
couple.set_user_fy_lib('$HOME/miniconda3/lib/python3.8/site-packages/onix/data/other_libs/jeff33/fy_lib', complete=True)

Currently

libraries are in ONIX format. You have to just write the path location of these libraries.

1 Like

Ok, these will help me.
Thank you @Pranto for giving this additional information.