I have 2 questions about the data extraction of OpenMC depletion results.
First, I wonder if you have any plans to give both the number of atoms and radioactivity of the nuclides in the output files. This would eliminate the need to manually calculate the results again for many analyses that use activity as a unit.
Secondly, is there a convenient way to extract all the nuclides in the material directly after each burnup calculation. Because, in many cases, I need to do a comparison of all the generated nuclides to confirm which are the main contributing nuclides. A dumb way for me to do this is to get a list of all nuclides and then get their concentrations using the command like these:
time_01, isotope_01 = results.get_atoms(“1”, “isotope_01”)
time_02, isotope_02 = results.get_atoms(“2”, “isotope_02”)
Right now the
Results class doesn’t provide any methods that give that information in an easy way. What I would recommend is to export your results to a new
Materials object and then use methods on the
Material class. This would look something like:
# Export materials from the last timestep
materials = results.export_to_materials(-1)
# materials is a list of Material objects, so you'll need to get the right index
# for the material of interest
material = materials[index]
# Get number of atoms
atoms = material.get_nuclide_atoms()
# Get total activity and activity by nuclide
activity = material.activity
activity_by_nuclide = material.get_nuclide_activity()
Note that the ability to get activity was just recently merged in OpenMC and will be part of our next release.
Thanks, @paulromano. This provides a good solution. Looking forward to a more powerful OpenMC.