Skip to content

Remove self loops from spontaneous fission decay mode#3907

Merged
paulromano merged 4 commits intoopenmc-dev:developfrom
eepeterson:fix-sf-decay-selfloop
Apr 21, 2026
Merged

Remove self loops from spontaneous fission decay mode#3907
paulromano merged 4 commits intoopenmc-dev:developfrom
eepeterson:fix-sf-decay-selfloop

Conversation

@eepeterson
Copy link
Copy Markdown
Contributor

@eepeterson eepeterson commented Mar 28, 2026

Description

This PR just prevents spontaneous fission decay modes from erroneously adding source terms along the diagonal of the burnup matrix. Since the official depletion chains have this behavior, this seems like the easiest immediate fix, but it does warrant a discussion on whether the semantics should be changed in the chain file themselves.

Fixes #3906

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

@eepeterson eepeterson requested a review from paulromano as a code owner March 28, 2026 19:29
@shimwell
Copy link
Copy Markdown
Member

shimwell commented Mar 29, 2026

Skipping the gain term for sf in form_matrix() is a nice fix, and the path_rate != 0.0 guard to avoid explicit zeros in the sparse matrix is a nice cleanup too. It might be a while till the corrected chain files are used everywhere.

As a possible follow-up (separate PR), it might be worth also fixing this upstream in from_endf() so that sf decay modes get target=None instead of the self-referential target when generating chain files. That way the existing if target is not None guard in form_matrix() would handle it naturally without needing the sf-specific check. But that's a bigger change since it means regenerating the official chain files too, so totally fine as a future thing.

@eepeterson
Copy link
Copy Markdown
Contributor Author

I agree, but if you wanted to add spontaneous fission yields to actually populate the correct gain terms you'd still need a specific check for 'sf' somewhere probably after the alpha and proton gain terms. I do tend to agree that None should be the correct target in the chain files.

@paulromano paulromano changed the title Remove self loops from sf decay_mode Remove self loops from spontaneous fission decay mode Apr 21, 2026
Copy link
Copy Markdown
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eepeterson for the PR and @shimwell for the further suggestion. I've fixed the underlying issue here, which is that DecayMode.daughter was returning the parent nuclide for the 'sf' decay mode; now it returns None.

@paulromano paulromano enabled auto-merge (squash) April 21, 2026 16:01
@paulromano paulromano merged commit a1df584 into openmc-dev:develop Apr 21, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spontaneous fission decreases total decay rate in burnup

3 participants