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/)
-   -   [mesh manipulation] StitchMesh and Interfaces problem (https://www.cfd-online.com/Forums/openfoam-meshing/137951-stitchmesh-interfaces-problem.html)

marluc June 25, 2014 18:15

StitchMesh and Interfaces problem
 
Dear All,

after running fluentMeshToFoam and stitchMesh I get the following output from checkMesh:

Code:

Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          21680
    internal points:  0
    faces:            42248
    internal faces:  20572
    cells:            10470
    faces per cell:  6
    boundary patches: 9
    point zones:      0
    face zones:      0
    cell zones:      0

Overall number of cells of each type:
    hexahedra:    10470
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    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: 2
    The mesh has multiple regions which are not connected by any face.
  <<Writing region information to "0/cellToRegion"
  <<Writing region 0 with 5235 cells to cellSet region0
  <<Writing region 1 with 5235 cells to cellSet region1

Checking patch topology for multiply connected surfaces...
    Patch              Faces    Points  Surface topology                 
    WALL-RIB-up        60      122      ok (non-closed singly connected) 
    WALL-up            95      194      ok (non-closed singly connected) 
    WALL-RIB-down      60      122      ok (non-closed singly connected) 
    WALL-down          95      194      ok (non-closed singly connected) 
    OUTLET              98      200      ok (non-closed singly connected) 
    INLET              98      200      ok (non-closed singly connected) 
    INTERFACE-up        115      232      ok (non-closed singly connected) 
    INTERFACE-down      115      232      ok (non-closed singly connected) 
    frontAndBackPlanes  20940    21680    ok (non-closed singly connected) 

Checking geometry...
    Overall domain bounding box (0 0 -0.2506) (22 12 0.2506)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-5.82137e-19 -2.01201e-17 8.24694e-19) OK.
    Max cell openness = 1.56737e-16 OK.
    Max aspect ratio = 4.64471 OK.
    Minimum face area = 0.0100249. Maximum face area = 0.232792.  Face area magnitudes OK.
    Min volume = 0.0050245. Max volume = 0.0415455.  Total volume = 128.307.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 5.28606e-13 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

Time = 1

Mesh stats
    points:          21664
    internal points:  0
    faces:            42241
    internal faces:  20795
    cells:            10470
    faces per cell:  6.02063
    boundary patches: 9
    point zones:      1
    face zones:      3
    cell zones:      0

Overall number of cells of each type:
    hexahedra:    10346
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:    124
    Breakdown of polyhedra by number of faces:
        faces  number of cells
            7  72
            8  20
            9  24
          10  8

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).

Checking patch topology for multiply connected surfaces...
                  Patch    Faces  Points                  Surface topology
            WALL-RIB-up      60      122  ok (non-closed singly connected)
                WALL-up      95      194  ok (non-closed singly connected)
          WALL-RIB-down      60      122  ok (non-closed singly connected)
              WALL-down      95      194  ok (non-closed singly connected)
                  OUTLET      98      198  ok (non-closed singly connected)
                  INLET      98      198  ok (non-closed singly connected)
            INTERFACE-up        0        0                        ok (empty)
          INTERFACE-down        0        0                        ok (empty)
      frontAndBackPlanes    20940    21664  ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (0 0 -0.2506) (22 12 0.2506)
    Mesh (non-empty, non-wedge) directions (1 1 0)
    Mesh (non-empty) directions (1 1 0)
    All edges aligned with or perpendicular to non-empty directions.
    Boundary openness (-6.05475e-19 1.44683e-17 8.57756e-19) OK.
    Max cell openness = 1.56737e-16 OK.
    Max aspect ratio = 4.64471 OK.
    Minimum face area = 0.00353238. Maximum face area = 0.232792.  Face area magnitudes OK.
    Min volume = 0.0050245. Max volume = 0.0415455.  Total volume = 128.307.  Cell volumes OK.
    Mesh non-orthogonality Max: 57.2336 average: 3.50758
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 1.52343 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

