EgorV
January 14, 2025, 3:36pm
1
Hello OpenMC community,
I’m looking to use a DAGMC-generated unstructured mesh (.h5m) file for a neutron source in OpenMC. Has anyone done something similar or come across any relevant documentation or examples? I’ve had trouble finding concrete references so far and would really appreciate any guidance, tips, or links.
Thank you in advance!
Best regards,
Egor
EgorV
January 17, 2025, 10:50am
2
Dear community,
Let me answer that question myself. I found a great example from Jonathan Shimwell here:
# This example makes use of a DAGMC unstructured tet mesh to produce a source with
# a MeshSpatial distribution.
# this section loads a CAD step file and creates an unstrucutred DAGMC tet mesh
# the resulting mesh file (umesh.mesh) is already included in the repo
# so this creation from step file is included for completeness but can be skipped
from cad_to_dagmc import CadToDagmc
cad = CadToDagmc()
cad.add_stp_file('plasma_simplified_180.step')
cad.export_unstructured_mesh_file(filename="umesh.h5m", max_mesh_size=100, min_mesh_size=10)
import openmc
# Setting the cross section path to the correct location in the docker image.
# If you are running this outside the docker image you will have to change this path to your local cross section path.
openmc.config['cross_sections'] = '/nuclear_data/cross_sections.xml'
umesh = openmc.UnstructuredMesh(filename="umesh.h5m",library='moab')
This file has been truncated. show original
Thanks!
2 Likes