diff --git a/openmc/deplete/results_list.py b/openmc/deplete/results_list.py index eee214d8ff..db1f0ff9db 100644 --- a/openmc/deplete/results_list.py +++ b/openmc/deplete/results_list.py @@ -59,9 +59,9 @@ class ResultsList(list): Nuclide name to evaluate nuc_units : {"atoms", "atom/b-cm", "atom/cm3"}, optional Units for the returned concentration. Default is ``"atoms"`` - time_units : {"s", "d"}, optional + time_units : {"s", "min", "h", "d"}, optional Units for the returned time array. Default is ``"s"`` to - return the value in seconds + return the value in seconds. Returns ------- @@ -71,7 +71,7 @@ class ResultsList(list): Concentration of specified nuclide in units of ``nuc_units`` """ - check_value("time_units", time_units, {"s", "d"}) + check_value("time_units", time_units, {"s", "d", "min", "h"}) check_value("nuc_units", nuc_units, {"atoms", "atom/b-cm", "atom/cm3"}) @@ -86,6 +86,10 @@ class ResultsList(list): # Unit conversions if time_units == "d": time /= (60 * 60 * 24) + elif time_units == "h": + time /= (60 * 60) + elif time_units == "min": + time /= 60 if nuc_units != "atoms": # Divide by volume to get density diff --git a/tests/unit_tests/test_deplete_resultslist.py b/tests/unit_tests/test_deplete_resultslist.py index d3609135b3..9b40a1ac91 100644 --- a/tests/unit_tests/test_deplete_resultslist.py +++ b/tests/unit_tests/test_deplete_resultslist.py @@ -34,8 +34,12 @@ def test_get_atoms(res): assert t_days == pytest.approx(t_ref / (60 * 60 * 24)) assert n_cm3 == pytest.approx(n_ref / volume) - _t, n_bcm = res.get_atoms("1", "Xe135", nuc_units="atom/b-cm") + t_min, n_bcm = res.get_atoms("1", "Xe135", nuc_units="atom/b-cm", time_units="min") assert n_bcm == pytest.approx(n_cm3 * 1e-24) + assert t_min == pytest.approx(t_ref / 60) + + t_hour, _n = res.get_atoms("1", "Xe135", time_units="h") + assert t_hour == pytest.approx(t_ref / (60 * 60)) def test_get_reaction_rate(res):