openmc icon indicating copy to clipboard operation
openmc copied to clipboard

error handling of infinitely thin mesh

Open py1sl opened this issue 3 years ago • 1 comments

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

py1sl avatar May 18 '22 09:05 py1sl

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

RemDelaporteMathurin avatar Jul 04 '22 10:07 RemDelaporteMathurin

#2363 should fix this!

RemDelaporteMathurin avatar Jan 26 '23 19:01 RemDelaporteMathurin