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

[Gmsh] GmshToFoam warnings

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By alexeym
  • 2 Post By andybond13

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2015, 12:28
Default GmshToFoam warnings
  #1
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
Hello all,

I'm trying to build a mesh in GMSH and send it to OpenFOAM for simulation using their tool gmshToFoam. I've been getting a lot of "warnings" and the result is that two of my patches are not correctly populated (in fact they each own zero faces) and the defaultFaces patch has more than zero.

The warnings are of the type:
-Could not match gmsh face 3(856 858 857) to any of the interior or exterior faces that share the same 0th point
-Not using gmsh face 3(856 859 860) since zero vertex is not on boundary of polyMesh

I've read a former thread in cfd-online and tried to apply it to my .geo file (including everything into a physical group), but haven't been successful.

My experience level with gmsh is pretty low, so I apologize if this is an easy question or something that I should have picked up quickly from the previous thread.

My intention is to create a tube with the shape given in the .geo file, and have air flowing through from one end to the other (inlet to outlet).
Attached Files
File Type: txt log.gmshToFoam.txt (40.1 KB, 32 views)
File Type: txt container_full.geo.txt (4.5 KB, 35 views)
andybond13 is offline   Reply With Quote

Old   February 21, 2015, 05:17
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,926
Rep Power: 35
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

As your GEO file does not contain commands for mesh creation, can you describe your process of mesh generation? I have tried usuall "Mesh 3" command but did not succeed in generating anything that can be called mesh. Gmsh even rejected to create 3D mesh in central part of the geometry.
alexeym is offline   Reply With Quote

Old   February 21, 2015, 12:21
Default
  #3
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
I open the .geo file in the gmsh GUI by command line: "gmsh container_full.geo". It loads the .geo file without warning/error and then I do "Modules>Mesh>2D" and "Modules>Mesh>3D", which run without warning/error.

I'm using version 2.8.5 of gmsh.
andybond13 is offline   Reply With Quote

Old   February 21, 2015, 12:52
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,926
Rep Power: 35
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Gmsh version 2.8.5 but under OS X. MSH file generated using attached GEO-file (with commands Mesh 2 and Mesh 3) produces the following output:

Code:
Starting to read points at line 13
Vertices to be read:880
Vertices read:880

Starting to read cells at line 896
Cells to be read:1912

Mapping region 5 to Foam patch 0
Mapping region 4 to Foam patch 1
Mapping region 2 to Foam patch 2
Mapping region 3 to Foam patch 3
Cells:
    total:0
    hex  :0
    prism:0
    pyr  :0
    tet  :0



--> FOAM FATAL IO ERROR: 
No cells read from file "container_full.msh"
Does your file specify any 3D elements (hex=5, prism=6, pyramid=7, tet=4)?
Perhaps you have not exported the 3D elements?
alexeym is offline   Reply With Quote

Old   February 22, 2015, 10:43
Default
  #5
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
Well that's strange, I've been using gmsh in OSX as well. After running the command: "gmsh container_full.geo -2 -3 -o container_full.msh", and then gmshToFoam, I now get:

Quote:
Starting to read points at line 13
Vertices to be read:1123
Vertices read:1123

Starting to read cells at line 1139
Cells to be read:5396

Mapping region 5 to Foam patch 0
Mapping region 4 to Foam patch 1
Mapping region 2 to Foam patch 2
Mapping region 3 to Foam patch 3
Mapping region 1 to Foam cellZone 0
Cells:
total:3504
hex :0
prism:0
pyr :0
tet :3504

CellZones:
Zone Size
0 3504

Skipping tag at line 6538
Patch 0 gets name construction
Patch 1 gets name walls
Patch 2 gets name inlet
Patch 3 gets name outlet

--> FOAM Warning :
From function polyMesh:olyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 627
Found 1392 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
--> FOAM Warning :
From function gmshToFoam
in file gmshToFoam.C at line 972
Could not match gmsh face 3(59 242 60) to any of the interior or exterior faces that share the same 0th point
Interestingly, when I run gmsh in ubuntu (2.8.2) on the same file and then gmshToFoam, I get another different result:

Quote:
Starting to read points at line 14
Vertices to be read:5159
Vertices read:5159

Starting to read cells at line 5176
Cells to be read:11035

Unhandled element 15 at line 5178
Unhandled element 15 at line 5179
Unhandled element 15 at line 5180
...
So then perhaps the first question should be: why are we getting different results running this .geo file through gmsh (is the .geo file poorly constructed?).

Perhaps knowing why that is could make gmshToFoam run smoother. Thanks for your help!
andybond13 is offline   Reply With Quote

Old   February 22, 2015, 12:20
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,926
Rep Power: 35
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Guess we have different mesh generation options. I was able to reproduce your error message if I set 2D and 3D algorithms to Frontal. And I don't know how to fix this except to propose to mesh different shapes of the tube using transfinite algorithm (dividing geometry into volumes with 6 corners), then merge meshes (using mergeMeshes) and finally stitch connecting patches (using stitchMesh). Or you can use 2D mesh from Gmsh as STL for snappyHexMesh/cfMesh.

And btw error message on Ubuntu means that gmsh on Ubuntu produced higher-order mesh elements, they are ignored by gmshToFoam with the warning you have posted.
sourav90 likes this.
alexeym is offline   Reply With Quote

Old   February 23, 2015, 16:21
Default
  #7
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
could you give an example of this (Transfinite mesh) for just one section of the tube? I've attached an attempt to do this for one section, and it works well in 2-D, but throws errors in 3-D.

If I understand correctly, I will also have to also:
-label the boundaries of each section (e.g. inlet, walls1, innerSurface1a; innerSurface1b, walls2, innerSurface2a; etc.)
-run each section through gmshToFoam individually
-merge mesh
-stitch adjoining patches

whew! shame it can't be easier. Is the unstructured mesh insufficient for OpenFOAM - why is transfinite needed?
Attached Files
File Type: txt tf.geo.txt (2.7 KB, 33 views)
andybond13 is offline   Reply With Quote

Old   February 24, 2015, 03:00
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,926
Rep Power: 35
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

See an example of transfinite mesh of the middle part (tube) attached to the message. Other parts (frusta and spherical sectors) are made the same way, frusta just have different top and bottom circle radii, spherical sectors have curved outer edges.

Quote:
If I understand correctly, I will also have to also:
-label the boundaries of each section (e.g. inlet, walls1, innerSurface1a; innerSurface1b, walls2, innerSurface2a; etc.)
-run each section through gmshToFoam individually
-merge mesh
-stitch adjoining patches
Yes, you get the algorithm right. Also, as I said, you can take 2D surface mesh as STL and use snappyHexMesh to create volume mesh.

Quote:
Is the unstructured mesh insufficient for OpenFOAM - why is transfinite needed?
It is sufficient but a) with high probability Gmsh will generate mesh with high non-orthogonality, b) you've got more control over mesh quality when using transfinite algorithm, and c) do you have unstructured mesh?
Attached Files
File Type: gz tube.geo.gz (1.1 KB, 45 views)
alexeym is offline   Reply With Quote

Old   February 24, 2015, 03:41
Default
  #9
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,926
Rep Power: 35
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Finally I was able to convert your geo-file into msh. You've forgotten to create geometrical volume for tube part, so no 3D mesh were generated for that part and this somehow worried gmshToFoam.

After I was able to identify parts of the mesh that gmshToFoam do not like, it is on attached image. There are lots of planes on the picture, during conversion all of them, except the surface of the cone, are ignored. Are these planes really there?
Attached Images
File Type: gif construction.gif (54.6 KB, 72 views)
alexeym is offline   Reply With Quote

Old   February 24, 2015, 16:42
Default
  #10
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
That set of planes (and the same on the other side) are there as "construction planes" or "scaffolding". That's to say that I needed to make them to construct the object, but I they are not part of the finished object.

I really don't need them meshed and I would prefer that openFOAM doesn't know about them at all.
andybond13 is offline   Reply With Quote

Old   February 24, 2015, 17:32
Default
  #11
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
Your tube.geo file is great, thanks!! and it passes gmshToFoam and simulates nicely.

