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

[Gmsh] gmshToFoam warning - cannot match faces

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2019, 12:16
Default gmshToFoam warning - cannot match faces
  #1
umd
New Member
 
Una
Join Date: Feb 2019
Posts: 1
Rep Power: 0
umd is on a distinguished road
Hi all,

I'm trying to build a 3D hexagonal mesh for use in OpenFoam. I started with a template in gmsh so that's the tool I've been using, but I don't have a lot of experience with it.

The mesh builds fine in gmsh and I don't get any errors, nor can I see any from looking at the geometry and mesh it visualises. However, as soon as I run gmshToFoam on the .msh file I get a whole load of warnings and errors. I am saving in Version 2 ASCII, as recommended somewhere else on this forum.

The warnings I get are:

--> FOAM Warning :
From function Foam:: polyMesh:: polyMesh(const Foam::IOobject&, const Foam::Xfer<Foam::Field<Foam::Vector<double> > >&, const cellShapeList&, const faceListList&, const wordList&, const wordList&, const Foam::word&, const Foam::word&, const wordList&, bool)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 595
Found 534 undefined faces in mesh; adding to default patch.

This is followed by an enormous number of this error:

--> FOAM Warning :
From function int main(int, char**)
in file gmshToFoam.C at line 972
Could not match gmsh face 4(12 13 154 150) to any of the interior or exterior faces that share the same 0th point
--> FOAM Warning : Not using gmsh face 4(150 154 155 151) since zero vertex is not on boundary of polyMesh

I suspect the problem is in my surface and volume definitions but I can't for the life of me see what it is. I am attaching my .geo file (hexagonalModel.txt) and the gmsh-generated .msh file (hexagonalModel_mesh.txt). To generate the mesh file I have been using the gmsh GUI 3D option.

I would be really grateful for any help or comments!
Attached Files
File Type: txt hexagonalModel.txt (3.7 KB, 8 views)
File Type: txt hexagonalModel_mesh.txt (71.3 KB, 1 views)
umd is offline   Reply With Quote

Old   November 7, 2020, 11:27
Default
  #2
New Member
 
Join Date: Nov 2020
Posts: 1
Rep Power: 0
KraftPunked is on a distinguished road
I had the same problem and I solved it by not extruding the lines. I extruded only the surfaces and the problem is gone.
KraftPunked is offline   Reply With Quote

Old   February 23, 2022, 10:15
Default
  #3
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 2
Quentin Chevalier is on a distinguished road
I have a very similar problem on my end.


I'm using gmsh 4.7.1 and OpenFOAM in a container v2112. I'm trying to do something similar to https://openfoamwiki.net/index.php/2...ial_using_GMSH in a cylindrical geometry using wedge boundary conditions.


My .geo file is attached, it's basically a 2D simple nozzle with varying mesh refinement that has been extruded 1 to end up with a slice of a round jet.


@KraftPunked, I did extrude only the physical surface.



This gives no error in gmsh, but it does create issues with gmshToFoam with several hundreds of "Could not match gmsh face W(X Y Z) to any of the interior or exterior faces that share the same 0th point" errors.


As could be expected, this problem leads to a boundary file with missing faces, though some get through nonetheless.


I'm not sure how to adress this error. The top google entries (http://geuz.org/pipermail/gmsh/2020/013527.html, http://onelab.info/pipermail/gmsh/2009/004487.html or https://gitlab.onelab.info/gmsh/gmsh/-/issues/490) are not super helpful.


This in turn leads to the creation of auto patchs in boundary upon execution that lead to failure of decomposePar, and it goes downhill from there.


Anyone had the same problem before ?
Attached Files
File Type: zip nozzle.zip (1.3 KB, 2 views)
File Type: zip boundary.zip (661 Bytes, 0 views)
Quentin Chevalier is offline   Reply With Quote

Old   February 23, 2022, 11:44
Default
  #4
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 2
Quentin Chevalier is on a distinguished road
Attached is my entire case file for completeness. Because of file size limits, the .geo file and the .msh file are separate. The .msh file must be put into the case file for the setup to work, the .geo is purely for reference.


The Allrun script will run gmshToFoam, modify the boundary file and run. You'll see that with the versions mentioned above, gmshToFoam throws many errors, and then creates a boundary with no faces for most surfaces as well as a huge defaultFaces that causes a general breakdown in decomposePar.


I also get an error in createPatch that confuses me - it requires a symmetric wedge with respect to y but that seems to be the case in my mesh...


Comments welcome.
Attached Files
File Type: zip nozzle.zip (10.0 KB, 0 views)
File Type: zip nozzle_geo.zip (1.3 KB, 0 views)
File Type: zip nozzle_msh.zip (194.9 KB, 0 views)
Quentin Chevalier is offline   Reply With Quote

Old   September 4, 2022, 17:59
Default
  #5
New Member
 
Mohamad
Join Date: Feb 2020
Posts: 2
Rep Power: 0
mcheikh is on a distinguished road
Hi,

I know this is an old thread but I think it's important that I upload my solution for converting GMSH .msh files to FOAM format using "gmshToFoam".


When "gmshToFoam" sends the error
"Could not match gmsh face 3(25 2 98) to any of the interior or exterior faces that share the same 0th point"
It means that the 2D gmsh surface face 3(25 2 98) is not found in any of the 3D elements. Remember that open foam 3D elements are saved as faces and that boundary faces in OpenFOAM have to be attributed to a 3D element. If they are not attributed than gmshToFoam will ignore them.

To explain the error in more details let's assume we have the below 2D gmsh surface faces:
face 1 is (25, 2 98) and face 2 is (98 10 2)
25-98
| / |
2 - 10
Lets focus on face 1 for a second. Let's assume that the nearest 3D tet element to that face is
25-98
\ | \
10 - 50
As you can see, face 1 and the corresponding face from the 3D element are not aligned so face 1 will be ignored.

One can easily see this problem in GMSH when one turns on the Mesh Visibility options for 2D element edges and 3D element edges at the same time. If the 2D and 3D edges are aligned at the surface ==> No problem, but if they are not aligned ==> gmshToFoam will ignore the 2D faces. Look at the two pngs that I have uploaded

Now how to solve this problem:
Usually, this discrepancy between the surface faces and the faces of a 3D element happens when one creates all 2D surface faces first and then creates from them a 3D body.
To solve it either create the volume first from one 2D surface (like extruding for example) or focus on aligning the 2D surface properly by using the RIGHT, LEFT when you transfite the surface.

I have uploaded a GMSH script with a problem and how I solved it.
Attached Images
File Type: png Solution_1.png (24.4 KB, 10 views)
File Type: png Problem_1.png (29.2 KB, 9 views)
Attached Files
File Type: txt CubeDomain_OF.txt (1.8 KB, 2 views)
File Type: txt CubeDomain_OF_Problem.txt (1.8 KB, 3 views)
mcheikh is offline   Reply With Quote

Reply

Tags
gmsh, gmshtofoam, mesh generation, 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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
GenerateVolumeMesh Error - Surface Wrapper Self Interacting (?) AndreP STAR-CCM+ 10 August 2, 2018 08:48
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 11:20
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42


All times are GMT -4. The time now is 14:04.