I will answer my own question, in case others are wondering the same in the future.
The best way is to use one of the options available and then rotate the geometry to be in the desired reference frame. The key here is that two rotation calls are necessary. First, the region (intersection of hex cell and bounding z-planes) must be rotated via openmc.Region.rotate()
. Then, the cell that contains the universe must be rotated by specifying openmc.Cell.rotation
on the cell after it is created. Here’s some code to show how I do this
zplane_min = openmc.ZPlane(z0=z_min, boundary_type="vacuum")
zplane_max = openmc.ZPlane(z0=z_max, boundary_type="vacuum")
hex_boundary_region = openmc.model.HexagonalPrism(
edge_length=lattice_flat_to_flat * f / math.sqrt(3),
orientation="y"
)
region = -hex_boundary_region & +zplane_min & -zplane_max
rotated_region = region.rotate((-90.0, 0.0, 0.0))
core_cell = openmc.Cell(
region=rotated_region,
fill=core_lattice
)
core_cell.rotation = (-90.0, 0.0, 0.0)
geometry = openmc.Geometry([core_cell])
(note the definition of core_lattice
is not shown, but I used a HexLattice
)
Important to note that openmc.Cell.rotation
applies to the fill of the cell and doesn’t actually rotate the cell itself, which is why openmc.Region.rotate()
must be used.