CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] gmshToFoam undefined faces (https://www.cfd-online.com/Forums/openfoam-meshing/63953-gmshtofoam-undefined-faces.html)

benconnell April 24, 2009 10:31

gmshToFoam undefined faces
 
Hi-

I'm trying to learn how to create meshes in gmsh and import them to openfoam. I think I'm following the proper approach, but when i use gmshtofoam i get a warning that there are undefined faces which are put in a default patch called "defaultFaces".

The number of undefined faces is the same as the number of non-volumetric elements (lines and triangles) listed in the msh file. The openfoam grid is generated, but I have this defaultFaces patch that I need to set boundary conditions for ... and I don't know what these conditions should be set as.

I have the same problem when using the sample CubeVer1.msh from the openfoam installation, so I don't think it's an issue with the way I'm generating my mesh in gmsh.

Am I missing something? Any insight as to how I should set the defaultFaces patch boundary conditions? I was considering writing a program to remove the non-volumetric elements from the msh file.

Any help is much appreciated.

Thanks
-Ben

benconnell April 24, 2009 11:55

I stripped the non-volumetric elements out the the .msh file to test the effect, gmshtofoam still gave the same number of undefined faces.

For the original .msh file it set the p and U boundaries to zerogradient to see what would happen. That solution doesn't look right.

-Ben

louisgag April 24, 2009 14:52

Hi Ben,

Usually you want to define physical surfaces for each patch and a physical volume for the whole mesh. From there, I would not worry about a undefined faces warning and would also not define them in the boundary file.

have fun,


-Louis

benconnell April 24, 2009 15:18

Thanks Louis-

I did have defined physical surfaces and a physical volume, but it still gave the warning. Of all the combination of things I thought I tried, I guess I didn't try the right combination. When I finally deleted the defaultFaces patch from the "boundary" file (and reduced the corresponding integer number of faces above by one), I was able to ignore the warning and run successfully.

Thanks very much for your help,
-Ben

benconnell April 24, 2009 15:20

.... in the message above I guess I should have said "integer number of boundary surfaces" (not faces)

louisgag April 24, 2009 15:28

glad you got it working

-Louis

T.D. October 8, 2010 11:28

Hi
 
Hi
i deleted defaultFaces, but i don't know where to remove 1 from the faces, can you explain clearly in which file?
because in my boundary File i have:

defaultFaces
{
type patch;
nFaces 0;
startFace 1783;
}


when i delete it all, it says error:
Expected a ')' or a '}' while reading PtrList, etc.....

help please,

is there any better solution by drawing in gmsh and to get these defaultFaces after conversion by gmshToFoam?

thanks a lot

louisgag October 8, 2010 12:50

In that same file, before the list of faces there is a number, lower that number by one.

Something like

Code:

6
(

face1

face2

...

face6
)

regards,

-Louis

benconnell October 12, 2010 10:49

I think I had originally misspoke in the above thread, but corrected myself. I meant to reduce the indicated number of surfaces by one in the boundary file (as Louis describes), so that the number listed after removing defaultFaces corresponds to the number at top.

I believe someone posted the instructions on how to set up your GMSH file properly so you don't get defaultFaces, but the method described above works for me and is pretty easy so I haven't changed my ways.

Sorry for the late reply (long weekend in the US), and thanks to Louis for picking this up.

-Ben

T.D. October 12, 2010 13:05

Thanks
 
Hi
thanks a lot
it worked

thanks

T.D.

MaxJets March 30, 2015 10:06

gmshtofoam problem, creation of DefaultFaces
 
p { margin-bottom: 0.25cm; line-height: 120%; } He llo everyone,


I'm working with OpenFOAM and I would like to study an impinging air jet on a cylinder. I have got a problem with gmshtoFoam. Indeed, I made the geometry and the mesh with GMSH. I defined the boundaries (inlet, outlet … and the internal domain).


GMSH file :
[...]
Physical Surface("Inlet") = {131, 132, 133, 136, 137};
Physical Surface("WallBuse") = {129, 130, 134, 135};
Physical Surface("FinBuse") = { 97, 100, 104, 108};
Physical Surface("Top") = {309, 306, 311, 279, 276, 273, 208, 205, 211, 216, 214, 218, 345, 343, 344, 379, 377, 381, 114, 119, 117, 111, 202, 203};
Physical Surface("Bottom") = {247, 246, 242, 245, 244, 243, 222, 221, 220, 313, 312, 314, 347, 348, 349};
Physical Surface("FrontBack") = {17, 18, 19, 20, 21, 16, 15, 333, 13, 6, 5, 197, 265, 12, 1, 2, 3, 51, 52, 53, 11, 9, 54, 50, 49, 7, 4, 25, 28, 29, 30, 33, 24, 27, 39, 31, 34, 23, 38, 37, 35, 40, 41, 42, 44, 45, 48, 32, 36, 47, 46, 43, 26, 22};
Physical Surface("LeftRight") = {282, 285, 287, 292, 290, 293, 300, 302, 298, 308, 307, 310, 355, 350, 356, 363, 362, 360, 366, 371, 370, 378, 376, 380};
Physical Surface("Cylinder") = {164, 166, 167, 165, 162, 163, 60, 61, 62, 63, 55, 56, 57, 58, 59, 142, 141, 140, 139, 138, 182, 185, 184, 180, 181, 183};


Physical Volume("Internal") = {1:102};




I used gmshtoFoam without problem to conver the mesh to OpenFOAM.
But when I open the boundary file, I can read :
[...]
9
(
FrontBack
{
type patch;
physicalType patch;
nFaces 11308;
startFace 1482584;
}
Cylinder
{
type patch;
physicalType patch;
nFaces 6592;
startFace 1493892;
}
FinBuse
{
type patch;
physicalType patch;
nFaces 1120;
startFace 1500484;
}
Top
{
type patch;
physicalType patch;
nFaces 8224;
startFace 1501604;
}
WallBuse
{
type patch;
physicalType patch;
nFaces 560;
startFace 1509828;
}
Inlet
{
type patch;
physicalType patch;
nFaces 260;
startFace 1510388;
}
Bottom
{
type patch;
physicalType patch;
nFaces 5332;
startFace 1510648;
}
LeftRight
{
type patch;
physicalType patch;
nFaces 11524;
startFace 1515980;
}
defaultFaces ←---------------- ???
{
type patch;
nFaces 1216;
startFace 1527504;
}
)


I don't understand why there is a region called « defaultFaces »
I made a first similar mesh with the same method and I did'nt have this kind of problem


Maybe someone can help me


Thank you in advance


Max

alexeym March 30, 2015 10:27

Hi,

defaultFaces patch consists of the faces at the boundary of your mesh which do not belong to any physical group. You can visualize defaultFaces in paraview to see what you have forgotten.

MaxJets March 30, 2015 11:04

Hello Alexeym,

Thank you for your answer.
Actually, with Paraview, I can see thaht the defaultFaces is a surface in the internal domain and not at the boundary of my mesh.

alexeym March 30, 2015 11:20

Hi,

With the amount of information you have provided it is rather difficult to diagnose the error. defaultFaces can be two planes in front of each other. It may look as an internal plane but still be two boundary planes.

MaxJets March 31, 2015 01:51

Hello,

Yes, I know... I can't send you the file.geo because it's too big...
I'm going to check the GSMH script

Thank you a lot for your quick answer

MaxJets March 31, 2015 08:06

Ok I found the error. On the GMSH script, a face was defined two times with different label...
Now, it works.

Thank you Alexeym

rafa13 April 7, 2015 16:25

default internalfaces
 
Hi everybody,

i am simulating a porous wavebreaker and to create the geometry i create internalfaces for better meshing.this faces are named defaultfaces at openfoam, so I dont know how to define them, can i define this faces as empty in the polymesh/boundry folder? is it a good ou a bad idea?

geatings

Rafael

rafa13 April 21, 2015 19:39

Gmsh mesh problem
 
Hi everybody,

I know that this is not the right thread for this question, but maybe someone of you can help me with this issue.

someone knows how to use the periodic line command on gmsh?

I am trying to force point to mesh each other i a triangle to create a quadrangular mesh but I get a unstructed mesh and the points are not connection to each other.

thanks to all and sorry about the post in a wrong threat.

RM

louisgag April 22, 2015 03:43

Dear Rafael,
I remember struggling with Periodic Lines... and I think I gave up because something didn't work when meshing them..
I did succeed in making a structured 2D boundary layer with Gmsh, I think part of the solution comes from the NACA example given on the Gmsh mailing list, which is also the forum where your message might receive a better answer...
http://www.geuz.org/pipermail/gmsh/2009/004532.html
My latest approach for boundary layers was to use « Transfinite Line » and « Transfinite Surface ».
Good luck,
-Louis

rafa13 April 22, 2015 08:23

Gmsh mesh problem
 
Hi Louis,

thanks for you answer and thanks for your help. I have already created a structured mesh with the transfinite line/surface command but the problem is when i am meshing a triangular geometry, the transfinite algorithm connect 2 line and the 3rd line is connected with the opposite vertex.

But thanks a lot i 'm trying my luck at the forum that you recommended.

Greats
Rafael Marques


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