DAGMC Export Error

I’m trying to export my geometry to DAGMC and Coreform Cubit won’t export it. When I try to export it using the Export button in the GUI, I get this error:

Finished Command: undo group begin
WARNING: export cf_dagmc is deprecated in favor of export dagmc.
export cf_dagmc will be removed in the next release.
Found 60 entities of dimension 0
Found 90 entities of dimension 1
Found 80 entities of dimension 2
Found 37 entities of dimension 3
Surface 58 has reverse sense with multiple volume 30 and volume 31
Error storing surface senses: 16
ERROR: Command Failed.
Finished Command: undo group end`

When I try to export to DAGMC with commands in the command line, I get the same error. Here’s snippets from my Journal Script where I export my files for reference.

{path = ‘/home/fbsmith/Documents/Work/CSNR/models/NARUTO’}
{save_folder = ‘november’}

Export Helix Files
save as “{path}/{save_folder}/model_files/naruto_helix.cub” overwrite
save cub5 “{path}/{save_folder}/model_files/naruto_helix.cub5” overwrite
export step “{path}/{save_folder}/model_files/naruto_helix.stp” overwrite

Export Geometry Files
save as “{path}/{save_folder}/model_files/naruto_geom.cub” overwrite
save cub5 “{path}/{save_folder}/model_files/naruto_geom.cub5” overwrite
export step “{path}/{save_folder}/model_files/naruto_geom.stp” overwrite
export dagmc “{path}/{save_folder}/model_files/naruto_geom.h5m” overwrite`

As a quick note, the .cub, .cub5, and .stp exports work perfectly. It’s just the DAGMC that I’m having issues with.

Hi @fbsmith,
could you share the geometry with us so that we can take a look what’s going wrong?

Here’s the Journal File that I’m running

reset

# {path = ‘/home/fbsmith/Documents/Work/CSNR/models/NARUTO’}
# {save_folder = ‘november’}

# Variables
# {r_tube = 2.5}
# {r_helix_inner = 10}
# {r_helix_outer = 30}
# {r_mod = 40}

# {n_helix = 3}
# {dr = (r_helix_outer- r_helix_inner) / (n_helix - 1)}

# {n_strand = 6}
# {da = 360 / n_strand}

# {h_helix = 160}
# {h_mod = h_helix + 40}
# {h_reflect = 20}

# {n_rev = 4}
# {h_rev = h_helix / n_rev}
# {a_rev = 360 * n_rev}

# {n_interval = 36}
# {n_rad_interval = 6}
# {n_helix_struct = n_helix * n_strand}

# Make Circle Tool
create surface circle radius {r_tube} yplane
# {i = 0}
# {r_curr = r_helix_inner}

# Start Radial Loop
# {Loop(n_helix)}
# {a_curr = 0}

# Start Axial Loop
# {Loop(n_strand)}

# Move Circle Tool to the right Radius
surface 1 copy move x {r_curr}
# {id_circ_surf = 2 + 4 * i}

# Move Circle Tool to right Angle
rotate surface {id_circ_surf} angle {a_curr} about z

# Sweep new Circle Tool to make a Helix
sweep surface {id_circ_surf} helix zaxis thread_distance {h_rev} angle {a_rev} right_handed keep
# {id_circ_vol = 3 + 2 * i}

# Merge tool and volume surfaces
merge surface {id_circ_surf} {id_circ_surf + 3}
# {i += 1}
# {a_curr += da}

# End Axial Loop
# {EndLoop}
# {r_curr += dr}

# End Radial Loop
# {EndLoop}
delete surface 1

# Export Helix Files
save as “{path}/{save_folder}/model_files/naruto_helix.cub” overwrite
save cub5 “{path}/{save_folder}/model_files/naruto_helix.cub5” overwrite
export step “{path}/{save_folder}/model_files/naruto_helix.stp” overwrite

# Make Moderator
create prism height {h_mod} sides 6 radius {r_mod}
# {id_mod_vol = id_circ_vol + 1}
move volume {id_mod_vol} z {h_helix / 2}
rotate volume {id_mod_vol} angle 90 about z

