Skip to content

Skip atomic relaxation emissions below the photon energy cutoff - #4158

Open
GuySten wants to merge 3 commits into
openmc-dev:developfrom
GuySten:claude/photon-relaxation-cutoff
Open

GuySten wants to merge 3 commits into
openmc-dev:developfrom
GuySten:claude/photon-relaxation-cutoff

Conversation

@GuySten

@GuySten GuySten commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Description

After a photoelectric or Compton interaction, atomic relaxation follows the full vacancy cascade down to the outermost shells, sampling a transition and an isotropic direction (with sin, cos and sqrt) at every step. For heavy elements most of this work has no effect on the simulation:

  • fluorescence photons below the photon energy cutoff are never created (create_secondary returns before banking them), and
  • Auger electrons below the photon energy cutoff cannot produce bremsstrahlung photons above it (thick_target_bremsstrahlung returns immediately), and with local energy deposition electrons produce nothing at all.

Every particle emitted while filling a vacancy, and every vacancy left behind, has an energy below the binding energy of the vacancy shell. This PR therefore:

  1. skips vacancies whose binding energy is below the photon energy cutoff, together with the rest of their cascade, and
  2. for the remaining vacancies, samples a direction and creates or processes the emitted particle only when its energy is at or above the cutoff.

The physics is unchanged, but the random number sequence changes for any problem with atomic relaxation, so some photon regression results need to be updated.

For W and Pb with the default 1 keV photon cutoff, roughly 80–85% of the vacancies in a K- or L-shell cascade lie below the cutoff (for example, a Pb K-shell cascade visits about 23 vacancies, of which about 3.5 are above 1 keV). Profiling the gamma shielding model from this Discourse thread (Cs-137 source in a W/Pb cask, analog, single thread) showed atomic relaxation taking 26% of the run time. With this change, transport time dropped by about 22% (22.4 s to 17.4 s for 10⁶ histories), and the tally results agreed with the original within statistical uncertainty.

I also added a paragraph describing this to the atomic relaxation section of the photon physics methods documentation.

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)

Atomic relaxation followed the full vacancy cascade down to the outermost
shells, sampling a transition and an isotropic direction at every step.
Fluorescence photons below the photon energy cutoff are never created and
Auger electrons below it produce no bremsstrahlung photons, so for heavy
elements most of this work had no effect: for W and Pb roughly 80-85% of
the vacancies in a K- or L-shell cascade have binding energies below the
default 1 keV cutoff.

Since every particle emitted while filling a vacancy, and every vacancy
left behind, has an energy below the binding energy of the vacancy shell,
vacancies below the cutoff are now skipped along with the rest of their
cascade, and directions are only sampled for emissions above the cutoff.
This does not change the physics but does change the random number
sequence. On a Cs-137 source in a W/Pb cask this reduces the transport
time by about 22%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
claude added 2 commits October 2, 2026 20:54
Skipping atomic relaxation emissions below the photon energy cutoff
changes the random number sequence for problems with photon transport.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
test_weightwindows compares the source bin of an analog run and a weight
window run with uncertainties estimated from only two batches, and
required the difference to be within two combined standard deviations.
With the random number sequence changed by the atomic relaxation
change, the shared secondary bank case fails this check at the default
seed (2.5 sigma). Higher statistics runs of the same model (40 times as
many histories) show no bias between the analog and weight window
results, and a 2 sigma check on two quantities in each of two cases is
expected to fail regularly.

Use three standard deviations, as other tests comparing Monte Carlo
results do (e.g. test_torus and test_filter_mesh). Rerunning on failure
would not help since the test uses a fixed seed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
@GuySten
GuySten marked this pull request as ready for review October 2, 2026 23:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants