CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   mergePatchPairs (http://www.cfd-online.com/Forums/openfoam/69044-mergepatchpairs.html)

 sarajags_89 October 10, 2009 01:16

mergePatchPairs

Hi I wanted to try the merge patchpair option ...I couldnt figure out where I went wrong..
help pls
/*--------------------------------*- 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)
(3 0 0)
(0 0 1)
(3 0 1)
(0 1 0)
(3 1 0)
(0 1 1)
(3 1 1)
(0 0 2)
(3 0 2)
(0 0 3)
(3 0 3)
(0 1 2)
(3 1 2)
(0 1 3)
(3 1 3)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
hex (8 9 10 11 12 13 14 15 ) (20 20 1) simpleGrading (1 1 1)
);

edges
(
);

patches
(
wall fixedWalls
(//walls of block 1
(7 5 4 6)
(0 4 5 1)
(5 7 3 1)
(0 1 3 2)
(6 2 3 7)
(4 0 2 6)
//walls of block2
(8 12 13 9)
(9 13 15 11)
(11 10 14 15)
(9 11 10 8)
(10 8 12 14)
)
empty frontAndBack
(

)
);

mergePatchPairs
(
(<8 12 13 9> <6 2 3 7>) //merge patch pair 0
);

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

 tstovall October 12, 2009 12:16

The inputs for mergePatchPairs are patch names. Make your blockMeshDict file look like this:

...
patches
(
wall fixedWalls
(//walls of block 1
(7 5 4 6)
(0 4 5 1)
(5 7 3 1)
(0 1 3 2)
// (6 2 3 7) remove this face for stitching
(4 0 2 6)
//walls of block2
// (8 12 13 9) remove this face for stitching
(9 13 15 11)
(11 10 14 15)
(9 11 10 8)
(10 8 12 14)
)
patch stitchPatch1
(
(6 2 3 7) \\rename face here for stitching
)
patch stitchPatch2
(
(8 12 13 9) \rename face here for stitching
)

);

mergePatchPairs
(
( stitchPatch1 stitchPatch2 ) \\ use patch names as input for mergePatchPairs
);

This should work for you.

On another issue: I've been getting error messages with the mergePatchPairs feature as follows: Any ideas on how to fix this? I've checked the mesh and the faces for merging are of the same size and flush together.

blockMesh output...

Creating cells

Creating patches

Creating mesh from block mesh

Default patch type set to empty
Creating merge patch pairs