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

[Gmsh] Pipe flow in gmsh / OF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By billynoe

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2011, 08:15
Default Pipe flow in gmsh / OF
  #1
New Member
 
Andreas P
Join Date: Sep 2010
Posts: 26
Rep Power: 15
andreasp is on a distinguished road
Hi everyone!

Actually my problems seem to be quite similar to other discussions in this forum, but since I am completely new to both gmsh and OF I haven't really found answers that help me...

In the future I want to use OF to compute steady state flow profiles in rather complex "pipe-like" geometries. For that, I will have to use unstructured meshes in different formats (nastran, icem, ...).

So I thought a very simple pipe flow simulation on a gmsh-generated tetra-mesh would be a good start. I am attaching the .geo file (added .txt). To be able to distinguish between different boundaries etc., I have generated physical groups for inlet, outlet, walls, and fluid volume. To me, the mesh looks just fine. Please let me know, if there is already something wrong with the gmsh part.

btw. is there a command to do the meshing directly in the .geo file? So far I just load the .geo file and then do the meshing by clicking the 3D button in the gmsh menu... which is somehow a strange hybrid approach. I'd prefer to have the complete procedure scripted.

Anyway, I convert the gmsh to polyMesh by
Code:
gmshToFoam pipe.msh
This runs without errors, but gives me a warning:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Found $MeshFormat tag; assuming version 2 file format.
Starting to read mesh format at line 2
Read format version 2.2  ascii 0

Starting to read physical names at line 5
Physical names:4
    Surface 1    inlet
    Surface 2    outlet
    Surface 3    wall
    Volume 4    fluid

Starting to read points at line 12
Vertices to be read:1549
Vertices read:1549

Starting to read cells at line 1564
Cells to be read:8197

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

CellZones:
Zone    Size
    0    6565

Skipping tag  at line 9764
Patch 0 gets name inlet
Patch 1 gets name wall
Patch 2 gets name outlet

--> FOAM Warning : 
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
    Found 1632 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
Finding faces of patch 1
Finding faces of patch 2

FaceZones:
Zone    Size

Writing zone 0 to cellZone fluid and cellSet
End
And running
Code:
checkMesh -constant
indicates no problems at all, but the most interesting output is:
Code:
Checking patch topology for multiply connected surfaces ...
    Patch               Faces    Points   Surface topology                  
    inlet               28       21       ok (non-closed singly connected)  
    wall                1576     800      ok (non-closed singly connected)  
    outlet              28       21       ok (non-closed singly connected)  
    defaultFaces        0        0        ok (empty)
Moreover the generated constant/polyMesh/boundary file contains this:
Code:
    defaultFaces
    {
        type            patch;
        nFaces          0;
        startFace       13946;
    }
This seems odd to me. No inner faces?

I have not yet tried to just run a solver, since setting up physical parameters and numerical solution schemes will probably take me some time. And I believe that doesn't really make sense as long as there's still a problem with the mesh...?

And another thing: Which solver would you recommend for this application? Basically appropriate to me seem both icoFoam and simpleFoam. Remember, I just want to compute a very simple laminar flow steady state solution (Hagen-Poiseuille).

Thanks in advance for any hints!

Andreas
Attached Files
File Type: txt pipe.geo.txt (1.2 KB, 169 views)
andreasp is offline   Reply With Quote

Old   February 22, 2011, 12:13
Default
  #2
New Member
 
Andreas P
Join Date: Sep 2010
Posts: 26
Rep Power: 15
andreasp is on a distinguished road
OK, I figured it out.

As described here I could just delete the defaultFaces, and everything worked!

But maybe one more thing:
Is there any way to specify a stop criterion for simpleFoam besides a fixed number of steady state solver iterations (i.e. time steps)? I was looking for something like an overall stopping residual, but haven't found that so far.
andreasp is offline   Reply With Quote

Old   March 2, 2011, 05:07
Default
  #3
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
Quote:
Originally Posted by andreasp View Post
Hi everyone!

Actually my problems seem to be quite similar to other discussions in this forum, but since I am completely new to both gmsh and OF I haven't really found answers that help me...

In the future I want to use OF to compute steady state flow profiles in rather complex "pipe-like" geometries. For that, I will have to use unstructured meshes in different formats (nastran, icem, ...).

So I thought a very simple pipe flow simulation on a gmsh-generated tetra-mesh would be a good start. I am attaching the .geo file (added .txt). To be able to distinguish between different boundaries etc., I have generated physical groups for inlet, outlet, walls, and fluid volume. To me, the mesh looks just fine. Please let me know, if there is already something wrong with the gmsh part.

btw. is there a command to do the meshing directly in the .geo file? So far I just load the .geo file and then do the meshing by clicking the 3D button in the gmsh menu... which is somehow a strange hybrid approach. I'd prefer to have the complete procedure scripted.

Anyway, I convert the gmsh to polyMesh by
Code:
gmshToFoam pipe.msh
This runs without errors, but gives me a warning:
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Found $MeshFormat tag; assuming version 2 file format.
Starting to read mesh format at line 2
Read format version 2.2  ascii 0

Starting to read physical names at line 5
Physical names:4
    Surface 1    inlet
    Surface 2    outlet
    Surface 3    wall
    Volume 4    fluid

Starting to read points at line 12
Vertices to be read:1549
Vertices read:1549

Starting to read cells at line 1564
Cells to be read:8197

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

CellZones:
Zone    Size
    0    6565

Skipping tag  at line 9764
Patch 0 gets name inlet
Patch 1 gets name wall
Patch 2 gets name outlet

--> FOAM Warning : 
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
    Found 1632 undefined faces in mesh; adding to default patch.
Finding faces of patch 0
Finding faces of patch 1
Finding faces of patch 2

FaceZones:
Zone    Size

Writing zone 0 to cellZone fluid and cellSet
End
And running
Code:
checkMesh -constant
indicates no problems at all, but the most interesting output is:
Code:
Checking patch topology for multiply connected surfaces ...
    Patch               Faces    Points   Surface topology                  
    inlet               28       21       ok (non-closed singly connected)  
    wall                1576     800      ok (non-closed singly connected)  
    outlet              28       21       ok (non-closed singly connected)  
    defaultFaces        0        0        ok (empty)
Moreover the generated constant/polyMesh/boundary file contains this:
Code:
    defaultFaces
    {
        type            patch;
        nFaces          0;
        startFace       13946;
    }
This seems odd to me. No inner faces?

I have not yet tried to just run a solver, since setting up physical parameters and numerical solution schemes will probably take me some time. And I believe that doesn't really make sense as long as there's still a problem with the mesh...?

And another thing: Which solver would you recommend for this application? Basically appropriate to me seem both icoFoam and simpleFoam. Remember, I just want to compute a very simple laminar flow steady state solution (Hagen-Poiseuille).

Thanks in advance for any hints!

Andreas

Dear Andreas,

I would like to built a prismatic boundary layer onto the pipe internal surfaces. The result would be an hybrid mesh with a tetrahedral core and a prismatic boundary layer.

Have You ever tried it? Can You Help me doing that via a .geo file?

Thank You in advance.


Claudio Comis
claco is offline   Reply With Quote

Old   March 2, 2011, 09:33
Default
  #4
New Member
 
Andreas P
Join Date: Sep 2010
Posts: 26
Rep Power: 15
andreasp is on a distinguished road
Claudio,

I am sorry I have hardly any experience with gmsh.
(Just enough to generate trivial tetra meshes for my test cases...)

But I'm sure you'll find hints on this googling for things like "gmsh prism layer hybrid meshes" etc...

Andreas
andreasp is offline   Reply With Quote

Old   March 2, 2011, 18:16
Default
  #5
Member
 
William
Join Date: Feb 2011
Location: Minnesota USA
Posts: 33
Rep Power: 15
billynoe is on a distinguished road
as for the default faces gmshToFoam always makes that patch. it is convenient if you don't want to define many internal physical surfaces (faces) as walls for instance. it is weird that it said it was putting 1600 some undefined faces there but checkmesh said it was empty. Foam ignores any patches with 0 faces anyways.
Ramzy1990 likes this.

Last edited by billynoe; March 2, 2011 at 18:46.
billynoe 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
Setting boundary conditions for simple pipe flow with flow direction changing in time Sipher FLUENT 1 May 4, 2015 20:05
[GAMBIT] meshing in GAMBIT, a flow through a pipe having complex inflow geometry mazhar1613 ANSYS Meshing & Geometry 1 January 11, 2012 23:18
[ASK] Flow in Corrugated Pipe with FLUENT Primadhani FLUENT 1 May 11, 2011 20:41
Pipe Flow Saima CFX 1 January 10, 2011 16:41
Turbulence in a pipe flow JM Main CFD Forum 4 December 21, 2006 04:04


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