CFD Online URL
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

gmsh and boundary layers

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 17, 2010, 18:01
Default gmsh and boundary layers
  #1
New Member
 
Kanuk
Join Date: Oct 2010
Posts: 24
Rep Power: 6
kanuk is on a distinguished road
Hello,

I'm trying to run a test case of a 2-D airfoil (similar to the airFoil2D tutorial case). I am using gmsh as a meshing tool and followed the directions in http://openfoamwiki.net/index.php/2D...ial_using_GMSH.

Originally, I had been using an unstructured mesh (tets) and got good visual results, but I am trying to validate the case, so I have now meshed with a structured grid using a couple of boundary layers (primary and secondary). The problem is that once I specify all faces and volumes in the .geo file, mesh it (with no problems), convert it using gmshToFoam, I get very, very unstable behavior in my solution, even though my grid is refined. I have checked my 0/U, 0/p, 0/nut, 0/nuTilda, polyMesh/boundary and system/controlDict files, and nothing seems to be wrong. I think the problem is with my "interfaces" patch in the .msh file... I don't know for sure but I specified the boundary layers (which are labeled interfaces in gmsh) as "empty" in the above files, which seems correct to me.

Also, when running gmshToFoam I get the following error (see below). Why am I getting a faceZone_1??

////////////////////
Skipping tag at line 144939
Patch 0 gets name back
Patch 1 gets name interfaces
Patch 2 gets name airfoil
Patch 3 gets name front
Patch 4 gets name inlet
Patch 5 gets name outlet

--> FOAM Warning :
From function polyMesh:olyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
Found 57744 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
Finding faces of patch 1
Finding faces of patch 2
Finding faces of patch 3
Finding faces of patch 4
Finding faces of patch 5

FaceZones:
Zone Size
1 879

Writing zone 0 to cellZone airvol and cellSet
Writing zone 1 to faceZone faceZone_1 and faceSet
End

///////////////////

As of this point, I am stumped, but will keep trying to find the solution. Anyone out there successfully ran a case with boundary layers?? Any help is really appreciated!
kanuk is offline   Reply With Quote

Old   November 30, 2010, 09:17
Default
  #2
Senior Member
 
Join Date: Sep 2010
Location: France
Posts: 169
Rep Power: 6
T.D. is on a distinguished road
Quote:
Originally Posted by kanuk View Post
Hello,

I'm trying to run a test case of a 2-D airfoil (similar to the airFoil2D tutorial case). I am using gmsh as a meshing tool and followed the directions in http://openfoamwiki.net/index.php/2D...ial_using_GMSH.

Originally, I had been using an unstructured mesh (tets) and got good visual results, but I am trying to validate the case, so I have now meshed with a structured grid using a couple of boundary layers (primary and secondary). The problem is that once I specify all faces and volumes in the .geo file, mesh it (with no problems), convert it using gmshToFoam, I get very, very unstable behavior in my solution, even though my grid is refined. I have checked my 0/U, 0/p, 0/nut, 0/nuTilda, polyMesh/boundary and system/controlDict files, and nothing seems to be wrong. I think the problem is with my "interfaces" patch in the .msh file... I don't know for sure but I specified the boundary layers (which are labeled interfaces in gmsh) as "empty" in the above files, which seems correct to me.

Also, when running gmshToFoam I get the following error (see below). Why am I getting a faceZone_1??

////////////////////
Skipping tag at line 144939
Patch 0 gets name back
Patch 1 gets name interfaces
Patch 2 gets name airfoil
Patch 3 gets name front
Patch 4 gets name inlet
Patch 5 gets name outlet

--> FOAM Warning :
From function polyMesh:olyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
Found 57744 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
Finding faces of patch 1
Finding faces of patch 2
Finding faces of patch 3
Finding faces of patch 4
Finding faces of patch 5

FaceZones:
Zone Size
1 879

Writing zone 0 to cellZone airvol and cellSet
Writing zone 1 to faceZone faceZone_1 and faceSet
End

///////////////////

As of this point, I am stumped, but will keep trying to find the solution. Anyone out there successfully ran a case with boundary layers?? Any help is really appreciated!
Hi,
you need to change the patches names in the constant/PolyMesh/boundary file to that of "back" "interfaces" "airfoil" "front" etc...

Good Luck
T.D. is offline   Reply With Quote

Old   November 30, 2010, 15:11
Default
  #3
New Member
 
Kanuk
Join Date: Oct 2010
Posts: 24
Rep Power: 6
kanuk is on a distinguished road
Thanks for your reply, T.D. After struggling with this for awhile, I realized the errors in my computations were entirely due to large aspect ratios of the elements. I have corrected this issue and things seem to work just fine.
kanuk is offline   Reply With Quote

Old   January 21, 2011, 13:01
Default
  #4
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 6
claco is on a distinguished road
Quote:
Originally Posted by kanuk View Post
Hello,

I'm trying to run a test case of a 2-D airfoil (similar to the airFoil2D tutorial case). I am using gmsh as a meshing tool and followed the directions in http://openfoamwiki.net/index.php/2D...ial_using_GMSH.

