From 92c288e693ccc09bd22ee987f0cf08092b4a9b0b Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Sat, 28 Mar 2026 15:07:32 -0400 Subject: [PATCH 1/2] remove self loops from sf decay_mode --- openmc/deplete/chain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 689546b86bf..25c473bf03f 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -655,7 +655,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) From e50a0f33a910f35d7d3b27e7dbb0b2ccfcc9fc6d Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Sat, 28 Mar 2026 17:21:52 -0400 Subject: [PATCH 2/2] use path_rate guard to not put explicit zeros into matrix --- openmc/deplete/chain.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 25c473bf03f..8972e173591 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -696,11 +696,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():