Merge pull request #1 from paulromano/results-export-fix

Fix potential bug with nuclide densities in Results.export_to_materials
This commit is contained in:
Olek 2022-08-11 13:03:41 -07:00 committed by GitHub
commit 131fd2f3e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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