Could not find the cell containing particle 2

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:

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

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

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

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()

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

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