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

[Gmsh] unwanted defaultFaces after exporting to foam 5.0

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2018, 15:04
Default unwanted defaultFaces after exporting to foam 5.0
  #1
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Hi,
Continuing my efforts to tweak the tutorial case here: https://github.com/openfoamtutorials...r/SpaceCapsule.

1. I wanted to create structured mesh in the immediate vicinity of the front side of the object.
2. Also, I wanted to modify the geometry slightly and introduce a smooth corner on the front.


I did this in these two steps. Modified the gmsh file a little first to create the hybrid mesh and then to create the corner. When I export the mesh to foam, I get an warning of this sort for both cases:
Code:
--> 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 1146577 undefined faces in mesh; adding to default patch.
However, for the first case where I did not have any curved corner, the export did not crate any defaultFaces in my polyMesh/boundary file whereas it does so in the second case. I do not understand why.
When I checked in paraview these faces are the ones that I created for the structured region (part of which were present for the first case yet did not result in defaultFaces entry)


Can anyone please explain why this is happening? Also, how do I get rid of the defaultFaces?

Last edited by deepbandivadekar; June 20, 2018 at 16:57.
deepbandivadekar is offline   Reply With Quote

Old   June 20, 2018, 16:54
Default
  #2
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
I thought maybe actually visualizing this would help. So here's the script and the mesh for both above cases. https://drive.google.com/open?id=109K42DoIiMBcrsE_7RBxxgRXzUdJ1hN0


Does anyone see what's wrong?

Last edited by deepbandivadekar; June 21, 2018 at 13:02.
deepbandivadekar is offline   Reply With Quote

Old   June 22, 2018, 12:41
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

It is fine, that you read all warnings, but is there defaultFaces patch in converted mesh? Could you post checkMesh output?

Initially gmshToFoam adds ALL boundary faces of the mesh to defaultFaces patch, then it iterates over Gmsh physical groups and moves faces from defaultFaces to corresponding patches. And if in the end defaultFaces has 0 faces, this patch is removed.
Robin.Kamenicky likes this.
alexeym is offline   Reply With Quote

Old   June 23, 2018, 20:16
Default
  #4
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

It is fine, that you read all warnings, but is there defaultFaces patch in converted mesh? Could you post checkMesh output?

Initially gmshToFoam adds ALL boundary faces of the mesh to defaultFaces patch, then it iterates over Gmsh physical groups and moves faces from defaultFaces to corresponding patches. And if in the end defaultFaces has 0 faces, this patch is removed.

Okay. Well, checkMesh does indicate non-zero defaultFaces for sure and the converted mesh retains the defaultFaces patch. I'm not in front of the machine at the moment but I'll post checkMesh output as soon as I can.
deepbandivadekar is offline   Reply With Quote

Old   June 24, 2018, 13:30
Default
  #5
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
checkMesh log:
Code:
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           724034
    internal points:  0
    faces:            2074429
    internal faces:   927852
    cells:            570553
    faces per cell:   5.26205
    boundary patches: 8
    point zones:      0
    face zones:       0
    cell zones:       2

Overall number of cells of each type:
    hexahedra:     149929
    prisms:        419736
    wedges:        0
    pyramids:      475
    tet wedges:    0
    tetrahedra:    413
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
   *Number of regions: 7
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "0/cellToRegion"
  <<Writing region 0 with 420377 cells to cellSet region0
  <<Writing region 1 with 107221 cells to cellSet region1
  <<Writing region 2 with 29351 cells to cellSet region2
  <<Writing region 3 with 931 cells to cellSet region3
  <<Writing region 4 with 931 cells to cellSet region4
  <<Writing region 5 with 361 cells to cellSet region5
  <<Writing region 6 with 11381 cells to cellSet region6

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology                  
    wedge1              570553   361262   ok (non-closed singly connected)  
    inletExt            74       149      ok (non-closed singly connected)  
    outlet              50       101      ok (non-closed singly connected)  
    vehicle             265      531      ok (non-closed singly connected)  
    wedge0              570553   363434   ok (non-closed singly connected)  
    tunnel              77       156      ok (non-closed singly connected)  
    defaultFaces        4338     6507     ok (non-closed singly connected)  

Checking geometry...
    Overall domain bounding box (-0.4625 0 -0.0431832) (1.055 0.989058 0.0431832)
    Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Wedge wedge1 with angle 2.5 degrees
    Wedge wedge0 with angle 2.5 degrees
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (2.22698e-18 -9.85001e-15 -3.63658e-14) OK.
    Max cell openness = 3.06502e-16 OK.
    Max aspect ratio = 4.93758 OK.
    Minimum face area = 1.12807e-09. Maximum face area = 0.00223978.  Face area magnitudes OK.
    Min volume = 1.48533e-13. Max volume = 2.19885e-05.  Total volume = 0.0647844.  Cell volumes OK.
    Mesh non-orthogonality Max: 41.98 average: 5.90285
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 0.842296 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End
deepbandivadekar is offline   Reply With Quote

Old   June 24, 2018, 13:33
Default
  #6
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

It is fine, that you read all warnings, but is there defaultFaces patch in converted mesh? Could you post checkMesh output?

These lines are talking about the structured regions of the mesh.

Code:
*Number of regions: 7     The mesh has multiple regions which are not connected by any face.
deepbandivadekar is offline   Reply With Quote

Old   July 2, 2018, 09:50
Default
  #7
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
I had an epiphany to try the original case once again with the current version of Gmsh.
(I had recently upgraded to 3.0.6 from the previous 2.10.0 since I wanted to work with Boolean operations.) As it turns out even for the base case the default faces are created after exporting to OF. Base case doesn't even have any internal faces!

So now I know that this is something about Gmsh 3.0.6 and not any error in my script. Problem remains to be resolved. Can anyone see a workaround?

This is part of the gmahToFoam export log for base case
Code:
Skipping tag  at line 483535
Patch 0 gets name wedge0
Patch 1 gets name vehicle
Patch 2 gets name outlet
Patch 3 gets name inlet
Patch 4 gets name wedge1
Patch 5 gets name tunnel

--> 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 241757 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

FaceZones:
Zone    Size

Writing zone 0 to cellZone volume and cellSet
End
deepbandivadekar is offline   Reply With Quote

Old   July 2, 2018, 11:40
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

You can visualise your defaultFaces for every case and then try to deduce why they have appeared (it is your case files, so, in general, you should know more about meshes than people who look at your files).

I have attached your default faces for case1.msh and case2.msh. So now you should answer a question: why these faces were not added to any patch?
Attached Images
File Type: png default-faces-case1.png (10.7 KB, 43 views)
File Type: png default-faces-case2.png (15.8 KB, 32 views)
alexeym is offline   Reply With Quote

Old   July 3, 2018, 17:37
Default
  #9
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

You can visualise your defaultFaces for every case and then try to deduce why they have appeared (it is your case files, so, in general, you should know more about meshes than people who look at your files).

I have attached your default faces for case1.msh and case2.msh. So now you should answer a question: why these faces were not added to any patch?
Thank you for your response. Yes, I did visualise these myself. However, those faces that we see in paraview as defaultFaces are created purely for meshing convenience. Those are not physical surfaces. So I have no idea why to be honest.

But since I now know that I can get around this issue with older Gmsh version am not going to pursue this.
deepbandivadekar 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
error with reactingFoam BakedAlmonds OpenFOAM Running, Solving & CFD 4 June 22, 2016 03:21
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 15:11
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


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