Can't Access Transmutation Results: KeyError: '6'

Hi. I’m trying to access the results of my depletion. I have the following lines. My material ID: 9 is Nitrogen. I’m trying to get the number of atoms through each timestep.

results = openmc.deplete.Results("./depletion_results.h5")

times, number_of_N14_atoms = results.get_atoms("9", "N14")

I get the following error:
File “/h/u659290/.conda/envs/openmc/lib/python3.9/site-packages/openmc/deplete/results.py”, line 203, in get_atoms
concentrations[i] = result[0, mat_id, nuc]
File “/h/u659290/.conda/envs/openmc/lib/python3.9/site-packages/openmc/deplete/stepresult.py”, line 103, in getitem
mat = self.index_mat[mat]
KeyError: ‘6’

I can’t seem to figure out why I’m getting this. I have tried inputting the material name, with and without quotations and no luck. Any advice please?

1 Like

Hi Harry, welcome to the community.
If the script could read the depletion results files, and the material ID you want to read is 9, have you tried the complete declaration like this one? .get_atoms(mat='9', nuc='N14')
I usually use a longer declaration i.e.

DeplTime, N14atomdens = DeplResults.get_atoms(mat='9', nuc='N14', nuc_units='atom/b-cm', time_units='d')
1 Like

Thanks, this sorted it!

1 Like