# hexagonal lattice

**URL:** <https://openmc.discourse.group/t/hexagonal-lattice/260>\
**Category:** User Support\
**Created:** [March 14, 2017, 8:06pm UTC](https://openmc.discourse.group/t/hexagonal-lattice/260 "2017-03-14T20:06:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_K\_Madani](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@Ahmed\_K\_Madani](https://openmc.discourse.group/u/Ahmed_K_Madani)\
**Post date:** [March 14, 2017, 8:06pm UTC](https://openmc.discourse.group/t/hexagonal-lattice/260/1 "2017-03-14T20:06:51Z")

</div>

I’m trying to simulate VVER reactor assembly but i couldn’t understand how to set hexagonal lattice in openmc the assembly VVER contain 312 fuel pins and 19 guide tubes , so can you share with me any way to understand how to set it up because i cannot understand the concept of the hexagonal lattice in openmc  
Thanks

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [March 17, 2017, 12:24pm UTC](https://openmc.discourse.group/t/hexagonal-lattice/260/2 "2017-03-17T12:24:43Z")

</div>

Ahmed,

If you are writing XML files directly, you should take a look at the documentation for the [\<hex\_lattice\> element](http://openmc.readthedocs.io/en/latest/usersguide/input.html#hex-lattice-element). If you are using the Python API, there is an example of creating a hexagonal lattice [here](https://github.com/paulromano/cnl-workshop/blob/master/notebooks/05-lattices/Solution/Lattices-Solution.ipynb) and [here](https://github.com/mit-crpg/openmc/blob/develop/examples/python/lattice/hexagonal/build-xml.py). Let us know if you are still confused after looking over the documentation and the examples.

Best regards,  
Paul

---

<div class="post-metadata">

**Author:** ![Marcin\_Rowinski](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Marcin\_Rowinski](https://openmc.discourse.group/u/Marcin_Rowinski)\
**Post date:** [May 11, 2017, 10:04am UTC](https://openmc.discourse.group/t/hexagonal-lattice/260/3 "2017-05-11T10:04:43Z")

</div>

Hi!

Have you solved you problem? I am currently do very similar thing, an assembly of VVER reactor. I have managed to create the geometry, picture made in openmc attached. But cannot make it work.

```auto
I believe that the problem is either in some surface, region or settings definition, however, I am running out of ideas how to fix it. My base for geometry was [this workshop](https://github.com/paulromano/cnl-workshop/blob/master/notebooks/05-lattices/Solution/Lattices-Solution.ipynb)suggested by Paul. The calculations work fine when I use cylinder or rectangular region. But when I use openmc.get_hexagonal_prism(edge_length, orientation='y', boundary_type='reflective') it does not. I keep receiving following error:

```

```auto
WARNING: After particle 3 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 3 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 4 crossed surface 10018 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 6 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 7 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 8 crossed surface 10018 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 9 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 11 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 12 crossed surface 10018 it could not be located in any
          cell and it did not leak.
 WARNING: After particle 13 crossed surface 10019 it could not be located in any
          cell and it did not leak.
 ERROR: Maximum number of lost particles has been reached.
ERROR STOP 

I would appreciate any help in this matter. Is there any example of similar geometry? Please let me know if you have any questions?

Best,
Marcin

```

W dniu wtorek, 14 marca 2017 21:06:51 UTC+1 użytkownik Ahmed K. Madani napisał:

 ![materials-xy.png](https://global.discourse-cdn.com/free1/uploads/openmc/original/1X/80a4855e0a4459c5f89637f88950825a318b9794.png)

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [May 17, 2017, 1:35pm UTC](https://openmc.discourse.group/t/hexagonal-lattice/260/4 "2017-05-17T13:35:31Z")

</div>

Hi Marcin,

Without having a look at your inputs, it’s hard to say where the problem lies. Looking at the attached picture, I am a little bit suspicious of the fuel pins. The regions in the fuel pin that are white appear to be voids – have you actually assigned cells there? From the Python API, if you want to create a cell with no material in it, simply do not assign anything to the fill, e.g.

void\_cell = openmc.Cell(region=…)

or if you were writing XML directly, you would need to put material=“void”, e.g.

If you’re comfortable sharing your inputs, I can try to help diagnose further.

Best,  
Paul
