From 5cdef2e964d6823faf7ebae0f977d86df4506998 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Fri, 26 Aug 2022 16:30:24 +0100 Subject: [PATCH] added Julian years to Integrator --- openmc/deplete/abc.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 3e2c37ece7..45432218a7 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -12,7 +12,6 @@ from numbers import Real, Integral from contextlib import contextmanager import os from pathlib import Path -import sys import time from warnings import warn @@ -36,6 +35,7 @@ __all__ = [ _SECONDS_PER_MINUTE = 60 _SECONDS_PER_HOUR = 60*60 _SECONDS_PER_DAY = 24*60*60 +_SECONDS_PER_JULIAN_YEAR = 365.25*24*60*60 OperatorResult = namedtuple('OperatorResult', ['k', 'rates']) OperatorResult.__doc__ = """\ @@ -531,11 +531,11 @@ class Integrator(ABC): each interval in :attr:`timesteps` .. versionadded:: 0.12.1 - timestep_units : {'s', 'min', 'h', 'd', 'MWd/kg'} + timestep_units : {'s', 'min', 'h', 'd', 'a', 'MWd/kg'} Units for values specified in the `timesteps` argument. 's' means - seconds, 'min' means minutes, 'h' means hours, and 'MWd/kg' indicates - that the values are given in burnup (MW-d of energy deposited per - kilogram of initial heavy metal). + seconds, 'min' means minutes, 'h' means hours, 'a' means Julian years + and 'MWd/kg' indicates that the values are given in burnup (MW-d of + energy deposited per kilogram of initial heavy metal). solver : str or callable, optional If a string, must be the name of the solver responsible for solving the Bateman equations. Current options are: @@ -638,6 +638,8 @@ class Integrator(ABC): seconds.append(timestep*_SECONDS_PER_HOUR) elif unit in ('d', 'day'): seconds.append(timestep*_SECONDS_PER_DAY) + elif unit in ('a', 'year'): + seconds.append(timestep*_SECONDS_PER_JULIAN_YEAR) elif unit.lower() == 'mwd/kg': watt_days_per_kg = 1e6*timestep kilograms = 1e-3*operator.heavy_metal