Why should I not just do everything like this in one big .geo file, so that way my mesh is already merged and my surfaces already stitched?
andybond13 is offline   Reply With Quote

Old   February 25, 2015, 03:13
Default
  #12
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,926
Rep Power: 35
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well,

You don't need these planes and yet, you created physical group for these planes (which then will be converted into patch, so OpenFOAM will definitely know about these planes). So you can start by removing physical group "construction". Then you need to create geometrical volumes for these "construction cones". Currently they are not meshed. And finally inlet and outlet planes meshed twice, though I wasn't able to find a reason for this behaviour. Maybe they are created in the base geometry and then during extrude operation.

I proposed to mesh different parts of the mesh separately so it will be easier to manage geometry or the parts. Also it will be easier to control density of the meshes in different parts of the shape if you mesh parts separately. If it is OK for you to deal with the whole geometry in a single geo-file, you can mesh the whole shape at once.
alexeym is offline   Reply With Quote

Old   March 11, 2015, 16:21
Default
  #13
New Member
 
Andrew
Join Date: Feb 2015
Posts: 8
Rep Power: 8
andybond13 is on a distinguished road
Thanks again for your guidance Alexey, things are working well!

For any readers curious to how I solved my issues, here's what I did:
1. adapted Alexey's tube.geo file that uses transfinite meshing and applied this to the inlet and outlet sections
2. adapted this .geo file to mesh the hemi-spherical sections (defining all the lines and planes individually, rather than by extrusion/rotation).
3. labeled all the exterior sections as physical surfaces (i.e. "walls", "inlet", outlet")
4. labeled all the interior sections as physical surfaces ("interface1a", "interface1b", ...)
5. ran all with gmsh to make .msh files.
6. created separate folders for each part in my openfoam project directory
7. copied in project parameter folders (OpenFOAM sees each part as it's own simulation)
8. did gmshToFoam to each part
9. merged the meshes (only two at a time: i.e. part1 & part2, part1 & part3, ...
10. stitched the meshes across the interface patches

Voila! Done! I have a working object with a combined exterior and no interior patches. For more specifics on using mergeMeshes and stitchMesh, see: http://openfoamwiki.net/index.php/Si...vaned_diffuser

alexeym and sourav90 like this.
andybond13 is offline   Reply With Quote

Old   December 8, 2019, 13:58
Default gmshToFoam error: 'Unhandled element at line '
  #14
New Member
 
Sourav Mandal
Join Date: Jul 2019
Posts: 26
Rep Power: 3
sourav90 is on a distinguished road
Quote:
Originally Posted by alexeym View Post
And btw error message on Ubuntu means that gmsh on Ubuntu produced higher-order mesh elements, they are ignored by gmshToFoam with the warning you have posted.
Thanks for pointing that out. But what would be the right path to solve this, to get rid of higher order elements while meshing in Gmsh (don't know if it's possible...)? Or, any other ways to import mesh to openFOAM?

I actually use Gmsh because there is a possibility to automate the mesh generation procedure till running simulation. Which I am exploring right now and faced the 'Unhandled element at line ' issue, where all my boundary patches are lost while invoking gmshtofoam ).

Please inform if anybody knows if there are other ways (keeping the non-gui or command line pathway in mind).

Thanks in advance,
sourav90 is offline   Reply With Quote

Reply

Tags
gmsh, gmshtofoam, openfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Gmsh] New version of gmshToFoam? stootoon OpenFOAM Meshing & Mesh Conversion 6 May 23, 2019 11:32
MPI warnings sita OpenFOAM Running, Solving & CFD 1 May 9, 2019 05:46
[Gmsh] gmshToFoam problem. nilashansen OpenFOAM Meshing & Mesh Conversion 11 June 5, 2016 10:45
[Gmsh] gmshTofoam pbm with cyclicAMI acahuzac OpenFOAM Meshing & Mesh Conversion 2 October 20, 2014 03:53
[Gmsh] gmshToFoam command mvinassa OpenFOAM Meshing & Mesh Conversion 1 April 25, 2014 07:36


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