CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (http://www.cfd-online.com/Forums/openfoam-meshing-open/)
-   -   Structured meshing in Gmsh (http://www.cfd-online.com/Forums/openfoam-meshing-open/88190-structured-meshing-gmsh.html)

 the_phew May 10, 2011 16:31

Structured meshing in Gmsh

After some digging online, it appears there are only two ways to generate a structured mesh in Gmsh; extrusion and applying "Recombine Surface" on an unstructured surface.

Here is my simple mesh, that I am trying to mesh structured:

cl1 = 0.5;
cl2 = 0.002;
cl3 = 0.005;
Point(1) = {23.5, 0.02, 0, cl1};
Point(2) = {23.5, 10, 0, cl1};
Point(3) = {59.5, 10, 0, cl2};
Point(4) = {59.5, 0.02, 0, cl1};
Point(5) = {0, 0, 0, cl1};
Point(6) = {0, 23.75, 0, cl1};
Point(7) = {24, 23.75, 0, cl1};
Point(8) = {16.052083, 14.122111, 0, cl3};
Point(9) = {24, 14.122111, 0, cl1};
Point(10) = {16.052083, 14.059611, 0, cl1};
Point(11) = {16, 14.025063, 0, cl3};
Point(13) = {23.5, 19, 0, cl1};
Point(14) = {16.017535, 14.111694, 0, cl3};
Line(1) = {2, 1};
Line(2) = {2, 3};
Transfinite Line {2} = 72Using Progression 1;
Line(3) = {3, 4};
Line(4) = {4, 1};
Transfinite Line {4} = 72Using Progression 1;
Line(5) = {1, 5};
Line(6) = {5, 6};
Line(7) = {6, 7};
Line(8) = {9, 7};
Line(9) = {8, 9};
Transfinite Line {1,3,8} = 45 Using Progression 1.2;
Transfinite Line {5,6,7} = 49Using Progression 1.0;
Transfinite Line {9} = 55Using Progression 1.1;
Circle(10) = {11, 13, 2};
Transfinite Line {10} = 65Using Progression 1.07;
Circle(11) = {11, 10, 14};
Transfinite Line {11} = 19Using Progression 1.0;
Circle(12) = {14, 10, 8};
Transfinite Line {12} = 9Using Progression 1.0;

Line Loop(1) = {-1, 2, 3, 4};
Plane Surface(1) = {1};
Transfinite Surface {1} = {1,2,3,4};
Recombine Surface {1};

Line Loop(2) = {1, 5, 6, 7, -8, -9, -12, -11, 10};
Plane Surface(2) = {2};
Physical Line(13) = {5, 6, 7};
Physical Line(14) = {9, 12, 11, 10};
Transfinite Surface {2} = {1,13,8,14};
Recombine Surface {2};

As you can see, Surface 1 recombines properly into a nice structured domain, but on Surface 2, the Recombine algorithm fails. As far as I can tell, the four entities that make up the boundary of Surface 2 (1,13,8,14) should form a structured half O-mesh around the lip feature, with dimensions 145x45. What am I doing wrong?

Thanks

P.S.-Structured meshing seems very cumbersome in Gmsh; can anyone recommend a free meshing program that is more conducive to structured meshes?

 jbf September 18, 2011 07:44

Hello Matt,

The surface 2 of your model has 9 lines as boundary. You can create structured mesh only on surfaces defined by 3 or 4 border lines. The only way for you, in that example, is to divide the surface 2 into smaller surfaces, and apply the transfinite/recombine command on them.

Yes, you are right: structured meshing is very cumbersome, but that is a general fact. An alternative is the unstructured quadrilateral meshing. For instance, the Q-Morph algorithm provides unstructured quadrilateral meshes with well-aligned rows of quadrilaterals parallel to the boundary of the domain. In my album "Q-Morph example 1" you will find pictures of the application of the Q-Morph algorithm on the surface 2 of your domain.