DAGMC Geometry Assitance

Hi all, (me again)

I am looking for assistance in creating a custom geometry using Cubit Coreform. I have some experience in meshing and geometry domains, but I struggle to incorporate them into openmc. Below, I share a simple cartesian slab with its respective mesh.

In the DAGMC documentation, it was recommended that Cubit , which I assume Cubit Coreform, is used for HDF5 file exportation. I created this slab and was met with Cubit not supporting export dagmc <file.h5m>". So instead I exported the geometry in .stl and did a conversion to h5m file.

Convert Stl to H5M

!mbconvert <file.stl> <file.h5m>

From then on , I interpreted the files into openmc as followed :

Import Mesh and Geometry

mesh_library = ‘moab’ # change to ‘libmesh’ to use libMesh instead
mesh_file = ‘Testing.h5m’ # Import h5m files (mesh)

umesh = openmc.UnstructuredMesh(mesh_file, library=mesh_library)
mesh_filter = openmc.MeshFilter(umesh)

Create DAGMC universes out of h5m files

PlanarF = openmc.DAGMCUniverse(filename=mesh_file).bounded_universe()
#, auto_geom_ids=True, universe_id=1)

Create regions

#Fuel_region = PlanarF.bounding_region()
#Fuel_region = PlanarF.bounding_region(bounded_type=‘box’, boundary_type=‘vacuum’, starting_id=20000)

Create openmc Cells

#Fuel_cell = openmc.Cell(region=Fuel_region , fill=PlanarF)

Create openmc Geometry object

#geometry = openmc.Geometry([Fuel_cell,])
geometry = openmc.Geometry(root=PlanarF)
geometry.export_to_xml()

Geometry output

Then when I ! cat the geometry I get
geometry
cell fill=“1” id=“1” region=“1 -2 3 -4 5 -6” universe=“2”
dagmc_universe auto_geom_ids=“true” filename=“PlanarFuel.h5m” id=“1”
surface boundary=“vacuum” coeffs=“-0.20000000298023224” id=“1” type=“x-plane”
surface boundary=“vacuum” coeffs=“0.20000000298023224” id=“2” type=“x-plane”
surface boundary=“vacuum” coeffs=“-0.20000000298023224” id=“3” type=“y-plane”
surface boundary=“vacuum” coeffs=“0.20000000298023224” id=“4” type=“y-plane”
surface boundary=“vacuum” coeffs=“0.0” id=“5” type=“z-plane” />
surface boundary=“vacuum” coeffs=“0.0” id=“6” type=“z-plane” />
geometry

Then when I run openmc() it cannot find my source term which is written as :
point = openmc.stats.Point((0, 0, 0))
src = openmc.Source(space=point,energy=energy_distribution)
settings.source = src
settings.export_to_xml()

Error :

ERROR: More than 95% of external source sites sampled were rejected. Please check your external source’s spatial definition.

Based off the geometry.xml output I am assuming cells were not created in the mesh, because the point (0,0,0) should exist since it is the center.

I apologize if this explanation is difficult to understand and if I am posting to many issues for support. I am highly interested in coupling the results of openmc with ansys fluent for MSR work. If their is any examples/readings of people explaining how to create and import custom geometries that would be fantastic

I don’t believe that route will work. You will need to download the DAGMC plugin for Cubit - Release v0.2.4 · svalinn/Cubit-plugin · GitHub. Its likely you do not have the correct topology setup from the STL file - another route (if you can stomach conda) is stl-to-h5m · PyPI. This should give you a route to a working geometry, however I would recommend going for the plugin if you plan on doing large complex assemblies. For simpler non-coincident geometry the stl-to-h5m route should do the job great :slight_smile:

@makeclean Thank you very much, this is a good link and I love your username, haha!