WARNING: After particle 1878 crossed surface 66 it could not be located in cell and it did not leak

Hi,
I recently started learning and using OpenMC. I tried to create a test pincell by following the example provided on GitHub. However, I encountered the following issue:
WARNING: After particle 1878 crossed surface 66 it could not be located in cell and it did not leak.

Material Definition

#Moderator
water = openmc.Material(name=‘Water’)
water.set_density(‘g/cm3’, .99659)
water.add_nuclide(‘H1’, 2.0)
water.add_nuclide(‘O16’, 1.0)
water.add_s_alpha_beta(‘c_H_in_H2O’)

#UZrH
uzrh = openmc.Material(name=‘UZrH’)
uzrh.set_density(‘g/cm3’, 5.79875)
uzrh.add_nuclide(‘U235’, 38.0, ‘wo’)
uzrh.add_nuclide(‘U238’, 152.0, ‘wo’)
uzrh.add_element(‘Zr’, 2009.76191, ‘wo’)
uzrh.add_element(‘H’, 35.5322, ‘wo’)

#graphite
graphite = openmc.Material(name=‘Graphite’)
graphite.set_density(‘g/cm3’, 1.67)
graphite.add_element(‘C’, 1.0)
graphite.add_s_alpha_beta(‘c_Graphite’)

#Stainless steel
ss304 = openmc.Material(name=‘Stainless Steel 304’)
ss304.set_density(‘g/cm3’, 7.82)
ss304.add_element(‘Mn’,0.0175,‘wo’)
ss304.add_element(‘Cr’,.115,‘wo’)
ss304.add_element(‘Fe’,0.70,‘wo’)
ss304.add_element(‘Ni’,0.0925,‘wo’)

#B4C
b4c = openmc.Material(name=‘Boron Carbide’)
b4c.set_density(‘g/cm3’, 2.4)
b4c.add_element(‘B’, 4)
b4c.add_element(‘C’, 1)

#Zirconium
zirconium = openmc.Material(name=‘Zirconium’)
zirconium.set_density(‘g/cm3’, 6.500)
zirconium.add_element(‘Zr’, 1.0)

#Void
void = openmc.Material(name=‘Void’)
void.set_density(‘g/cm3’, 0.001205)
void.add_element(‘Ni’, 0.755268, ‘wo’)
void.add_element(‘C’, 0.000124, ‘wo’)
void.add_element(‘O’, 0.231781, ‘wo’)
void.add_element(‘Ar’, 0.012827, ‘wo’)

#Aluminium
aluminum = openmc.Material(name=‘Aluminum’)
aluminum.set_density(‘g/cm3’, 2.7)
aluminum.add_element(‘Al’, 1.0)

#Instantiate a Materials collection and export to xml
materials_file = openmc.Materials([aluminum, void, zirconium, b4c, ss304, graphite, uzrh, water])
materials_file.export_to_xml()

Fuel Rod Definition

#diameter Zr rod
rod_outer_radius = openmc.ZCylinder(r=0.31750)
#diameter end fitting
end_fitting_outer_1_radius = openmc.ZCylinder(r=0.93663)
#diameter UZrH
uzrh_outer_radius = openmc.ZCylinder(r=1.82245)
#diameter graphite plug
graphite_outer_radius = openmc.ZCylinder(r=1.82245)
#diameter ss304
ss304_outer_radius = openmc.ZCylinder(r=1.82245)
#diameter cladding (pembungkus)
clad_outer_radius = openmc.ZCylinder(r=1.87325)

