CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Mesh Generation & Pre-Processing

GMSH Tet Mesh sizing not working.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2024, 14:10
Default GMSH Tet Mesh sizing not working.
  #1
New Member
 
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2
airwarriorg91 is on a distinguished road
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};
airwarriorg91 is offline   Reply With Quote

Old   July 16, 2024, 08:15
Default
  #2
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
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.
klausb is offline   Reply With Quote

Old   July 16, 2024, 09:59
Default
  #3
New Member
 
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2
airwarriorg91 is on a distinguished road
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 ?
airwarriorg91 is offline   Reply With Quote

Old   July 16, 2024, 11:14
Default
  #4
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
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.
klausb is offline   Reply With Quote

Old   July 16, 2024, 11:33
Default
  #5
New Member
 
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2
airwarriorg91 is on a distinguished road
Thanks, I will check it out. It seems it is a python example. Is the command valid in .geo file too ?
airwarriorg91 is offline   Reply With Quote

Old   July 16, 2024, 13:48
Default
  #6
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 281
Rep Power: 22
klausb will become famous soon enough
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.
klausb is offline   Reply With Quote

Old   July 16, 2024, 14:10
Default
  #7
New Member
 
Gaurav Gupta
Join Date: May 2024
Posts: 23
Rep Power: 2
airwarriorg91 is on a distinguished road
Sure ! I will try to move to the Python workflow. I need to learn that. Thanks !
airwarriorg91 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] GMSH : structured mesh issue bibiboom OpenFOAM Meshing & Mesh Conversion 0 May 17, 2017 18:49
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 03:21
[Gmsh] gmshToFoam problem: not the same mesh in Gmsh vs. paraview zhernadi OpenFOAM Meshing & Mesh Conversion 8 July 7, 2011 02:28
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


All times are GMT -4. The time now is 00:05.