End

In the file constant/polymesh/boundary I find the two interfaces with nFaces 0.

Do I have to delete them from this file (and accordingly change the number of patches at the top of the file?
And should i then always use ciclicAMI BC for them in the IO field files in the /0 directory?

Actually I have changed the word interface to wall in the .msh file before running fluentMeshToFoam otherwise the interfaces wouldn't have been written to the boundary file and I would have not been able to run stitchMesh (no interfaces were found). Is this correct?

Thank you in advance for your help.
Regards,
Luca

student666 June 25, 2014 19:46

Hi Luca,
Quote:

Do I have to delete them from this file (and accordingly change the number of patches at the top of the file?
after you run stitchMesh, you can delete boundary patches with nFaces = 0 and you have to adjust number of boundary at the top of the file.

Quote:

And should i then always use ciclicAMI BC for them in the IO field files in the /0 directory?
if you're intention is to make "interfaces" between to domains, for example fixed.domain and rotating domain like as MRFSimpleFoam, you have to specify interfaces as cyclicAMI and you don't have to run stitchMesh; stitchMesh allows you to remove internal faces.


Quote:

Actually I have changed the word interface to wall in the .msh file before running fluentMeshToFoam otherwise the interfaces wouldn't have been written to the boundary file and I would have not been able to run stitchMesh (no interfaces were found). Is this correct?
can't give you any advice.

Bye!

marluc June 26, 2014 06:33

Dear All,

I found the solution to my problem.

The mesh generated with Gambit contained two overlapping interfaces which has been defined as type interface. Before using stitchMesh I edited the .msh file and changed at the bottom of it interface to wall.
Then I ran fluentMeshToFoam.
Then with checkMesh I verified that I had two distinct regions, i.e. two separate volumes (*Number of regions: 2).

Now I have modified the field files in the 0 directory (p, U etc.) according to the patches listed in the file ./constant/polymesh/boundary. I have assigned a boundary conditions to the patches INTERFACE-up and INTERFACE-down as well.

After that I made the following steps (note that the directory is named 1 because of the deltaT in the controlDict. You can change it of course to obtain another directory name):
Code:

stitchMesh INTERFACE-up INTERFACE-down
rm -r ./constant/polymesh
mv ./1/polymesh ./constant
rm -r 1/

Again with checkMesh I verified to have only one region left
(*Number of regions: 1).

I didn't remove the INTERFACE patches neither from the boundary file (even if their face number is zero (nfaces 0)) nor from the field files (p, U, etc.).

...and I could run my case with a non-conformal mesh.

Hope it helps.
Regards,
Luca


Eloise June 27, 2014 07:50

Quote:

Originally Posted by marluc (Post 498772)

I didn't remove the INTERFACE patches neither from the boundary file (even if their face number is zero (nfaces 0)) nor from the field files (p, U, etc.).

Hi Luca,

If you want to remove the patches with 0 faces, you can run the command "createPatch" with this createPatchDict in your system/ directory:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches
//      with transformations (i.e. cyclics).
pointSync false;

// Patches to create.
patches
(
);

// ************************************************************************* //

You will actually note create any patch, but this command automatically removes empty patches from the boundary file at the end of its execution. And you can then remove those patches from your field files.

As you noticed, it is not absolutely needed for the simulation to run, but it makes it cleaner :)

I hope that helps!
Regards,
Eloïse

marluc June 27, 2014 15:43

Dear Eloïse,

nice tip...I didn't know it but it works perfectly!
Thanks a lot!

Regards,
Luca

f0208secretx August 8, 2015 17:29

Hi,

Thanks. I followed the instruction and the interface is stitched as advertised.

I am curious though: this process creates several more severly nonorthogonal faces (>70 degrees). Because I am running DES, I am worried that this would have adverse effects on the accuracy.

Have you tried to compare this approach (which obviously works topologically), and the AMI approach by directly assigning BC to interfaces? Which one is more appropriate in terms of accuracy?


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