# Geometry debugging: overlapping cells

**URL:** <https://openmc.discourse.group/t/geometry-debugging-overlapping-cells/6370>\
**Category:** User Support\
**Created:** [June 18, 2026, 8:22am UTC](https://openmc.discourse.group/t/geometry-debugging-overlapping-cells/6370 "2026-06-18T08:22:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giorgia](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Giorgia](https://openmc.discourse.group/u/Giorgia)\
**Post date:** [June 18, 2026, 8:22am UTC](https://openmc.discourse.group/t/geometry-debugging-overlapping-cells/6370/1 "2026-06-18T08:22:05Z")

</div>

Hello everyone,

I am facing an issue while implementing a relatively complex geometry in OpenMC, and I would appreciate some guidance. Conceptually, I am trying to model a detector volume embedded in air, so I expect the air cell to be defined as the room volume minus all embedded objects.

I have defined all surfaces and cells, but when running openmc.run(geometry\_debug=True), I get an error indicating that two cells are overlapping. For simplicity, I will refer to them as `cell_air_up `and `cell_detector`. Both cells are filled with air. The geometry is such that `cell_detector` is a simple sphere, and it is entirely contained within `cell_air_up`.

The geometry structure is the following:

I define an inner universe:

> u\_inner = openmc.Universe(cells=[cell\_detector, # other cells…])

The upper room volume is defined as:

> room\_up = openmc.model.RectangularParallelepiped(
> 
> -140.05, 199.95,
> 
> -905, 350,
> 
> -344, 332
> 
> )

I then build a combined region of all solid objects:

> solids\_up = ( cell\_detector, # other cells…)
> 
> solidup\_region = solids\_up[0].region
> 
> for cell in solids\_up[1:]:
> 
> solidup\_region |= cell.region

The air in the room is defined as:

> cell\_air\_up = openmc.Cell(
> 
> name=“Air in room (upper part)”,
> 
> fill=air,
> 
> region=-room\_up & ~solidup\_region
> 
> )
> 
> u\_inner.add\_cell(cell\_air\_up)

The bounding structure is then defined:

> cell\_boundary = openmc.Cell(
> 
> name=“Boundary”,
> 
> fill=u\_inner,
> 
> region=(
> 
> +xmin & -xmax &
> 
> +ymin & -ymax &
> 
> +zmin & -zmax
> 
> )
> 
> )

I also define an external air region:

> outer\_region = (
> 
> +xmin & -xmax &
> 
> +ymin & -ymax &
> 
> +zmin & -zmax
> 
> )
> 
> structure\_region = ( -room\_up # | other structures… )
> 
> cell\_outside = openmc.Cell(
> 
> name=“Outside air”,
> 
> fill=air,
> 
> region=outer\_region & ~structure\_region
> 
> )
> 
> u\_inner.add\_cell(cell\_outside)

Finally:

> u\_root = openmc.Universe(cells=[cell\_boundary])
> 
> geometry = openmc.Geometry(u\_root)

Despite explicitly subtracting `solidup_region` from `cell_air_up`, OpenMC still reports an overlap between `cell_air_up` and `cell_detector`.

Any suggestions on how to resolve this overlap issue (or best practices for structuring such geometries) would be greatly appreciated.

Thank you in advance!

Giorgia