#end fitting upper (4.953 cm)
end_fitting_upper_min = openmc.ZPlane(z0=-4.953)
end_fitting_upper_max = openmc.ZPlane(z0=+0)
#ss304 upper (1.27 cm)
ss304_upper_min = openmc.ZPlane(z0=-6.223)
ss304_upper_max = openmc.ZPlane(z0=-4.953)
#graphite upper (6.604 cm)
graphite_upper_min = openmc.ZPlane(z0=-12.827)
graphite_upper_max = openmc.ZPlane(z0=-6.223)
#Zirconium (38.1 cm)
rod_min = openmc.ZPlane(z0=-50.927)
rod_max = openmc.ZPlane(z0=-12.827)
#UZrH (38.1 cm)
uzrh_min = openmc.ZPlane(z0=-50.927)
uzrh_max = openmc.ZPlane(z0=-12.827)
#graphite lower (9.398 cm)
graphite_lower_min = openmc.ZPlane(z0=-60.325)
graphite_lower_max = openmc.ZPlane(z0=-50.927)
#ss304 lower (1.27 cm)
ss304_lower_min = openmc.ZPlane(z0=-61.595)
ss304_lower_max = openmc.ZPlane(z0=-60.325)
#cladding
clad_min = openmc.ZPlane(z0=-4.953)
clad_max = openmc.ZPlane(z0=-61.595)
#end fitting lower 1 (5.08 cm)
end_fitting_lower_1_min = openmc.ZPlane(z0=-66.675)
end_fitting_lower_1_max = openmc.ZPlane(z0=-61.595)
#empty space lower (48.26 cm)
empty_space_lower_min = openmc.ZPlane(z0=-109.855)
empty_space_lower_max = openmc.ZPlane(z0=-66.675)

universe fuel rod

fuel_universe = openmc.Universe(name=‘UZrH Fuel Universe’)

#buat sel end fitting upper
end_fitting_upper_cell = openmc.Cell(name=‘Upper End Fitting’)
end_fitting_upper_cell.fill = ss304
end_fitting_upper_cell.region = -end_fitting_outer_1_radius & +end_fitting_upper_min & -end_fitting_upper_max
fuel_universe.add_cell(end_fitting_upper_cell)

#buat sel ss304 upper
ss304_upper_cell = openmc.Cell(name=‘Upper Stainless Steel 304’)
ss304_upper_cell.fill = ss304
ss304_upper_cell.region = -ss304_outer_radius & +ss304_upper_min & -ss304_upper_max
fuel_universe.add_cell(ss304_upper_cell)

#buat sel graphite upper
graphite_upper_cell = openmc.Cell(name=‘Upper Graphite’)
graphite_upper_cell.fill = graphite
graphite_upper_cell.region = -graphite_outer_radius & +graphite_upper_min & -graphite_upper_max
fuel_universe.add_cell(graphite_upper_cell)

#buat sel Zr rod
rod_cell = openmc.Cell(name=‘Zr Rod’)
rod_cell.fill = zirconium
rod_cell.region = -rod_outer_radius & +rod_min & -rod_max
fuel_universe.add_cell(rod_cell)

#buat sel uzrh
uzrh_cell = openmc.Cell(name=‘UZrH’)
uzrh_cell.fill = uzrh
uzrh_cell.region = +rod_outer_radius & -uzrh_outer_radius & +uzrh_min & -uzrh_max
fuel_universe.add_cell(uzrh_cell)

#buat sel graphite lower
graphite_lower_cell = openmc.Cell(name=‘Lower Graphite’)
graphite_lower_cell.fill = graphite
graphite_lower_cell.region = -graphite_outer_radius & +graphite_lower_min & -graphite_lower_max
fuel_universe.add_cell(graphite_lower_cell)

#buat sel lower ss304
ss304_lower_cell = openmc.Cell(name=‘Lower Stainless Steel 304’)
ss304_lower_cell.fill = ss304
ss304_lower_cell.region = -ss304_outer_radius & +ss304_lower_min & -ss304_lower_max
fuel_universe.add_cell(ss304_lower_cell)

#buat sel cladding
clad_cell = openmc.Cell(name=‘Stainless Steel 304 Cladding’)
clad_cell.fill = ss304
clad_cell.region = -clad_outer_radius & +ss304_outer_radius & +clad_min & -clad_max
fuel_universe.add_cell(clad_cell)

#buat sel end fitting lower 1
end_fitting_lower_1_cell = openmc.Cell(name=‘Lower End Fitting 1’)
end_fitting_lower_1_cell.fill = ss304
end_fitting_lower_1_cell.region = -end_fitting_outer_1_radius & +end_fitting_lower_1_min & -end_fitting_lower_1_max
fuel_universe.add_cell(end_fitting_lower_1_cell)

#buat sel empty space diatas ss304
empty_space_upper_cell= openmc.Cell(name=‘Empty space upper fuel rod’)
empty_space_upper_cell.fill = water
empty_space_upper_cell.region = +end_fitting_outer_1_radius & +end_fitting_upper_min & -end_fitting_upper_max
fuel_universe.add_cell(empty_space_upper_cell)