Originally, I had been using an unstructured mesh (tets) and got good visual results, but I am trying to validate the case, so I have now meshed with a structured grid using a couple of boundary layers (primary and secondary). The problem is that once I specify all faces and volumes in the .geo file, mesh it (with no problems), convert it using gmshToFoam, I get very, very unstable behavior in my solution, even though my grid is refined. I have checked my 0/U, 0/p, 0/nut, 0/nuTilda, polyMesh/boundary and system/controlDict files, and nothing seems to be wrong. I think the problem is with my "interfaces" patch in the .msh file... I don't know for sure but I specified the boundary layers (which are labeled interfaces in gmsh) as "empty" in the above files, which seems correct to me.

Also, when running gmshToFoam I get the following error (see below). Why am I getting a faceZone_1??

////////////////////
Skipping tag at line 144939
Patch 0 gets name back
Patch 1 gets name interfaces
Patch 2 gets name airfoil
Patch 3 gets name front
Patch 4 gets name inlet
Patch 5 gets name outlet

--> FOAM Warning :
From function polyMesh:olyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
Found 57744 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
Finding faces of patch 1
Finding faces of patch 2
Finding faces of patch 3
Finding faces of patch 4
Finding faces of patch 5

FaceZones:
Zone Size
1 879

Writing zone 0 to cellZone airvol and cellSet
Writing zone 1 to faceZone faceZone_1 and faceSet
End

///////////////////

As of this point, I am stumped, but will keep trying to find the solution. Anyone out there successfully ran a case with boundary layers?? Any help is really appreciated!


Dear kanuk,

Can You please explain me how can I build boundary layers in GMSH environment?

Thank You in advance.

Claudio Comis
claco is offline   Reply With Quote

Old   January 21, 2011, 16:12
Default
  #5
New Member
 
Kanuk
Join Date: Oct 2010
Posts: 24
Rep Power: 6
kanuk is on a distinguished road
I'm not sure if I did it correctly, but it worked....

What I did was created a pseudo surface of thickness T around the surface I needed the boundary layer on, then treated this as its own surface.

Make use of the "transfinite line" operator, along with "using progression" (to get the y+) and lastly, "transfinite surface"....

The gmsh user guide should be very helpful with this.

Cheers
Dave
kanuk is offline   Reply With Quote

Old   February 17, 2011, 08:35
Default
  #6
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 6
claco is on a distinguished road
Quote:
Originally Posted by kanuk View Post
I'm not sure if I did it correctly, but it worked....

What I did was created a pseudo surface of thickness T around the surface I needed the boundary layer on, then treated this as its own surface.

Make use of the "transfinite line" operator, along with "using progression" (to get the y+) and lastly, "transfinite surface"....

The gmsh user guide should be very helpful with this.

Cheers
Dave



Dear Sirs,

I have a great problem.
I have build the geometry of a simple wind tunnel, with a bump located
on the bottom. I built a boundary layer; the other part of the 3D (a 2D extrude mesh) mesh is a structured mesh.
I succeeded in doing that, but a terrible problem remains: there is an
unwanted intersection between the boundary layer mesh and the rest of
the structured mesh.
I cannot find the proper commands to prevent this intersection.
I would like to made the structured mesh starting from the edges where the boundary layers end.
I enclose the simple .geo file along with a screen shot.
I hope You can Help me, or forward this e-mail to someone can resolve
this simple (and at the same time difficult) problem.


file.geo

lc = 0.5;

dx = 2.0;
dy = 1.0;
dz = 5.0;
dy_bl = 0.05;
nx = 100;
ny1 = 10;//0.9;//(dy/(2*dy_bl))*ny2;
ny2 = 100;
nz = 1;

//cx = dx/nx;
//cy = dy/ny;
//cz = (cx + cy)/2;

Point(1) = {0.0,0.0,0.0,lc};
Point(2) = {0,dy,0.0,lc};
Point(3) = {dx,dy,0.0,lc};
Point(4) = {dx,0,0.0,lc};
Point(5) = {dx,0,0.0,lc};
Point(6) = {dx/2,0,0.0,lc};
Point(7) = {dx/2-0.2,0,0.0,lc};
Point(8) = {dx/2-0.05,dy/8,0.0,lc};
Point(9) = {dx/2+0.05,dy/8,0.0,lc};
Point(10) = {dx/2+0.2,0,0.0,lc};
Point(11) = {0,dy_bl,0.0,lc};
Point(12) = {dx,dy_bl,0.0,lc};
Point(13) = {0,dy-dy_bl,0.0,lc};
Point(14) = {dx,dy-dy_bl,0.0,lc};
Line(2) = {2,3};
Line(3) = {14,12};
Line(5) = {11,13};
Line(1) = {1,11};
Line(6) = {12,4};
Line(7) = {13,2};
Line(8) = {3,14};


Spline(4) = {4,10,9,8,7,1};

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

Plane Surface(6) = {5};
old = Geometry.ExtrudeReturnLateralEntities;
Printf("lateral entities = %g", old);
Geometry.ExtrudeReturnLateralEntities = 0;
e1[]= Extrude {0,0,1.000000} {Surface{6}; Layers{1}; Recombine;};

cells[0] = 0;
heights[0] = 0.01;
For i In {1:5}
cells[i] = 1;
heights[i] = heights[i-1] * 1.2;
EndFor
tmp[] = Extrude {Surface{49}; Layers{cells[],heights[]}; Recombine;};
Printf("top surface = %g", tmp[0]);
Extrude {Surface{19}; Layers{cells[],heights[]}; Recombine;};
Geometry.ExtrudeReturnLateralEntities = old;

// Top surface
//Physical Surface(33) = {15};

// Bottom surface
//Physical Surface(34) = {23};

// Left surface
//Physical Surface(35) = {19};

// Right surface
//Physical Surface(36) = {27};

// Front surface
//Physical Surface(37) = {28};

// Back surface
//Physical Surface(38) = {6};

// Box volume
//Physical Volume (39) = {32};

Transfinite Line {1,8} = (ny1) + 1 Using Progression 1;
Transfinite Line {7,6} = (ny1) + 1 Using Progression 1;
Transfinite Line {5,3} = (ny2) + 1 Using Progression 1.0;
Transfinite Line {2,4} = nx + 1 Using Progression 1.0;
//Transfinite Line {1,3} = ny + 1 Using Progression 1.0;
//Transfinite Line {14,18,13,22} = nz + 1 Using Progression 1.0;

Transfinite Surface {6} = {3,2,1,4};
Recombine Surface {6};
//Transfinite Surface {27} = {5,14,2,3};
//Transfinite Surface {15} = {5,3,4,6};
//Transfinite Surface {28} = {6,10,14,5};
//Transfinite Surface {23} = {14,2,1,10};
//Transfinite Surface {19} = {6,10,1,4};
//Surface Loop(1000) = {14:28:2}; // the sphere (only need for internal mesh)
Surface Loop(1001) = {72};//tmp[{0:14:2}]}; // The outside of the BL
Surface Loop(1002) = {21,25,29,33,6,37,41,45,49,50}; // the box (entire farfield surface loop)

//Volume(1000) = {1000}; /// inside the sphere
//Volume(1) = {1002, 1001}; /// FarField

Mesh.Algorithm3D = 4;
Mesh.Smoothing = 100;
Mesh.Optimize=1;
Mesh.OptimizeNetgen=1;
Mesh.OptimizeNetgen=1;



Claudio Comis
Attached Images
File Type: jpg Problem.jpg (96.2 KB, 250 views)
claco is offline   Reply With Quote

Old   May 2, 2011, 03:52
Default
  #7
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Hi All,

I am a new user of Gmsh. I created the geo file and meshed it using Gmsh GUI. From mesh option, I change the element size factor to create finer mesh, e.g I used element size factor 0.05, 0.03, and 0.01. However, I did not get any explanations about element size factor. Could you please explain what is that element size factor in gmsh and how it controls element size? If element size factor is 0.01, is that mean target element size is 0.01?
Any help will be very much appreciated.
msarkar is offline   Reply With Quote

Old   May 2, 2011, 13:51
Default
  #8
New Member
 
Kanuk
Join Date: Oct 2010
Posts: 24
Rep Power: 6
kanuk is on a distinguished road
I'm not sure about "element size factor" but you normally specify the element characteristic length. If you say the characteristic length is 0.01 then the meshing program keeps all elements small enough to fit inside a sphere (or in 2-D a circle) of diameter 0.01. At least this is my interpretation...
kanuk is offline   Reply With Quote

Old   May 4, 2011, 03:37
Default
  #9
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Thank you kanuk for your reply.
If anyone has any idea about "element size factor" in Gmsh, please let me know.
msarkar is offline   Reply With Quote

Old   May 9, 2011, 08:21
Default Boundary Layer and Gmsh
  #10
Member
 
MSarkar
Join Date: Dec 2009
Posts: 99
Rep Power: 7
msarkar is on a distinguished road
Hi All,

I am using Gmsh to generate mesh. I want to create boundary layer around ellipse. I created four dummy surfaces (each of one quarter of ellipse) around the ellipse and tried to create boundary layer using transfinite line and surface. However, it did not work, gave error: Surface 30 cannot be meshed using transfinite algo. Could anyone tell me how to create boundary layer / structured mesh around ellipse using Gmsh?

Thanks
M.S.
msarkar is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52
Default Faces on Boundary Layer axel Open Source Meshers: Gmsh, Netgen, CGNS, ... 8 February 17, 2011 08:47
GMSH and the creation of a boundary layer pa-ma Main CFD Forum 0 October 11, 2010 12:15
Import problem ARC Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 February 27, 2010 11:56
Taging boundary faces with gmsh hamdaoui Main CFD Forum 0 October 9, 2007 14:02


All times are GMT -4. The time now is 21:11.