fix unit conversion in openmc.deplete.Results.get_mass (#2761)

Co-authored-by: Nicolas Linden <n.linden@naarea.fr>
This commit is contained in:
nplinden 2023-11-09 14:13:30 +01:00 committed by GitHub
parent 7c14603312
commit 910d1df1c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -318,7 +318,7 @@ class Results(list):
# Divide by volume to get density
mass /= self[0].volume[mat_id]
elif mass_units == "kg":
mass *= 1e3
mass /= 1e3
return times, mass

View file

@ -111,7 +111,7 @@ def test_get_mass(res):
assert n_cm3 == pytest.approx(n_ref / volume)
t_min, n_bcm = res.get_mass("1", "Xe135", mass_units="kg", time_units="min")
assert n_bcm == pytest.approx(n_ref * 1e3)
assert n_bcm == pytest.approx(n_ref / 1e3)
assert t_min == pytest.approx(t_ref / 60)
t_hour, _n = res.get_mass("1", "Xe135", time_units="h")