# Could not find the cell containing particle 2

**URL:** <https://openmc.discourse.group/t/could-not-find-the-cell-containing-particle-2/1230>\
**Category:** User Support\
**Created:** [June 2, 2021, 1:27am UTC](https://openmc.discourse.group/t/could-not-find-the-cell-containing-particle-2/1230 "2021-06-02T01:27:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaoPF](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@HaoPF](https://openmc.discourse.group/u/HaoPF)\
**Post date:** [June 2, 2021, 1:27am UTC](https://openmc.discourse.group/t/could-not-find-the-cell-containing-particle-2/1230/1 "2021-06-02T01:27:31Z")

</div>

Hello, everyone,

I’m a beginner to OpenMC, and now I’ve built a model of my own.But an error occurred while I was running it.

I found that OpenMC works well when my model is infinite in volume (with no upper and lower boundaries).But when I add the upper and lower bounds, OpenMC gets an error.The error reporting page is as follows:

 ![1.png](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/7/75ceb09b95acc6bb3a0d9b2bb2fdf0d807b7fab7.jpeg)

The interface that works well in infinite volume is as follows:

 ![2.png](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/e/eb1020fdff00df1b898606c46af02590b1513fa1.jpeg)

Specifically, I changed the upper and lower boundaries in the geometry.This is as follows:

 ![3.png](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/0/09ad1ef9d4a45c102ab416c266ec708a5ccaa0f5.jpeg)

The resulting image looks pretty good.I’m sorry I’m so stupid I don’t know where the mistake is.

Sincerely hope to get your help.

thanks  
HaoPF

---

<div class="post-metadata">

**Author:** ![HaoPF](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@HaoPF](https://openmc.discourse.group/u/HaoPF)\
**Post date:** [June 2, 2021, 1:54am UTC](https://openmc.discourse.group/t/could-not-find-the-cell-containing-particle-2/1230/2 "2021-06-02T01:54:17Z")

</div>

Here is the code for my model:

import openmc

material\_Na = openmc.Material(name=‘Na’)  
material\_Na.temperature = 300  
material\_Na.set\_density(‘g/cm3’, 0.968)  
material\_Na.add\_element(‘Na’, 1.0)  
material\_K = openmc.Material(name=‘K’)  
material\_K.temperature = 300  
material\_K.set\_density(‘g/cm3’, 0.862)  
material\_K.add\_element(‘K’, 1.0)  
coolant = openmc.Material.mix\_materials([material\_Na, material\_K], [0.22, 0.78], ‘wo’)

coolant\_pipe = openmc.Material(name=‘Re’)  
coolant\_pipe.temperature = 300  
coolant\_pipe.set\_density(‘g/cm3’, 0.732)  
coolant\_pipe.add\_element(‘Re’, 1.0)

fuel = openmc.Material(name=‘UN’)  
fuel.temperature = 300  
fuel.set\_density(‘g/cm3’, 14.264)  
fuel.add\_element(‘U’, 1.0, enrichment=55.0)  
fuel.add\_element(‘N’, 1.0)

material\_Mo = openmc.Material(name=‘Mo’)  
material\_Mo.temperature = 300  
material\_Mo.set\_density(‘g/cm3’, 10.200)  
material\_Mo.add\_element(‘Mo’, 1.0)  
material\_Re = openmc.Material(name=‘Re’)  
material\_Re.temperature = 300  
material\_Re.set\_density(‘g/cm3’, 21.020)  
material\_Re.add\_element(‘K’, 1.0)  
cladding = openmc.Material.mix\_materials([material\_Mo, material\_Re], [0.70, 0.30], ‘wo’)

materials = openmc.Materials([coolant, coolant\_pipe, fuel, cladding])  
materials.export\_to\_xml()

# Define problem geometry

s01 = openmc.ZCylinder(r=0.3000)  
s02 = openmc.ZCylinder(r=0.3800)  
s03 = openmc.ZCylinder(r=1.6325)  
cell01 = openmc.Cell(name=‘Cell 01’)  
cell02 = openmc.Cell(name=‘Cell 02’)  
cell03 = openmc.Cell(name=‘Cell 03’)  
cell04 = openmc.Cell(name=‘Cell 04’)  
cell11 = openmc.Cell(name=‘Cell 11’)

cell01.region = -s01  
cell02.region = +s01 & -s02  
cell03.region = +s02 & -s03  
cell04.region = +s03

cell01.fill = coolant  
cell02.fill = coolant\_pipe  
cell03.fill = fuel  
cell04.fill = cladding  
cell11.fill = cladding

universe01 = openmc.Universe()  
universe02 = openmc.Universe()

universe01.add\_cells([cell01, cell02, cell03, cell04])  
universe02.add\_cells([cell11])

lattice1 = openmc.HexLattice()  
lattice1.center = (0., 0.)  
lattice1.pitch = (3.4,)  
lattice1.outer = universe02

ring\_1 = [universe01]\*24  
ring\_2 = [universe01]\*18  
ring\_3 = [universe01]\*12  
ring\_4 = [universe01]\*6  
ring\_5 = [universe01]\*1  
lattice1.universes = [ring\_1,  
ring\_2,  
ring\_3,  
ring\_4,  
ring\_5]

outer\_surface1 = openmc.ZCylinder(r=16)  
outer\_surface2 = openmc.ZPlane(z0=0.0)  
outer\_surface3 = openmc.ZPlane(z0=43.2)  
outer\_surface1.boundary\_type = ‘vacuum’  
outer\_surface2.boundary\_type = ‘vacuum’  
outer\_surface3.boundary\_type = ‘vacuum’  
main\_cell = openmc.Cell(fill=lattice1, region=-outer\_surface1 & +outer\_surface2 & -outer\_surface3)  
geometry = openmc.Geometry([main\_cell])  
geometry.export\_to\_xml()

# OpenMC simulation parameters

batches = 100  
inactive = 30  
particles = 10000

settings\_file = openmc.Settings()  
settings\_file.batches = batches  
settings\_file.inactive = inactive  
settings\_file.particles = particles  
settings\_file.export\_to\_xml()

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [June 2, 2021, 12:14pm UTC](https://openmc.discourse.group/t/could-not-find-the-cell-containing-particle-2/1230/3 "2021-06-02T12:14:13Z")

</div>

@HaoPF You haven’t specified a source distribution at all. Please see my response to another recent post with the same issue:

> [@Critical Boron Concentration in Burnup Calculation](https://openmc.discourse.group/t/critical-boron-concentration-in-burnup-calculation/1173/6):
>
> @ayaz It looks like you haven’t specified a source distribution at all. By default, OpenMC will source particles at the origin, (0, 0, 0). The z-dimension in your geometry starts at z=0, so particles would be sourced directly on the boundary, which can cause issues like this. You should define a starting source that covers the entire length of your fuel bundle. See the user’s guide section on [external source distributions](https://docs.openmc.org/en/latest/usersguide/settings.html#external-source-distributions) for further information.

---

<div class="post-metadata">

**Author:** ![HaoPF](https://avatars.discourse-cdn.com/v4/letter/h/ba9def/32.png) [@HaoPF](https://openmc.discourse.group/u/HaoPF)\
**Post date:** [June 3, 2021, 1:22am UTC](https://openmc.discourse.group/t/could-not-find-the-cell-containing-particle-2/1230/4 "2021-06-03T01:22:09Z")

</div>

Thanks，@paulromano

As you said, I define a starting source that covers the entire length of your fuel bundle and it works well.

I really appreciate your help.  
HaoPF
