1+ ## create base
2+ #{offset = 0.005}
3+ brick x 5 y 0.5 z 5
4+ move volume 1 y 0.25 include_merged
5+
6+ ## create plhange base
7+ create cylinder height 0.25 radius 2.2
8+ rotate volume 2 angle 90 about x include_merged
9+ move volume 2 y {0.125 + 0.5 + offset} include_merged
10+
11+ ## create plhange
12+ brick x 2 y 2.25 z 2
13+ brick x 1.5 y 2.0 z 1.5
14+ move volume 4 y -0.125
15+ subtract volume 4 from volume 3
16+ tweak curve 15, 17, 19, 21, 39, 41, 43, 45 fillet radius 0.5
17+ move volume 3 y {1.125 + 0.5 + offset} include_merged
18+ subtract volume 3 from volume 2 keep
19+ split body 5
20+ delete volume 2
21+ delete volume 5
22+
23+ ## Round base edges
24+ tweak curve 1 3 5 7 fillet radius 0.5
25+
26+ ## Create hole for first bolt
27+ create cylinder height {0.75 + offset} radius {0.164 + 0.002}
28+ rotate volume 7 angle 90 about x include_merged
29+ move volume 7 location 1.25 {(0.75 + offset)/2.0} 1.25 include_merged
30+
31+ ## Create other bolt holes
32+ volume 7 copy move z -2.5 # volume 8
33+ volume 7 copy move x -2.5 # volume 9
34+ volume 7 copy move x -2.5 z -2.5 # volume 10
35+ volume 7 copy move x -3. z -1.25 # volume 11
36+ volume 7 copy move x 0.5 z -1.25 # volume 12
37+ subtract volume 7 8 9 10 11 12 from volume 6
38+
39+ ## Create shaft of first bolt
40+ # if change number of bolts, e.g. to 4 volume 13 must become 11
41+ create cylinder height {0.75 + offset} radius {0.164 + 0.002}
42+ rotate volume 13 angle 90 about x include_merged
43+ move volume 13 location 1.25 {(0.75 + offset)/2.0} 1.25 include_merged
44+
45+ ## Create head of bolt and unite
46+ # if change number of bolts, e.g. to 4 volume 14 must become 12
47+ create cylinder height 0.164 radius 0.25
48+ rotate volume 14 angle 90 about x include_merged
49+ move volume 14 location 1.25 {0.164/2.0+0.5+0.25+offset} 1.25 include_merged
50+ unite volume 13 14 # volume 13
51+
52+ ## Copy bolts to a bolt pattern
53+ # if change number of bolts, e.g. to 4 volume 13 must become 11
54+ volume 13 copy move z -2.5 # volume 15
55+ volume 13 copy move x -2.5 # volume 16
56+ volume 13 copy move x -2.5 z -2.5 # volume 17
57+ volume 13 copy move x -3. z -1.25 # volume 18
58+ volume 13 copy move x 0.5 z -1.25 # volume 19
59+
60+ ## Subtract and keep bolts in plate
61+ subtract volume 13 15 16 17 18 19 from volume 1 keep
62+ delete volume 1 # renames base plate to volume 20 (with 6 bolts)
63+
64+ # Be very specific about imprinting and merging
65+ imprint volume 13 15 16 17 18 19 20
66+ merge volume 13 15 16 17 18 19 20
67+
68+ # Make sure we do not merge the shafts in body 6 with the bolts
69+ imprint volume 13 15 16 17 18 19 6
70+ surface 79 80 81 82 83 84 merge off # bolt surfaces of volume 6
71+ merge volume 13 15 16 17 18 19 6
72+
73+ # imprinting caused a small surfaces (of gap width) in each shaft
74+ # composite surfaces to remedy the issue
75+ composite create surface 147 148
76+ composite create surface 149 150
77+ composite create surface 151 152
78+ composite create surface 153 154
79+ composite create surface 155 156
80+ composite create surface 157 158
81+
82+ # still need to imprint and merge component
83+ imprint volume 3 6
84+ merge volume 3 6
85+
86+ # set scheme for tetmeshing
87+ volume all scheme tetmesh proximity layers off
88+ trimesher surface gradation 1.2
89+ trimesher volume gradation 1.2
90+ set tetmesher optimize level 6 overconstrained off sliver off
91+ set tetmesher interior points on
92+ set tetmesher boundary recovery off
93+
94+ #{coarse_size = 0.25}
95+ #{medium_size = 0.125}
96+
97+ # mesh attachement
98+ volume 3 6 size {coarse_size}
99+ surface 79 80 81 82 83 84 size {medium_size}
100+ mesh volume 3 6
101+
102+ # mesh plate
103+ volume 16 size {coarse_size}
104+ surface 119 120 121 122 123 124 size {medium_size}
105+ mesh volume 20
106+
107+ # mesh bolts
108+ volume 13 15 16 17 18 19 size {medium_size}
109+ mesh volume 13 15 16 17 18 19
110+
111+ # assign blocks
112+ block 1 volume 3 6
113+ block 2 volume 20
114+ block 3 volume 13 15 16 17 18 19
115+ block 1 name "component"
116+ block 2 name "plate"
117+ block 3 name "bolts"
118+ block all element type tetra4
119+
120+ # assign nodesets
121+ nodeset 1 surface 125 127 128 129 130 131 132 134
122+ nodeset 1 name "base_plate"
123+ nodeset 2 surface 14 # top of shaft
124+ nodeset 2 name "loading"
125+
126+ # assign sidesets
127+ sideset 1 surface 125 127 128 129 130 131 132 134
128+ sideset 1 name "base_plate_ss"
129+ sideset 2 surface 14 # top of shaft
130+ sideset 2 name "loading_ss"
131+
132+ body all scale 0.0254 0.0254 0.0254
133+
134+ #export to genesis
135+ export mesh "joint_circular_coarse.g" overwrite
0 commit comments