mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Merge pull request #1166 from liangjg/develop
Updated atomic mass evaluation to AME 2016
This commit is contained in:
commit
1fe80990e5
5 changed files with 3483 additions and 3400 deletions
|
|
@ -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
3475
openmc/data/mass16.txt
Normal file
File diff suppressed because it is too large
Load diff
2
setup.py
2
setup.py
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue