CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] Default Faces on Boundary Layer

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mattijs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2008, 11:20
Default Default Faces on Boundary Layer
  #1
New Member
 
Axel Hackbarth
Join Date: Mar 2009
Posts: 6
Rep Power: 17
axel is on a distinguished road
I am using the 'new' GMSH boundary layer command. I meshed a 3D-wing and it looks really nice in GMSH (with all physical surfaces / volumes defined correctly).
I have many boundary layer volumes on the surface of the wing, outside a box filled with tetrahedras and the outer boundary layer surface (which is NOT a physical surface, thus should not be exported - loading .msh file in GMSH shows it correctly).

Conversion with gmsh2ToFoam results in many errors:
meshes/meshShapes/cellModel/cellModel::centre at line 76: zero or negative pyramid volume

and once:
meshes/polyMesh/polyMeshFromShapeMesh::polyMesh at line 577 found 19702 undefined faces in mesh -> adding to default patch

Somehow there are just 1678 faces in defaultFaces (but there should be none in there). These faces are partly randomly, partly symmetrically distributed over the wing. Sometimes connected, sometimes not. They are the outer hull of the boundary layer, but just ~20% of it.

checkMesh failed in 6 mesh checks. I have ~250000 prisms and ~250000 tets, and mysteriously 59 polyhedras.
The thing is that it worked correctly without the boundary layer.

One possible workaround could be to mark the defaultFaces patch as some kind of invisible, but I did not find such option.

If you need more information I'll be glad to post them. I could also post a simple box example that behaves similarly.

Help is greatly appreciated,

Axel
axel is offline   Reply With Quote

Old   August 7, 2008, 11:51
Default Ok, here comes one example whe
  #2
New Member
 
Axel Hackbarth
Join Date: Mar 2009
Posts: 6
Rep Power: 17
axel is on a distinguished road
Ok, here comes one example where the main problem still occurs (the mysterious defaultFaces, but the checkMesh is OK.

Regards,

Axel

just copy and paste to GMSH and mesh it, then use gmsh2ToFoam to transform to OpenFOAM:

// ############ create inner box (wing) ############
scale = 1;

lcBox=0.1*scale;

xmax=+scale;
xmin=-scale;
ymax=+scale;
ymin=-ymax;
zmax=+scale;
zmin=-zmax;

// create points of sidewall
i=-1;
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymax, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymax, zmin, lcBox};
I=i;

// create lines of sidewall
ii[]={0:I,0};
For i In {0:I}
lBox[i] = newl; Line(lBox[i]) = {pBox[i],pBox[ii[i+1]]};
EndFor
// create line loop and surface of sidewall
llBox = newll; Line Loop (llBox) = {lBox[0]:lBox[I]};
sTmp = news; Ruled Surface (sTmp) = {llBox};

sBox[] = Extrude {0,0,zmax-zmin} {Surface{sTmp};};
vBox = sBox[1];
// delete box volume
Delete{Volume{vBox};}
sBox[1] = -sTmp;
slBox = newsl; Surface Loop (slBox) = {-sBox[]};


surfaceWing[] = sBox[];
slWing = newsl; Surface Loop (slWing) = {surfaceWing[]};
// create physical elements - only physical elements are exported in mesh
Physical Surface("Wing") = {surfaceWing[]};


// ############ create outer box ############

scale = scale*2;

lcBox=0.1*scale;

xmax=+scale;
xmin=-scale;
ymax=+scale;
ymin=-ymax;
zmax=+scale;
zmin=-zmax;

// create points of sidewall
i=-1;
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymax, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymax, zmin, lcBox};
I=i;

// create lines of sidewall
ii[]={0:I,0};
For i In {0:I}
lBox[i] = newl; Line(lBox[i]) = {pBox[i],pBox[ii[i+1]]};
EndFor
// create line loop and surface of sidewall
llBox = newll; Line Loop (llBox) = {lBox[0]:lBox[I]};
sTmp = news; Ruled Surface (sTmp) = {llBox};

sBox[] = Extrude {0,0,zmax-zmin} {Surface{sTmp};};
vBox = sBox[1];
// delete box volume
Delete{Volume{vBox};}
sBox[1] = -sTmp;
slBox = newsl; Surface Loop (slBox) = {-sBox[]};

// create physical elements - only physical elements are exported in mesh
Physical Surface("sidewalls") = {};
Physical Surface("inlet") = {sBox[1],sBox[2],sBox[5]};
Physical Surface("outlet") = {sBox[0],sBox[4],sBox[3]};

// ############ boundary layer creation ############
BLlayers = 2;
BLgrowth = 2;
cells[] = {1,1};
heights = lcBox/10;
heights[1] = heights * (BLgrowth+1);
For i In {2:BLlayers-1}
// Printf("new %g",i);
cells[i] = 1;
heights[i] = heights[i-1] + BLgrowth * (heights[i-1] -heights[i-2]);
EndFor

tmp[] = Extrude{Surface{surfaceWing[]};Layers{cells[],heights[]};Recombine;};

// all boundary layer volumes and top surfaces
vBL[] = {tmp[1]:tmp[# tmp[]-5]};
sBL[] = {tmp[0]:tmp[# tmp[]-6]:22};
slBL = newsl; Surface Loop (newsl) = {-sBL[]};

// ########## volume creation #############
vAir = newv; Volume(newv) = {slBox,slBL};
// create physical elements - only physical elements are exported in mesh
Physical Volume ("air") = {vAir,vBL[]};
axel is offline   Reply With Quote

Old   August 7, 2008, 15:08
Default That file creates a somewhat s
  #3
Senior Member
 
Oliver Gloth
Join Date: Mar 2009
Location: Todtnau, Germany
Posts: 121
Rep Power: 17
ogloth is on a distinguished road
That file creates a somewhat strange grid for me: There is a boundary layer placed in the middle of the cube which is completely filled with hexes -- no connection between tetras and prisms ...
ogloth is offline   Reply With Quote

Old   August 7, 2008, 15:17
Default You have a defaultFaces patch
  #4
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
You have a defaultFaces patch inbetween your tets and prisms. Seems the tets and prisms use different points so the converter correctly says that they are not connected.
aow likes this.
mattijs is offline   Reply With Quote

Old   August 7, 2008, 15:39
Default I am either doing something wr
  #5
Senior Member
 
Oliver Gloth
Join Date: Mar 2009
Location: Todtnau, Germany
Posts: 121
Rep Power: 17
ogloth is on a distinguished road
I am either doing something wrong or the resulting grid is weird. There is a tet mesh inside and outside of the box ... The outer surface of the prisms seems to be connected to the outside tet mesh and the inside tet mesh (see attached image, prisms are the green things).
ogloth is offline   Reply With Quote

Old   August 8, 2008, 05:14
Default Hi Oliver, you might need t
  #6
New Member
 
Axel Hackbarth
Join Date: Mar 2009
Posts: 6
Rep Power: 17
axel is on a distinguished road
Hi Oliver,

you might need to download the nightly build of GMSH. The boundary layer command had a little error that has just recently been fixed.
It should look like this:


After conversion with gmsh2ToFoam it comes out like this:


@Mattijs
Thanks for your help, so you think the problem lies within GMSH and the boundary layer command?
If yes, do you have any idea on how to fix it, since the .geo file does not define multiple points / surfaces.
The weird thing is that there are just 8 faces in defaultFaces (in 2 groups of 4), but all other faces are OK.
axel is offline   Reply With Quote

Old   August 20, 2008, 04:47
Default Ok, I found the error. It lies
  #7
New Member
 
Axel Hackbarth
Join Date: Mar 2009
Posts: 6
Rep Power: 17
axel is on a distinguished road
Ok, I found the error. It lies within GMSH and is due to the smoothing algorithm of the 3D mesh generation with Tetgen.
Using Netgen algorithm works fine.
axel is offline   Reply With Quote

Old   September 17, 2009, 15:59
Default This example really helped me a lot. I feel very grateful to you.
  #8
New Member
 
Zhu Xiaofeng
Join Date: Sep 2009
Posts: 4
Rep Power: 17
boubalos is on a distinguished road
After seeing your example, I noticed that when creating boundary layer meshs by "Extrude{Surface{}...}" , gmsh will not show lines and points created. This is why people have difficulty using this method.

So I have to find these lines and points in Tools/Visibility

and I attach a geo file which is simpler and more straight-forward

Quote:
Originally Posted by axel View Post
Ok, here comes one example where the main problem still occurs (the mysterious defaultFaces, but the checkMesh is OK.

Regards,

Axel

just copy and paste to GMSH and mesh it, then use gmsh2ToFoam to transform to OpenFOAM:

// ############ create inner box (wing) ############
scale = 1;

lcBox=0.1*scale;

xmax=+scale;
xmin=-scale;
ymax=+scale;
ymin=-ymax;
zmax=+scale;
zmin=-zmax;

// create points of sidewall
i=-1;
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymax, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymax, zmin, lcBox};
I=i;

// create lines of sidewall
ii[]={0:I,0};
For i In {0:I}
lBox[i] = newl; Line(lBox[i]) = {pBox[i],pBox[ii[i+1]]};
EndFor
// create line loop and surface of sidewall
llBox = newll; Line Loop (llBox) = {lBox[0]:lBox[I]};
sTmp = news; Ruled Surface (sTmp) = {llBox};

sBox[] = Extrude {0,0,zmax-zmin} {Surface{sTmp};};
vBox = sBox[1];
// delete box volume
Delete{Volume{vBox};}
sBox[1] = -sTmp;
slBox = newsl; Surface Loop (slBox) = {-sBox[]};


surfaceWing[] = sBox[];
slWing = newsl; Surface Loop (slWing) = {surfaceWing[]};
// create physical elements - only physical elements are exported in mesh
Physical Surface("Wing") = {surfaceWing[]};


// ############ create outer box ############

scale = scale*2;

lcBox=0.1*scale;

xmax=+scale;
xmin=-scale;
ymax=+scale;
ymin=-ymax;
zmax=+scale;
zmin=-zmax;

// create points of sidewall
i=-1;
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymax, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmin, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymin, zmin, lcBox};
i=i+1; pBox[i]=newp; Point (pBox[i]) = {xmax, ymax, zmin, lcBox};
I=i;

// create lines of sidewall
ii[]={0:I,0};
For i In {0:I}
lBox[i] = newl; Line(lBox[i]) = {pBox[i],pBox[ii[i+1]]};
EndFor
// create line loop and surface of sidewall
llBox = newll; Line Loop (llBox) = {lBox[0]:lBox[I]};
sTmp = news; Ruled Surface (sTmp) = {llBox};

sBox[] = Extrude {0,0,zmax-zmin} {Surface{sTmp};};
vBox = sBox[1];
// delete box volume
Delete{Volume{vBox};}
sBox[1] = -sTmp;
slBox = newsl; Surface Loop (slBox) = {-sBox[]};

// create physical elements - only physical elements are exported in mesh
Physical Surface("sidewalls") = {};
Physical Surface("inlet") = {sBox[1],sBox[2],sBox[5]};
Physical Surface("outlet") = {sBox[0],sBox[4],sBox[3]};

// ############ boundary layer creation ############
BLlayers = 2;
BLgrowth = 2;
cells[] = {1,1};
heights = lcBox/10;
heights[1] = heights * (BLgrowth+1);
For i In {2:BLlayers-1}
// Printf("new %g",i);
cells[i] = 1;
heights[i] = heights[i-1] + BLgrowth * (heights[i-1] -heights[i-2]);
EndFor

tmp[] = Extrude{Surface{surfaceWing[]};Layers{cells[],heights[]};Recombine;};

// all boundary layer volumes and top surfaces
vBL[] = {tmp[1]:tmp[# tmp[]-5]};
sBL[] = {tmp[0]:tmp[# tmp[]-6]:22};
slBL = newsl; Surface Loop (newsl) = {-sBL[]};

// ########## volume creation #############
vAir = newv; Volume(newv) = {slBox,slBL};
// create physical elements - only physical elements are exported in mesh
Physical Volume ("air") = {vAir,vBL[]};
Attached Files
File Type: txt testextrude4.geo.txt (1.1 KB, 103 views)
boubalos is offline   Reply With Quote

Old   February 17, 2011, 08:47
Default
  #9
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
Quote:
Originally Posted by axel View Post
I am using the 'new' GMSH boundary layer command. I meshed a 3D-wing and it looks really nice in GMSH (with all physical surfaces / volumes defined correctly).
I have many boundary layer volumes on the surface of the wing, outside a box filled with tetrahedras and the outer boundary layer surface (which is NOT a physical surface, thus should not be exported - loading .msh file in GMSH shows it correctly).

Conversion with gmsh2ToFoam results in many errors:
meshes/meshShapes/cellModel/cellModel::centre at line 76: zero or negative pyramid volume

and once:
meshes/polyMesh/polyMeshFromShapeMesh:olyMesh at line 577 found 19702 undefined faces in mesh -> adding to default patch

Somehow there are just 1678 faces in defaultFaces (but there should be none in there). These faces are partly randomly, partly symmetrically distributed over the wing. Sometimes connected, sometimes not. They are the outer hull of the boundary layer, but just ~20% of it.

checkMesh failed in 6 mesh checks. I have ~250000 prisms and ~250000 tets, and mysteriously 59 polyhedras.
The thing is that it worked correctly without the boundary layer.

One possible workaround could be to mark the defaultFaces patch as some kind of invisible, but I did not find such option.

If you need more information I'll be glad to post them. I could also post a simple box example that behaves similarly.

Help is greatly appreciated,

Axel



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 file.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;


Morevoer, I would like to undertand how to use the new boundary-layer command present in the last release of GMSH.


Your Sincerely,


Claudio Comis
Attached Images
File Type: jpg Problem.jpg (96.2 KB, 147 views)
claco 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
Prismatic boundary layer KateEisenhower enGrid 5 September 15, 2015 08:48
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[Gmsh] Vertex numbering is dense KateEisenhower OpenFOAM Meshing & Mesh Conversion 7 August 3, 2015 11:49
[OpenFOAM.org] OF2.3.1 + OS13.2 - Trying to use the dummy Pstream library aylalisa OpenFOAM Installation 23 June 15, 2015 15:49
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00


All times are GMT -4. The time now is 04:37.