diff --git a/openmc/data/data.py b/openmc/data/data.py index b332344241..e813209f0a 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -358,7 +358,12 @@ def zam(name): symbol, A, state = _GND_NAME_RE.match(name).groups() except AttributeError: raise ValueError("'{}' does not appear to be a nuclide name in GND " - "format.".format(name)) + "format".format(name)) + + if symbol not in ATOMIC_NUMBER: + raise ValueError("'{}' is not a recognized element symbol" + .format(symbol)) + metastable = int(state[2:]) if state else 0 return (ATOMIC_NUMBER[symbol], int(A), metastable) diff --git a/openmc/material.py b/openmc/material.py index 1700055268..375e1dca1e 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -413,8 +413,6 @@ class Material(IDManagerMixin): Z, _, _ = openmc.data.zam(nuclide) except ValueError as e: warnings.warn(str(e)) - except KeyError as e: - warnings.warn(repr(e)) else: # For actinides, have the material be depletable by default if Z >= 89: