Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for zero fission cross section before sampling fission reaction #2600

Merged
merged 1 commit into from Aug 9, 2023

Conversation

paulromano
Copy link
Contributor

Description

As described in #2599, OpenMC runs into problems when a threshold fission reaction is present. Specifically, in the following lines:

openmc/src/physics.cpp

Lines 109 to 110 in 3f9cd0d

if (nuc->fissionable_) {
auto& rx = sample_fission(i_nuclide, p);

we assume that if a nuclide is fissionable, we can sample a fission reaction. Normally there is just a single fission reaction so the sampling step is trivial, but when you have first-chance, second-chance, etc. fission, it's necessary to pick one of them for the sake of producing fission neutrons. This happens with Pu244 in JEFF 3.3 which both has threshold fission where the fission cross section is 0 below a cutoff and has multiple fission reactions. In this case, for energies below the cutoff, OpenMC will abort with:

terminate called after throwing an instance of 'std::runtime_error'
what(): No fission reaction was sampled for Pu244

The fix here is to simply check if the total fission cross section is non-zero before calling sample_fission.

Fixes #2599

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format 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)

Note that none of the data in the cross section library we use for testing has this condition, so I couldn't really add a test for it.

Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

This makes sense to me. Thanks @paulromano!

@pshriwise pshriwise merged commit 46866cb into openmc-dev:develop Aug 9, 2023
18 checks passed
@paulromano paulromano deleted the threshold-fission-check branch August 19, 2023 04:48
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.

std::runtime_error when running depletion with JEFF 3.3 and chain_endfb71_pwr.xml
2 participants