# Obtaining all nuclides and number of atoms in a material after depletion

**URL:** <https://openmc.discourse.group/t/obtaining-all-nuclides-and-number-of-atoms-in-a-material-after-depletion/4793>\
**Category:** User Support\
**Created:** [September 13, 2024, 12:06pm UTC](https://openmc.discourse.group/t/obtaining-all-nuclides-and-number-of-atoms-in-a-material-after-depletion/4793 "2024-09-13T12:06:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harrytili](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@harrytili](https://openmc.discourse.group/u/harrytili)\
**Post date:** [September 13, 2024, 12:06pm UTC](https://openmc.discourse.group/t/obtaining-all-nuclides-and-number-of-atoms-in-a-material-after-depletion/4793/1 "2024-09-13T12:06:32Z")

</div>

Hello, happy Friday.

I found the following thread which proved to be very helpful: [https://openmc.discourse.group/t/how-to-plot-all-nuclides-density-of-depletion-material/2762/2](https://openmc.discourse.group/t/how-to-plot-all-nuclides-density-of-depletion-material/2762/2)

This thread gives a way of using the depletions.h5 file to obtain all nuclides present. However, I didn’t see a way to specify which material I want to look at (I’m only concerned with one), and is there a way to get the corresponding number of atoms from this?

This is the code they used:  
results = openmc.deplete.Results(‘depletion\_results.h5’)  
nuclides = list(results[0].index\_nuc.keys())

But I would like to be able to specify which material I’m looking at, and also get atomic numbers.

I have tried following other techniques given on this forum, like obtaining the materials.xml file of the last time-step. However, as the cross-sections file does not include all isotopes, in particular very short lived isotopes, then this is not a complete list.

I can supply more information if required, I hope I’ve made my ask clear.

Thanks,  
Harry

---

<div class="post-metadata">

**Author:** ![wahidluthfi](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/wahidluthfi/32/3375_2.png) [@wahidluthfi](https://openmc.discourse.group/u/wahidluthfi)\
**Post date:** [September 16, 2024, 12:44am UTC](https://openmc.discourse.group/t/obtaining-all-nuclides-and-number-of-atoms-in-a-material-after-depletion/4793/2 "2024-09-16T00:44:00Z")

</div>

Hi Harry, welcome back to the community.  
Sorry if I am wrong, but from what I understand to your question, you want to find the atomic density from one of your materials that you know its material ID right? Have you supplied the material ID to your get\_atoms or get\_mass input?  
here are some examples if I want to extract the U-235 atomic density from my fuel material that has a material ID of 1

```auto
# read depletion results
depletion_results = openmc.deplete.Results('depletion_results.h5')
# read the atomic density of U235 from material ID 1
deptime, atom_U235 = depletion_results.get_atoms(mat='1', nuc='U235', nuc_units='atom/b-cm', time_units='d')
print(atom_U235) # print atomic density on each burnup steps
# len(atom_U235) # check data length = burnup steps + 1
# plot the atomic density if needed
plt.plot(deptime, atom_U235, label='U-235')
plt.xlabel('Time (d)')
plt.ylabel('Atomic density U-235 (atom/barn-cm)')

```

same thing if I want to plot the total Pu-239 mass from my fuel material @ ID 1

```auto
deptime, mass_Pu239 = depletion_results.get_mass(mat='1', nuc='Pu239', mass_units='g', time_units='d')
print(atom_Pu239)
# len(atom_Pu239) # check data length = burnup steps + 1
# plot
plt.plot(deptime, mass_Pu239, label='Pu-239')
plt.xlabel('Time (d)')
plt.ylabel('Pu-239 mass (gr)')

```

then regarding the short-lived isotopes, I think if those isotopes are produced during depletion calculation, then openmc will report it, i.e. Mo-99 with half life 66h and Xe- 135 with half life 9h will reported when produced from a fission reaction. but I don’t know if the isotopes interested you have a shorter half life.

hope it could help you

---

<div class="post-metadata">

**Author:** ![harrytili](https://avatars.discourse-cdn.com/v4/letter/h/eb8c5e/32.png) [@harrytili](https://openmc.discourse.group/u/harrytili)\
**Post date:** [September 16, 2024, 8:35am UTC](https://openmc.discourse.group/t/obtaining-all-nuclides-and-number-of-atoms-in-a-material-after-depletion/4793/3 "2024-09-16T08:35:03Z")

</div>

Hi, thankyou for the reply.

So the method you have outlined is very useful, and i have already been using it when depleting fuel. However, this particular depletion I am looking at, I don’t have a complete list of all transmutation products I will be expecting. Therefore I can’t use the ‘get\_atoms’ function, as I’d have to include every single possible isotope. What I was looking for was a readout of all present isotopes and their associated abundance.

Cheers,  
Harry

---

<div class="post-metadata">

**Author:** ![wahidluthfi](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/wahidluthfi/32/3375_2.png) [@wahidluthfi](https://openmc.discourse.group/u/wahidluthfi)\
**Post date:** [September 16, 2024, 11:24pm UTC](https://openmc.discourse.group/t/obtaining-all-nuclides-and-number-of-atoms-in-a-material-after-depletion/4793/4 "2024-09-16T23:24:12Z")

</div>

Hi Harry, sorry if I didn’t answer your question.  
Did the isotopes exist on the burnup chain that you use during depletion calculation? If the isotopes exist, I think it will be reported on the calculation because from my experience, openmc will report atomic density of isotopes even if it is at the order or E-20. So it is more detailed than some other transport/lattice code that only report isotopes that has atomic density above E-10 by default.
