mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
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:
commit
131fd2f3e0
1 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue