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