The meaning of filling universe for a cell

Hi, everyone!
I’m green hand in OpenMC, and there is a problem that has been bothering me for a while, I can’t understand the meaning of filling universe for a cell, for exemple: I already definie a Universe that possess series of Cells, and each Cell has its own region, however if I wanna fill another cell with this Universe ,i still need define region. I can’t understand /(ㄒoㄒ)/

And now I am building a complex model, because of my lack of knowledge on OpenMC, I definie different function for each components which return an array of Cell for in different locations so that I could repeat. Final, all Cells are filled in a same Universe, then Universe–>Geometry, the simulation could run, but I noticed that in this case, there will be a lots of Plane, their positons are same,just the id is different. I have no idea if it will affect the simulation results, in fact, I run debug model ,there are not overlap Cell.
Thank you for your time and effort!

1 Like

Hi @Tianxiang and welcome to the community!

Let’s say you have cell A that is filled with universe B. All cells in universe B will be constrained by the region that is assigned to cell A. For example, if universe B had the following two cells:

yplane = openmc.YPlane(0.0)
cell1 = openmc.Cell(region=+yplane)
cell2 = openmc.Cell(region=-yplane)
universeB = openmc.Universe(cells=[cell1, cell2])

and it were placed in a cell defined with a cylinder:

cyl = openmc.ZCylinder(r=5.0)
cellA = openmc.Cell(fill=universeB, region=-cyl)

In this case, cell1 and cell2 won’t extend past the boundary imposed by cellA. Here’s a plot of the geometry:

In general, if you’re having trouble understanding geometry, I would recommend using the openmc-plotter tool to visualize your geometry.

Hi @paulromano.
thanks for your answer, It’s clear to me now :smiley:. And if cellA’s region was bigger than universeB (in your example), the gap is vacuum? The act of filling a Universe into a Cell makes it easier to model, right? because Cell can be cloned and translation.
In addition, I have tried to install OpenMc plotter before, but for OpenMc 0.13.0. it doesn’t seem to have a suitable version

If cellA’s region was bigger than the collection of cells in universeB, the gap is undefined and you may lose particles in your model. If you want a region of vacuum, you need to explicitly define a cell for that region and just don’t assign any fill at all (or, equivalently, set fill=None). This is why it is generally recommend to make sure each universe doesn’t have any undefined regions (in my example, cell1 and cell2 fill all the space in universeA).

If you install openmc-plotter using pip, it should work with OpenMC 0.13.0. What’s the error you’re running into?

Thanks again.
Here is the error:

It looks like you need to uninstall openmc-plotter 0.1.1 first before trying to install openmc-plotter 0.2.0.

I created a new environment and successfully installed openmc-plotter, but when I run, some problems reappear.

This appears to be version mismatch between packages:

Thank you Paul! this is helpful :smiley: