Hi,
I am new user. I am creating a hexagonal fuel assembly (UO2). Fuel pellet has a hole in the center with radius 0.1 cm. Outer radius of fuel pellet 0.45 cm. Cladding inner radius is 0.465 and cladding outer radius is 0.525.
Hexagonal fuel assembly has 7 rings including center. the pitch size between fuel pins is 1.215 cm. assembly thickness is 0.7 cm. Thus, fuel assembly contains 127 pins.
I tried to create this hexagonal assembly but I met trouble. Please, could you help me.
Below I attached my code
import openmc
import matplotlib.pyplot as plt
Materials
uo2 = openmc.Material(name=“fuel”)
uo2.add_nuclide(‘U235’, 0.03)
uo2.add_nuclide(‘U238’, 0.97)
uo2.add_nuclide(‘O16’, 2.0)
uo2.set_density(‘g/cm3’, 10.0)
cladding = openmc.Material(name=“steel”)
cladding.add_element(‘Ti’, 0.0373)
cladding.add_element(‘C’, 0.0739)
cladding.add_element(‘Mn’, 0.0246)
cladding.add_element(‘Mo’, 0.0220)
cladding.add_element(‘Ni’, 0.1387)
cladding.add_element(‘Cr’, 0.1348)
cladding.add_element(‘Si’, 0.0231)
cladding.add_element(‘Fe’, 0.5456)
cladding.set_density(‘g/cm3’, 6.6)
gap = openmc.Material(name=“helium”)
gap.add_element(‘He’, 1.0)
gap.set_density(‘g/cm3’, 0.176e-3)
water = openmc.Material(name=“h2o”)
water.add_nuclide(‘H1’, 2.0)
water.add_nuclide(‘O16’, 1.0)
water.set_density(‘g/cm3’, 1.0)
water.add_s_alpha_beta(‘c_H_in_H2O’)
materials = openmc.Materials([uo2, cladding, water, gap])
Geometry
uo2_outer_radius = 0.45
cladding_outer_radius = 0.525
cladding_inner_radius = 0.465
hole_radius = 0.1
z_min = openmc.ZPlane(z0=0, boundary_type=‘reflective’)
z_max = openmc.ZPlane(z0=60, boundary_type=‘reflective’)
uo2_cylinder = openmc.ZCylinder(r=uo2_outer_radius)
cladding_cylinder = openmc.ZCylinder(r=cladding_outer_radius)
gap_cylinder = openmc.ZCylinder(r=cladding_inner_radius)
hole_cylinder = openmc.ZCylinder(r=hole_radius)
assembly = openmc.model.HexagonalPrism(edge_length=15.8, orientation=‘y’,
boundary_type=‘reflective’)
assembly_region = assembly & +z_min & -z_max
assembly_cell = openmc.Cell(region=assembly_region)
uo2_cell = openmc.Cell(fill=uo2, region=+hole_cylinder & -uo2_cylinder & +z_min &
-z_max)
gap_cell = openmc.Cell(fill=gap, region=+uo2_cylinder & -gap_cylinder & +z_min &
-z_max)
cladding_cell = openmc.Cell(fill=cladding, region=+gap_cylinder & -cladding_cylinder
& +z_min & -z_max)
hole_cell = openmc.Cell(fill=water, region=-hole_cylinder & +z_min & -z_max)
water_surrounding_cell = openmc.Cell(fill=water, region=+cladding_cylinder & +z_min
& -z_max)
pin_universe = openmc.Universe(cells=[uo2_cell, gap_cell, cladding_cell, hole_cell,
water_surrounding_cell])
all_water_cell = openmc.Cell(fill=water)
outer_universe = openmc.Universe(cells=[all_water_cell])
lattice = openmc.HexLattice(name=‘assembly’)
lattice.center = (0., 0.)
lattice.pitch = (1.215,)
lattice.outer = outer_universe
ring_6 = [pin_universe] * 36
ring_5 = [pin_universe] * 30
ring_4 = [pin_universe] * 24
ring_3 = [pin_universe] * 18
ring_2 = [pin_universe] * 12
ring_1 = [pin_universe] * 6
center = [pin_universe]
lattice.orientation = ‘y’
lattice.universes = [ring_6, ring_5, ring_4, ring_3, ring_2, ring_1, center]
assembly_cell.fill = lattice
assembly_universe = openmc.Universe(cells=[assembly_cell])
geometry = openmc.Geometry(assembly_universe)
Export to XML
materials.export_to_xml()
geometry.export_to_xml()
Create plot
plot = openmc.Plot()
plot.filename = ‘assembly’
plot.width = (50, 50)
plot.pixels = (400, 400)
plot.color_by = ‘material’
plot.colors = {water: ‘blue’, uo2: ‘yellow’, gap: ‘white’, cladding: ‘gray’}
plot.origin = (0, 0, 30) # Middle of the z-axis
plot.basis = ‘xy’
plots = openmc.Plots([plot])
plots.export_to_xml()
Generate and display the plot
openmc.plot_geometry(output=False)
plt.savefig(‘hexagonal_assembly.png’)
plt.show()