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/)
-   -   [snappyHexMesh] create inlet and outlet (https://www.cfd-online.com/Forums/openfoam-meshing/221061-create-inlet-outlet.html)

Didu October 2, 2019 11:55

create inlet and outlet
 
Hi,
I need to create an inlet and outlet in final mesh (after a blockMesh-snappyHexMesh (.stl)). I tried topoSet followed by createPath with no sucess. My inlet and outlet are pipes (cylindrical shape) and my main body is a tank.
Thank you.

piotr.mecht October 3, 2019 03:12

Isn't it easier to remesh with CORRECT settings?


in snappyHexMesh in geometry subdictionary:
Code:

geometry
{
    myGeometry.stl //this stl contains different surface regions specified
    {
        type triSurfaceMesh;
        name Geometry;
        regions
        {
            // patch name specification
            // regionNameInSTLfile    {name    patchNameInOpenFOAM;}
            myInletSTLregion          {name Inlet;      }
            myOutletSTLregion        {name Outlet;      }
            myWallsInSTL              {name Walls;      }
            symmetryPlaneInSTL        {name mySymmetry;  }
        }
    }
}

and in snappyHexMesh castellatedMeshControl subdictionary:
Code:

refinementSurfaces
    {
        Geometry
        {
        level (1 1);
         
          regions
          {
                // surface region refinement
                // patch type specification
                // stlRegionName    { level (default feature_angle_resolved); patchInfo { type patchType; }
                myInletSTLregion    { level (4 4); patchInfo { type patch;        }}
                myOutletSTLregion    { level (4 4); patchInfo { type patch;        }}
                myWallsInSTL        { level (3 4); patchInfo { type wall;          }}
                symmetryPlaneInSTL  { level (0 1); patchInfo { type symmetry;      }}
          }
        }
    }


Didu October 3, 2019 04:34

Many thanks for your reply,
but how can I build an .stl file of flat geometry?

piotr.mecht October 3, 2019 07:05

snappHexMesh expects that you provide closed surface file, so it can be determined, whether to prepare mesh for internal or external flow based on locationInMesh input. You can't use flat non-closed geometry, as the snappyHexMesh is designed to prepare 3d meshes.


You can create 3d closed surface out of flat stl elements of course (stl is meant to represent surfaces flat ord 3d). People often use software like SALOME to prepare stl surface mesh with matching points between patches. You can export each of these patches as separate stls and concatenate them to a single file - copypaste its content to a single file or you can use linux command:
Code:

cat inlet.stl outlet.stl wall.stl > myGeometry.stl

piotr.mecht October 4, 2019 02:39

I've discovered this tool recently:
https://openfoamwiki.net/index.php/AutoPatch


It is actually possible to create patches after you've meshed over your stl with snappyHexMesh, but they are separated automatically by some algorithm, based on feature angle specified (and not an exact region, so you can end up with much more patches, than you wanted). New patches are also named automatically auto0, auto1, auto2 etc. You can rename them manually in constant/polyMesh/boundary


With feature angle of 120 degrees:

Code:

autoPatch 120


All times are GMT -4. The time now is 13:52.