CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   blockMesh: merging two unmatching faces (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/88976-blockmesh-merging-two-unmatching-faces.html)

pbe_cfd May 31, 2011 13:00

blockMesh: merging two unmatching faces
 
2 Attachment(s)
Hi,

I try to mesh the following geometry to understand how "mergePatchPairs" works.
Attachment 7863

The mesh looks fine but I strongly doubt that faces are merged properly. Here is the blockMeshDict,
Attachment 7864

Moreover, checkMesh doesn't complain and indicates only 1 Region, however icoFoam doesn't run for this mesh and complains as follows .

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++
This mesh contains patches of type empty but is not 1D or 2D by virtue of
the fact that the number of faces of this empty patch is not divisible by
the number of cells.
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

I suppose, an experienced eye will catch the mistake(s) immediately...

cheers,
Evren

MartinB May 31, 2011 15:28

Hi Evren,

you must define the wall patches, afterwards it works fine (tested with simpleFoam):
Code:

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

convertToMeters 1;

vertices
(
    (0.0  0.00 0.0 )//0
    (1.0  0.00 0.0 )//1
    (1.0  1.00 0.0 )//2
    (0.0  1.00 0.0 )//3
    (1.0  0.25 0.25)//4
    (2.0  0.25 0.25)//5
    (2.0  0.75 0.25)//6
    (1.0  0.75 0.25)//7
    (0.0  0.00 1.0 )//8
    (1.0  0.00 1.0 )//9
    (1.0  1.00 1.0 )//10
    (0.0  1.00 1.0 )//11
    (1.0  0.25 0.75)//12
    (2.0  0.25 0.75)//13
    (2.0  0.75 0.75)//14
    (1.0  0.75 0.75)//15
);

blocks
(
    hex (0 1 2 3 8 9 10 11  ) block1 (4 4 4) simpleGrading (1 1 1)//B1
    hex (4 5 6 7 12 13 14 15) block2 (2 2 2) simpleGrading (1 1 1)//B2
);

edges
(
);

patches
(
    patch inlet
    (
        (5 13 14 6)
    )
    patch outlet
    (
        (0 8 11 3)
    )
    patch master1
    (
        (1 9 10 2) // face of the big cube
    )
    patch slave1
    (
        (4 12 15 7) // face of the small cube
    )
    wall wall
    (
        (8 9 10 11)
        (11 10 2 3)
        (0 1 2 3)
        (12 13 14 15)
        (15 14 6 7)
        (12 13 5 4)
        (4 5 6 7)
        (8 9 1 0)
    )
);

mergePatchPairs
(
        (master1 slave1)
);

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

Since master1 and slave1 do not fit exactly, you must define a patch for master1 in U and p.

Martin

lmblanes June 1, 2011 05:28

I dont think you have to specify Slave and Mater either, if the two boxes are matching their surfaces try to simple input "mergepatchpairs" and that's it...

BlockMesh needs for all the block surfaces to be defined as a patch. If not, it generates a "defaultFaces" patch set to "empty", that means that there is no solution for the surface, therefore is a 1D or a 2D problem. As your geometry is 3D, the error message is warning you about that issue, and that it will not run.

For this simple geometry you can just set it manually in the "boundary" dictionary, and set the defaultPatch type to "wall"

Consult the User Guide first Tutorial.
LuisBlanes

pbe_cfd June 1, 2011 07:30

As Martin suggests it works with icoFoam, as well. Moreover, Luis has a point if in the boundary file defaultPatch is set to wall, it's not necessary to specify every single cell for walls. That is a trick, I have already used couple of time, even for more complex geometries it works well. Nevertheless, one has to specify which patches to be merged.

@ Luis:
Quote:

if the two boxes are matching their surfaces try to simple input "mergepatchpairs" and that's it...
could you be a little more specific, please?

Thanks,
Evren

lmblanes June 1, 2011 08:01

I just was stating that:

Page U-138 of the User Guide
(...)To connect two blocks with face matching, the two patches that form the connection should simply be ignored from the patches list. blockMesh then identifies that the faces do not form an external boundary and combines each collocated pair into a single internal faces that connects cells from the two blocks (...)

yours
Luis Blanes

pbe_cfd June 1, 2011 08:04

Ok, that's clear for matching faces, that's no good for unmatching faces... Everything is clear....

by the way thanks ;-)

Cheers,
Evren

vaina74 October 22, 2014 04:51

Hi foamers, I'm trying to use blockMesh and mergePatchPairs and my starting simple case is similar to pbe_cfd's one.
If I'm correct, p and U need a boundary definition only for the big block face and not for the small cube one. It's not clear to me how to apply patch settings to the not-overlapped area, I think that a wall boundary (for the patch and p or U) on the big block face is not compatible with the inlet or outlet flow. I open a thread but I had no reply so far.
Thanks for your attention.


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