Conversation
When a geometry surface coincides with a weight window mesh plane, the surface checkpoint looks up the weight window with the particle sitting exactly on the plane. Structured mesh index lookups resolve an exact boundary position to the lower-coordinate element, so particles crossing in the +x/+y/+z direction were assigned the window of the element they were leaving. This produced asymmetric splitting/rouletting and a direction-dependent loss of FOM (reported on Discourse for a gamma shielding problem using ADVANTG weight windows whose mesh planes match the geometry). Nudge the lookup position by TINY_BIT along the direction of travel, as is already done for tracklength mesh tallies, so the particle is assigned to the element it is entering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
Both tests apply weight windows at surface checkpoints on geometry surfaces that coincide with weight window mesh planes. In the survival biasing test, the reflective planes at x, y, z = 0 lie on the lower edge of the mesh, so particles reflecting off them were previously found outside the mesh and no window was applied; in the bootstrap test, a cavity face lies on an interior mesh plane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014RN7JroEkrbkLKVHbMDap9
This branch has not been deployed
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 free
to 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
When a geometry surface coincides with a plane of the weight window mesh, the weight window lookup at a surface checkpoint is done with the particle sitting exactly on that plane. The structured mesh index lookups (
lower_bound_indexfor rectilinear meshes,ceilfor regular meshes) resolve a position exactly on an element boundary to the element on the lower-coordinate side. As a result, a particle crossing such a surface in the +x/+y/+z direction is assigned the window of the element it is leaving, while a particle crossing in the opposite direction happens to get the correct one.This was reported on Discourse (OpenMC's gamma transport with WW just slow or am I doing something wrong?) for a Cs-137 source in a W/Pb cask using ADVANTG weight windows whose mesh planes match the geometry. It showed up as an anisotropic relative error distribution and a much lower FOM than MCNP with the same weight windows. Another forum user traced the asymmetry to the weight-window lookup at surface checkpoints.
This PR offsets the lookup position by
TINY_BITalong the particle's direction of travel inWeightWindows::get_weight_window, so a particle on a mesh boundary is assigned to the element it is entering. This is the same approach already used for tracklength mesh tallies inStructuredMesh::bins_crossed. Away from mesh boundaries the 1e-8 cm offset has no effect.On a symmetric multigroup shielding problem with geometry planes on mesh planes and surface-only checkpoints, the relative error on the +x/+y/+z faces dropped from about 0.025 to about 0.016, matching the -x/-y/-z faces within statistics.
Checklist
I have made corresponding changes to the documentation (if applicable)