Adding an extra layer to the geometry to test the cell instance filter regression test for a universe-filled cell.

This commit is contained in:
Patrick Shriwise 2021-07-29 20:01:21 -05:00
parent 930fb20010
commit 3114c93562
2 changed files with 17 additions and 12 deletions

View file

@ -2,18 +2,19 @@
<geometry>
<cell id="1" material="1" region="-1" universe="1" />
<cell id="2" material="2" region="1" universe="1" />
<cell id="3" material="1" region="-2" universe="2" />
<cell id="4" material="2" region="2" universe="2" />
<cell fill="3" id="5" region="3 -4 5 -6" universe="4" />
<lattice id="3">
<cell fill="1" id="3" universe="2" />
<cell id="4" material="1" region="-2" universe="3" />
<cell id="5" material="2" region="2" universe="3" />
<cell fill="4" id="6" region="3 -4 5 -6" universe="5" />
<lattice id="4">
<pitch>2 2</pitch>
<dimension>4 4</dimension>
<lower_left>-4 -4</lower_left>
<universes>
1 2 2 2
2 1 2 2
2 2 1 2
2 2 2 1 </universes>
2 3 3 3
3 2 3 3
3 3 2 3
3 3 3 2 </universes>
</lattice>
<surface coeffs="0.0 0.0 0.7" id="1" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.5" id="2" type="z-cylinder" />
@ -48,10 +49,10 @@
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="1" type="cellinstance">
<bins>3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 2 0 2 1 2 2 2 3</bins>
<bins>4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 4 10 4 11 2 0 2 1 2 2 2 3 3 0 3 1 3 2 3 3</bins>
</filter>
<filter id="2" type="cellinstance">
<bins>2 3 2 2 2 1 2 0 3 11 3 10 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 3 1 3 0</bins>
<bins>3 3 3 2 3 1 3 0 2 3 2 2 2 1 2 0 4 11 4 10 4 9 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0</bins>
</filter>
<tally id="1">
<filters>1</filters>

View file

@ -22,7 +22,10 @@ def model():
cyl1 = openmc.ZCylinder(r=0.7)
c1 = openmc.Cell(fill=m1, region=-cyl1)
c2 = openmc.Cell(fill=m2, region=+cyl1)
u1 = openmc.Universe(cells=[c1, c2])
# intermediate universe
ui = openmc.Universe(cells=[c2])
ci = openmc.Cell(fill=ui)
u1 = openmc.Universe(cells=[c1, ci])
cyl2 = openmc.ZCylinder(r=0.5)
c3 = openmc.Cell(fill=m1, region=-cyl2)
@ -50,7 +53,8 @@ def model():
model.settings.source = openmc.Source(space=openmc.stats.Point())
instances = ([(c3, i) for i in range(c3.num_instances)] +
[(c2, i) for i in range(c2.num_instances)])
[(c2, i) for i in range(c2.num_instances)] +
[(ci, i) for i in range(ci.num_instances)])
f1 = openmc.CellInstanceFilter(instances)
f2 = openmc.CellInstanceFilter(instances[::-1])
t1 = openmc.Tally()