Raise exception if timestep in [MWd/kg] is given with zero power

This commit is contained in:
Paul Romano 2022-06-03 09:09:52 -05:00
parent 355ecd3747
commit bc1ab31746
2 changed files with 4 additions and 1 deletions

View file

@ -719,6 +719,9 @@ class Integrator(ABC):
elif unit.lower() == 'mwd/kg':
watt_days_per_kg = 1e6*timestep
kilograms = 1e-3*operator.heavy_metal
if rate == 0.0:
raise ValueError("Cannot specify a timestep in [MWd/kg] when"
" the power is zero.")
days = watt_days_per_kg * kilograms / rate
seconds.append(days*_SECONDS_PER_DAY)
else:

View file

@ -20,7 +20,7 @@ __all__ = ["StepResult"]
class StepResult:
"""Output of a depletion run
"""Result of a single depletion timestep
Attributes
----------