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

[Gmsh] gmshToFoam: strange error

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By alexeym
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2015, 02:58
Default gmshToFoam: strange error
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Dear Foamers,

could you help me with this: I do have a question about the utility gmsh. I have done a very simple geometry: one cylinder inside the other one and I have created a mesh with gmsh.

It seems to be a good mesh, but when I try to convert it using gmshTo Foam, I get this error:

Code:
szampini@archimede:~/Documenti/Afros/CFDSimulations/01dielectricCylinder$ mshToFoam meshGeneration.msh 
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.3.1-262087cdf8db
Exec   : mshToFoam meshGeneration.msh
Date   : Jan 20 2015
Time   : 08:45:16
Host   : "archimede"
PID    : 25055
Case   : /home/szampini/Documenti/Afros/CFDSimulations/01dielectricCylinder
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time



--> FOAM FATAL IO ERROR: 
wrong token type - expected int, found on line 1 the word '$MeshFormat'

file: meshGeneration.msh at line 1.

    From function operator>>(Istream&, int&)
    in file primitives/ints/int/intIO.C at line 68.

FOAM exiting

szampini@archimede:~/Documenti/Afros/CFDSimulations/01dielectricCylinder$
Could you help?

Also, if I want to add patches name, could I do this with gmsh?

Thanks a lot,
Samuele
samiam1000 is offline   Reply With Quote

Old   January 20, 2015, 03:17
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

If you'd like to use gmshToFoam, use gmshToFoam, not mshToFoam as latter is Fluent mesh converter.
alexeym is offline   Reply With Quote

Old   January 20, 2015, 03:22
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Yeah,

that's what I did (I wrote it wrong in the post: I'm gonna to change it!).

Anyway, I solved this cleaning up everything and doing it again.

Also, as far as the patches are concerned, how can I give them a name?

Thanks a lot,
Samuele
samiam1000 is offline   Reply With Quote

Old   January 20, 2015, 03:30
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
In case of physical groups you can use strings instead of numbers, here's a fragment of the GEO file (if you start with GEO)

Code:
...
Physical Surface("bottom") = {14};
Physical Surface("top") = {16};
Physical Surface("sides") = {24, 18, 20, 22};
...
I don't know how to set string IDs in gmsh GUI, usually I edit file in external editor.

If you just have MSH file there's PhysicalNames section of the file, where you can set the names:

Code:
$PhysicalNames
4
2 1 "bottom"
2 2 "top"
2 3 "sides"
3 4 "cuboid"
$EndPhysicalNames
Second column is IDs of the physical groups.
alexeym is offline   Reply With Quote

Old   January 20, 2015, 04:17
Default
  #5
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Great,

thanks a lot!

Samuele!

PS: could you check me .geo file, letting me know if it is "nice"?

Code:
Point(1) = {0,0,0};
Point(18) = {0,0.55,0};

Point(2) = {0.0125,0,0};
Point(3) = {0,0,0.0125};
Point(4) = {-0.0125,0,0};
Point(5) = {0,0,-0.0125};

Point(6) = {0.005,0,0};
Point(7) = {0,0,0.005};
Point(8) = {-0.005,0,0};
Point(9) = {0,0,-0.005};

Point(10) = {0.0125,0.55,0};
Point(11) = {0,0.55,0.0125};
Point(12) = {-0.0125,0.55,0};
Point(13) = {0,0.55,-0.0125};

Point(14) = {0.005,0.55,0};
Point(15) = {0,0.55,0.005};
Point(16) = {-0.005,0.55,0};
Point(17) = {0,0.55,-0.005};

Circle(1) = {2,1,3};
Circle(2) = {3,1,4};
Circle(3) = {4,1,5};
Circle(4) = {5,1,2};

Circle(5) = {6,1,7};
Circle(6) = {7,1,8};
Circle(7) = {8,1,9};
Circle(8) = {9,1,6};

Circle(9) = {10,18,11};
Circle(10) = {11,18,12};
Circle(11) = {12,18,13};
Circle(12) = {13,18,10};

Circle(13) = {14,18,15};
Circle(14) = {15,18,16};
Circle(15) = {16,18,17};
Circle(16) = {17,18,14};

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

Line Loop(3) = {9,10,11,12};
Line Loop(4) = {13,14,15,16};
Plane Surface(2) = {3,4};

Physical Surface("bottom") = {1};
Physical Surface("top") = {2};

Ruled Surface(3) = {1, 3};
Ruled Surface(4) = {2, 4};
Physical Surface("innerWall") = {3};
Physical Surface("outerWall") = {4};
With this code, do I get a cylinder inside the other one, with for patches: top, bottom, innerWall and outerWall?
Now, if the geometry is fine, how can I mesh it properly?
samiam1000 is offline   Reply With Quote

Old   January 20, 2015, 05:15
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well, you only describe two disks in your geometry. You have to connect them, define surfaces, then, using defined surfaces, define volumes. After you can add transfinite algorithm for mesh construction.

You can find compressed geo file in attachment. Also in attachment is a screenshot of the resulting mesh.
Attached Images
File Type: png mesh.png (93.7 KB, 9 views)
Attached Files
File Type: gz cylinder.geo.gz (1.2 KB, 6 views)
samiam1000 likes this.
alexeym is offline   Reply With Quote

Old   January 20, 2015, 05:23
Default
  #7
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
WoW: thanks a lot! Great mesh and very nice script. Thanks a lot!

Just 1 more questions: could you suggest me a pdf to learn GMSH?

Thanks a lot. Have a good day,
Samuele.
samiam1000 is offline   Reply With Quote

Old   January 20, 2015, 05:29
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Reference manual is quite nice (http://www.geuz.org/gmsh/doc/texinfo/gmsh.html), sections 3-5 & 6.3.2 are of particular interest, it is available in PDF format (http://www.geuz.org/gmsh/doc/texinfo/gmsh.pdf) if you insist on PDF
samiam1000 likes this.

Last edited by alexeym; January 20, 2015 at 05:52. Reason: typo
alexeym 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
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 07:43
DPM udf error haghshenasfard FLUENT 0 April 13, 2016 06:35
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 05:07


All times are GMT -4. The time now is 15:30.