diff --git a/openmc/data/decay.py b/openmc/data/decay.py index 7cd4bf43d41..ce20a252c3f 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -2,7 +2,6 @@ from functools import cached_property from io import StringIO from math import log -import re from warnings import warn import numpy as np @@ -13,7 +12,7 @@ from openmc.exceptions import DataError from openmc.mixin import EqualityMixin from openmc.stats import Discrete, Tabular, Univariate, combine_distributions -from .data import ATOMIC_NUMBER, gnds_name +from .data import gnds_name, zam from .function import INTERPOLATION_SCHEME from .endf import Evaluation, get_head_record, get_list_record, get_tab1_record @@ -241,9 +240,7 @@ def branching_ratio(self, branching_ratio): @property def daughter(self): # Determine atomic number and mass number of parent - symbol, A = re.match(r'([A-Zn][a-z]*)(\d+)', self.parent).groups() - A = int(A) - Z = ATOMIC_NUMBER[symbol] + Z, A, _ = zam(self.parent) # Process changes for mode in self.modes: @@ -253,6 +250,9 @@ def daughter(self): delta_A, delta_Z = changes A += delta_A Z += delta_Z + break + else: + return None return gnds_name(Z, A, self._daughter_state) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 97ec8d96184..42d4ab07ea6 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -413,6 +413,8 @@ def from_endf(cls, decay_files, fpy_files, neutron_files, type_ = ','.join(mode.modes) if mode.daughter in decay_data: target = mode.daughter + elif 'sf' in type_: + target = None else: print('missing {} {} {}'.format( parent, type_, mode.daughter)) @@ -641,7 +643,7 @@ def setval(i, j, val): # Allow for total annihilation for debug purposes if branch_val != 0.0: - if target is not None: + if target is not None and 'sf' not in decay_type: k = self.nuclide_dict[target] setval(k, i, branch_val) @@ -731,11 +733,12 @@ def setval(i, j, val): # Determine light nuclide production, e.g., (n,d) should # produce H2 - light_nucs = REACTIONS[r_type].secondaries - for light_nuc in light_nucs: - k = self.nuclide_dict.get(light_nuc) - if k is not None: - setval(k, i, path_rate * br) + if path_rate != 0.0: + light_nucs = REACTIONS[r_type].secondaries + for light_nuc in light_nucs: + k = self.nuclide_dict.get(light_nuc) + if k is not None: + setval(k, i, path_rate * br) else: for product, y in fission_yields[nuc.name].items():