Hi everyone,
I am new to OpenMC. I am attempting to simulate a HDPE neutron collimator with diameter 5cm, 18.5cm long, and aperture diameter 3.8cm. The neutron source energy is 2.45MeV (D-D reactions). However, I ran into a warning stating that after particle #number crossed surface 4 it could not be located in any cell and it did not leak. May I know how can I solve this problem? Below is my code. Thank you. Regards.
import openmc
Define the materials
hdpe = openmc.Material(name=“HDPE”)
hdpe.add_element(“C”, 2)
hdpe.add_element(“H”, 4)
hdpe.set_density(“g/cm3”, 0.95)
materials = openmc.Materials([hdpe])
Define the geometry
geometry = openmc.Geometry()
Define the collimator dimensions
outer_radius = 2.5 # cm
inner_radius = 1.9 # cm
length = 18.5 # cm
distance = 1.0 # cm
Create the collimator geometry
collimator_outer_surface = openmc.YCylinder(surface_id=1, r=outer_radius, boundary_type=‘vacuum’)
collimator_inner_surface = openmc.YCylinder(surface_id=2, r=inner_radius)
collimator_right_surface = openmc.YPlane(surface_id=3, y0=length / 2)
collimator_left_surface = openmc.YPlane(surface_id=4, y0=-length / 2)
collimator_region = -collimator_outer_surface & +collimator_inner_surface & -collimator_right_surface & +collimator_left_surface
collimator_cell = openmc.Cell(cell_id=1, region=collimator_region, fill=hdpe)
aperture_cell = openmc.Cell(cell_id=2, region=-collimator_inner_surface)
entry_cell = openmc.Cell(cell_id=3, region=-collimator_left_surface)
exit_cell = openmc.Cell(cell_id=4, region=+collimator_right_surface)
Add the cells to the geometry
geometry.root_universe = openmc.Universe(cells=[collimator_cell, aperture_cell, entry_cell, exit_cell])
Create the settings
settings = openmc.Settings()
settings.run_mode = “fixed source”
settings.particles = 1000000
settings.batches = 10
settings.inactive = 0
settings.source = openmc.Source(space=openmc.stats.Point(xyz=(0,-(length / 2) - distance,0)), energy=openmc.stats.Discrete([2.45e6], [1]))
Create the tallies
tally = openmc.Tally(name=“neutron_collimation”)
tally.scores = [“flux”]
tally.filters = [openmc.CellFilter(collimator_cell)]
tallies = openmc.Tallies([tally])
Run the simulation
model = openmc.model.Model(geometry, materials, settings, tallies)
model.run()