Defining region between hexagonal lattice & a cylinder

Hi all, how can i define a region & assign a material between a hexagonal lattice & a cylinder??

-Thanks

One approach could be using the Lattice.outer attribute:

# Create the hexagonal lattice as you normally would.
hex_lattice = openmc.HexLattice()
populate_the_hex_lattice(...)
# Create a universe containing just an infinite cell
c = openmc.Cell(fill=some_material)
u = openmc.Universe(cells=[c])
hex_lattice.outer = u
# Put it in the cylinder. 
cyl = openmc.ZCylinder(...)
your_cell = openmc.Cell()
your_cell.region  = -cyl
your_cell.fill = hex_lattice # Space outside the hex lattice will be filled with some_material.
2 Likes

Thanks for your concern but what i wanted to do is actually to define the region between a cylinder (larger in diameter) & the hexagonal prism/lattice i defined. By doing as u mentioned will fill that cylinder with the hex cell. But still i can’t freely define the region in between. I already solved this issue myself.

Defining the six planes separately using openmc.Plane(a,b,c,d) & then doing boolean operation between the six planes & the cylinder will give me the defined region & i can use it after that to assign any material i want.

-Thanks

sorry to say, but i guess my solution is also not entirely correct. it’ll still leave some areas undefined in between. it’ll be better if we can define a region outside a hexagonal prism & inside another geometry by boolean .but i dont know how to do it!!

Not sure I follow. Are you placing a cylinder around a HexLattice, or around a hexagon made from six planes?

I actually had a misconception .thank you so much.this was the right thing.i got it now

-Imtiaj