Don't update non-depletable materials (changes test results)

This commit is contained in:
Paul Romano 2018-02-19 09:15:09 -06:00
parent afd4ad61b0
commit f113205ab9
3 changed files with 23 additions and 19 deletions

View file

@ -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:

View file

@ -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)