DAGMC/Cubit Workflow Issues for Cylinders in OpenMC Plot

Let me first start off by saying I’m new to DAGMC. I’ve used GEANT4 for most of my work and I’ve imported CAD files using GDML. OpenMC’s DAGMC/h5m format is new to me.

I have a couple of questions about merging and just general workflow guidance when it comes to importing STEP files and meshing them into a DAGMC format. I’ve gone through the webinars and tutorials for the DAGMC workflow, but I’m still running into some problems. I’ve outlined a thorough walkthrough of my workflow, so if anyone could please point out where the issue lies, it would be greatly appreciated!

I am currently attempting to generate a rough “strawman” geometry of a molten salt reactor core. It’s very simplistic, at this point it is 3 cylinders. The three cylinders are coaxial, fitting precisely within one another. The innermost cylinder is the fuel, the middle cylinder is the moderator, and the outer cylinder is the container. As mentioned, they are coaxial and fit precisely within each other, so the inner surface(s) of each geometry is shared with the outer surface of the cylinder that fits within it. The geometry is shown in Figure A.

I first imprinted and merged all the relevant geometries/surfaces. This is where I run into problems. I first run the standard

imprint body all
merge body all

commands to automatically merge any shared surfaces. Here is the output:

Preserving undo information...done
Group imprint finished.
Updated volume(s): 2, 3
IMPRINT completed.
Finished Command: imprint body all
Consolidated 0 pair of surfaces
Curve 1 and 10 consolidated
Curve 2 and 9 consolidated
Curve 11 and 14 consolidated
Curve 12 and 13 consolidated
Curve 6 and 8 consolidated
Consolidated 5 curves
Consolidated 0 pairs of vertices
Finished Command: merge body all

Notice how none of the surfaces are actually merged. This is confirmed when I try to mesh the geometry, as I receive a warning that there are overlapping surfaces. The command

find overlap all

confirms this notion:

Finding surface overlap...
Found 6 overlapping surface pairs (added to group 'surf_overlap')
Surface 1 and 15 overlap
Surface 2 and 14 overlap
Surface 3 and 13 overlap
Surface 7 and 11 overlap
Surface 8 and 12 overlap
Surface 9 and 10 overlap
Finished Command: find overlap all

Inspecting these surfaces visually confirms that these are indeed surfaces that should’ve been merged with the imprint and merge commands. For example, surfaces 3 and 13 (shared between the innermost and middle cylinders) do indeed represent the same surface when checked visually (as indicated by the orange circle in Figure B). One can even see the artefacts from the outermost and middle container in Figure B.

In an attempt to solve this problem, I force merged all those overlapping surfaces.

merge surface 1 15 force
merge surface 2 14 force
…
merge surface 9 10 force

This indeed allowed me to mesh the geometry. However, I ran into more problems when trying to export the DAGMC file:

Found 7 entities of dimension 0
Found 7 entities of dimension 1
Found 9 entities of dimension 2
Found 3 entities of dimension 3
Surface 9 has forward sense with multiple volume 2 and volume 3
Error storing surface senses: 16
ERROR: Command Failed.

For multiple surfaces, I got this error regarding the forward sense of certain surfaces. After trying to do some research about the error online, I assumed that I must reverse it:

reverse surface 9
…
reverse surface 2

After reversing these surfaces, I attempt to mesh again, but get the overlapping surfaces error. Lo and behold, it’s the latest surface that I reversed:

Finding surface overlap...
Found 1 overlapping surface pairs
Surface 19 and 2 overlap
Finished Command: find overlap all

At this point I decide the force merge surfaces 2 and 19, which allows me to mesh the object. At this point I can also export the object as a DAGMC file. I didn’t mention this earlier, but the rest of the workflow (creating materials, assigning materials to blocks, creating reflecting boundary surfaces) have been completed.

I don’t know if my workflow is accurate, because my OpenMC slice plot of the geometry looks completely wrong. I get some strange slices with the material colors all over the place, with the streak lines of the geometry meshing showing as well. In addition, the slice coordinates seem to only work from between around 0.5 to -0.1, otherwise a blank image is outputted. This is strange, because the geometry is around 60 cm tall. It extends 10 cm in the +y direction from the origin, and extends 50 cm in the -y direction from the origin. These can be seen in Figure C.