# Subtract Helixes from Moderator
# {id_helix_vol_curr = 3}
# {Loop(n_helix_struct)}
# Start Subtract and Merge Loop
subtract volume {id_helix_vol_curr} from volume {id_mod_vol} keep_tool
# {id_mod_vol += 1}
# Merge Moderator and Helixes
merge volume {id_helix_vol_curr} {id_mod_vol}
# {id_helix_vol_curr += 2}
# {EndLoop}

# Make Reflector
create prism height {h_reflect} sides 6 radius {r_mod}
# {id_reflect_vol = id_mod_vol + 1}
move volume {id_reflect_vol} z {h_mod - 10}
rotate volume {id_reflect_vol} angle 90 about z

# Merge Moderator and Reflector
merge volume {id_mod_vol} {id_reflect_vol}

# Export Geometry Files
save as “{path}/{save_folder}/model_files/naruto_geom.cub” overwrite
save cub5 “{path}/{save_folder}/model_files/naruto_geom.cub5” overwrite
export step “{path}/{save_folder}/model_files/naruto_geom.stp” overwrite
export dagmc “{path}/{save_folder}/model_files/naruto_geom.h5m” overwrite

# Meshing
delete mesh volume all
delete mesh surface all
delete mesh curve all

# Mesh Helixes
# {id_circ_curv = 2}
# {id_circ_surf = 2}
# {id_circ_vol = 3}
# {Loop(n_helix_struct)}

# Mesh Curves on Circles
curve {id_circ_curv} {id_circ_curv + 1} interval {n_interval}
curve {id_circ_curv} {id_circ_curv + 1} scheme equal
mesh curve {id_circ_curv} {id_circ_curv + 1}

# Mesh Surfaces on Circles
surface {id_circ_surf} {id_circ_surf + 2} scheme circle
mesh surface {id_circ_surf} {id_circ_surf + 2}
qtri surface {id_circ_surf} {id_circ_surf + 2}

# Mesh Helical Line
curve {id_circ_curv + 2} interval {h_helix * 4}
curve {id_circ_curv + 2} scheme equal
mesh curve {id_circ_curv + 2}

# Mesh Helix
surface {id_circ_surf + 1} scheme map
mesh surface {id_circ_surf + 1}
qtri surface {id_circ_surf + 1}
volume {id_circ_vol} scheme tetmesh
mesh volume {id_circ_vol}

# Update ID’s
# {id_circ_curv += 4}
# {id_circ_surf += 4}
# {id_circ_vol += 2}
# {EndLoop}

# Mesh Moderator and Reflector
volume {id_mod_vol} {id_reflect_vol} scheme tetmesh
mesh volume {id_mod_vol} {id_reflect_vol}

# Export Mesh Files
save as “{path}/{save_folder}/model_files/naruto_mesh.cub” overwrite
save cub5 “{path}/{save_folder}/model_files/naruto_mesh.cub5” overwrite
export step “{path}/{save_folder}/model_files/naruto_mesh.stp” overwrite
export mesh “{path}/{save_folder}/model_files/naruto_mesh.h5m” dimension 3 overwrite
export dagmc “{path}/{save_folder}/model_files/naruto_mesh.h5m” overwrite

# Blocks and Materials
delete block all
delete material all

# Create Fuel Block
# {id_circ_vol = 3}
# {Loop(n_helix_struct)}
block 1 add volume {id_circ_vol}
# {id_circ_vol += 2}
# {EndLoop}
block 1 name “fuel”

# Create Moderator Block
block 2 add volume {id_mod_vol}
block 2 name “moderator”

# Create Reflector Block
block 3 add volume {id_reflect_vol}
block 3 name “reflector”

# Create Materials
create material “fuel” property_group “CUBIT-ABAQUS”
create material “moderator” property_group “CUBIT-ABAQUS”
create material “reflector” property_group “CUBIT-ABAQUS”

# Assign Materials to Blocks
block 1 material “fuel”
block 2 material “moderator”
block 3 material “reflector”

# Export Files
save as “{path}/{save_folder}/model_files/naruto.cub” overwrite
save cub5 “{path}/{save_folder}/model_files/naruto.cub5” overwrite
export step “{path}/{save_folder}/model_files/naruto.stp” overwrite
export mesh “{path}/{save_folder}/model_files/naruto.h5m” dimension 3 overwrite
export dagmc “{path}/{save_folder}/model_files/naruto.h5m” overwrite

@Norbert_Hofbauer
Here’s the journal script I’m working with

Hi @fbsmith,

i reversed the sense of the surfaces that are throwing errors on the dagmc export right before the first export attempt. It exports without an error on my machine. Could you take a look if the dagmc files are usable with the reversed sense?

reset

# {path = '/home/user/coreform'}
# {save_folder = 'forum'}

# Variables
# {r_tube = 2.5}
# {r_helix_inner = 10}
# {r_helix_outer = 30}
# {r_mod = 40}

# {n_helix = 3}
# {dr = (r_helix_outer- r_helix_inner) / (n_helix - 1)}

# {n_strand = 6}
# {da = 360 / n_strand}

# {h_helix = 160}
# {h_mod = h_helix + 40}
# {h_reflect = 20}

# {n_rev = 4}
# {h_rev = h_helix / n_rev}
# {a_rev = 360 * n_rev}

# {n_interval = 36}
# {n_rad_interval = 6}
# {n_helix_struct = n_helix * n_strand}

# Make Circle Tool
create surface circle radius {r_tube} yplane
# {i = 0}
# {r_curr = r_helix_inner}

# Start Radial Loop
# {Loop(n_helix)}
# {a_curr = 0}

# Start Axial Loop
# {Loop(n_strand)}

# Move Circle Tool to the right Radius
surface 1 copy move x {r_curr}
# {id_circ_surf = 2 + 4 * i}

# Move Circle Tool to right Angle
rotate surface {id_circ_surf} angle {a_curr} about z

# Sweep new Circle Tool to make a Helix
sweep surface {id_circ_surf} helix zaxis thread_distance {h_rev} angle {a_rev} right_handed keep
# {id_circ_vol = 3 + 2 * i}

# Merge tool and volume surfaces
merge surface {id_circ_surf} {id_circ_surf + 3}
# {i += 1}
# {a_curr += da}

# End Axial Loop
# {EndLoop}
# {r_curr += dr}

# End Radial Loop
# {EndLoop}
delete surface 1

# Export Helix Files
save as "{path}/{save_folder}/model_files/naruto_helix.cub" overwrite
save cub5 "{path}/{save_folder}/model_files/naruto_helix.cub5" overwrite
export step "{path}/{save_folder}/model_files/naruto_helix.stp" overwrite

# Make Moderator
create prism height {h_mod} sides 6 radius {r_mod}
# {id_mod_vol = id_circ_vol + 1}
move volume {id_mod_vol} z {h_helix / 2}
rotate volume {id_mod_vol} angle 90 about z

# Subtract Helixes from Moderator
# {id_helix_vol_curr = 3}
# {Loop(n_helix_struct)}
# Start Subtract and Merge Loop
subtract volume {id_helix_vol_curr} from volume {id_mod_vol} keep_tool
# {id_mod_vol += 1}
# Merge Moderator and Helixes
merge volume {id_helix_vol_curr} {id_mod_vol}
# {id_helix_vol_curr += 2}
# {EndLoop}

# Make Reflector
create prism height {h_reflect} sides 6 radius {r_mod}
# {id_reflect_vol = id_mod_vol + 1}
move volume {id_reflect_vol} z {h_mod - 10}
rotate volume {id_reflect_vol} angle 90 about z

# Merge Moderator and Reflector
merge volume {id_mod_vol} {id_reflect_vol}

# Export Geometry Files
save as "{path}/{save_folder}/model_files/naruto_geom.cub" overwrite
save cub5 "{path}/{save_folder}/model_files/naruto_geom.cub5" overwrite
export step "{path}/{save_folder}/model_files/naruto_geom.stp" overwrite


reverse surface 2
reverse surface 62
reverse surface 70
reverse surface 58
reverse surface 50
reverse surface 6
reverse surface 54
reverse surface 38
reverse surface 34
reverse surface 46
reverse surface 18
reverse surface 66
reverse surface 14
reverse surface 30
reverse surface 22
reverse surface 42
reverse surface 10
reverse surface 26

