diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 9a895a508..e5eaf52dc 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -397,6 +397,9 @@ class OpenMCOperator(Operator): number_i = comm.bcast(self.number, root=rank) for mat in number_i.mat_to_ind: + if number_i.mat_to_ind[mat] >= number_i.n_mat_burn: + continue + nuclides = [] densities = [] for nuc in number_i.nuc_to_ind: diff --git a/tests/regression_tests/test_deplete_utilities.py b/tests/regression_tests/test_deplete_utilities.py index f9d34aa75..f38129cc7 100644 --- a/tests/regression_tests/test_deplete_utilities.py +++ b/tests/regression_tests/test_deplete_utilities.py @@ -20,35 +20,36 @@ def res(): def test_evaluate_single_nuclide(res): """Tests evaluating single nuclide utility code.""" - x, y = utilities.evaluate_single_nuclide(res, "1", "Xe135") + t, n = utilities.evaluate_single_nuclide(res, "1", "Xe135") - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - y_ref = [6.6747328233649218e+08, 3.5519299354458244e+14, - 3.4599104054580338e+14, 3.3821165110278112e+14] + t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + n_ref = [6.6747328233649218e+08, 3.5421791038348462e+14, + 3.6208592242443462e+14, 3.3799758969347038e+14] - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, y_ref) + np.testing.assert_array_equal(t, t_ref) + np.testing.assert_array_equal(n, n_ref) def test_evaluate_reaction_rate(res): """Tests evaluating reaction rate utility code.""" - x, y = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") + t, r = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - xe_ref = np.array([6.6747328233649218e+08, 3.5519299354458244e+14, - 3.4599104054580338e+14, 3.3821165110278112e+14]) - r_ref = np.array([4.0643598574337784e-05, 4.1457730544386974e-05, - 3.4121248544056681e-05, 3.9204686657643301e-05]) + t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + n_ref = np.array([6.6747328233649218e+08, 3.5421791038348462e+14, + 3.6208592242443462e+14, 3.3799758969347038e+14]) + xs_ref = np.array([4.0594392323131994e-05, 3.9249546927524987e-05, + 3.8394587728581798e-05, 4.1521845978371697e-05]) - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, xe_ref * r_ref) + np.testing.assert_array_equal(t, t_ref) + np.testing.assert_array_equal(r, n_ref * xs_ref) def test_evaluate_eigenvalue(res): """Tests evaluating eigenvalue.""" - x, y = utilities.evaluate_eigenvalue(res) + t, k = utilities.evaluate_eigenvalue(res) - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - y_ref = [1.1921986054449838, 1.1712785643938586, 1.1927099024502694, 1.2269183590698847] + t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + k_ref = [1.181281798790367, 1.1798750921988739, 1.1965943696058159, + 1.2207119847790813] - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, y_ref) + np.testing.assert_array_equal(t, t_ref) + np.testing.assert_array_equal(k, k_ref) diff --git a/tests/regression_tests/test_reference.h5 b/tests/regression_tests/test_reference.h5 index f832e3e26..6e724c597 100644 Binary files a/tests/regression_tests/test_reference.h5 and b/tests/regression_tests/test_reference.h5 differ