[help needed] OPENMC Cross Section not specified

Hello,

I have successfully installed OpenMC and configured cross section using “nndc-data.” I have also set the environment variable of OPENMC_CROSS_SECTION to nndc_hdf5/cross_sections.xml using the command

OPENMC_CROSS_SECTION = nndc_hdf5/cross_sections.xml
When I echoed $OPENMC_CROSS SECTION it also returned nndc_hdf5/cross_sections.xml.

However, when I runed the “Modelling a Pin-Cell” example on my Jupyter Notebook (which is running through my terminal), an error occured at the very end when actually running OPENMC.

For the input

openmc.run()

The error message follows

Reading settings XML file...
 ERROR: No cross_sections.xml file was specified in materials.xml, settings.xml,
         or in the OPENMC_CROSS_SECTIONS environment variable. OpenMC needs such
        a file to identify where to find ACE cross section libraries. Please
        consult the user's guide at [http://mit-crpg.github.io/openmc](http://mit-crpg.github.io/openmc) for
        information on how to set up ACE cross section libraries.
STOP 1

I have the cross_sections.xml set to nndc_hdf5/cross_sections.xml but problem still persist. Does anyone know why it may cause the problem? I am using ubuntu bash on windows to install OPENMC, does that make a difference when configuring cross sections or setting up OpenMC in general?

Sincerely,

Brian

Hi Brian,

Generally speaking, you should set OPENMC_CROSS_SECTIONS to be an absolute path, not a relative path, so that if you are running in a different directory, it is still able to find the cross_sections.xml file.

From your Jupyter notebook, I’d advise checking the environment variable with:

import os
print(os.environ[‘OPENMC_CROSS_SECTIONS’])

Best,
Paul

Hi Paul
while calculating two group cross section I found a type error mentioned as:

TypeError: TotalXS.init() got an unexpected keyword argument ‘groups’

the problem indicates at the section given below:

total = mgxs.TotalXS(domain=cell, groups=groups)

absorption = mgxs.AbsorptionXS(domain=cell, groups=groups)

scattering = mgxs.ScatterXS(domain=cell, groups=groups)

can you comment something on that?

Regards
Sabyasachi

@Sabyasachi At some point, the name of the argument was changed from groups to energy_groups, so you just need to change it to:

total = mgxs.TotalXS(domain=cell, energy_groups=groups)
absorption = mgxs.AbsorptionXS(domain=cell, energy_groups=groups)
scattering = mgxs.ScatterXS(domain=cell, energy_groups=groups)
1 Like