Skip to content

Commit a1df584

Browse files
Remove self loops from spontaneous fission decay mode (#3907)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
1 parent e431d49 commit a1df584

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

openmc/data/decay.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from functools import cached_property
33
from io import StringIO
44
from math import log
5-
import re
65
from warnings import warn
76

87
import numpy as np
@@ -13,7 +12,7 @@
1312
from openmc.exceptions import DataError
1413
from openmc.mixin import EqualityMixin
1514
from openmc.stats import Discrete, Tabular, Univariate, combine_distributions
16-
from .data import ATOMIC_NUMBER, gnds_name
15+
from .data import gnds_name, zam
1716
from .function import INTERPOLATION_SCHEME
1817
from .endf import Evaluation, get_head_record, get_list_record, get_tab1_record
1918

@@ -241,9 +240,7 @@ def branching_ratio(self, branching_ratio):
241240
@property
242241
def daughter(self):
243242
# Determine atomic number and mass number of parent
244-
symbol, A = re.match(r'([A-Zn][a-z]*)(\d+)', self.parent).groups()
245-
A = int(A)
246-
Z = ATOMIC_NUMBER[symbol]
243+
Z, A, _ = zam(self.parent)
247244

248245
# Process changes
249246
for mode in self.modes:
@@ -253,6 +250,9 @@ def daughter(self):
253250
delta_A, delta_Z = changes
254251
A += delta_A
255252
Z += delta_Z
253+
break
254+
else:
255+
return None
256256

257257
return gnds_name(Z, A, self._daughter_state)
258258

openmc/deplete/chain.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ def from_endf(cls, decay_files, fpy_files, neutron_files,
413413
type_ = ','.join(mode.modes)
414414
if mode.daughter in decay_data:
415415
target = mode.daughter
416+
elif 'sf' in type_:
417+
target = None
416418
else:
417419
print('missing {} {} {}'.format(
418420
parent, type_, mode.daughter))
@@ -641,7 +643,7 @@ def setval(i, j, val):
641643

642644
# Allow for total annihilation for debug purposes
643645
if branch_val != 0.0:
644-
if target is not None:
646+
if target is not None and 'sf' not in decay_type:
645647
k = self.nuclide_dict[target]
646648
setval(k, i, branch_val)
647649

@@ -731,11 +733,12 @@ def setval(i, j, val):
731733

732734
# Determine light nuclide production, e.g., (n,d) should
733735
# produce H2
734-
light_nucs = REACTIONS[r_type].secondaries
735-
for light_nuc in light_nucs:
736-
k = self.nuclide_dict.get(light_nuc)
737-
if k is not None:
738-
setval(k, i, path_rate * br)
736+
if path_rate != 0.0:
737+
light_nucs = REACTIONS[r_type].secondaries
738+
for light_nuc in light_nucs:
739+
k = self.nuclide_dict.get(light_nuc)
740+
if k is not None:
741+
setval(k, i, path_rate * br)
739742

740743
else:
741744
for product, y in fission_yields[nuc.name].items():

0 commit comments

Comments
 (0)