From dcb25575ca0691ddde36af5141376c29aab884bc Mon Sep 17 00:00:00 2001 From: Lorenzo Chierici Date: Mon, 14 Oct 2024 21:47:22 +0200 Subject: [PATCH] avoid zero division if source rate of previous result is zero (#3169) --- openmc/deplete/abc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 7bf7f1086a..784023f26f 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -754,8 +754,9 @@ class Integrator(ABC): rates = res.rates[0] k = ufloat(res.k[0, 0], res.k[0, 1]) - # Scale reaction rates by ratio of source rates - rates *= source_rate / res.source_rate + if res.source_rate != 0.0: + # Scale reaction rates by ratio of source rates + rates *= source_rate / res.source_rate return bos_conc, OperatorResult(k, rates) def _get_start_data(self):