openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
750 stars 483 forks source link

Allow empty lattice cells #3083

Open HunterBelanger opened 1 month ago

HunterBelanger commented 1 month ago

Description

Currently, when defining a lattice component in a geometry, all tiles or cells of the lattice must be filled with a universe. We are currently now able to support having an "empty" lattice cell, which would then default to the background outer universe without performing a coordinate transformation. Here is a very crude example of where this would be useful:

lattice_diagram

Suppose all the black outlined lattice cells are "filled", while the blue outlined ones I would want to be "empty". Let's also assume I have some shared global geometry elements outside the lattice (like the red circle in the diagram). If I make an outer universe with the red circle, but then place that universe in one of the blue tiles, there would be a coordinate transformation when moving to the outer universe, and the particle would not be in the correct position.

One "real world" example of where such a feature might be useful is situations where you have nested lattices with different pitches, such as the CROCUS reactor.

Alternatives

Currently, the only solution to this in our geometry system seems to be defining a cell with a region that corresponds to the black filled lattice tiles, and then placing the lattice as a fill in that cell. The fill lattice would still require dummy universes to be present in the blue cells, but they should never be visible, as they would be clipped by the cell in which the lattice is nested.

Compatibility

I don't believe that this would break any existing geometries. It should be possible to implement this just as a new feature, where all previous geometries would still work.

tjlaboss commented 4 weeks ago

By "the background outer universe", do you mean the parent universe (root universe) here, or lattice.outer?

HunterBelanger commented 4 weeks ago

By background I had lattice.outer in mind.