From bc1ab31746518ab420f01695ab91da4390134cd4 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 3 Jun 2022 09:09:52 -0500 Subject: [PATCH] Raise exception if timestep in [MWd/kg] is given with zero power --- openmc/deplete/abc.py | 3 +++ openmc/deplete/stepresult.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index df30579e57..457c51a8ae 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -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: diff --git a/openmc/deplete/stepresult.py b/openmc/deplete/stepresult.py index bfd1654816..6f30e934d9 100644 --- a/openmc/deplete/stepresult.py +++ b/openmc/deplete/stepresult.py @@ -20,7 +20,7 @@ __all__ = ["StepResult"] class StepResult: - """Output of a depletion run + """Result of a single depletion timestep Attributes ----------