Flip_normal() and physics for periodic problems

Hello again,

Back in December, the merge_surfaces = True seemed to fix my issue, and I was able to run a Cardinal multiphysics simulation using O(30) OpenMC k-eigenvalue solves. Note, this is a sixth core model that is constructed by making a full core and slicing it between two planes with a periodic BC applied.

I’m now running the same model (i.e. the same XML) but in two other scenarios: OpenMC depletion and Cardinal multiphysics search for keff. Both are now encountering the same problem as before with maximum events and a -nan batch. Here’s an example failure where it reports both lost particles and particles hitting the maximum number of events.

 WARNING: Could not find the cell containing particle 2343
 WARNING: Could not find the cell containing particle 2344
 WARNING: Particle 38527 underwent maximum number of events.
 ERROR: No fission sites banked on MPI rank 0
...

These simulations use more k-eigenvalue sovles than before: O(100) for depletion and more for multiphysics search. I bring this up because these simulations go further into the random number stream than my previous “successful” simulation. It seems like very rarely, particles are getting stuck between periodic boundaries without actually transporting further. I can’t envision another reason why particles would reach the event limit as there’s many chances to be absorbed in this reactor.

For the record, I am using an OpenMC version beyond the merged PR#3692. To test whether the issue was with my model or if the issue is due to the periodic BC, I re-ran both of the aforementioned simulations with the a reflective BC instead of a periodic one (all other details are identical). I’ve also tried doing openmc -g with my XML. Since the troublesome event happens much further down the random number stream, I don’t think a single standalone transport will show the same issue in geometry debug mode.

Both the depletion and the multiphysics search were able to complete without these errors when using a reflective BC. This isn’t fully “proof,” but it does support that there might still be something wrong with the periodic BC. While it appears to be an extremely rare event, at some point, a particle is getting into trouble. It could be specific to my model, but it appears to be some interaction of my model and the periodic BC. Any debugging advice would be appreciated! I might need to rebuild OpenMC with some kinds of print statements to diagnose further.