#buat sel empty space lower fuel rod 1
empty_space_lower_1_cell= openmc.Cell(name=‘Empty space upper fuel rod’)
empty_space_lower_1_cell.fill = water
empty_space_lower_1_cell.region = +end_fitting_outer_1_radius & +end_fitting_lower_1_min & -end_fitting_lower_1_max
fuel_universe.add_cell(empty_space_lower_1_cell)

#buat sel empty space lower fuel rod 2
empty_space_lower_cell = openmc.Cell(name=‘Empty space lower fuel rod’)
empty_space_lower_cell.fill = water
empty_space_lower_cell.region = -clad_outer_radius & +empty_space_lower_min & -empty_space_lower_max
fuel_universe.add_cell(empty_space_lower_cell)

Create water universe to surround the lattice

all_water_cell = openmc.Cell(fill=water)
outer_universe = openmc.Universe(cells=(all_water_cell,))

Create surfaces that will divide rings in the circular lattice

ring_radii = np.array([0.0, 8.0, 16.0, 24.0, 32.0, 40.0])
radial_surf = [openmc.ZCylinder(r=r) for r in
(ring_radii[:-1] + ring_radii[1:])/2]

water_cells =
for i in range(ring_radii.size):
# Create annular region
if i == 0:
water_region = -radial_surf[i]
elif i == ring_radii.size - 1:
water_region = +radial_surf[i-1]
else:
water_region = +radial_surf[i-1] & -radial_surf[i]
water_cells.append(openmc.Cell(fill=water, region=water_region))

Arrange the pins in the circular lattice

num_pins = [1, 6, 12, 18, 24, 30]
angles = [0, 0, 0, 0, 0, 0]

for i, (r, n, a) in enumerate(zip(ring_radii, num_pins, angles)):

for j in range(n):
    
    # Determine location of center of pin
    theta = (a + j/n*360.) * np.pi/180.
    x = r*np.cos(theta)
    y = r*np.sin(theta)
    
    pin_boundary = openmc.ZCylinder(x0=x, y0=y, r=clad_outer_radius.r)
    water_cells[i].region &= +pin_boundary
    
    # Create each fuel pin -- note that we explicitly assign an ID so 
    # that we can identify the pin later when looking at tallies
    pin = openmc.Cell(fill=fuel_universe, region=-pin_boundary)
    pin.translation = (x, y, 0)
    pin.id = (i + 1)*100 + j
    bundle_universe.add_cell(pin)

Geometry definitions for the reactor

reactor_wall = openmc.ZCylinder(r=50.0, boundary_type=‘vacuum’)
reactor_top = openmc.ZPlane(z0=0.0, boundary_type=‘vacuum’)
reactor_bottom = openmc.ZPlane(z0=-109.855, boundary_type=‘vacuum’)
reactor = openmc.Cell()
reactor.region = -reactor_wall & -reactor_top & +reactor_bottom
reactor.fill = bundle_universe
reactor_universe = openmc.Universe(cells=[reactor])

reactor_universe.plot(width=(100, 100), origin=[0,0,-40], show_overlaps=(True),
basis=‘yz’, color_by=‘material’,
colors={water:‘blue’,uzrh:‘orange’,
zirconium:‘green’,graphite:‘gray’,
b4c:‘yellow’})

geometry = openmc.Geometry(reactor_universe)
geometry.export_to_xml()

OpenMC simulation parameters

batches = 100
inactive = 10
particles = 5000

settings_file = openmc.Settings()
settings_file.batches = batches
settings_file.inactive = inactive
settings_file.particles = particles

bounds = [-28.527375, -28.527375, -28.527375, 28.527375, 28.527375, 28.527375]
uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:])
settings_file.source = openmc.IndependentSource(space=uniform_dist)

settings_file.export_to_xml()

running openmc

openmc.run()

Hi pras_3136, welcome to the openmc community
I think the problem was came from your cladding cell definition, please check the z region definition you have done clad_cell.region = -clad_outer_radius & +ss304_outer_radius & +clad_min & -clad_max

also, I see that you havent include your water_cells into the bundle_universe, so your developed core model just made up only by the fuel pin cells