Hi, I am new to OpenMC and I am trying to learn how to build a simple fuel assembly.
I started by creating materials > geometry > cells > universe > then a rectangular lattice, populated it with the fuel universe > placed the lattice inside a cell > then inside a root universe.
All of this worked just fine. The error arises when I try to plot the universe with a width larger than the width of the root universe in the y-direction.
The error message says: “RuntimeError: Particle -1 left lattice 2, but it has no outer definition.”
The weird thing is that: the universe plotting works if I increase the plot width in the x-direction, increase the y-direction width by just 1(2 breaks it too), or plot using the exact dimensions of the assembly.
I uploaded the notebook used.
Thanks in advance for your help.
Assembly.ipynb (65.2 KB)
Hi Ahmed, welcome to the community.
I think the problem came from 2 things, you forgot to declare the outer universe for your assembly2 lattice. outer was used if you fill your lattice into a region bigger than your lattice definition, I add this line to your lattice input
assembly2.outer = openmc.Universe(cells=[openmc.Cell(fill=water)])
also, you forgot to change your back (negative y) y-surface for the fuel assembly region in xx cell, & +openmc.YPlane(17*-pitch/2,boundary_type=‘vacuum’
xx = openmc.Cell(region = -openmc.XPlane(17*pitch/2,boundary_type='vacuum')& +openmc.XPlane(17*-pitch/2,boundary_type='vacuum')& -openmc.YPlane(17*pitch/2,boundary_type='vacuum')& +openmc.YPlane(17*-pitch/2,boundary_type='vacuum'), fill=assembly2)
this is your notebook that I modified
AssemblyxW.ipynb (116.8 KB)
then if you want to debug your geometry after all your input is ready, try using the openmc geometry debug. it can help you to localize which cells overlap or if you forgot your boundary condition, just for checking
openmc.run(geometry_debug=True)
2 Likes
Hi Wahid,
Thank you for your response. It really worked after changing the sign of the plane, I guess I got confused when the plot worked initially, so I thought that the error must be in the plot function itself not the cell region.
Thank you again
1 Like