I would like to ask how to import the nuclear data library downloaded from the official website into OpenMC. I have downloaded three databases from the official website, but I don’t know how to import them into OpenMC on my Linux system. Any reply would be greatly appreciated.
I am a newcomer to OpenMC and have some questions about how to start and run OpenMC. I would appreciate any help.
Hi @Utopia and welcome to the community. You can find usage instructions here:
For a given library, download and unpack the archive in a desired location. Inside the directory that is extracted is a file called
cross_sections.xml
. Set yourOPENMC_CROSS_SECTIONS
environment variable to the absolute path of this file and then it will be recognized when you run OpenMC.
Thank you for your patient reply,I wonder what operating system (Windows or Linux) will the environment be configured on?
Additionally, I think I need a simple example to verify that my OpenMC is running properly.
Hi @Utopia there are some examples you will find in your open clone ( I am guessing you installed it from the source code). Please go to your openmc directory and open it in the terminal. Then
run this commands:
cd examples/jezebel
python jezebel.py
if this works then OK other wise you can just copy this input file and run it as a python program.
import openmc
# Create plutonium metal material
pu = openmc.Material()
pu.set_density('sum')
pu.add_nuclide('Pu239', 3.7047e-02)
pu.add_nuclide('Pu240', 1.7512e-03)
pu.add_nuclide('Pu241', 1.1674e-04)
pu.add_element('Ga', 1.3752e-03)
mats = openmc.Materials([pu])
mats.export_to_xml()
# Create a single cell filled with the Pu metal
sphere = openmc.Sphere(r=6.3849, boundary_type='vacuum')
cell = openmc.Cell(fill=pu, region=-sphere)
geom = openmc.Geometry([cell])
geom.export_to_xml()
# Finally, define some run settings
settings = openmc.Settings()
settings.batches = 200
settings.inactive = 10
settings.particles = 10000
settings.export_to_xml()
# Run the simulation
openmc.run()
# Get the resulting k-effective value
n = settings.batches
with openmc.StatePoint(f'statepoint.{n}.h5') as sp:
keff = sp.keff
print(f'Final k-effective = {keff}')
also make sure that your OPENMC_CROSS_SECTIONS
is set. To check try to run this command in the terminal,
echo $OPENMC_CROSS_SECTIONS
and it should print out something like this: /home/ebny_walid/OpenMC/openmc-setup/endfb-viii.0-hdf5/cross_sections.xml
if you get a blank then copy the path of the cross_sections.xml
file [ for me it was /home/ebny_walid/OpenMC/openmc-setup/endfb-viii.0-hdf5/cross_sections.xml
this] and try to set
export OPENMC_CROSS_SECTIONS ="your_copied_path"
to get more examples you can visit this repository: GitHub - mit-crpg/openmc-reactor-examples: Catalogs a plethora of reactor inputs for OpenMC