I was trying to do a single pin run on my model using reflective conditions as I had done before, but I can’t seem to get it working now. I am currently using the code below, but I also tried it by defining water_rect (pitch square unit around pin) as four planes and bounding the interior region. I get the same answer for both definitions whether boundary_type is set to reflective or not and regardless of the albedo level. I’m not sure what I’m missing.
water_rect = openmc.model.RectangularPrism(x[2],x[2], boundary_type = ‘reflective’, albedo = 1.0)
Hi @Daedalus,
Could you share more of your model generation code? The context might be useful in determining what’s going on.
Best,
Patrick
## Geometry
# XY Surfaces
fuel_rod_surf = openmc.ZCylinder(r=x[1])
gap_surf = openmc.ZCylinder(r=x[1] + gap_thickness)
cladding_surf = openmc.ZCylinder(r=x[1] + gap_thickness + cladding_thickness)
vessel_inner_wall_surf = openmc.model.RectangularPrism(110,110,corner_radius=25)
vessel_outer_wall_surf = openmc.ZCylinder(r = 80, boundary_type = 'vacuum')
water_rect = openmc.model.RectangularPrism(x[2],x[2], boundary_type = 'reflective')
fuel_cell_bottoms = openmc.ZPlane(z0 = 0) # reference 0
fuel_cell_tops = openmc.ZPlane(z0 = fuel_length)
individual_cell_tops = openmc.ZPlane(z0=fuel_length/(2*num_segs))
individual_cell_bottoms = openmc.ZPlane(z0=-fuel_length/(2*num_segs))
water_bottom = openmc.ZPlane(z0 = -20, boundary_type = 'vacuum')
water_top = openmc.ZPlane(z0 = fuel_length + 20, boundary_type = 'vacuum')
pin_box = -water_rect & +individual_cell_bottoms & -individual_cell_tops
rod_region = -fuel_rod_surf
gap_region = -gap_surf & +fuel_rod_surf
clad_region = -cladding_surf & +gap_surf
rod_water_region = pin_box & ~clad_region & ~rod_region & ~gap_region
## Cells
fuel_rod = openmc.Cell(region=rod_region, fill = UOX)
fuel_rod.volume = (fuel_length*np.pi*x[1]**2/num_segs)
gap = openmc.Cell(region=gap_region, fill = Helium)
clad = openmc.Cell(region=clad_region, fill = Zircalloy_4)
vessel = openmc.Cell(region=vessel_region, fill = steel_mat)
water_fill = openmc.Cell(region=water_region, fill = Water)
rod_water = openmc.Cell(region=rod_water_region, fill = Water)
outer_void_cell = openmc.Cell(region=void_region)
## Universes
f = openmc.Universe(cells=[fuel_rod,clad,gap,rod_water])
void = openmc.Universe(cells=[outer_void_cell])
## Core Region
core_cell = openmc.Cell(region=core_region)
core_lattice = openmc.RectLattice()
core_lattice.pitch = [x[2], x[2], fuel_length/num_segs]
core_lattice.lower_left = [-A_side/2,-A_side/2,0]
core_lattice.outer = void
core_lattice.universes = [[[f for _ in range(n)] for _ in range(n)] for _ in range(num_segs)]
core_cell.fill=core_lattice
core = openmc.Universe(cells=[core_cell,vessel,water_fill])
assembly = openmc.Geometry(core)
assembly.export_to_xml()
Hi @Daedalus! Thanks for the extra info. Very helpful!
From what I can tell, it looks like you’re applying a reflecting boundary condition at the pin cell level on the water_rect
surface. If the lattice cells are closer than the reflective boundary of the pincell, then particles will cross into the adjacent lattice cell without seeing that boundary and it won’t have any effect.
More generally though, this isn’t how I’d recommend applying a reflecting boundary condition in a full core model. You’ll want to apply boundary conditions to the surfaces of the region for the core cell (core_region
) instead for them to impact the model as a whole. I don’t see that variable set in the code you provided though. Is it set somewhere else?
-Patrick
My model geometry is designed to be fluid because it is being used in an optimization program. In this case n=1 so there is only 1 fuel pin in the geometry that I am trying to apply reflective conditions to. num_segs specifies the # of axial fuel segmentations, which I have set to 1 for this test as well. x[2] is lattice pitch, so the pin cell boundaries shouldn’t be crossing over into the neighboring lattice.
Yes, applying the reflective conditions to the core_north (ect) bounding box fixed the problem.
1 Like