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] GmshToFoam keyword patch0 is undefined (https://www.cfd-online.com/Forums/openfoam-meshing/61874-gmshtofoam-keyword-patch0-undefined.html)

steve999 September 3, 2008 13:05

GmshToFoam keyword patch0 is undefined
 
Hi there,

Well I've been struggling with the following problem for days and I can't figure out where is the mistake.

I want to study a flow around a complicated object. I did a cube around the objet in Catia, meshed the object, meshed the volume and then imported it in Gmsh. Everything was fine in gmsh.

Here was the .msh :

********$MeshFormat
********2 0 8
********$EndMeshFormat
********$Nodes
********...
********$EndNodes
********$Elements
********... (triangles -- surfaces)
********$EndElements
********$Elements
********... (tetrahedron -- volume)
********$EndElements


When I did gmshToFoam . . my_mesh.msh, here is what I got :


********Found $MeshFormat tag; assuming version 2 file format.
********Starting to read points at line 5
********Vertices to be read:129645
********Vertices read:129645
********
********Starting to read cells at line 129653
********Cells to be read:692471
********
********Mapping region 0 to Foam patch 0
********Mapping region 2 to Foam cellZone 0
********Cells:
******** total:562747
******** hex :0
******** prism:0
******** pyr :0
******** tet :562747
********
********CellZones:
********Zone Size
******** 0 562747
********
********Skipping tag at line 822127
********--> FOAM Warning :
******** From function polyMesh::polyMesh(... construct from shapes...)
******** in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
******** Found 129728 undefined faces in mesh; adding to default patch.
********Finding faces of patch 0
********
********FaceZones:
********Zone Size
********
********Writing zone 0 to cellZone cellZone_0 and cellSet
********End


I could view it with paraFoam, no problem, even with the warning.

The thing is, the whole mesh being between $Elements and $EndElements, there was of course only one physical entity so I couldn' tell FoamX what was the inlet (in the list, I only had patch0, internal mesh and defaultPatch).
This was expected : I wanted to do something easy first, to be sure the mesh was readable. Here come the problems : I put every cube wall in a different paragraph so that every wall could be defined as a different entity :


********$MeshFormat
********2 0 8
********$EndMeshFormat
********$Nodes
********...
********$EndNodes
********$Elements
********... (wall 1 -- surfaces)
********$EndElements
********$Elements
********... (wall 2 -- surfaces)
********$EndElements
********...
********$Elements
********... (wall 8 -- surfaces)
********$EndElements
********$Elements
********... (tetrahedron -- volume)
********$EndElements


In gmsh, it was wonderful : I could view all the different walls with different colors as expected. Great.
But then I tried gmshToFoam . . my_new_mesh.msh and here is the result :

********Found $MeshFormat tag; assuming version 2 file format.
********Starting to read points at line 5
********Vertices to be read:129645
********Vertices read:129645
********
********Starting to read cells at line 129653
********Cells to be read:16000
********
********Mapping region 1 to Foam patch 0
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 145656
********Cells to be read:12800
********
********Mapping region 2 to Foam patch 1
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 158459
********Cells to be read:16000
********
********Mapping region 3 to Foam patch 2
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 174462
********Cells to be read:12800
********
********Mapping region 4 to Foam patch 3
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 187265
********Cells to be read:16000
********
********Mapping region 5 to Foam patch 4
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 203268
********Cells to be read:16000
********
********Mapping region 6 to Foam patch 5
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 219271
********Cells to be read:40124
********
********Mapping region 7 to Foam patch 6
********Cells:
******** total:0
******** hex :0
******** prism:0
******** pyr :0
******** tet :0
********
********CellZones:
********Zone Size
********
********Starting to read cells at line 259398
********Cells to be read:562747
********
********Mapping region 2 to Foam cellZone 0
********Cells:
******** total:562747
******** hex :0
******** prism:0
******** pyr :0
******** tet :562747
********
********CellZones:
********Zone Size
******** 0 562747
********
********Skipping tag at line 822148
********--> FOAM Warning :
******** From function polyMesh::polyMesh(... construct from shapes...)
******** in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
******** Found 129728 undefined faces in mesh; adding to default patch.
********Finding faces of patch 0
********Finding faces of patch 1
********Finding faces of patch 2
********Finding faces of patch 3
********Finding faces of patch 4
********Finding faces of patch 5
********Finding faces of patch 6
********
********FaceZones:
********Zone Size
********
********Writing zone 0 to cellZone cellZone_0 and cellSet
********End
********
********
********
********--> FOAM FATAL IO ERROR : keyword patch1 is undefined in dictionary "/home/steve/OpenFOAM/steve-1.4.1/current_work/0/T::boundaryField"
********

********file: /home/steve/OpenFOAM/steve-1.4.1/current_work/0/T::boundaryField from line 36 to line 41.
********
******** From function dictionary::lookupEntry(const word& keyword) const
******** in file db/dictionary/dictionary.C at line 146.
********
********FOAM exiting


Of course if I try to run paraFoam, I do have in the list "patch0, patch1, ... patch6", but it bursts out whit a segmentation fault if I try to make it display anything.

If I try to do only one paragraph in gmsh specifying different entities this way :


********...
********$Elements
********1 2 3 1 1 0 ... ... ... ---> Wall 1
********2 2 3 1 1 0 ... ... ...
********...

********10 2 3 1 2 0 ... ... ... ---> Wall 2
********11 2 3 1 2 0 ... ... ...
********...
********$EndElements
********...


Everything's the same...

Please help me...

Best regards

PS :*I'm affraid I can't post the .msh because the object I'm working on is to be patented soon...supposing I can figure out where the pb is... http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

steve999 September 9, 2008 04:18

Hi guys, is there anyone t
 
Hi guys,

is there anyone to help me ?

Best regards

steve999 September 12, 2008 10:09

Please, foamers, any idea ? I'
 
Please, foamers, any idea ? I'm really stuck.

Best regards.

mattijs September 12, 2008 13:01

From the comment in gmshToFoam
 
From the comment in gmshToFoam:

Needs surface elements on mesh to be present and aligned with outside faces
of the mesh. I.e. if the mesh is hexes, the outside faces need to be quads

Sorry, couldn't find a test gmsh surface.

steve999 September 14, 2008 04:39

Hi, thanks for the answer ! I
 
Hi, thanks for the answer !
I think that, unfortunately, this is not the problem : my mesh is made of tetrahedron, and the surfaces are the corresponding triangles.

I can't figure out what the problem is...

mattijs September 14, 2008 14:45

So does your mesh have (non-ze
 
So does your mesh have (non-zero-sized) patches? Look at constant/polyMesh/boundary or run checkMesh.

(your paraview message comes from it reading a T field with patch information inconsistent with the mesh)


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