Easily generate macroscopic cross section vs. energy from openmc.Material?

Hi all,

It would be nice to be able to automatically generate data to plot macroscopic cross section of a material vs. energy for some reaction. In particular, I think this would be useful for making a plot of things like nu*Sigma_f / Sigma_a for comparing different fuels in my senior design project. So far, my approach has been making materials, making a dictionary that maps nuclide names to variables containing instances of openmc.data.IncidentNeutron, and finally writing functions that take the dictionaries and materials to compute macroscopic cross section plots.

  1. is there an easier way to do this? Maybe like openmc.Material.computeMacroXS(<MT_number>)? I don’t see any in source.

and 2) would it be desirable to have Material methods that associate nuclides in a material to a particular data library? I think this would look something like adding a field to openmc.Nuclide for the .h5 file containing relevant data. Then Material methods could use those libraries for computing macroscopic cross sections of interest.

Thanks,

Gavin Ridley

Hi Gavin,

To plot macroscopic cross sections of a material, you can try using the openmc.plot_xs function. For example:

import matplotlib.pyplot as plt


openmc.plot_xs(material, [‘nu-fission’], [‘absorption’])
plt.show()

As for your second question, unfortunately we don’t have a way right now of managing nuclides from multiple libraries at the same time.

Best regards,
Paul

Hey Paul,

Thanks, this is a really helpful function! I had no clue it could take Materials as well.

Thanks,

Gavin Ridley