Problem loading MGXS to state point HDF5 output

Hello!

I am trying to compute MGXS for cells and so on… I am able to create the necessary xml tally files, and I can only see the ASCII output of tallies.out. Now, on my python input I tried a simple case to get homogenized and multigroup XS’s, such as:

Instantiate a 2-group EnergyGroups object

groups = mgxs.EnergyGroups()
groups.group_edges = np.array([0., 0.625, 20.0e6])

Instantiate a few different sections

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

Instantiate an empty Tallies object

tallies_file = openmc.Tallies()

Add absorption tallies to the tallies file

tallies_file += absorption.tallies.values()

Export to “tallies.xml”

tallies_file.export_to_xml()

Of course after importing openmc as mgxs and so on, I am able to fully run my case and produce a statepoint.20.h5 file…but when for instance, in a jupyter page I do:

sp = openmc.StatePoint(‘statepoint.20.h5’)
absorption.load_from_statepoint(sp)

I got an error stating that the name absorption is not defined…

I was also wondering if from the tallies.put file one can get directly the XS values instead of the reaction rates and fluxes…

Thanks in advance!

UPDATE

Hi,

I realized what was my problem… I think that essentially, the MGXS class should be used as a post-processing tool. The tallies.xml file contains the fluxes and reaction rates info as this is what is actually computed by the code. Thereafter, once openmc has been executed, during the post-processing phase mgxs is invoked in python (i.e. absorption = mgxs.AbsorptionXS(domain=fuel_
hex2, groups=groups) ). So I understood now that after the calculation, all the geometry, materials and type of requested macroscopic XS’s should be loaded again while in jupyter or in a python environment. So my problem is so far solved.

Nevertheless, I do have one question… I found tedious the fact that I should load again all the geometry and materials in order to extract info from the StatePoint that was computed a priori. Maybe I am doing the long way; perhaps after the OpenMC execution, there is an easy way to load geometry and materials (from summary.h5 maybe???) in order to extract StatePoint info such as MGXS and so on… Would appreciate if such procedure exists, if you could please let me know a fast way of doing this.

Regards,

Augusto.

Hi Augusto,

The Summary object does have ‘geometry’ and ‘materials’ attributes that are equivalent to the geometry and materials used to construct a model. Hopefully that should serve your needs.

Best,
Paul