Merge pull request #1166 from liangjg/develop

Updated atomic mass evaluation to AME 2016
This commit is contained in:
Paul Romano 2019-02-15 15:04:45 -06:00 committed by GitHub
commit 1fe80990e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3483 additions and 3400 deletions

View file

@ -141,8 +141,8 @@ _GND_NAME_RE = re.compile(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)')
def atomic_mass(isotope):
"""Return atomic mass of isotope in atomic mass units.
Atomic mass data comes from the `Atomic Mass Evaluation 2012
<https://www-nds.iaea.org/amdc/ame2012/AME2012-1.pdf>`_.
Atomic mass data comes from the `Atomic Mass Evaluation 2016
<https://www-nds.iaea.org/amdc/ame2016/AME2016-a.pdf>`_.
Parameters
----------
@ -157,8 +157,8 @@ def atomic_mass(isotope):
"""
if not _ATOMIC_MASS:
# Load data from AME2012 file
mass_file = os.path.join(os.path.dirname(__file__), 'mass.mas12')
# Load data from AME2016 file
mass_file = os.path.join(os.path.dirname(__file__), 'mass16.txt')
with open(mass_file, 'r') as ame:
# Read lines in file starting at line 40
for line in itertools.islice(ame, 39, None):

File diff suppressed because it is too large Load diff

3475
openmc/data/mass16.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -32,7 +32,7 @@ kwargs = {
# Data files and librarries
'package_data': {
'openmc.capi': ['libopenmc.{}'.format(suffix)],
'openmc.data': ['mass.mas12', 'BREMX.DAT', '*.h5']
'openmc.data': ['mass16.txt', 'BREMX.DAT', '*.h5']
},
# Metadata

View file

@ -51,14 +51,14 @@ def test_thin():
def test_atomic_mass():
assert openmc.data.atomic_mass('H1') == 1.00782503223
assert openmc.data.atomic_mass('U235') == 235.043930131
assert openmc.data.atomic_mass('H1') == 1.00782503224
assert openmc.data.atomic_mass('U235') == 235.04392819
with pytest.raises(KeyError):
openmc.data.atomic_mass('U100')
def test_atomic_weight():
assert openmc.data.atomic_weight('C') == 12.011115164862904
assert openmc.data.atomic_weight('C') == 12.011115164864455
with pytest.raises(ValueError):
openmc.data.atomic_weight('Qt')