Skip to content

Angular flux tallying capabilities for Random Ray - #4072

Draft
j-fletcher wants to merge 6 commits into
openmc-dev:developfrom
j-fletcher:rr_angular
Draft

Angular flux tallying capabilities for Random Ray#4072
j-fletcher wants to merge 6 commits into
openmc-dev:developfrom
j-fletcher:rr_angular

Conversation

@j-fletcher

@j-fletcher j-fletcher commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

Introduces angular flux tallying capabilities in Random Ray mode.

This is accomplished by the addition of an angular_flux_new_ vector to each SourceRegion which stores the groupwise angular flux from the current iteration. Rays are assigned to each angular bin according to the spherical Voronoi diagram of all angles in the "quadrature" set on the unit sphere. That is, when a ray with direction $\vec{u}$ enters a source region where the angular flux will be accumulated, its bin index is determined by determining which quadrature direction $\vec{q}$ maximizes the dot product $[ \vec{q} \cdot \vec{u}]$.

As quadrature sets can easily number in the hundreds of angles, to prevent performing these operations on every region crossing, we instead store the angular bin index on the ray once calculated, only resetting once the ray changes direction at the problem boundary. Additionally, we may initialize the ray with no assigned angular bin, only performing the search when crossing a source region where angular flux tallies are located and during the ray's active length.

While this has the effect of imposing the requirement that only one angular discretization scheme be used throughout the problem, the approach taken in this PR also offers a key advantage in that the angular flux is only banked in source regions where the user has specified angular flux tallies. This avoids the potentially significant memory overhead from storing $N_\Omega$ flux values in $N_E$ energy bins in all $N_{SR}$ source regions of the problem, while still enabling the output of some angular data.

Additionally, tallying will be possible with any set of quadrature angles specified in the tally filter. For comparison to other discrete ordinates codes, and to provide a few approximately uniform distributions of unit-sphere directions, some point-set generator functions are also provided in the Python API. These include generators for level-symmetric and triangular Chebyshev-Legendre quadrature directions, as well as direction sets based on the vertices or face centroids of a geodesic icosahedron ("icosphere") subdivided at arbitrary integer frequency.

Fixes #4071

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)

@j-fletcher j-fletcher changed the title Angular flux tallying capabilities for RandomR Angular flux tallying capabilities for Random Ray Aug 21, 2026
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.

Angular flux tallying capabilities for Random Ray

1 participant