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] Problem with Gmsh (https://www.cfd-online.com/Forums/openfoam-meshing/61888-problem-gmsh.html)

nishant_hull November 23, 2007 12:09

Problem with Gmsh
 
Hi all..
I am trying to simulate naca aerofoil on foam using mesh from gmsh. i created a mesh using gmsh and convert it to foam polmesh format using gmshToFoam. I am repeatedly getting this warning...

--> FOAM Warning : Not using gmsh face 4(64 122 123 65) since zero vertex is not on boundary of polyMesh
--> FOAM Warning :
From function gmshToFoam
in file gmshToFoam.C at line 799
Could not match gmsh face 4(64 122 123 65) to any of the interior or exterior faces that share the same 0th point


However it is getting executed and I am getting polymesh directory with all files. but again... the files are reading just the points and not the faces or boundaries etc.
patches in boundary files are even taking nFace=0 and startface=0 in all patches.
The .geo file for my mesh is as follows:

Point (137) = {0.999972181112207, -3, 0.4, 0.1};
Point (138) = {0.999972181112207, -3, 0.5, 0.1};
Line (26) = {57, 61};
Line (27) = {59, 62};
Line (31) = {60, 66};
Line (35) = {58, 70};
Line (42) = {25, 77};
Line (43) = {102, 50};
Line (62) = {128, 77};
Line (63) = {25, 127};
Line (64) = {102, 130};
Line (65) = {50, 129};
Line (66) = {61, 128};
Line (67) = {70, 128};
Line (68) = {57, 127};
Line (69) = {58, 127};
Line (70) = {127, 128};
Line (71) = {62, 130};
Line (72) = {130, 129};
Line (73) = {59, 129};
Line (74) = {130, 66};
Line (75) = {129, 60};
CatmullRom (76) = {77, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102};
CatmullRom (77) = {102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77};
CatmullRom (78) = {50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
CatmullRom (79) = {25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50};
Line (108) = {136, 77};
Line (109) = {25, 135};
Line (110) = {102, 138};
Line (111) = {137, 50};
Line (112) = {138, 137};
Line (113) = {136, 135};
Line (114) = {132, 77};
Line (115) = {25, 131};
Line (116) = {132, 131};
Line (117) = {134, 133};
Line (118) = {133, 50};
Line (119) = {102, 134};
Line (124) = {61, 132};
Line (125) = {132, 134};
Line (126) = {134, 62};
Line (127) = {57, 131};
Line (128) = {131, 133};
Line (129) = {133, 59};
Line (130) = {70, 136};
Line (131) = {136, 138};
Line (132) = {138, 66};
Line (133) = {60, 137};
Line (134) = {137, 135};
Line (135) = {135, 58};
Line Loop (121) = {77, -42, 79, -43};
Plane Surface (121) = {121};
Line Loop (123) = {76, 43, 78, 42};
Plane Surface (123) = {123};
Line Loop (137) = {135, 35, 130, 113};
Plane Surface (137) = {137};
Line Loop (139) = {134, -113, 131, 112};
Plane Surface (139) = {139};
Line Loop (141) = {133, -112, 132, -31};
Plane Surface (141) = {141};
Line Loop (143) = {67, 62, -108, -130};
Plane Surface (143) = {143};
Line Loop (145) = {108, -77, 110, -131};
Plane Surface (145) = {145};
Line Loop (147) = {64, 74, -132, -110};
Plane Surface (147) = {147};
Line Loop (149) = {69, -63, 109, 135};
Plane Surface (149) = {149};
Line Loop (151) = {109, -134, 111, -79};
Plane Surface (151) = {151};
Line Loop (153) = {65, 75, 133, 111};
Plane Surface (153) = {153};
Line Loop (155) = {118, 65, -73, -129};
Plane Surface (155) = {155};
Line Loop (157) = {65, -72, -64, 43};
Plane Surface (157) = {157};
Line Loop (159) = {63, 70, 62, -42};
Plane Surface (159) = {159};
Line Loop (161) = {71, -64, 119, 126};
Plane Surface (161) = {161};
Line Loop (163) = {119, -125, 114, 76};
Plane Surface (163) = {163};
Line Loop (165) = {129, 27, -126, 117};
Plane Surface (165) = {165};
Line Loop (167) = {128, -117, -125, 116};
Plane Surface (167) = {167};
Line Loop (169) = {127, -116, -124, -26};
Plane Surface (169) = {169};
Line Loop (171) = {114, -62, -66, 124};
Plane Surface (171) = {171};
Line Loop (173) = {118, 78, 115, 128};
Plane Surface (173) = {173};
Line Loop (175) = {63, -68, 127, -115};
Plane Surface (175) = {175};
Line Loop (177) = {73, -72, -71, -27};
Plane Surface (177) = {177};
Line Loop (179) = {75, 31, -74, 72};
Plane Surface (179) = {179};
Line Loop (181) = {70, -66, -26, 68};
Plane Surface (181) = {181};
Line Loop (183) = {69, 70, -67, -35};
Plane Surface (183) = {183};
Line Loop (189) = {42, -114, 116, -115};
Plane Surface (189) = {189};
Line Loop (191) = {119, 117, 118, -43};
Plane Surface (191) = {191};
Line Loop (193) = {109, -113, 108, -42};
Plane Surface (193) = {193};
Line Loop (195) = {111, -43, 110, 112};
Plane Surface (195) = {195};
Surface Loop (185) = {143, 183, 149, 151, 139, 137, 145, 121, 147, 179, 153, 141, 157, 159};
Volume (185) = {185};
Surface Loop (187) = {163, 161, 177, 155, 173, 123, 175, 181, 171, 169, 167, 165, 159, 157};
Volume (187) = {187};
Physical Surface ("Inlet_5") = {137, 139, 141, 181, 183};
Physical Surface ("outlet_5") = {165, 167, 169, 177, 179};
Recombine Surface {163,171,161,177,143,145,147,157,121,159,175,181,1 83,137,139,141,149,151,173,155 ,153,179,165,167,169};

nishant_hull November 23, 2007 12:14

I again try to export mesh for
 
I again try to export mesh for a simple cube geometry ...
and then again the problem is same..
I am getting the same warning.

and similarly gmshToFoam is getting executed and I am getting polymesh directory with all files. but again... the files are reading just the points and not the faces or zones etc.
patches in boundary file is even taking nFace=0 and startface=0 in all patches.
The .geo file for my mesh is as follows:

Point(1) = {-1,1,0,0.1};
Point(2) = {1,1,0,0.1};
Point(3) = {1,-1,0,0.1};
Point(4) = {-1,-1,0,0.1};
Line(1) = {3,4};
Line(2) = {4,1};
Line(3) = {2,1};
Line(4) = {2,3};
Line Loop(5) = {4,1,2,-3};
Plane Surface(6) = {5};
Extrude {0,0,1} {
Surface{6};
}
Physical Surface(29) = {23};
Physical Surface(30) = {23};
Physical Surface(31) = {19};
Physical Surface(32) = {27};
Physical Surface(33) = {15};
Surface Loop(34) = {28,15,6,19,23,27};
Volume(35) = {34};

please suggest in this reagrd...

with regards ..

Nishant

7islands November 23, 2007 20:05

Hi Nishant, Note that Gmsh on
 
Hi Nishant,
Note that Gmsh only writes mesh for the parts where physical entities are defined if you define any physical entities. Thus you need to define physical surfaces for all the surfaces and a physical volume for the volume. For your cube case with some other corrections your .geo will be

Point(1) = {-1,1,0,0.1};
Point(2) = {1,1,0,0.1};
Point(3) = {1,-1,0,0.1};
Point(4) = {-1,-1,0,0.1};
Line(1) = {3,4};
Line(2) = {4,1};
Line(3) = {2,1};
Line(4) = {2,3};
Line Loop(5) = {4,1,2,-3};
Plane Surface(6) = {5};
e1[] = Extrude {0,0,1} {
Surface{6};
};
Physical Surface(29) = {e1[0]};
Physical Surface(30) = {e1[2]};
Physical Surface(31) = {e1[3]};
Physical Surface(32) = {e1[4]};
Physical Surface(33) = {e1[5]};
Surface Loop(34) = {6,e1[0],e1[2],e1[3],e1[4],e1[5]};
Physical Surface(1) = {6};
Physical Volume(1) = {e1[1]};

(you need Gmsh version >= 2.0.7 to load the corrected .geo). And if you'd like to use string labels for physical entity definitions ("Inlet_5" and "outlet_5" in your airfoil case) you want to try gmsh2ToFoam that comes with the gmshFoam package instead.

Takuya

nishant_hull November 26, 2007 14:49

Thanks Takuya .. My mesh i
 
Thanks Takuya ..

My mesh is generated now. However I am getting following error:

--> FOAM FATAL IO ERROR :
patch type 'patch' not constraint type 'empty'
for patch defaultFaces of field p in file "/home/343880/OpenFOAM/343880-1.4.1/run/tutorials/sonicTurbFoam/gmsh/0/p"

file: /home/343880/OpenFOAM/343880-1.4.1/run/tutorials/sonicTurbFoam/gmsh/0/p::default Faces from line 57 to line 57.

From function emptyFvPatchField<type>::emptyFvPatchField
(
const fvPatch& p,
const Field<type>& field,
const dictionary& dict
)

in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 101.

FOAM exiting


Can you make any comment? Where could possibly be the error?

thanks in advance ..

regards..
Nishant

7islands November 27, 2007 08:13

Hi Nishant, I can't say for s
 
Hi Nishant,
I can't say for sure with all the information you provided, but I guess you are trying to do a two dimensional computation by setting the third dimensional patch type to empty. If that's the case make sure the base patch types of both the mesh (constant/polyMesh/boundary) and the initial field file (0/p) are set to empty.

Takuya

nishant_hull November 30, 2007 07:15

Hi Takuya.. Thanks. I am s
 
Hi Takuya..

Thanks. I am still getting this error:-

Selecting turbulence model LaunderSharmaKE
Creating field DpDt

--> FOAM FATAL ERROR : This mesh contains patches of type empty but is not 1D or 2D
by virtue of the fact that the number of faces of this
empty patch is not divisible by the number of cells.

From function emptyFvPatchField<type>::updateCoeffs()
in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 148.

FOAM exiting


I guess.. I have some problem with the plane surafe generation at the fin. Can you suggest what standard method should I use for it?

nishant_hull November 30, 2007 07:27

I guess.. I have some problem
 
I guess.. I have some problem with the plane surafe generation at the airfoil surface (where I need to put the boundary condition). Can you suggest what standard method should I use for it in gmsh?
Please see your email where I send my mesh file.

With regards ..


Nishant Singh

7islands November 30, 2007 19:03

Hi Nishant, As of now I still
 
Hi Nishant,
As of now I still haven't received a mail from you... maybe sent to some wrong address? Could you post the .geo here via the attachment feature since I prefer to have all the discussions on the board (to use the attachment feature, see the Formatting section under the Documentation tree in the pane left of the board screen).

Takuya

nishant_hull December 2, 2007 11:56

Hi Takuya .. Sorry for repl
 
Hi Takuya ..

Sorry for replying late. The .geo and mesh file is attached here.
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif aerofoil-quater2
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif aerofoil

nishant_hull December 2, 2007 12:29

Do not use the aerofoil mesh f
 
Do not use the aerofoil mesh file. thats not the right file. Sorry fpr attaching that.
Plese check the way I describe the aerofoil surface plane in the .geo file. I would be glad to see ur comments in this regard.
and Thanks you for, letting me know the attachment related links.

Nishant Singh

nishant_hull December 2, 2007 13:11

Please overlook the previous f
 
Please overlook the previous files and see these files:-
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif aerofoil-quater2
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif boundary
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif U

7islands December 3, 2007 04:48

Hi Nishant, In a nutshell, in
 
Hi Nishant,
In a nutshell, in OpenFOAM a 2D case should consist of an extruded surface mesh, i. e. a mesh with the identical bottom and top patches of type empty and with a single cell height.

Here I'm attaching a corrected .geo and other files for minimal setup copied from the sonicTurbFoam/nacaAirfoil case with appropriate patch name corrections. You'll need Gmsh version >= 2.0.7 and gmsh2ToFoam to convert the .geo to the polyMesh format. Also note that you would want to correct the case setup as necessary since other than the patch name changes the case setup is verbatim from the nacaAirfoil case (I only confirmed the case runs at least up to 1e-5 s).
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif nishantAirfoil.tar.gz
Takuya

nishant_hull December 3, 2007 08:57

Thanks for the help Takuya. I
 
Thanks for the help Takuya. I hope to proceed further now. However I have few problem with my set up of Foam. I could not be able to recompile my Foam package. So I wanted to ask, if the gnsh2ToFoam need recompilation of complete Foam or just the binaries of the package will do? Let me know. I am using Openfoam 1.4.1.

Thnak you once again http://www.cfd-online.com/OpenFOAM_D...part/happy.gif
Nishant

7islands December 3, 2007 09:30

You can download and read usag
 
You can download and read usage instructions of gmsh2ToFoam here. You just have to compile the gmshFoam package and no necessity of recompiling the whole OpenFOAM sources. Or if the installation procedure seems too much of work to you, just using the stock gmshToFoam with some hand-editing constant/polyMesh/boundary after conversion will do (you have to do the hand-editing every time you do the conversion though).

Takuya

nishant_hull December 3, 2007 16:02

Hi Takuya... Thank you so
 
Hi Takuya...

Thank you so much. I really like the gmsh2ToFoam. Its a excellent piece of work. I could be able to run the sonicTurbFoam case.
Thank you for the help http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Nishant

touf December 6, 2007 08:31

Hi Takuya, Your example fil
 
Hi Takuya,

Your example file is very good.
Please just one question: How GMSH is numbering when extruding?
I saw that results from extrusion are stocked to arrays (e1[] and e2[]), but I didn't find how to know which number in the array is face, volume,...

Touf

7islands December 6, 2007 23:06

Hi Touf, Well, it's a bit dif
 
Hi Touf,
Well, it's a bit difficult to explain... Let's take the Nishant's case for example:

Line Loop (149) = {69, -63, 109, 135};
Plane Surface (149) = {149};
Line Loop (151) = {109, -134, 111, -79};
Plane Surface (151) = {151};
Line Loop (153) = {65, 75, 133, 111};
Plane Surface (153) = {153};
e1[] = Extrude {0, 0, 0.1} {Surface{149, 151, 153}; Layers{1}; Recombine;};

In this case the elements of the array e1[] are
e1[0]: the id of the extruded opposite surface of the first surface specified in the Extrude command (Surface 149)
e1[1]: the id of the extruded volume of Surface 149
e1[2] - e1[5]: the id's of the lateral surfaces, in the order of the Lines 69, 63, 109 and 135 in the corresponding "base" Line Loop 149, which constructs Surface 149
e1[6]: the id of the extruded opposite surface of the second surface specified in the Extrude command (Surface 151)
e1[7]: the id of the extruded volume of Surface 151
e1[8]-e1[11]: the id's of the lateral surfaces, in the order of the Lines 109, 134, 111 and 79 in the corresponding "base" Line Loop 151, which constructs Surface 151
e1[12] - e1[17]: same as in the first two surfaces specified in the Extrude command, but for Surface 153
.

The order of the lateral surfaces may not be guaranteed since AFAIK it is undocumented. Hope you get the idea http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Takuya

touf December 7, 2007 01:33

Hi Takuya, Thanks for the exp
 
Hi Takuya,
Thanks for the explainations, it's now more clear
Touf

rafa13 April 22, 2015 08:43

gmsh problem
 
Hi everybody,
I am struggling hart wirh the periodic line command on gmsh, i am trying to create mesh a triangular geometry with quads and triangles. I want to force 2 line to connect each other with the mesh...simply straight lines but it doesn't work for know! maybe some body with a idea?

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

I searched in many places on the internet but there isn't many information about this command.

greetings and thanks to all
Rafa marques

KateEisenhower July 31, 2015 05:10

Quote:

Originally Posted by 7islands (Post 203592)
You can download and read usage instructions of gmsh2ToFoam here. You just have to compile the gmshFoam package and no necessity of recompiling the whole OpenFOAM sources. Or if the installation procedure seems too much of work to you, just using the stock gmshToFoam with some hand-editing constant/polyMesh/boundary after conversion will do (you have to do the hand-editing every time you do the conversion though).

Takuya

Hello foamers,

I have some problem with gmshToFoam producing a default patch. Could gmsh2ToFoam help me here or is gmshToFoam already corrected. I am asking because the cited post is from 2007.

Any help is appreciated! Best regards,

Kate


All times are GMT -4. The time now is 17:03.