No tally output when using UnstructuredMesh

Hi there,

I am trying to use an UnstructuredMesh to avoid tallying on the whole model, however, when transferring from a RegularMesh, I no longer have any output in the tallies.out file.

This is the setup for the mesh (.h5m file from Paramak)

Working RegularMesh:

mesh = openmc.RegularMesh()
mesh.dimension =  (17,17,14)
mesh.lower_left =  (0,0,0)
mesh.upper_right =  (170,170,170)

mesh_filter = openmc.MeshFilter(mesh)

heating_tally = openmc.CellFilter([1])
heating_tally = openmc.Tally(name='heating_on_mesh')
heating_tally.filters = [mesh_filter]
heating_tally.scores = ['heating-local']

tallies = openmc.Tallies([heating_tally])
tallies.export_to_xml()

The UnstructuredMesh that’s not working:

unstructured_mesh = openmc.UnstructuredMesh('/home/dagmc.h5m', library='moab')
unstructured_mesh.output = False

mesh_filter = openmc.MeshFilter(unstructured_mesh)

tally = openmc.Tally(name='heating_on_mesh')
tally.filters = [mesh_filter]
tally.scores = ['heating-local']

tallies = openmc.Tallies([tally])
tallies.export_to_xml()

when converting to vtk in the unstructured mesh case, I can get the point cloud that is the same as the input geometry so I assume that side of things is working?

with openmc.StatePoint("statepoint.3.h5") as sp:
    tally = sp.tallies[1]
    
    umesh = sp.meshes[1]
    centroids = umesh.centroids
    mesh_vols = umesh.volumes
    
    heating= tally.get_values(scores=['heating-local'])

mesh_shape = (umesh.n_elements,)
heating = heating.reshape(mesh_shape)

data_dict = {'heating' : heating}

umesh.write_data_to_vtk("heating.vtk", data_dict)

This is the output when converting the UnstructuredMesh to vtk:

Does anybody have any ideas as to how to resolve this?
Thanks!

I’m wondering if that line that reshapes the mesh is needed or can that be removed

heating = heating.reshape(mesh_shape)

Ah, the tallies.out file also shows no output, even before I run the conversion to vtk.

All I get from the tallies.out file is this:

 ===================>     TALLY 1: HEATING_ON_MESH     <====================


Ok my 2nd suspicion is that we have faceted geometry with triangles instead of volume meshes with tets.

There is a section of your code where you have

unstructured_mesh = openmc.UnstructuredMesh('/home/dagmc.h5m', library='moab')

I wonder if this is a surface mesh geometry or a volume mesh geometry. How did you create the dagmc.h5m file?

Oh, it might be. This is the output from Paramak / in the future will probably be from the vertices to h5m module

We should proberbly do some input checking on the openmc.UnstructuredMesh method and return an error to catch these sorts of things.

In DAGMC there are two different geometry types. surfaces of triangles (vertices_to_h5m, cad_to_dagmc, paramak) all create this same type of geometry from different inputs.

The unstructured mesh in openmc accepts moab / DAGMC tet meshes and also libmesh meshes (which offer more mesh element types). I don’t currently have a package for creating these types of geometry but I’ve had some success using Cubit and GMSH in the past to make the files manually.

Perhaps take a peak at the unstructured examples if you have not seen them already