mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Updated atomic mass evaluation to AME 2016, close #1137
This commit is contained in:
parent
f5b1a39d4a
commit
3122e14010
4 changed files with 3482 additions and 3399 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
|
|
@ -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