mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Make use of openmc.data.neutron.get_metadata()
Changed _get_metadata() to a public function and used it in openmc-update-inputs
This commit is contained in:
parent
24f3dd6f55
commit
27870417ca
2 changed files with 4 additions and 10 deletions
|
|
@ -34,7 +34,7 @@ from openmc.mixin import EqualityMixin
|
|||
_RESONANCE_ENERGY_GRID = np.logspace(-3, 3, 61)
|
||||
|
||||
|
||||
def _get_metadata(zaid, metastable_scheme='nndc'):
|
||||
def get_metadata(zaid, metastable_scheme='nndc'):
|
||||
"""Return basic identifying data for a nuclide with a given ZAID.
|
||||
|
||||
Parameters
|
||||
|
|
@ -677,7 +677,7 @@ class IncidentNeutron(EqualityMixin):
|
|||
# If mass number hasn't been specified, make an educated guess
|
||||
zaid, xs = ace.name.split('.')
|
||||
name, element, Z, mass_number, metastable = \
|
||||
_get_metadata(int(zaid), metastable_scheme)
|
||||
get_metadata(int(zaid), metastable_scheme)
|
||||
|
||||
# Assign temperature to the running list
|
||||
kTs = [ace.temperature*EV_PER_MEV]
|
||||
|
|
|
|||
|
|
@ -241,15 +241,9 @@ def update_geometry(geometry_root):
|
|||
|
||||
def replace_zaid(name):
|
||||
"""Replace a nuclide name in the ZAID notation with the correct name."""
|
||||
# TODO: Account for metastable and any other special cases
|
||||
name = name.strip()
|
||||
z = int(name[:-3])
|
||||
a = int(name[-3:]) # Strips leading 0s
|
||||
symbol = openmc.data.ATOMIC_SYMBOL[z]
|
||||
name = str(symbol).title() + str(a)
|
||||
zaid = int(name.strip())
|
||||
name = openmc.data.neutron.get_metadata(zaid)[0]
|
||||
return name
|
||||
|
||||
|
||||
|
||||
def update_materials(root):
|
||||
"""Update the given XML materials tree. Return True if changes were made."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue