|
[Sponsors] |
June 30, 2024, 15:10 |
GMSH Tet Mesh sizing not working.
|
#1 |
New Member
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2 |
Hello !
I am trying to make a tetrahedral mesh in GMSH. The geometry is imported in GMSH in step format and subtracted from a box to create a domain. I tried using fields and mesh control from points but it is not working. Any suggestions why it is not working. I have attached the .geo code. Thanks for the help ! Code:
SetFactory("OpenCASCADE"); Merge "geo.step"; //Meshing Settings Mesh.Algorithm = 1; Mesh.Algorithm3D = 7; Mesh.SubdivisionAlgorithm = 2; Mesh.MeshSizeFromPoints = 1; Mesh.MeshSizeFromCurvature = 0; Mesh.MeshSizeExtendFromBoundary = 1; Mesh.MeshSizeMin = 1; Mesh.MeshSizeMax = 20; Mesh.ElementOrder = 2; Box(2) = {-350, -250, -150, 700, 500, 300}; BooleanDifference (3) = {Volume{2}; Delete;} {Volume{1}; Delete;}; //Points 1 to 8 are the end points of the domain boundary. For i In {1:8} MeshSize{Point{i}} = 400; EndFor Physical Surface("Inlet", 1) = {4}; Physical Surface("Outlet", 2) = {2}; Physical Surface("Top", 3) = {3}; Physical Surface("Bottom",4) = {5}; Physical Surface("Left", 5) = {6}; Physical Surface("Right", 6) = {1}; Physical Surface("Wall", 7) = {7:65}; Physical Volume("Fluid", 8) = {3}; |
|
July 16, 2024, 09:15 |
|
#2 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22 |
I am also looking into 3D meshing using Gmsh and am struggling with mesh size settings. The way to approach 3D meshes is by using fields. I recommend to use python scripts rather than geo files. I import a CAD geometry in igs format, assign a surface mesh sizes to the individual surfaces... my problem is currently, that the mesh size on one of the surfaces is not as defined which may have to do with underlying mesh size definition hierarchies Gmsh applies automatically. I recommend to work through related python tutorials and examples available at: https://gitlab.onelab.info/gmsh/gmsh...r/examples/api to get started.
Also, you need to synchronize the opencascade and geo kernels before applying certain operations, maybe that's causing the issue - just a guess. |
|
July 16, 2024, 10:59 |
|
#3 |
New Member
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2 |
Hii,
I solved the issue in .geo file by using Transfinite Curve and specify the number of elements I wanted. I think the transfinite property is enforced even when the point size is defined. So, kind of a hack. Also, another issue I ran into is improving the tet mesh quality in GMSH. I tried NETGEN but it is not that useful. Any other steps to improve the mesh quality. Also how could I add prism boundary layer here in GMSH ? Is that possible ? |
|
July 16, 2024, 12:14 |
|
#4 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22 |
3D boundary layers are possible:
See: https://gitlab.onelab.info/gmsh/gmsh...ry_layer_3d.py The boundary layer is extruded from the surface mesh. You can even create 2nd order i.e. curved cells which takes a lot of time as it's not yet running in parallel. |
|
July 16, 2024, 12:33 |
|
#5 |
New Member
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2 |
Thanks, I will check it out. It seems it is a python example. Is the command valid in .geo file too ?
|
|
July 16, 2024, 14:48 |
|
#6 |
Senior Member
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22 |
Yes, it's a python example. I recommend to move to using python scripts when using Gmsh as it's more and more common and provides more flexibility. There's no geo version of the example to my knowledge.
|
|
July 16, 2024, 15:10 |
|
#7 |
New Member
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2 |
Sure ! I will try to move to the Python workflow. I need to learn that. Thanks !
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] GMSH : structured mesh issue | bibiboom | OpenFOAM Meshing & Mesh Conversion | 0 | May 17, 2017 19:49 |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
[Gmsh] gmshToFoam problem: not the same mesh in Gmsh vs. paraview | zhernadi | OpenFOAM Meshing & Mesh Conversion | 8 | July 7, 2011 03:28 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 11:56 |
Icemcfd 11: Loss of mesh from surface mesh option? | Joe | CFX | 2 | March 26, 2007 19:10 |