Question regarding setting depletion chain as environment variable!

15 views
Skip to first unread message

Farshid Reza Sabab

unread,
Jul 23, 2020, 1:51:09 PM7/23/20
to OpenMC Users Group
Hello,
I was thinking if there is anyway to set depletion chain as environment variable like as we set cross-section path as environment variable. Is there anyway to do this?  Also, is it possible to embed the depletion chain file in the cross-section library ?

Andrew Johnson

unread,
Jul 24, 2020, 10:44:12 AM7/24/20
to OpenMC Users Group
There used to be an environment variable that was used for just this purpose, but it was removed in #1247

However, you can add the depletion chain to the cross section file pointed at by OPENMC_CROSS_SECTIONS. The best way to do this is with openmc.data.DataLibrary.register_file

import openmc.data
lib = openmc.data.DataLibrary.from_xml()  # looks for OPENMC_CROSS_SECTIONS if not path provided
lib.register_file(<path to your depletion chain file>)
lib.export_to_xml(<path to new cross section file>)

Then you can update your OPENMC_CROSS_SECTIONS environment variable to point to this new file, or move the new file to the existing location. Alternatively. you could use os.environ to export the new library directly to the path indicated by the environment variable.

It should be said that you may want to make a backup cross sections file before overwriting the file at OPENMC_CROSS_SECTIONS

Regards,

Andrew
Reply all
Reply to author
Forward
0 new messages