Skip to content

Remove self loops from sf decay_mode#3907

Open
eepeterson wants to merge 2 commits intoopenmc-dev:developfrom
eepeterson:fix-sf-decay-selfloop
Open

Remove self loops from sf decay_mode#3907
eepeterson wants to merge 2 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.

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

2 participants