Using meshes with tallies

Hello all,

What’s the process and syntax needed to make a tally work with a specific mesh? Like if I wanted to create a rectangular mesh and have a heating tally taken at each of the specific mesh points, who would that look in the input file?

I’ve been trying to define specific meshes to feed into tallies and vice versa but keep getting errors, I’d like to keep this as simple a mesh tally as possible, any feedback would be great.

Regards,

Hello! Once you create the mesh (my_mesh) and the tally (my_tally), you can create a mesh_filter and add it to the tally like this:
mesh_filter = openmc.MeshFilter(my_mesh)
my_tally.filters.append(mesh_filter)

Thank you this is very helpful, it’s much easier in my troubleshooting when I can see a visual like this. When we input this new form in we’re going a series of 0 values for our heating tally, I still need to check some things but if our system is critical and a single heating tally gives a nonzero answer that shouldn’t be the case correct?

If you are getting all zeros, you probably have a problem with the mesh. Make sure it covers the fuel region!

Looks like you have everything needed, but just in case here is an example of a 2d mesh tally here
and a 3d mesh tally here

Also if you are wanting to convert the regular mesh tally to a VTK file for visualization in software like Paraview or Visit then you might find this minimal python package handy