CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   gmsh usage - how to generate patterns? (http://www.cfd-online.com/Forums/main/66135-gmsh-usage-how-generate-patterns.html)

canciger July 7, 2009 00:23

gmsh usage - how to generate patterns?
 
Hi All;

This is my first message. I am working with commercial tools every day and night. I would like to give opensource a try, to see the capabilities.

I am not sure if this is the right thread to post. Please advise otherwise.

I am experimenting with gmsh, to generate some simple mesh. I kind of liked the fact that it has scripting option. However I am stuck at simple operations. I would like to have a symmetry copy of a half sphere, which is shown on the left(structured):
http://www.postimage.org/image.php?v=aVnDRqJ
http://img9.imageshack.us/img9/7827/40540960.th.png">http://img9.imageshack.us/img9/7827/40540960.th.png

However not only the shape of the surfaces but also the mesh does not come out as expected. Any help/ideas are appreciated.
I am using the following code:
/************************************************** *******************
*
* Gmsh tutorial 1
*
* Variables, elementary entities (points, lines, surfaces), physical
* entities (points, lines, surfaces)
*
************************************************** *******************/

// The simplest construction in Gmsh's scripting language is the
// `affectation'. The following command defines a new variable `lc':

lc = 0.009;

Point(1) = {0, 0, 0, lc};
Point(2) = {.1, 0, 0, lc} ;
Point(3) = {.15, .125, 0, lc} ;
Point(4) = {.1, .25, 0, lc} ;
Point(5) = {0, .25, 0, lc};

Line(1) = {1,2} ;
Spline(2) = {2,3,4} ;
Line(3) = {4,5} ;
Line(4) = {5,1} ;

Line Loop(5) = {4,1,2,3} ;

//Plane Surface(6) = {5} ;


Physical Point(1) = {1,2} ;

MyLine = 99;
Physical Line(MyLine) = {1,2,4} ;

Physical Surface("My fancy surface label") = {6} ;

block_thickness = 0.3;

// Create surface
Plane Surface(6) = {5};


// Put 20 points with a refinement toward the extremities on curve 2
Transfinite Line{1} = 5;// Using Bump 0.05;

// Put 20 points total on combination of curves l1, l2 and l3
Transfinite Line{2} = 10;
Transfinite Line{3} = 5;
Transfinite Line{4} = 10;

// Put 30 points following a geometric progression on curve 1
// (reversed) and on curve 3
//Transfinite Line{-1,3} = 30 Using Progression 1.2;

// Define the Surface as transfinite, by specifying the four corners
// of the transfinite interpolation
Transfinite Surface{6} = {1,2,4,5};

// (Note that the list on the right hand side refers to points, not
// curves. When the surface has only 3 or 4 points on its boundary the
// list can be omitted. The way triangles are generated can be
// controlled by appending "Left", "Right" or "Alternate" after the
// list.)

// Recombine the triangles into quads
Recombine Surface{6};

// Apply an elliptic smoother to the grid
Mesh.Smoothing = 100;

//Extrude {0,0,block_thickness} {
// Surface{6}; Layers{ {4,2}, {0.5,1.0}};Recombine;
//}

Extrude {{0, 1, 0}, {0, 0, 0}, 1.0*Pi} {
Surface{6}; Layers{ {4,4}, {0.5,1.0}};Recombine;}

//Extrude {{0, 1, 0}, {0, 0, 0}, 1.0*Pi} {
// Surface{117}; Layers{ {2,4}, {0.5,1.0}};Recombine;}
//Symmetry {0, 0, 1, 0} {
// Duplicata{Volume{1};}
//}
Symmetry {0, 0, 1, -.001} {
Duplicata{Surface{116, 113, 6, 117, 109};}
}



Or alternatively: could you recommend some other/better open source, scriptable meshing tool?

Regards...


All times are GMT -4. The time now is 10:50.