export dagmc "{path}/{save_folder}/model_files/naruto_geom.h5m" overwrite

# Meshing
delete mesh volume all
delete mesh surface all
delete mesh curve all

# Mesh Helixes
# {id_circ_curv = 2}
# {id_circ_surf = 2}
# {id_circ_vol = 3}
# {Loop(n_helix_struct)}

# Mesh Curves on Circles
curve {id_circ_curv} {id_circ_curv + 1} interval {n_interval}
curve {id_circ_curv} {id_circ_curv + 1} scheme equal
mesh curve {id_circ_curv} {id_circ_curv + 1}

# Mesh Surfaces on Circles
surface {id_circ_surf} {id_circ_surf + 2} scheme circle
mesh surface {id_circ_surf} {id_circ_surf + 2}
qtri surface {id_circ_surf} {id_circ_surf + 2}

# Mesh Helical Line
curve {id_circ_curv + 2} interval {h_helix * 4}
curve {id_circ_curv + 2} scheme equal
mesh curve {id_circ_curv + 2}

# Mesh Helix
surface {id_circ_surf + 1} scheme map
mesh surface {id_circ_surf + 1}
qtri surface {id_circ_surf + 1}
volume {id_circ_vol} scheme tetmesh
mesh volume {id_circ_vol}

# Update ID’s
# {id_circ_curv += 4}
# {id_circ_surf += 4}
# {id_circ_vol += 2}
# {EndLoop}

# Mesh Moderator and Reflector
volume {id_mod_vol} {id_reflect_vol} scheme tetmesh
mesh volume {id_mod_vol} {id_reflect_vol}

# Export Mesh Files
save as "{path}/{save_folder}/model_files/naruto_mesh.cub" overwrite
save cub5 "{path}/{save_folder}/model_files/naruto_mesh.cub5" overwrite
export step "{path}/{save_folder}/model_files/naruto_mesh.stp" overwrite
export mesh "{path}/{save_folder}/model_files/naruto_mesh.h5m" dimension 3 overwrite
export dagmc "{path}/{save_folder}/model_files/naruto_mesh.h5m" overwrite

# Blocks and Materials
delete block all
delete material all

# Create Fuel Block
# {id_circ_vol = 3}
# {Loop(n_helix_struct)}
block 1 add volume {id_circ_vol}
# {id_circ_vol += 2}
# {EndLoop}
block 1 name "fuel"

# Create Moderator Block
block 2 add volume {id_mod_vol}
block 2 name "moderator"

# Create Reflector Block
block 3 add volume {id_reflect_vol}
block 3 name "reflector"

# Create Materials
create material "fuel" property_group "CUBIT-ABAQUS"
create material "moderator" property_group "CUBIT-ABAQUS"
create material "reflector" property_group "CUBIT-ABAQUS"

# Assign Materials to Blocks
block 1 material "fuel"
block 2 material "moderator"
block 3 material "reflector"

# Export Files
save as "{path}/{save_folder}/model_files/naruto.cub" overwrite
save cub5 "{path}/{save_folder}/model_files/naruto.cub5" overwrite
export step "{path}/{save_folder}/model_files/naruto.stp" overwrite
export mesh "{path}/{save_folder}/model_files/naruto.h5m" dimension 3 overwrite
export dagmc "{path}/{save_folder}/model_files/naruto.h5m" overwrite

@Norbert_Hofbauer Thank you! That worked for me! I don’t understand what about the reversed surfaces fixed it, but it works and that’s what matters. Thanks!

Hi @fbsmith,
it seems that the dagmc export currently won’t export merged surfaces between a volume and a sheet body because of their surface sense.

When i create a helix and merge the bodies. I will get the same errors as you’ve got.
When i reverse the troubling surface, it gets its sense reversed but it also gets unmerged. That’s why the export is working again. If the sheet body is only necessary for sweeping the helix, then it is best to just sweep without the keep keyword to get rid of the tool.

#!cubit
reset
create surface circle radius 1 zplane
move surface 1 x 5
sweep surface 1  helix yaxis thread_distance 5 angle {5*360} right_handed  keep
merge body all

mesh surface all
export dagmc "test.h5m"  overwrite

reverse surface 1
export dagmc "test.h5m"  overwrite