Uh oh!
There was an error while loading. Please reload this page.
Inline photon-induced electron and positron treatment - #4040
Merged
Conversation
Closed
5 tasks
shimwell
commented
Aug 3, 2026
Member
This is PR of the month award IMO. I know several users who will really appreciate this including myself. I have also looked through and code looks fine to me. Can I ask if this is significant enough change to consider a minor version bump for the next release? Perhaps v0.16.0? |
Uh oh!
There was an error while loading. Please reload this page.
TsvikiHirsh added a commit
to TsvikiHirsh/openmc
that referenced
this pull request
Aug 10, 2026
PR openmc-dev#4040 (included in v0.16.0) inlined positron treatment: annihilation photons from pair production are now emitted in process_charged_secondary at the parent photon collision site, and sample_positron_reaction is no longer on the pair-production path. Move the next-event estimator hook for the two isotropic 511 keV photons into the inline path (keeping the one in sample_positron_reaction for banked positrons). Regenerate point detector regression references: the corrected Compton shell selection and Doppler broadening from openmc-dev#4036 shifts the scattered-flux bins. Re-verified against thin-shell track-length tallies: total flux agrees to 0.3% inside water and in vacuum, and the 511 keV annihilation line from 6.5 MeV photons on iron agrees to 0.8%. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR changes photon-induced electrons and positrons to be processed at their birth location instead of being created and handled as secondary particles. This avoids unnecessary secondary banking and transport overhead, especially in shared-secondary mode, while preserving explicit handling of electron/positron source particles.
This changes heating-tally behavior: heating from photon-induced charged particles is now attributed to the parent photon. Consequently, a heating tally using
ParticleFilter(["photon"])includes the electron/positron contribution, avoiding a longstanding and common user gotcha where that contribution was silently omitted. Electron/positron secondaries are no longer exposed throughParticleProductionFilter.If OpenMC gains physical electron/positron transport in the future, energy deposition can then be separated by particle type instead of being attributed entirely to the photon collision.
Checklist