Skip to content

Reevaluate cell in a close collision after a surface crossing - #3933

Merged
paulromano merged 3 commits into
openmc-dev:developfrom
GuySten:collision-cell-change
Aug 3, 2026
Merged

Reevaluate cell in a close collision after a surface crossing#3933
paulromano merged 3 commits into
openmc-dev:developfrom
GuySten:collision-cell-change

Conversation

@GuySten

@GuySten GuySten commented May 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a cell lookup after a collision that could change particle's cell.
This PR is an alternative path for #3923.

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)

@GuySten
GuySten requested a review from paulromano May 3, 2026 08:06
@GuySten

This comment was marked as resolved.

@GuySten GuySten changed the title recalc cell in a collision after a surface crossing Reevaluate cell in a close collision after a surface crossing May 3, 2026
@GuySten GuySten added the Bugs label May 3, 2026
@lewisgross1296

This comment was marked as resolved.

@lewisgross1296

This comment was marked as resolved.

@GuySten

This comment was marked as resolved.

@lewisgross1296

This comment was marked as resolved.

@GuySten
GuySten requested review from pshriwise and shimwell May 5, 2026 09:49

@paulromano paulromano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for the proposed fix @GuySten. I ended up fixing two things on your branch:

  1. The "find cell" operation when a collision is close to a surface had to be done after tallies were performed so that the collision is attributed properly.
  2. If the particle crossed a surface and changed universe levels, the search needed to account for that systematically.

@paulromano
paulromano enabled auto-merge (squash) August 3, 2026 15:36
@paulromano
paulromano merged commit 8202ef6 into openmc-dev:develop Aug 3, 2026
16 checks passed
@GuySten
GuySten deleted the collision-cell-change branch August 3, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants