Skip to content

Fix collision track feature for photon transport#3946

Open
pshriwise wants to merge 17 commits into
openmc-dev:developfrom
pshriwise:fix-collision-track-photons
Open

Fix collision track feature for photon transport#3946
pshriwise wants to merge 17 commits into
openmc-dev:developfrom
pshriwise:fix-collision-track-photons

Conversation

@pshriwise
Copy link
Copy Markdown
Contributor

@pshriwise pshriwise commented May 28, 2026

Description

Fixes #3945

An alternative here would be to filter out electron collision events entirely, but the documentation and file format seem to indicate that these events for electrons and positrons will be present.

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)

@pshriwise pshriwise force-pushed the fix-collision-track-photons branch from 06d6e02 to 0f7f7d5 Compare May 28, 2026 03:00
@pshriwise pshriwise changed the title Fix collision track photons Fix collision track feature for photon transport May 28, 2026
@pshriwise
Copy link
Copy Markdown
Contributor Author

I came across a few other items in the course of this PR:

  • The CollisionTrackTestHarness was using the original PyAPITestHarness method for _check_results due to a misnaming so the nice methods for comparison of track files weren't being leveraged here.
  • The result files are all the same in this case because none of the various test parameters perturb transport. I opted to simply remove the result files as comparison of the collision track files is a more rigorous test of this feature.
  • Moved the two thread test to the unit tests. Because we're only checking the number of collisions written and aren't able to check that the set of events themselves are reproducible in this case it seemed to fit better there.

Copy link
Copy Markdown
Contributor

@paulromano paulromano left a comment

Choose a reason for hiding this comment

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

Thanks @pshriwise! A few notes about updates I made:

  • Simplified how the PDG number is determined for a nuclide
  • Use 0 as the "empty" value instead of -1. By the PDG code specification, -1 would actually mean "anti-down quark". 0 on the other hand does not have anything assigned
  • Bumped collision track file version

@paulromano paulromano enabled auto-merge (squash) May 30, 2026 04:14
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.

Collision Track Feature Fails for Photon Transport

2 participants