Skip to content

Commit

Permalink
avoid zero division if source rate of previous result is zero (#3169)
Browse files Browse the repository at this point in the history
  • Loading branch information
church89 authored Oct 14, 2024
1 parent 8263f05 commit dcb2557
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions openmc/deplete/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,9 @@ def _get_bos_data_from_restart(self, source_rate, bos_conc):
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):
Expand Down

0 comments on commit dcb2557

Please sign in to comment.