There are two routes for making the unstructured mesh.
Option one.
Produce a tetrahedral mesh using Cubit, save as a h5 file, make sure dagmc is included in the openmc binary (either via conda or compilation), use the h5 file as shown by the example notebooks.
openmc.UnstructuredMesh(“filename.h5”, library=‘moab’)
Option two
Produce a mesh in Exodus and save it in .exo format. Make sure libmesh is included in the openmc binary (not currently available with conda, possible via the compile route). Use the exo file as shown in the notebooks.
openmc.UnstructuredMesh(“filename.exo”, library=‘libmesh’)
To make this easier we should look into including libmesh in the conda package. Otherwise I would suggest making use of the dockerfile with libmesh as it takes a while to compile. https://hub.docker.com/r/openmc/openmc/tags
I have a CAD file (in .stp format). If I have correctly understood, I have to first assign the materials/boundary conditions to the CAD file and then, using the “cad_to_openmc” package, export it in “.h5m”.
My question is: how should I assign the materials/BC to the CAD file?
The making of a h5m file for use in DAGMC can also be done in a variety of ways, essentially one needs triangle sets and their connectivity to make the geometry:
Here are some methods of the top of my head, but we maintain a complete list here
cad-to-dagmc (my latest creation and new personal favorite) [link]
Assigning the outer vacuum boundary conditions to the h5m DAGMC geometry was recently discussed on this thread.
There are a few options but in summary the boundary condition can be made automatically by using the bounded_universe introduced by an awesome PR in version 0.13.1
Assuming this returns two materials called “openmc_is_great” and another one called “especially_with_dagmc” which I would imaging are ever ones first choice of material names
Secondly, make use of these material names when making materials
Instead of opening another forum post I figure I’d ask in this forum since the subject matter is similar. In Cubit Coreform I meshed my geometry, simple sphere, as a Tetmesh and exported the file as a dagmc .h5m. I run the simulation and it converges nicely, expect that openmc cannot read the mesh as seen below:
Happy to answer questions here or on the DAGMC discussions. A few of us are on both forums but not all the DAGMC developers are here on the openmc forum.
Hi, I have a question about unstructured grids. My computer configuration and plugin (dagmc cubit) have been installed. Can be done the case “https://nbviewer.org/github/openmc-dev/openmc-notebooks/blob/main/unstructured-mesh-part-i.ipynb”, However, for my simple geometry, I built the mesh in cubit, export dagmc “test.h5m” and took .h5m file as umesh. The whole process can be calculated, but the tallies.out file is empty and cannot identify and loading my mesh file .This question diffuse me.
I have got the same problem as you. If you have got the solution please suggest me how can I create tetrahedral mesh in cubit and then export it into dagmc file.