However, if I use the mbconvert tool from MOAB and convert the .h5m file into an STL file, the geometry looks exactly how I want it to look like.

I have uploaded my OpenMC code, STEP files, and Cubit File here: Filebin | yifmddkdvqm0to0q
Note that the numbers of the surfaces may have changed, but the workflow is still the same when looking at the file.

Edit: added files

I have read this post by Dr. Shriwise regarding artefacts when plotting the slices in OpenMC:

I think this may be related to the issue, as I had issues with the forward and reverse sense surfaces in Cubit. My OpenMC version is 0.15.0, so I should have the latest changes that reflect the improved plotting methodology. I can run the teapot example just fine and get a good plot:

image

So I’m thinking it has to do with those meshing issues I had while working with Cubit and preparing the model for DAGMC.

Some more work on this topic:

I’ve made a simpler version of the geometry where the ends aren’t “capped” and the cylinders dont sit inside each other like Russian dolls. Instead, the geometry is “open faced” on both sides, like the pincell example.

This geometry seems to merge and mesh with no issues. Indeed, it was always the ends of each cylinder which were causing issues previously. The plot definitely looks more correct now. Additionally, I also realized that the issue with the “slice” layer value was because it seems that my geometry must’ve had a mismatch when exporting in terms of centimeters.

I still don’t know what the issue with the more complex geometry is. Furthermore, even after applying a reflecting boundary to all exterior surfaces of the model, I still see this “void” region (white) when plotting my geometry.

Regarding your original problem, there seem to be a problem with the geometry contained in your step, as it seems Cubit fails because of surface senses.

I recreated your case in “pure Cubit” and it works fine:

reset
create Cylinder height 0.6 radius 0.15 
create Cylinder height 0.5 radius 0.1 
create Cylinder height 0.4 radius 0.05

subtract vol 2 from vol 1 keep_tool
subtract vol 3 from vol 2 keep_tool

create material "Inner" property_group "CUBIT-ABAQUS" 
create material "Outer" property_group "CUBIT-ABAQUS" 
create material "Inter" property_group "CUBIT-ABAQUS" 

set duplicate block elements off
undo group begin
block 1 add volume 3
block 1 name "Inner"
undo group end

set duplicate block elements off
undo group begin
block 2 add volume 4
block 2 name "Outer"
undo group end

set duplicate block elements off
undo group begin
block 3 add volume 5
block 3 name "Inter"
undo group end

block 1 material 'Inner'
block 2 material 'Outer'
block 3 material 'Inter'

merge tolerance 0.0005
imprint volume all
merge volume all

set trimesher coarse on ratio 100 angle 5
surface all scheme trimesh
mesh surface all

export cf_dagmc "C:/Users/NicolasLINDEN/Documents/cylinder.h5m"  overwrite

How was your step file created? The problem probably stems from that.

From experience, imprinting and merging is the most error inducing part of the procedure for creating DAGMC geometries. I usually try to leverage the implicit complement feature as much as I can, and I usally don’t have to do any I&M at all.

In your case, you could simply remove the intermediate cylinder and create an implicit material to replace it, this would eliminate the need for merging surfaces.

Another thing that I usually do and that may be useful to you, is that I always insert DAGMC geometries in OpenMC CSG cells, rather than directly creating a openmc.Geometry object from the DAGMCUniverse.

Thanks for the detailed help, @nlinden !

My STEP file was exported from my workspace in OnShape. I’ve tried exporting individual parts, part studios, and assemblies, but it still shows up the same way. I haven’t tried “pure cubit” as you suggested, but that’s probably a cleaner approach since the geometry isn’t that complicated.

I do wonder, however, if the extrusion direction in Onshape makes a difference? The only reason why I could think that the surface faces the wrong way is because I extruded it in the “opposite” direction when creating the geometry in the CAD program.

For now I think I’ll use the “Pure Cubit” geometry, or even just the “built-in” OpenMC geometry for simplicity while I try to figure out the CAD model. I’ll be sure to try the implicit complement feature for the intermediate cylinder, too, and update the thread on how that goes.

Thanks again for the help!

EDIT: Here is the link to the OnShape document, if anyone is interested in exporting the STEP file to see if they have better luck. The file must be exported in centimeters. Onshape