In [1]:
import openmc
import numpy as np
In [2]:
fuel = openmc.Material()
fuel.add_nuclide('U235', 1.0)
fuel.set_density('g/cm3', 4.5)

water = openmc.Material()
water.add_nuclide('H1', 2.0)
water.add_nuclide('O16', 1.0)
water.add_s_alpha_beta('c_H_in_H2O')
water.set_density('g/cm3', 1.0)

metal = openmc.Material()
metal.add_element('Zr', 1.0)
metal.set_density('g/cm3', 3.0)
In [3]:
fuel_cyl = openmc.ZCylinder(r=0.35)
pin = openmc.model.pin([fuel_cyl], [fuel, water])

pitch = 1.0
water_box1 = openmc.model.rectangular_prism(2*pitch, 2*pitch, origin=(pitch, pitch, 0.))
metal_cyl1 = openmc.ZCylinder(x0=pitch, y0=pitch, r=0.85)
metal_cell1 = openmc.Cell(fill=metal, region=-metal_cyl1)
water_near_metal1 = openmc.Cell(fill=water, region=+metal_cyl1 & water_box1)

water_box2 = openmc.model.rectangular_prism(2*pitch, 2*pitch, origin=(-pitch, -pitch, 0.))
metal_cyl2 = openmc.ZCylinder(x0=-pitch, y0=-pitch, r=0.85)
metal_cell2 = openmc.Cell(fill=metal, region=-metal_cyl2)
water_near_metal2 = openmc.Cell(fill=water, region=+metal_cyl2 & water_box2)

lattice = openmc.RectLattice()
lattice.lower_left = (-5*pitch, -5*pitch)
lattice.pitch = (pitch, pitch)
lattice.universes = np.full((10, 10), pin)

outer_box = openmc.model.rectangular_prism(10*pitch, 10*pitch, boundary_type='reflective')
main_cell = openmc.Cell()
main_cell.region = outer_box & ~water_box1 & ~water_box2
main_cell.fill = lattice

main_universe = openmc.Universe(cells=[main_cell, metal_cell1, water_near_metal1, metal_cell2, water_near_metal2])
main_universe.plot(width=(10*pitch, 10*pitch))
Out[3]:
<matplotlib.image.AxesImage at 0x147893955e50>
In [4]:
cyl_top_right = openmc.ZCylinder(x0=-pitch/2, y0=-pitch/2, r=0.85)
pin_top_right = openmc.model.pin([cyl_top_right], [metal, water])
cyl_top_left = openmc.ZCylinder(x0=pitch/2, y0=-pitch/2, r=0.85)
pin_top_left = openmc.model.pin([cyl_top_left], [metal, water])
cyl_bottom_left = openmc.ZCylinder(x0=pitch/2, y0=pitch/2, r=0.85)
pin_bottom_left = openmc.model.pin([cyl_bottom_left], [metal, water])
cyl_bottom_right = openmc.ZCylinder(x0=-pitch/2, y0=pitch/2, r=0.85)
pin_bottom_right = openmc.model.pin([cyl_bottom_right], [metal, water])

lattice = openmc.RectLattice()
lattice.lower_left = (-5*pitch, -5*pitch)
lattice.pitch = (pitch, pitch)
p = pin
p1 = pin_top_right
p2 = pin_top_left
p3 = pin_bottom_left
p4 = pin_bottom_right
lattice.universes = [
    [p, p, p, p, p, p, p, p, p, p],
    [p, p, p, p, p, p, p, p, p, p],
    [p, p, p, p, p, p, p, p, p, p],
    [p, p, p, p, p, p2, p1, p, p, p],
    [p, p, p, p, p, p3, p4, p, p, p],
    [p, p, p, p2, p1, p, p, p, p, p],
    [p, p, p, p3, p4, p, p, p, p, p],
    [p, p, p, p, p, p, p, p, p, p],
    [p, p, p, p, p, p, p, p, p, p],
    [p, p, p, p, p, p, p, p, p, p],
]

outer_box = openmc.model.rectangular_prism(10*pitch, 10*pitch, boundary_type='reflective')
main_cell = openmc.Cell(fill=lattice, region=outer_box)

main_universe = openmc.Universe(cells=[main_cell, metal_cell1, water_near_metal1, metal_cell2, water_near_metal2])
main_universe.plot(width=(10*pitch, 10*pitch))
Out[4]:
<matplotlib.image.AxesImage at 0x147891811130>
In [ ]: