Hello everyone, I have been conducting calculations for a hexagonal gas cooled reactor recently, but during the modeling process, openmc showed that I have no boundaries on the xy plane. I checked the code again but did not find any errors. Here is my code, please advise
import openmc
import os
from math import log10
import numpy as np
import math
import matplotlib.pyplot as pyplot
openmc.config['cross_sections'] ="/home/server/cs/nndc-b7.1-hdf5/cross_sections.xml"
fuel=openmc.Material(name='fuel')
fuel.add_element('U',1.0,enrichment=19.75)
fuel.add_nuclide('O16',2.0)
fuel.set_density('g/cc',10.3)
fuel.depletable=True
water=openmc.Material(name='water')
water.add_nuclide('H1', 2.0)
water.add_nuclide('O16',1.0)
water.set_density('g/cc', 1.0)
water.add_s_alpha_beta('c_H_in_H2O')
co2=openmc.Material(name='co2')
co2.add_element('C',1.0)
co2.add_nuclide('O16',2.0)
co2.set_density('kg/m3',128.7)
Cr=openmc.Material(name='Cr')
Cr.add_element('Cr',1.0)
Cr.set_density('g/cm3',7.9)
Ni=openmc.Material(name='Ni')
Ni.add_element('Ni',1.0)
Ni.set_density('g/cm3',8.902)
Mo=openmc.Material(name='Mo')
Mo.add_element('Mo',1.0)
Mo.set_density('g/cm3',10.23)
Mn=openmc.Material(name='Mn')
Mn.add_element('Mn',1.0)
Mn.set_density('g/cm3',7.21)
Si=openmc.Material(name='Si')
Si.add_element('Si',1.0)
Si.set_density('g/cm3',2.33)
P=openmc.Material(name='P')
P.add_element('P',1.0)
P.set_density('g/cm3',1.82)
S=openmc.Material(name='S')
S.add_element('S',1.0)
S.set_density('g/cm3',2.069)
C=openmc.Material(name='C')
C.add_element('C',1.0)
C.set_density('g/cm3',2.281)
Fe=openmc.Material(name='Fe')
Fe.add_element('Fe',1.0)
Fe.set_density('g/cm3',7.86)
S316=openmc.Material.mix_materials([Cr,Ni,Mo,Mn,Si,P,S,C,Fe],[0.17,0.12,0.02,0.02,0.0075,0.00045,0.0003,0.0008,0.66095])
materials_file = openmc.Materials([fuel,water,co2,C,S316])
materials_file.export_to_xml()
# ------------------------------------------------------------------------------------------------------------------------------------------------
r_fuel=openmc.ZCylinder(r=0.425)
r_co2=openmc.ZCylinder(r=0.075)
z0=openmc.ZPlane(z0=0)
z1=openmc.ZPlane(z0=150)
fuel_cell=openmc.Cell(fill=fuel,region=-r_fuel & +z0 & -z1)
co2_cell=openmc.Cell(fill=co2,region=-r_co2& +z0 & -z1)
S316_cell=openmc.Cell(fill=S316,region=+r_fuel & +r_co2& +z0 & -z1)
fuel_universe=openmc.Universe(cells=(fuel_cell,S316_cell))
all_S316_cell=openmc.Cell(fill=S316)
outer_universe=openmc.Universe(cells=(all_S316_cell,))
lattice_fuel=openmc.HexLattice()
lattice_fuel.center=(0,0)
lattice_fuel.pitch=(1.2,)
lattice_fuel.outer=outer_universe
ring_1=[fuel_universe]*6
ring_in=[fuel_universe]
lattice_fuel.universes=[ring_1,
ring_in]
lattice_fuel.orientation='x'
component_region=openmc.model.HexagonalPrism(edge_length=1.2,orientation='x',origin=(0,0))
# component_region=-plan1 & +plan2 & -plan3 & +plan4 & -plan5 & +plan6& +z0 & -z1
component_cell=openmc.Cell(fill=lattice_fuel,region=-component_region&+z0&-z1)
u_root=openmc.Universe()
u_root.add_cells([component_cell])
geometry=openmc.Geometry(u_root)
geometry.export_to_xml()
plot=openmc.Plot.from_geometry(geometry)
plot.basis='xy'
plot.origin=(0,0,75)
plot.width=(2.4,2.4)
plot.color_by='material'
plot.to_ipython_image()