TRISO particle outside of lattice

Hello,

I have a reactor model that is edited from the VHTR example model available on GitHub.

When increasing the TRISO particle packing factor above 0.30, I run into a warning:

“UserWarning: TRISO particle is partially or completely outside of the lattice.”

It seems to me that the issue is from the sphere packing algorithm placing a coordinate outside of the accepted lattice region.

I have attached the section of code responsible for this below. Any help is appreciated.

kernelsph = openmc.Sphere(r=250e-4) # try 212.5um and 250um
buffsph = openmc.Sphere(r=350e-4)
IPyCsph = openmc.Sphere(r=390e-4)
SiCsph = openmc.Sphere(r=425e-4)
OPyCsph = openmc.Sphere(r=470e-4)
triso_outer_radius = 470e-4
layers = [kernelsph, buffsph, IPyCsph, SiCsph, OPyCsph]
triso_mats = [fuel, buffer_mat, IPyC, SiC, OPyC]
triso_cells =
for i in range(5):
if (i == 0):
triso_cells.append(openmc.Cell(fill=triso_mats[0], region=-layers[0]))
else:
triso_cells.append(openmc.Cell(fill=triso_mats[i], region=+layers[i-1] & -layers[i]))
triso_universe = openmc.Universe(universe_id=1001,cells=triso_cells)

cylsurf = openmc.ZCylinder(r=r_pellet)
maxz_pin = openmc.ZPlane(z0=+pellet_height/2)
minz_pin = openmc.ZPlane(z0=-pellet_height/2)
maxz = openmc.ZPlane(z0=+core_height/2)
minz = openmc.ZPlane(z0=-core_height/2)
maxz_refl = openmc.ZPlane(z0= core_height/2+top_refl_height, boundary_type=‘vacuum’)
minz_refl = openmc.ZPlane(z0=-core_height/2-bot_refl_height, boundary_type=‘vacuum’)
lattice_region = -cylsurf & -maxz_pin & +minz_pin
spheres = openmc.model.pack_spheres(radius=triso_outer_radius, region=lattice_region, pf=0.35)
triso_particles = [openmc.model.TRISO(triso_outer_radius, fill=triso_universe, center=c) for c in spheres]
lattice_cell = openmc.Cell(region=lattice_region)
lower_left, upp_right = lattice_cell.region.bounding_box
shape = (4, 4, 4)
pitch = (upp_right - lower_left)/shape
triso_latt = openmc.model.create_triso_lattice(triso_particles, lower_left, pitch, shape, graphite)
lattice_cell.fill = triso_latt
lattice_cell_outer=openmc.Cell(region=~lattice_region,fill=graphite)
lattice_universe = openmc.Universe(universe_id=1002,cells=[lattice_cell,lattice_cell_outer])

Hi,i think you can plot this geometry, then you may find some problems,I 've had the same problem before, probably caused by the inconsistency of the lattice and the cell 's outer boundary shapes

1 Like

I would agree with the previous suggestion (plotting is always helpful), although staring at your code for a little bit, I don’t see any obvious reason why a TRISO particle would end up outside the lattice since the lattice by definition should cover the region that was used when generating the TRISOs. @averyarnone If you’re able to share a full script, I can try to reproduce the behavior you’re seeing in order to give more specific advice.

1 Like

I’ve been following along the TRISO python notebook, and I’m actually getting the same warning:

/home/lgross/openmc/openmc/model/triso.py:848: UserWarning: TRISO particle is partially or completely outside of the lattice.
  warnings.warn('TRISO particle is partially or completely '

I have the lines to check that the particles are in the lattice from the notebook

centers = np.vstack([triso.center for triso in trisos])
print(centers.min(axis=0))
print(centers.max(axis=0))

and strangely, the output of the above is within the lattice (a cube with side length 1 centered at the origin), despite the warning appearing. Output:

[-0.457015 -0.457015 -0.457015]
[0.457015 0.457015 0.457015]

Note my TRISO outer radius is 0.042985 cm and 0.457015 cm + 0.042985 cm = 0.5 cm. It seems the edge of some TRISO spheres exactly touches the edge of the lattice. Maybe due to floating point error, it thinks a particle is outside?

I went to the plotter to investigate, but couldn’t see any TRISOs outside the lattice. To test, I generated a few slice_coords near both sides of the lattice boundaries for each basis: xy, xz, and yz.

One thing I am concerned about is the python notebook example slice plots show concentric circles for each region within a TRISO particle, but my image only shows solid purple spheres (which makes me think there’s an issue with my TRISO universes). Here is the version of my script, in case you have time to investigate.
triso

Following up:

  1. I was able to eliminate the warning by slightly increasing the size of the lattice (by 0.01 cm in each direction) after packing the spheres. This suggests that the warning is resulting from handling the position’s floating point value when TRISO particles’ outer radius is very near (or exactly at) the lattice edge. Note sure if this warning check could use an adjustable tolerance so that spheres very near the boundary do not generate the warning. For my case, I know the spheres are good, so I’m confident to now run transport on this geometry
  2. Re-only the purple in the spheres. I realized that I left a 1e-4r in my version of the script adapted from the notebook, so each inner surface was at a radius four orders of magnitude below what was intended, hence why they did not appear visible.