# Lost particles after crossing surfaces 1329 and 1330 — need help finding the geometry issue

**URL:** <https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063>\
**Category:** User Support\
**Created:** [October 17, 2025, 11:44am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063 "2025-10-17T11:44:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fakhar](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fakhar/32/4224_2.png) [@fakhar](https://openmc.discourse.group/u/fakhar)\
**Post date:** [October 17, 2025, 11:44am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/1 "2025-10-17T11:44:03Z")

</div>

Hello everyone,

I’m getting the following error during my OpenMC simulation:

 ![hhhhhhhhhhhhhhhhhhhhhh](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/d/ddcbc1698552caf3d37154114d0011e62b0706a2.png)

I understand this usually means there is a gap or overlap in the geometry, but I can’t find it

I’ve attached my **code (.ipynb)** and a **screenshot of the geometry** for reference.  
Could someone please review it and tell me what might be causing the particles to get lost around surfaces 1329 and 1330?

Thank you very much for your help!

[last\_one.ipynb](https://openmc.discourse.group/uploads/short-url/nN5jFZWSxmxDb01f1hSkbyNO3dF.ipynb) (177.7 KB)

 ![sasas](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/5/52fdcc96d0b806a26e2a8a517ac9e07c6416457c.png)

---

<div class="post-metadata">

**Author:** ![jsy](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jsy](https://openmc.discourse.group/u/jsy)\
**Post date:** [October 18, 2025, 2:36am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/2 "2025-10-18T02:36:33Z")

</div>

after test your .ipynb file, I found the surface which leak the particle is:

> plane\_up = openmc.ZPlane(z0=30,boundary\_type=‘reflective’)  
> plane\_down = openmc.ZPlane(z0=-30,boundary\_type=‘reflective’)

these two plane maybe the boundary surface of you geometry, so you should add the boundary conditions.

---

<div class="post-metadata">

**Author:** ![fakhar](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fakhar/32/4224_2.png) [@fakhar](https://openmc.discourse.group/u/fakhar)\
**Post date:** [October 18, 2025, 10:19am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/3 "2025-10-18T10:19:54Z")

</div>

Thank you so much! You were right—the leaking was from the axial planes, and setting them to `boundary_type='reflective'` fixed it.

Could you please help me calculate the neutron **flux** in this model? I’m not sure whether to use a **cell-averaged flux** tally (e.g., fuel cell) or a **regular mesh** tally, and what energy bins you recommend.can you help me

---

<div class="post-metadata">

**Author:** ![jsy](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jsy](https://openmc.discourse.group/u/jsy)\
**Post date:** [October 19, 2025, 2:46am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/4 "2025-10-19T02:46:44Z")

</div>

Tally flux using CellFilter or MeshFilter depends on what you are concerd about. If the you want to know the info of the cell, then you use CellFilter; or if you want to know the spatial flux distribution, MeshFilter is better. I usually use 500 energy groups which is equal-lethargy between 0-20MeV for research. If you have some special requirement, you should look up the professional litrature. OpenMC also provide some energy group structure, shown in [openmc.mgxs – Multi-Group Cross Section Generation — OpenMC Documentation](https://docs.openmc.org/en/stable/pythonapi/mgxs.html#energy-groups).

---

<div class="post-metadata">

**Author:** ![fakhar](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fakhar/32/4224_2.png) [@fakhar](https://openmc.discourse.group/u/fakhar)\
**Post date:** [October 19, 2025, 8:31am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/5 "2025-10-19T08:31:22Z")

</div>

Thanks a lot for your previous guidance about using `CellFilter` and `MeshFilter` for flux tallies.  
As you mentioned, _CellFilter_ is useful when I need flux information for specific cells, and _MeshFilter_ is better for spatial flux distribution.

I’d like to ask for your help checking or improving the following example code.  
I created two tallies — one for **per-cell flux** and another for **spatial flux** , both using **500 equal-lethargy energy groups (0–20 MeV)**.

Could you please help me confirm if this setup is correct or suggest any improvements?  
import openmc  
import numpy as np

# — 500-group equal-lethargy energy structure (0–20 MeV) —

E\_MIN\_eV = 1e-8  
E\_MAX\_eV = 20.0e6  
G = 500  
group\_edges\_eV = np.logspace(np.log10(E\_MIN\_eV), np.log10(E\_MAX\_eV), G+1)  
Efilter = openmc.EnergyFilter(group\_edges\_eV)

# — CellFilter tally —

cell\_filter = openmc.CellFilter([10]) # replace with your target cell ID  
cell\_flux = openmc.Tally(name=“cell\_flux\_500g”)  
cell\_flux.scores = [“flux”]  
cell\_flux.filters = [cell\_filter, Efilter]

# — MeshFilter tally —

mesh = openmc.RegularMesh()  
mesh.dimension = (100, 100, 1)  
mesh.lower\_left = (-50, -50, -30)  
mesh.upper\_right = (50, 50, 30)  
mesh\_filter = openmc.MeshFilter(mesh)

mesh\_flux = openmc.Tally(name=“mesh\_flux\_500g”)  
mesh\_flux.scores = [“flux”]  
mesh\_flux.filters = [mesh\_filter, Efilter]  
i upload my ipynb also :

[reactor.ipynb](https://openmc.discourse.group/uploads/short-url/6X3qDEZU3XxIcxFSKz8hXovqGQ0.ipynb) (81.3 KB)

---

<div class="post-metadata">

**Author:** ![jsy](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jsy](https://openmc.discourse.group/u/jsy)\
**Post date:** [October 20, 2025, 12:59pm UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/6 "2025-10-20T12:59:28Z")

</div>

I think you are doing well. You can just run it and analyze the result to see if any problem exists.

---

<div class="post-metadata">

**Author:** ![fakhar](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/fakhar/32/4224_2.png) [@fakhar](https://openmc.discourse.group/u/fakhar)\
**Post date:** [October 22, 2025, 10:27am UTC](https://openmc.discourse.group/t/lost-particles-after-crossing-surfaces-1329-and-1330-need-help-finding-the-geometry-issue/6063/7 "2025-10-22T10:27:57Z")

</div>

can you help me this is my results i thinks its incorrect

 ![thermal_flux_distribution](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/7/7e65328cf1c3147f1030d86a0dc848f9fc5b1262.png)  
and this is ipynb

[flux.ipynb](https://openmc.discourse.group/uploads/short-url/c6NXUIOryleGgZrJXzawtd3AaRL.ipynb) (155.3 KB)
