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