# Have a question about the "openmc.model.pack\_spheres"

**URL:** <https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842>\
**Category:** User Support\
**Created:** [January 22, 2024, 8:00am UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842 "2024-01-22T08:00:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kotori](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kotori/32/3107_2.png) [@kotori](https://openmc.discourse.group/u/kotori)\
**Post date:** [January 22, 2024, 8:00am UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/1 "2024-01-22T08:00:56Z")

</div>

I’m trying to build a lattice with a heat pipe loaded with coolant on the inside and then a hexagonal prism filled with triso particles on the outside, but openmc.model.pack\_spheres doesn’t support this geometry, any suggestions or ways to do this please? Thank you very much.

 ![微信截图_20240122155228](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/f/f920b2e63eb95bf8359a32e5c73b2302129b4a93.jpeg)

---

<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:** [January 23, 2024, 5:54am UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/2 "2024-01-23T05:54:08Z")

</div>

Hi @kotori and welcome to the community. Unfortunately the `pack_spheres` function only supports a few bounding shapes, which currently does not include a hexagonal prism.

---

<div class="post-metadata">

**Author:** ![kotori](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kotori/32/3107_2.png) [@kotori](https://openmc.discourse.group/u/kotori)\
**Post date:** [January 23, 2024, 6:29am UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/3 "2024-01-23T06:29:53Z")

</div>

Thank you very much for your reply, is there a way to implement this idea, like modifying the source code or something, or do I have to modify my model design? 🧐

---

<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:** [January 23, 2024, 1:05pm UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/4 "2024-01-23T13:05:08Z")

</div>

If you wanted to implement it, you would need to write a new class in [this module](https://github.com/openmc-dev/openmc/blob/develop/openmc/model/triso.py) that subclasses the `_Container` class. It wouldn’t be extremely difficult, but it’s also not a simple task and will require understanding some of the details of the algorithm.

Alternatively, as an approximation, you could pack spheres in a cylinder and then overlay a hexagonal prism on top of it (effectively cutting off some of the cylinder). This would give the correct geometry in the interior but would be incorrect near the boundaries since some spheres would be incomplete (and the packing fraction changes slightly near the boundary). Depending on your system that may or may not be acceptable.

---

<div class="post-metadata">

**Author:** ![kotori](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kotori/32/3107_2.png) [@kotori](https://openmc.discourse.group/u/kotori)\
**Post date:** [January 24, 2024, 1:02pm UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/5 "2024-01-24T13:02:24Z")

</div>

@paulromano ok 👌I will try to modify the source code and will keep in touch with you if I have any problems, thanks again!

---

<div class="post-metadata">

**Author:** ![kotori](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kotori/32/3107_2.png) [@kotori](https://openmc.discourse.group/u/kotori)\
**Post date:** [March 12, 2024, 12:00pm UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/6 "2024-03-12T12:00:57Z")

</div>

hi paul .I have a question. I have created a cylindrical shell now (a cylinder with a larger radius contains a cylinder with a smaller radius)to hold triso particles, and I would like to know  
"box=openmc. Cell (region=region)  
lower\_left, uppe\_right=box. region. bounding\_box "  
Can this function handle the region of this cylindrical shell?

---

<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 12, 2024, 12:20pm UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/7 "2024-03-12T12:20:48Z")

</div>

No, currently `pack_spheres` only supports a solid cylinder, not a cylindrical shell.

---

<div class="post-metadata">

**Author:** ![kotori](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kotori/32/3107_2.png) [@kotori](https://openmc.discourse.group/u/kotori)\
**Post date:** [March 12, 2024, 12:30pm UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/8 "2024-03-12T12:30:35Z")

</div>

i have write a new class that subclasses the \_Container class.its a cylinderical shell…so would it be work?

---

<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 12, 2024, 10:15pm UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/9 "2024-03-12T22:15:26Z")

</div>

I can’t tell you if your own code works 😄 You would have to test it yourself to see if it meets your requirements.

---

<div class="post-metadata">

**Author:** ![kotori](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/kotori/32/3107_2.png) [@kotori](https://openmc.discourse.group/u/kotori)\
**Post date:** [March 15, 2024, 7:46am UTC](https://openmc.discourse.group/t/have-a-question-about-the-openmc-model-pack-spheres/3842/10 "2024-03-15T07:46:53Z")

</div>

Thank you very much for your help. Now I have encountered another issue:

_**warnings.warn(‘TRISO particle is partially or completely’**_

How should I solve this problem, or can I ignore it?
