Precise control of the thickness of the first cell normal to wall, is crucial for turbulence models like k-epsilon, k-omega. Before moving to turbulence flow simulation for CFD workbench of FreeCAD
2D meshing with boundary layer, tutorial
3D boundary meshing for simple cube is also done, based on FreeCAD FEM workbench example of 3D cantilever.
CAD and Gmsh setup files are embeded.
photo and progress will be updated on the FreeCAD Fem post
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
// geo file for meshing with GMSH meshing software created by FreeCAD // open brep geometry Merge "./Box_Geometry.brep"; // group data //Physical Surface("FEMMeshGroup") = {6}; Physical Surface("FemConstraintFixed") = {1}; Physical Surface("FemConstraintForce") = {2}; // Characteristic Length // Characteristic Length according CharacteristicLengthMap // Face6 //Characteristic Length { 3, 1, 7, 5 } = 100.0; // min, max Characteristic Length Mesh.CharacteristicLengthMax = 1e+22; Mesh.CharacteristicLengthMin = 0.0; // optimize the mesh Mesh.Optimize = 1; Mesh.OptimizeNetgen = 0; Mesh.HighOrderOptimize = 0; //probably needs more lines off adjustment in geo file // mesh order Mesh.ElementOrder = 1; // boundary layer, need background mesh Field[4] = BoundaryLayer; //Field[4].EdgesList = {3, 1,}; // EdgesList for 2D, not necessary for 3D BL Field[4].FacesList = {1}; // FacesList for 3D, Field[4].hfar = 100; Field[4].hwall_n = 10; Field[4].hwall_t = 9; Field[4].thickness = 30; // must be bigger than hwall_n Field[4].ratio = 1.1; BoundaryLayer Field = 4; // mesh algorithm // 2D mesh algorithm (1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=BAMG, 8=DelQuad) Mesh.Algorithm = 2; // 2 and 8 both working for 3D BL // 3D mesh algorithm (1=Delaunay, 2=New Delaunay, 4=Frontal, 5=Frontal Delaunay, 6=Frontal Hex, 7=MMG3D, 9=R-tree) Mesh.Algorithm3D = 8; // meshing Mesh 3; // save Mesh.Format = 2; // For each group save not only the elements but the nodes too.; Mesh.SaveGroupsOfNodes = 1; // Needed for Group meshing too, because for one material there is no group defined; // Ignore Physical definitions and save all elements; Mesh.SaveAll = 1; Save "./Box_Mesh_TmpGmsh.unv"; ////////////////////////////////////////////////////////////////////// // GMSH documentation: // http://gmsh.info/doc/texinfo/gmsh.html#Mesh // // We do not check if something went wrong, like negative jacobians etc. You can run GMSH manually yourself: // // to see full GMSH log, run in bash: // /usr/bin/gmsh - /tmp/shape2mesh.geo // // to run GMSH and keep file in GMSH GUI (with log), run in bash: // /usr/bin/gmsh /tmp/shape2mesh.geo |
the CAD model file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
DBRep_DrawableShape CASCADE Topology V1, (c) Matra-Datavision Locations 2 1 1 0 0 0 0 1 0 0 0 0 1 0 2 1 -1 0 Curve2ds 24 1 0 0 1 0 1 0 0 1 0 1 1000 0 0 -1 1 0 0 0 1 1 0 -1000 1 0 1 0 0 1 0 1 0 0 0 -1 1 0 0 0 1 1 0 0 1 0 1 0 8000 1 0 1 1000 0 0 -1 1 8000 0 0 1 1 0 -1000 1 0 1 0 8000 1 0 1 0 0 0 -1 1 8000 0 0 1 1 0 0 0 1 1 0 0 1 0 1 1000 0 0 1 1 0 0 1 0 1 0 0 0 1 1 0 1000 1 0 1 1000 0 0 1 1 0 1000 1 0 Curves 12 1 0 0 0 0 0 1 1 0 0 1000 -0 1 0 1 0 1000 0 0 0 1 1 0 0 0 -0 1 0 1 8000 0 0 0 0 1 1 8000 0 1000 0 1 0 1 8000 1000 0 0 0 1 1 8000 0 0 -0 1 0 1 0 0 0 1 0 -0 1 0 0 1000 1 0 -0 1 0 1000 0 1 0 -0 1 0 1000 1000 1 0 -0 Polygon3D 0 PolygonOnTriangulations 24 2 1 2 p 16.6666666666667 1 0 1000 2 1 4 p 16.6666666666667 1 0 1000 2 2 3 p 16.6666666666667 1 0 1000 2 1 2 p 16.6666666666667 1 0 1000 2 4 3 p 16.6666666666667 1 0 1000 2 1 4 p 16.6666666666667 1 0 1000 2 1 4 p 16.6666666666667 1 0 1000 2 1 2 p 16.6666666666667 1 0 1000 2 1 2 p 16.6666666666667 1 0 1000 2 2 3 p 16.6666666666667 1 0 1000 2 2 3 p 16.6666666666667 1 0 1000 2 4 3 p 16.6666666666667 1 0 1000 2 4 3 p 16.6666666666667 1 0 1000 2 2 3 p 16.6666666666667 1 0 1000 2 1 4 p 16.6666666666667 1 0 1000 2 4 3 p 16.6666666666667 1 0 1000 2 1 2 p 16.6666666666667 1 0 8000 2 1 4 p 16.6666666666667 1 0 8000 2 4 3 p 16.6666666666667 1 0 8000 2 1 4 p 16.6666666666667 1 0 8000 2 1 2 p 16.6666666666667 1 0 8000 2 2 3 p 16.6666666666667 1 0 8000 2 4 3 p 16.6666666666667 1 0 8000 2 2 3 p 16.6666666666667 1 0 8000 Surfaces 6 1 0 0 0 1 0 -0 0 0 1 0 -1 0 1 0 0 0 -0 1 0 0 0 1 1 0 -0 1 0 0 1000 0 0 1 1 0 -0 -0 1 0 1 0 1000 0 -0 1 0 0 0 1 1 0 -0 1 0 0 0 0 0 1 1 0 -0 -0 1 0 1 8000 0 0 1 0 -0 0 0 1 0 -1 0 Triangulations 6 4 2 1 0 0 0 0 0 0 1000 0 1000 1000 0 1000 0 0 0 1000 0 1000 -1000 0 -1000 2 4 3 2 1 4 4 2 1 0 0 0 0 8000 0 0 8000 0 1000 0 0 1000 0 0 0 8000 1000 8000 1000 0 3 2 1 3 1 4 4 2 1 0 0 0 1000 0 1000 1000 8000 1000 1000 8000 0 1000 0 0 0 1000 8000 1000 8000 0 3 2 1 3 1 4 4 2 1 0 0 1000 0 8000 1000 0 8000 1000 1000 0 1000 1000 0 0 0 8000 1000 8000 1000 0 3 2 1 3 1 4 4 2 1 0 0 0 0 0 1000 0 8000 1000 0 8000 0 0 0 0 0 1000 8000 1000 8000 0 3 2 1 3 1 4 4 2 1 0 8000 0 0 8000 0 1000 8000 1000 1000 8000 1000 0 0 0 1000 0 1000 -1000 0 -1000 2 4 3 2 1 4 TShapes 34 Ve 1e-07 0 0 1000 0 0 0101101 * Ve 1e-07 0 0 0 0 0 0101101 * Ed 1e-07 1 1 0 1 1 0 0 1000 2 1 1 0 0 1000 2 2 2 0 0 1000 6 1 1 0 6 2 2 0 0 0101000 -34 2 +33 2 * Ve 1e-07 0 1000 1000 0 0 0101101 * Ed 1e-07 1 1 0 1 2 0 0 1000 2 3 1 0 0 1000 2 4 3 0 0 1000 6 3 1 0 6 4 3 0 0 0101000 -31 2 +34 2 * Ve 1e-07 0 1000 0 0 0 0101101 * Ed 1e-07 1 1 0 1 3 0 0 1000 2 5 1 0 0 1000 2 6 4 0 0 1000 6 5 1 0 6 6 4 0 0 0101000 -31 2 +29 2 * Ed 1e-07 1 1 0 1 4 0 0 1000 2 7 1 0 0 1000 2 8 5 0 0 1000 6 7 1 0 6 8 5 0 0 0101000 -29 2 +33 2 * Wi 0101000 -32 0 -30 0 +28 0 +27 0 * Fa 0 1e-07 1 0 2 1 0101000 +26 0 * Ve 1e-07 8000 0 1000 0 0 0101101 * Ve 1e-07 8000 0 0 0 0 0101101 * Ed 1e-07 1 1 0 1 5 0 0 1000 2 9 6 0 0 1000 2 10 2 0 0 1000 6 9 6 0 6 10 2 0 0 0101000 -24 2 +23 2 * Ve 1e-07 8000 1000 1000 0 0 0101101 * Ed 1e-07 1 1 0 1 6 0 0 1000 2 11 6 0 0 1000 2 12 3 0 0 1000 6 11 6 0 6 12 3 0 0 0101000 -21 2 +24 2 * Ve 1e-07 8000 1000 0 0 0 0101101 * Ed 1e-07 1 1 0 1 7 0 0 1000 2 13 6 0 0 1000 2 14 4 0 0 1000 6 13 6 0 6 14 4 0 0 0101000 -21 2 +19 2 * Ed 1e-07 1 1 0 1 8 0 0 1000 2 15 6 0 0 1000 2 16 5 0 0 1000 6 15 6 0 6 16 5 0 0 0101000 -19 2 +23 2 * Wi 0101000 -22 0 -20 0 +18 0 +17 0 * Fa 0 1e-07 6 0 2 6 0101000 +16 0 * Ed 1e-07 1 1 0 1 9 0 0 8000 2 17 2 0 0 8000 2 18 5 0 0 8000 6 17 2 0 6 18 5 0 0 0101000 -23 2 +33 2 * Ed 1e-07 1 1 0 1 10 0 0 8000 2 19 2 0 0 8000 2 20 3 0 0 8000 6 19 2 0 6 20 3 0 0 0101000 -24 2 +34 2 * Wi 0101000 -14 0 -22 0 +13 0 +32 0 * Fa 0 1e-07 2 0 2 2 0101000 +12 0 * Ed 1e-07 1 1 0 1 11 0 0 8000 2 21 4 0 0 8000 2 22 5 0 0 8000 6 21 4 0 6 22 5 0 0 0101000 -19 2 +29 2 * Ed 1e-07 1 1 0 1 12 0 0 8000 2 23 4 0 0 8000 2 24 3 0 0 8000 6 23 4 0 6 24 3 0 0 0101000 -21 2 +31 2 * Wi 0101000 -10 0 -18 0 +9 0 +28 0 * Fa 0 1e-07 4 0 2 4 0101000 +8 0 * Wi 0101000 -27 0 -10 0 +17 0 +14 0 * Fa 0 1e-07 5 0 2 5 0101000 +6 0 * Wi 0101000 -30 0 -9 0 +20 0 +13 0 * Fa 0 1e-07 3 0 2 3 0101000 +4 0 * Sh 0101100 -25 0 +15 0 -11 0 +7 0 -5 0 +3 0 * So 1100000 +2 0 * +1 1 |
BSD documentation licensed Free for non-commercial usage only
Author: Qingfeng XIA
copyright (C) 2011-2017
http://www.iesensor.com
please keep the original link in your reference.
http://www.iesensor.com/blog/2017/06/16/boundarylayer-setup-for-gmsh-3d-meshing/