From f9b2c21d59241990ca28fcb604b9ef7ca2c97f7c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Aug 2022 23:12:01 -0500 Subject: [PATCH] Fix potential bug with nuclide densities in Results.export_to_materials --- openmc/deplete/results.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index b89bae088b..c2138b55c6 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -417,7 +417,16 @@ class Results(list): mat_id = str(mat.id) if mat_id in result.mat_to_ind: mat.volume = result.volume[mat_id] + + # Change density of all nuclides in material to atom/b-cm + atoms_per_barn_cm = mat.get_nuclide_atom_densities() + for nuc, value in atoms_per_barn_cm.items(): + mat.remove_nuclide(nuc) + mat.add_nuclide(nuc, value) mat.set_density('sum') + + # For nuclides in chain that have cross sections, replace + # density in original material with new density from results for nuc in result.nuc_to_ind: if nuc not in available_cross_sections: continue