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

Ensure secondary particles below energy cutoff are not created #1924

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

paulromano
Copy link
Contributor

A user observed that in a photon transport problem, photons were being created (and contributing to flux) below the specified energy cutoff. The fix for this is simple -- I've added a check in Particle::create_secondary that prevents the secondary particle from being created if it's below the energy cutoff. Along with this, I've added a unit test that confirms the correct behavior, namely that no flux appears below the energy cutoff but that the total heating is not affected (the test uses an infinite medium problem, so the entirely of the source energy should be deposited regardless of the presence of an energy cutoff).

@amandalund since you're the expert with particle cutoffs/ secondary creation, would you mind reviewing?

Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks for the fix and test @paulromano.

There are a couple places where we also have the check on cutoff energy in the physics model (bremsstrahlung, where it's needed to accumulate the energy carried away by secondaries; Compton scattering, where it's no longer required but prevents us from unnecessarily calculating the secondary direction). There are also places where we might consider adding the check in the physics (e.g. to avoid sampling the direction of a photoelectron that's below cutoff), but it probably won't make much difference performance-wise.

@amandalund amandalund merged commit c6328d5 into openmc-dev:develop Dec 16, 2021
@paulromano paulromano deleted the cutoff-fix branch December 16, 2021 15:52
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.

2 participants