Sharing a fix for Particle X underwent maximum number of events. (and wondering why it worked)

Hello everyone,

I have really enjoyed building nuclear reactors in the past 3 years with openmc, however in my latest build I have had issues with some neutrons getting stuck in the middle of materials at the same coordinate and orientation forever (found this by tracking the neutrons), massively slowing down my simulation and giving off this warning:
WARNING: Particle 61 underwent maximum number of events.

I couldn’t find anything wrong with my geometry or material definition, but after much trial and error, I managed to fix this by applying a “rotation” to all my cells, like this:


rotated_cells = []
    for cell in cells:
        region = cell.region
        region = region.rotate((0, 0, 0))
        cell.region = region
        rotated_cells.append(cell)

    universe = openmc.Universe(cells=rotated_cells)

Not sure why this fixed my problem, but I wanted to share this because I was getting quite desperate.

Best,
Alexis

1 Like

That is almost always a geometry error. Otherwise, do you have coincident surfaces in your model? This can cause some particles to get stuck or lost in a technically “valid” geometry.

With the fake-rotation, do Particle 61 and the other stuck particles have the same histories up to the points where they got stuck? Without the rotation, do particles get stuck in the same places with different random seeds?

1 Like