diff --git a/openmc/element.py b/openmc/element.py index 1416ba1eb6..1f72115cc4 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -193,7 +193,7 @@ class Element(object): # Adjust the abundances for the absent nuclides for nuclide in absent_nuclides: - if nuclide == 'O18' and 'O16' in mutual_nuclides: + if nuclide in ['O17', 'O18'] and 'O16' in mutual_nuclides: abundances['O16'] += NATURAL_ABUNDANCE[nuclide] elif nuclide == 'Ta180' and 'Ta181' in mutual_nuclides: abundances['Ta181'] += NATURAL_ABUNDANCE[nuclide] @@ -253,7 +253,7 @@ class Element(object): for nuclide, abundance in abundances.items(): nuc = openmc.Nuclide(nuclide) nuc.scattering = self.scattering - pct = float('{:.14}'.format(percent*abundance)) + pct = round(percent*abundance, 12) isotopes.append((nuc, pct, percent_type)) return isotopes diff --git a/tests/test_triso/inputs_true.dat b/tests/test_triso/inputs_true.dat index 856581fdef..0ca3943f42 100644 --- a/tests/test_triso/inputs_true.dat +++ b/tests/test_triso/inputs_true.dat @@ -1 +1 @@ -5859cd73807c74cce612275817d3e1c6a2b55a347b31925115dbda2d83df60345ea4617cbc3b057a2fcfef4242f0e53d66d569ecffaeed35975ca28307b354c4 \ No newline at end of file +3a356b5b6d0aaa3db8c601521e1837a6870c5e5f6d1068f4f3e9b896c0107517d99ff9676311221633169b4d79dc1c4076bff84130e6de16df7ace4da5481a60 \ No newline at end of file diff --git a/tests/test_triso/plots.xml b/tests/test_triso/plots.xml new file mode 100644 index 0000000000..60ae7d9d8f --- /dev/null +++ b/tests/test_triso/plots.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/tests/test_triso/results_true.dat b/tests/test_triso/results_true.dat index 1716b67f53..15107e8c84 100644 --- a/tests/test_triso/results_true.dat +++ b/tests/test_triso/results_true.dat @@ -1,2 +1,2 @@ k-combined: -1.643727E+00 5.233644E-02 +1.636336E+00 1.154000E-01 diff --git a/tests/test_triso/test_triso.py b/tests/test_triso/test_triso.py index e79b9fa8c8..685034491f 100644 --- a/tests/test_triso/test_triso.py +++ b/tests/test_triso/test_triso.py @@ -19,33 +19,34 @@ class TRISOTestHarness(PyAPITestHarness): # Define TRISO matrials fuel = openmc.Material() fuel.set_density('g/cm3', 10.5) - fuel.add_element('U', 0.14154, 'ao', 14.0) - fuel.add_element('C', 0.5) - fuel.add_element('O', 1.5) + fuel.add_nuclide('U235', 0.14154) + fuel.add_nuclide('U238', 0.85846) + fuel.add_nuclide('C0', 0.5) + fuel.add_nuclide('O16', 1.5) porous_carbon = openmc.Material() porous_carbon.set_density('g/cm3', 1.0) - porous_carbon.add_element('C', 1.0) + porous_carbon.add_nuclide('C0', 1.0) porous_carbon.add_s_alpha_beta('c_Graphite') ipyc = openmc.Material() ipyc.set_density('g/cm3', 1.90) - ipyc.add_element('C', 1.0) + ipyc.add_nuclide('C0', 1.0) ipyc.add_s_alpha_beta('c_Graphite') sic = openmc.Material() sic.set_density('g/cm3', 3.20) sic.add_element('Si', 1.0) - sic.add_element('C', 1.0) + sic.add_nuclide('C0', 1.0) opyc = openmc.Material() opyc.set_density('g/cm3', 1.87) - opyc.add_element('C', 1.0) + opyc.add_nuclide('C0', 1.0) opyc.add_s_alpha_beta('c_Graphite') graphite = openmc.Material() graphite.set_density('g/cm3', 1.1995) - graphite.add_element('C', 1.0) + graphite.add_nuclide('C0', 1.0) graphite.add_s_alpha_beta('c_Graphite') # Create TRISO particles