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] Physical Surfaces not becoming patches - gmshToFoam (https://www.cfd-online.com/Forums/openfoam-meshing/224141-physical-surfaces-not-becoming-patches-gmshtofoam.html)

turinturambar February 8, 2020 16:36

Physical Surfaces not becoming patches - gmshToFoam
 
2 Attachment(s)
Hi,



I am totaly new to gmsh and openFoam so it's highly probable that I'm missing something simple, but after spending so time playing with the parameters and searching online I can't seem to find a solution.


In gmsh, I define several Physical surfaces but when I run gmshToFoam, it only creates one patch. Here is the definition of my physical surfaces in the .geo file:

Quote:

//+
Physical Surface("back") = {2};
//+
Physical Surface("front") = {8};
//+
Physical Surface("edges") = {6, 3, 4, 5};
//+
Physical Surface("wall") = {7};
//+
Physical Volume("internal") = {1};


When I run gmshToFoam, it appears to read the physical names, but then only creates one patch. I also get a warning about undefined faces. Here some of the output is gives me:
Quote:

Starting to read physical names at line 5
Physical names:5
Surface 1 back
Surface 2 front
Surface 3 edges
Surface 4 wall
Volume 5 internal

...
Unhandled element 15 at line 1867
Mapping region 0 to Foam patch 0
Mapping region 0 to Foam cellZone 0
...
Patch 0 gets name patch0

--> FOAM Warning :
From function Foam::polyMesh::polyMesh(const Foam::IOobject&, Foam::pointField&&, 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 593
Found 3591 undefined faces in mesh; adding to default patch defaultFaces
Finding faces of patch 0





The full .geo file and the output from gmshToFoam are attached.

mzzmrt February 8, 2020 17:08

Did you check the result with paraFoam.


I did and the mesh has been correctly converted with gmshTo Foam...

turinturambar February 8, 2020 18:46

I've checked the result with paraFoam and the mesh imports find. The problem is that all the faces are lumped into one patch instead of multiple patches as specified in gmsh to allow me to define boundry conditions

mzzmrt February 9, 2020 02:39

Well, I have opne your script with gmsh 4.5.2, made and exported mesh than imported to OpenFOAM 7.0, here is the result which is as expected, patched correctly:


https://ibb.co/9YL8hW4

Gimlas March 19, 2020 05:01

I have the same problem with my mesh. The geometry was imported from stp file. Then the mesh was generated. I've exported the mesh into msh file using ASCII 2 and saving all elements. Then I try to import the mesh into openFoam. The mesh is imported correctly however the patches are not created. I am using GMSH 4.5.4 and OpenFOAM7. Any sugestions?

zile96 March 22, 2021 13:12

Has any progress been made on this topic?
I have the same problem with mesh conversion :confused:

Sanjay-Kurian April 21, 2021 08:57

Hi, I am a beginner and currently learning about the gmsh software. I have created a simple geometry and meshed it. I also gave physical groups for boundary conditions but the groups are not being read when I export it to openFoam. Any suggestions or tips would be highly appreciated to tackle this issue. Below is the mesh file I have created.
Thanks

granzer November 16, 2021 10:07

Ansys Mesher
 
Not in gmsh but I faced the same problem in Ansys Mesher. I had named selection in Ansys Mesher which were not created as separate boundary patches in OF. I found that in AM you have to turn on 'Send to solver' in each named selection. This solved the problem. So there may be a similar parameter to be turned on in GMSH too.


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