mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Make sure from_ace classmethods get correct type of ACE table
This commit is contained in:
parent
a8d90844a3
commit
60f17ea466
3 changed files with 8 additions and 1 deletions
|
|
@ -588,6 +588,9 @@ class IncidentNeutron(EqualityMixin):
|
|||
|
||||
# If mass number hasn't been specified, make an educated guess
|
||||
zaid, xs = ace.name.split('.')
|
||||
if not xs.endswith('c'):
|
||||
raise TypeError(
|
||||
"{} is not a continuous-energy neutron ACE table.".format(ace))
|
||||
name, element, Z, mass_number, metastable = \
|
||||
get_metadata(int(zaid), metastable_scheme)
|
||||
|
||||
|
|
|
|||
|
|
@ -549,7 +549,9 @@ class IncidentPhoton(EqualityMixin):
|
|||
ace = get_table(ace_or_filename)
|
||||
|
||||
# Get atomic number based on name of ACE table
|
||||
zaid = ace.name.split('.')[0]
|
||||
zaid, xs = ace.name.split('.')
|
||||
if not xs.endswith('p'):
|
||||
raise TypeError("{} is not a photoatomic transport ACE table.".format(ace))
|
||||
Z = get_metadata(int(zaid))[2]
|
||||
|
||||
# Read each reaction
|
||||
|
|
|
|||
|
|
@ -600,6 +600,8 @@ class ThermalScattering(EqualityMixin):
|
|||
|
||||
# Get new name that is GND-consistent
|
||||
ace_name, xs = ace.name.split('.')
|
||||
if not xs.endswith('t'):
|
||||
raise TypeError("{} is not a thermal scattering ACE table.".format(ace))
|
||||
name = get_thermal_name(ace_name)
|
||||
|
||||
# Assign temperature to the running list
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue