From e97a69069ebbf76cec325620843a49929dbaaa6d Mon Sep 17 00:00:00 2001 From: guillaume Date: Sat, 14 Dec 2019 21:17:00 -0500 Subject: [PATCH] Handle case where user forgot to tally multiplicities or nu-scatter more gracefully --- openmc/mgxs/library.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 83d3178ff..352c5b173 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -1167,6 +1167,16 @@ class Library(object): np.subtract(xsdata._total[i], np.sum(np.sum( xsdata._scatter_matrix[i][:, :, :, :, :], axis=4), axis=3)) + # if only scatter matrices have been tallied, multiplicity cannot + # be accounted for + else: + msg = 'Scatter multiplicity (such as (n,xn) reactions) ' \ + 'are ignored since multiplicity or nu-scatter matrices '\ + 'were not tallied for '+xsdata_name + warn(msg, RuntimeWarning) + xsdata.set_scatter_matrix_mgxs(scatt_mgxs, xs_type=xs_type, + nuclide=[nuclide], + subdomain=subdomain) return xsdata