openmc
openmc copied to clipboard
error handling of infinitely thin mesh
if a user accidentally defines a mesh such as
mesh = openmc.RegularMesh() mesh.dimension = [50, 50, 1] mesh.lower_left = [-180, -455, 120] mesh.upper_right = [180, 455, 120] mesh_filter = openmc.MeshFilter(mesh)
where the z change is zero this will not return an error and appears to start running particles, but never completes a batch a check should be performed if defining using lower left and upper right
I'm able to reproduce the issue with:
import openmc
mat = openmc.Material()
mat.add_nuclide('Zr90', 1.0)
mat.set_density('g/cm3', 1.0)
model = openmc.Model()
sph = openmc.Sphere(r=25.0, boundary_type='vacuum')
cell = openmc.Cell(fill=mat, region=-sph)
model.geometry = openmc.Geometry([cell])
model.settings.run_mode = 'fixed source'
model.settings.batches = 2
model.settings.particles = 50
mesh = openmc.RegularMesh()
mesh.dimension = [50, 50, 1]
mesh.lower_left = [-25, -25, 0]
mesh.upper_right = [25, 25, 0]
mesh_filter = openmc.MeshFilter(mesh)
tally = openmc.Tally()
tally.scores = ["heating"]
tally.filters = [mesh_filter]
model.tallies = openmc.Tallies([tally])
model.run()
I can work on a fix
#2363 should fix this!