Problem with repeated cells in different universes

Hi!

Perhaps this has came out already, so sorry if I am repeating the question.

So let say I would like to define two universes (with many complex cells) that share a large part of cells. So in principle, both universes do not share the exact amount of cells but many of them. Then, when I do the python script and when I launched the API, then the geometry.xml file would only contain all the cells of the first universe, but the second universe who shares cells with the first one will be incomplete. I think in principle, my geometry is well defined. In fact, I had solved the problem by defining different cells to each universe but this is quite annoying since many cells are identical between the universes. So I think this is a problem with the translation from the python API while writing the xml files. Do you know how could I overcome such issue? I am using the openmc 0.10.0 latest stable version (i.e. the one that it is still in Fortran and was released last year).

Thanks for your attention.

Hi, again me :wink:

So well, I understand (just like in MCNP and SERPENT) that different universes should not share exact same cells. I just thought that by using the python API, due to the type of instructions of filling universes with cells, it might be possible for universes to share volumes (in fact, I think that if this approach is enabled by means of the python API, it would be indeed a very nice feature. It would save the creation of many other cells). So far, the fastest way I did for universes to share cells is to make a twin copy just like this (optimizing the region and fill lines):

U1.add_cells([cell1, cell2])

cell1_copy = openmc.Cell(region = cell1.region, fill = cell1.fill)

U2.add_cells([cell1_copy, cell3])

Anyway, if there was a way to solve this without the necessity of making twin copies in the python API would be great :wink:

Best regards,

Augusto

1 Like

Hi Augusto,

Yes, as you’ve discovered, cells currently can only be part of a single universe. We’ve discussed removing that constraint, but it is not trivial. For one, we keep “neighbor lists” that indicate the neighboring cells for each cell. If a cell can exist in multiple universes, it’s not clear how you would distinguish this when trying to determine which cell a particle should enter after it crosses a surface. We would also have to change our XML format in a manner that might break backwards compatibility. Anyway, I agree with you that this would be a useful capability, but no one has had the determination (or true need) to make it happen.

Best regards,
Paul

1 Like

FWIW, openmc provides an utility to create a copy of a cell with a new unique ID, and clones the cell’s region and fill:

cell1_copy = cell.clone(clone_materials=False, clone_regions=False)