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

[Gmsh] Problem with Gmsh

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2007, 12:09
Default Problem with Gmsh
  #1
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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};
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   November 23, 2007, 12:14
Default I again try to export mesh for
  #2
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   November 23, 2007, 20:05
Default Hi Nishant, Note that Gmsh on
  #3
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   November 26, 2007, 14:49
Default Thanks Takuya .. My mesh i
  #4
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   November 27, 2007, 08:13
Default Hi Nishant, I can't say for s
  #5
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   November 30, 2007, 07:15
Default Hi Takuya.. Thanks. I am s
  #6
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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?
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   November 30, 2007, 07:27
Default I guess.. I have some problem
  #7
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   November 30, 2007, 19:03
Default Hi Nishant, As of now I still
  #8
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   December 2, 2007, 11:56
Default Hi Takuya .. Sorry for repl
  #9
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
Hi Takuya ..

Sorry for replying late. The .geo and mesh file is attached here.
aerofoil-quater2
aerofoil
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   December 2, 2007, 12:29
Default Do not use the aerofoil mesh f
  #10
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   December 2, 2007, 13:11
Default Please overlook the previous f
  #11
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
Please overlook the previous files and see these files:-
aerofoil-quater2
boundary
U
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   December 3, 2007, 04:48
Default Hi Nishant, In a nutshell, in
  #12
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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).
nishantAirfoil.tar.gz
Takuya
7islands is offline   Reply With Quote

Old   December 3, 2007, 08:57
Default Thanks for the help Takuya. I
  #13
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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
Nishant
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   December 3, 2007, 09:30
Default You can download and read usag
  #14
Super Moderator
 
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20
7islands is on a distinguished road
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
7islands is offline   Reply With Quote

Old   July 31, 2015, 05:10
Default
  #15
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by 7islands View Post
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
KateEisenhower is offline   Reply With Quote

Old   August 4, 2015, 07:03
Default
  #16
Member
 
Rafael Marques
Join Date: Mar 2014
Location: Almada/Mülheim a.d. Ruhr, Portugal/Germany
Posts: 67
Rep Power: 12
rafa13 is on a distinguished road
Hi Kate,

I think that gmsh2ToFoam are not for above OF1.4.1. When i get this default faces problem mostly it is because of the definition of the physical surfaces that are not defined. I you get default faces in the interior of the mesh try to remove the mesh with topoSet, or simply go to constant/polymesh/boundry and look if there are 0 faces if so delete the hole boundry and change the number of the top left of the file, this number indicates how many boundry do you have. try it maybe it works

Kind regards
Rafa Marques
rafa13 is offline   Reply With Quote

Old   August 4, 2015, 10:42
Default
  #17
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hi Rafael,

thanks for your opinion! Unfortunately there are more than 0 faces in it. However, I'll have a look at topoSet!

Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   August 4, 2015, 22:12
Default Answer
  #18
Senior Member
 
tareqkh's Avatar
 
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16
tareqkh is on a distinguished road
Hey Kate,

Could you be more specific by sharing your case?

Best,
tareqkh is offline   Reply With Quote

Old   August 5, 2015, 02:09
Default
  #19
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Dear Tareqkh,

unfortunately I am not allowed to share this stuff. I'll try to describe it however. I have a part of a wing which I want to mesh with a boundary layer all around it. At the trailing edge gmsh has serious problems to create a decent mesh. I keep getting lots of non manifold faces, wrong oriented faces and so on. My default faces are located in the same area and I am quite sure this is related to the overall bad quality of the mesh at this location.
So my primary objective is to solve this problems and I hope the default face are going to disappear after that anyways.
If I wouldn't work with an imported stl geometry, I'm sure I could solve this by using transfinite entities around the trailing edge but somehow I have trouble combining them with my imported and extruded stl geometry.

Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   December 3, 2007, 16:02
Default Hi Takuya... Thank you so
  #20
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 166
Rep Power: 17
nishant_hull is on a distinguished road
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

Nishant
__________________
Thanks and regards,

Nishant
nishant_hull 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
Problem diverges when exhaust valve opens swerner0711 AVL FIRE 0 September 21, 2018 07:14
[Gmsh] gmsh meshing problem CHAYANIT OpenFOAM Meshing & Mesh Conversion 0 September 5, 2018 08:08
Gmsh problem liub Mesh Generation & Pre-Processing 0 December 17, 2015 13:26
[Gmsh] gmsh problem djamel OpenFOAM Meshing & Mesh Conversion 0 January 7, 2014 13:02
[Gmsh] Ubuntu 12.10 Gmsh installation problem sudo OpenFOAM Meshing & Mesh Conversion 0 November 7, 2013 12:47


All times are GMT -4. The time now is 07:49.