diff --git a/openmc/element.py b/openmc/element.py index 94b6ae8d6d..3df2ff1f24 100644 --- a/openmc/element.py +++ b/openmc/element.py @@ -62,7 +62,7 @@ class Element(str): Single nuclide name to enrich from a natural composition (e.g., 'O16') enrichment_type: {'ao', 'wo'}, optional 'ao' for enrichment as atom percent and 'wo' for weight percent. - Default is 'ao' + Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment cross_sections : str, optional Location of cross_sections.xml file. Default is None. @@ -103,7 +103,7 @@ class Element(str): When the `enrichment` argument is specified with `enrichment_target`, a general enrichment procedure is used for elements composed of exactly two naturally-occurring isotopes. `enrichment` is interpreted as atom - percent by default but can be controlled by the `enrichment_type` + percent by default but can be controlled by the `enrichment_type` argument. """ diff --git a/openmc/material.py b/openmc/material.py index e9ef21db06..fd9f92113c 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -522,7 +522,7 @@ class Material(IDManagerMixin): Single nuclide name to enrich from a natural composition (e.g., 'O16') enrichment_type: {'ao', 'wo'}, optional 'ao' for enrichment as atom percent and 'wo' for weight percent. - Default is 'ao' + Default is: 'ao' for two-isotope enrichment; 'wo' for U enrichment Notes ----- diff --git a/tests/unit_tests/test_element.py b/tests/unit_tests/test_element.py index ebbdab24e8..bacb988b9a 100644 --- a/tests/unit_tests/test_element.py +++ b/tests/unit_tests/test_element.py @@ -3,9 +3,6 @@ from pytest import approx, raises from openmc.data import NATURAL_ABUNDANCE, atomic_mass -# Relative tolerance for float comparison -TOL = 1e-9 - def test_expand_no_enrichment(): """ Expand Li in natural compositions""" @@ -13,7 +10,7 @@ def test_expand_no_enrichment(): # Verify the expansion into ATOMIC fraction against natural composition for isotope in lithium.expand(100.0, 'ao'): - assert isotope[1] == approx(NATURAL_ABUNDANCE[isotope[0]] * 100.0, rel=TOL) + assert isotope[1] == approx(NATURAL_ABUNDANCE[isotope[0]] * 100.0) # Verify the expansion into WEIGHT fraction against natural composition natural = {'Li6': NATURAL_ABUNDANCE['Li6'] * atomic_mass('Li6'), @@ -23,7 +20,7 @@ def test_expand_no_enrichment(): natural[key] /= li_am for isotope in lithium.expand(100.0, 'wo'): - assert isotope[1] == approx(natural[isotope[0]] * 100.0, rel=TOL) + assert isotope[1] == approx(natural[isotope[0]] * 100.0) def test_expand_enrichment(): @@ -33,11 +30,11 @@ def test_expand_enrichment(): # Verify the enrichment by atoms ref = {'Li6': 75.0, 'Li7': 25.0} for isotope in lithium.expand(100.0, 'ao', 25.0, 'Li7', 'ao'): - assert isotope[1] == approx(ref[isotope[0]], rel=TOL) + assert isotope[1] == approx(ref[isotope[0]]) # Verify the enrichment by weight for isotope in lithium.expand(100.0, 'wo', 25.0, 'Li7', 'wo'): - assert isotope[1] == approx(ref[isotope[0]], rel=TOL) + assert isotope[1] == approx(ref[isotope[0]]) def test_expand_exceptions():