Skip to content

Conversation

@paulromano
Copy link
Contributor

A user recently reported seeing some NaNs in photon flux mesh tallies. I traced this down to some divide-by-zeros in StructuredMesh::bins_crossed. This PR simply checks whether the total distance in a track is zero (as can happen when secondary electrons/positrons are created and immediately killed) and returns to prevent the divide-by-zero issue.

Also, I noticed that the rectangular_prism function doesn't work cleanly with periodic boundary conditions after our boundary condition refactor (#1701). Also included a fix for that.

@paulromano
Copy link
Contributor Author

FYI, there's some weird issue with GHA ubuntu VMs right now that is causing our tests to fail when MPI is enabled (tests for #1817 are failing for same reason). I've put in a workaround in this PR based on some comments from the linked issue.

@aprilnovak aprilnovak self-requested a review April 19, 2021 15:36
@aprilnovak
Copy link
Contributor

Looks good to me!

@aprilnovak aprilnovak merged commit fc0c784 into openmc-dev:develop Apr 20, 2021
@paulromano paulromano deleted the mesh-nan-fix branch April 20, 2021 19:32
pshriwise pushed a commit to pshriwise/openmc that referenced this pull request Apr 24, 2021
Prevent divide-by-zero in bins_crossed methods for meshes
pshriwise pushed a commit to pshriwise/openmc that referenced this pull request Apr 24, 2021
Prevent divide-by-zero in bins_crossed methods for meshes
pshriwise pushed a commit to pshriwise/openmc that referenced this pull request Apr 24, 2021
Prevent divide-by-zero in bins_crossed methods for meshes
pshriwise pushed a commit to pshriwise/openmc that referenced this pull request Apr 26, 2021
Prevent divide-by-zero in bins_crossed methods for meshes
paulromano pushed a commit that referenced this pull request Apr 26, 2021
Prevent divide-by-zero in bins_crossed methods for meshes
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.

2 participants