Have a question about the "openmc.model.pack_spheres"

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.

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.

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? :face_with_monocle:

If you wanted to implement it, you would need to write a new class in this module 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.

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

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?

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

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

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

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?