CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Internal Interface in mesh imported (https://www.cfd-online.com/Forums/openfoam-pre-processing/221286-internal-interface-mesh-imported.html)

hernanrmz October 10, 2019 13:55

Internal Interface in mesh imported
 
1 Attachment(s)
Hello Foamers!

I want to define an internal interface in a fluid region of an imported mesh from Star-ccm+. This is because I used different mesh operations in Star-ccm+ and creates internal interfaces.

I have a very simple case (Image attached). In this case, the internal interface makes no sense, but in other cases it does.

When I run ccm26ToFoam the boundary file generated is this:

Code:

6
(
    Wall-1
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          1800;
        startFace      88014;
    }
    Int-1
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          518;
        startFace      89814;
    }
    Inlet
    {
        type            patch;
        nFaces          518;
        startFace      90332;
    }
    Wall-2
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          1800;
        startFace      90850;
    }
    Outlet
    {
        type            patch;
        nFaces          518;
        startFace      92650;
    }
    Int-2
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          518;
        startFace      93168;
    }
)

In this post https://www.cfd-online.com/Forums/op...condition.html solves a similar problem, but they solved it manipulating the mesh in gambit...

I used "stitchMesh Int-1 Int-2" but it doesn't work, maybe I used wrong...

stitchMesh description: "Merge the faces on the specified patches (if geometrically possible) so the faces become internal."

Anyone have an idea?

Thanks!!

hernanrmz October 11, 2019 11:04

1 Attachment(s)
Hello Foamers!

I just solved! "stitchMesh" is the utility I need

The steps to convert a Star-CCM+ mesh with internal interfaces are:

1. ccm26ToFoam mesh.ccm (you need to install ccm26ToFoam library)
2. The boundary file generated is this:

Code:

6
(
    Wall-1
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          1800;
        startFace      88014;
    }
    Int-1
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          518;
        startFace      89814;
    }
    Inlet
    {
        type            patch;
        nFaces          518;
        startFace      90332;
    }
    Wall-2
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          1800;
        startFace      90850;
    }
    Outlet
    {
        type            patch;
        nFaces          518;
        startFace      92650;
    }
    Int-2
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          518;
        startFace      93168;
    }
)

where "Int-1" and "Int-2" are the faces that define the internal interface. Note that nFaces is 518.

3. You need to define the boundary conditions for the Int-1 and Int-2 in the 0 Files. In this case U and p files.

U file:

Code:

boundaryField
{
    Inlet
    {
        type            fixedValue;
        value          uniform (0.01 0 0);
    }

    Outlet
    {
        type            zeroGradient;
    }
    Wall-1
    {
        type            noSlip;
    }
    Wall-2
    {
        type            noSlip;
    }
  Int-1
    {
        type            zeroGradient;
    }
  Int-2
    {
        type            zeroGradient;
    }
}

You can put any condition, it just for preventing an error when you run the stitchMesh. I define the same condition for p file.

If you run checkMesh, you can see that you have 2 regions:

Code:

  *Number of regions: 2
    The mesh has multiple regions which are not connected by any face.

4. Run the stitchMesh utility:

Code:

stitchMesh Int-1 Int-2
This will generate a time folder with the boundary files (U, p) and the polymesh folder.

5. Delete the old polymesh and copy the new one:

Code:

rm -rv constant/polyMesh/
cp -rv 1/polyMesh/ constant/
rm -rv 1

If you run checkMesh again, it tells you that you have one region:

Code:

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

The boundary file now have nFaces=0:

Code:

    Int-1
    {
        type            wall;
        inGroups        List<word> 1(wall);
        nFaces          0;
        startFace      90332;

6. Now you can delete the Int-1 and Int-2 from boundary file, and from BC files (p, U), or you can just run.

7.
Code:

simpleFoam


All times are GMT -4. The time now is 12:45.