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

**URL:** <https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417>\
**Category:** User Support\
**Created:** [April 6, 2025, 10:13am UTC](https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417 "2025-04-06T10:13:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![creeperdeking](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@creeperdeking](https://openmc.discourse.group/u/creeperdeking)\
**Post date:** [April 6, 2025, 10:13am UTC](https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417/1 "2025-04-06T10:13:00Z")

</div>

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:

```auto

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

---

<div class="post-metadata">

**Author:** ![tjlaboss](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/tjlaboss/32/1390_2.png) [@tjlaboss](https://openmc.discourse.group/u/tjlaboss)\
**Post date:** [April 15, 2025, 5:27pm UTC](https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417/2 "2025-04-15T17:27:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![creeperdeking](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@creeperdeking](https://openmc.discourse.group/u/creeperdeking)\
**Post date:** [May 29, 2025, 12:34pm UTC](https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417/3 "2025-05-29T12:34:33Z")

</div>

Hi tjlaboss, update on my issue. I eliminated it completely by setting surface\_precision = 2 when defining my geometry object. Definitely pretty rough, but my issue was probably caused by the fact that I often didn’t reuse surfaces for different object, causing the creation of coincident surfaces that would cause the particles to be lost.

---

<div class="post-metadata">

**Author:** ![Jarret](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/jarret/32/4075_2.png) [@Jarret](https://openmc.discourse.group/u/Jarret)\
**Post date:** [May 29, 2025, 6:10pm UTC](https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417/4 "2025-05-29T18:10:29Z")

</div>

That definitely sounds like it could have been the issue. Have you read this support page from before?

> [@Particle underwent maximum number of events](https://openmc.discourse.group/t/particle-underwent-maximum-number-of-events/296/4):
>
> Hi Ingrid, I meet the same problem with you. [warning: Particle (number of particle) underwent maximum number of events.] Have you figured it out? Hope to get your reply! Best regards! Benjamin 在 2018年3月16日星期五 UTC+8上午1:48:27，Ingrid写道：

Every time the particle passes a boundary it would count as an interaction, so if you have a lot of boundaries stacked your reasoning makes sense that you would reach the max number of interactions (1 million) faster as it is passing 2 boundaries every time it changing cells. For the future I would just make sure you’re using the same surface for coinciding cells as this would prevent this issue, as well as general particle loss issues you might experience in more complicated geometries as the cells don’t align.

---

<div class="post-metadata">

**Author:** ![creeperdeking](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@creeperdeking](https://openmc.discourse.group/u/creeperdeking)\
**Post date:** [May 29, 2025, 9:55pm UTC](https://openmc.discourse.group/t/sharing-a-fix-for-particle-x-underwent-maximum-number-of-events-and-wondering-why-it-worked/5417/5 "2025-05-29T21:55:33Z")

</div>

I was running it in debug mode, but it did not tell me that any cell were coincident unfortunately. The issue also seems independent from the number of coincident surfaces I had in my problem, as I was able to simplify my model to a great extent and still encounter the problem. To be honest even today I am not completely sure that I have really identified the core of the issue.

Also note that the reason particles were lost is that they got stuck in the same position for hundreds of thousand of steps.
