# Hexagonal pincell geometry

**URL:** <https://openmc.discourse.group/t/hexagonal-pincell-geometry/3619>\
**Category:** User Support\
**Created:** [November 10, 2023, 1:38pm UTC](https://openmc.discourse.group/t/hexagonal-pincell-geometry/3619 "2023-11-10T13:38:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shamim](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@Shamim](https://openmc.discourse.group/u/Shamim)\
**Post date:** [November 10, 2023, 1:38pm UTC](https://openmc.discourse.group/t/hexagonal-pincell-geometry/3619/1 "2023-11-10T13:38:36Z")

</div>

I can not build this hexagonal fuel pill geometry. Please help.

 ![hexagonal geometry](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/c/c58c8f3432b0abf5754ca44505cfd8b5fc370bf2.jpeg)

---

<div class="post-metadata">

**Author:** ![Sabyasachi](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@Sabyasachi](https://openmc.discourse.group/u/Sabyasachi)\
**Post date:** [November 10, 2023, 2:51pm UTC](https://openmc.discourse.group/t/hexagonal-pincell-geometry/3619/2 "2023-11-10T14:51:24Z")

</div>

Hi Shamim, I will advice you to take a look on the code given below,  
[Pin cell design](https://github.com/Sabyaro/Openmc-in-dresden/blob/main/pincell_design.ipynb)  
For further query you can get help from [Geometry theory](https://docs.openmc.org/en/stable/methods/geometry.html) here as well.  
Best wishes

---

<div class="post-metadata">

**Author:** ![ligross](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/ligross/32/1653_2.png) [@ligross](https://openmc.discourse.group/u/ligross)\
**Post date:** [November 10, 2023, 5:58pm UTC](https://openmc.discourse.group/t/hexagonal-pincell-geometry/3619/3 "2023-11-10T17:58:14Z")

</div>

There’s a few different things you’ll need. To make the hexagonal part, there’s a function that makes it for you. If you’re using the newest version of OpenMC (v0.14.0), check out [openmc.model.HexagonalPrism](https://docs.openmc.org/en/stable/pythonapi/generated/openmc.model.HexagonalPrism.html#openmc.model.HexagonalPrism). If you’re using an older version, you’ll want [openmc.model.hexagonal\_prism](https://docs.openmc.org/en/v0.13.3/pythonapi/generated/openmc.model.hexagonal_prism.html?highlight=hexagonal_prism).

The concentric cylinders can be achieved using [openmc.ZCylinder()](https://docs.openmc.org/en/latest/pythonapi/generated/openmc.ZCylinder.html).

The workflow will go as follows:

- Make all the geometric objects using `ZCylinder`s and a hexagonal region with the correct call based on your version
- Define OpenMC regions for the spaces between the geometric objects using the correct operators on the geometric objects (e.g. `region_2 = +zcyl_1 & -zcyl_2 )`
- Make a cell for each of those regions, with `openmc.Cell(region=region_name,fill=material)` where material is an `openmc.Material` object
- Make a universe for all your cells by passing the list of cells made to `openmc.Universe([cell_list])`
