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/)
-   -   [blockMesh] Merging multiple blocks of diferent mesh density. (https://www.cfd-online.com/Forums/openfoam-meshing/190221-merging-multiple-blocks-diferent-mesh-density.html)

Algebraist July 7, 2017 20:27

Merging multiple blocks of diferent mesh density.
 
Hello all,

I'm trying to set up the following geometry in with blockMesh:

https://s2.postimg.org/m0wwik5pl/Single_Duct_1.png
Where the light blue area represents a coarse mesh, and the darker blue a fine mesh.

The simplest way to do it would be to simply use face matching to ensure the rough sections is all connected, but then using mergePatchPairs to connect the three inner faces of the fine section won't work because of adjacency.

Merging the top and bottom boxes into the center box and then using merging the left rough box into that combined box doesn't work either because it creates faces with less then 3 points.

Can anyone suggest a work around?

I've also heard people suggesting connecting such a geometry with cyclical boundaries - but doesn't that only work with meshes of the same density?

Algebraist July 15, 2017 14:04

CyclicAMI seems to actually be my best bet, but I'm not sure how to use it. Below is my best guess based on checking several threads here on CFD Online and the OpenFOAM user guide.

Code:

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

convertToMeters 0.1;

vertices
(
//left rough 'c' box
    //back plane
        (0 0 0)//0
        (180 0 0)//1
        (260 0 0)//2
        (260 90 0)//3
        (180 90 0)//4
        (180 170 0)//5
        (260 170 0)//6
        (260 260 0)//7
        (180 260 0)//8
        (0 260 0)//9
    //front plane
        (0 0 20)//10
        (180 0 20)//11
        (260 0 20)//12
        (260 90 20)//13
        (180 90 20)//14
        (180 170 20)//15
        (260 170 20)//16
        (260 260 20)//17
        (180 260 20)//18
        (0 260 20)//19
       
//left center box
    //back plane
        (180 90 0)//20
        (260 90 0)//21
        (260 170 0)//22
        (180 170 0)//23

    //front plane
        (180 90 20)//24
        (260 90 20)//25
        (260 170 20)//26
        (180 170 20)//27

);

blocks
(
    hex (0 1 8 9 10 11 18 19) (18 26 20) simpleGrading (1 1 1)//left rough box
    hex (1 2 3 4 11 12 13 14) (8 9 20) simpleGrading (1 1 1)//left bottom box
    hex (20 21 22 23 24 25 26 27) (16 160 20) simpleGrading (1 1 1)//left center box, note doubled mesh density
    hex (5 6 7 8 15 16 17 18) (8 9 20) simpleGrading (1 1 1)//left top box
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (10 11 18 19)//left rough box
            (11 12 13 14)//left bottom box
            (24 25 26 27)//left center box
            (15 16 17 18)//left top box
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (0 1 8 9)//left rough box
            (1 2 3 4)//left bottom box
            (20 21 22 23)//left center box
            (5 6 7 8)//left top box
        );
    }
    fixedWalls
    {
        type wall;
        faces
        (
            //left rough box
        (0 1 11 10)//bottom
        (0 10 19 9)//left wall
        (8 9 19 18)//top
            //left bottom box
        (1 2 12 11)//bottom
        (2 3 13 12)//right
            //left center box
        (21 22 26 25)//right
            //left top box
        (8 18 17 7)//top
        (6 7 17 16)//right
        );
    } 

//use the Arbitray Mesh Interface next 

//*********************
    inTopInterface
    {
        type cyclicAMI;
    neighborPatch outTopInterface;
        faces
        (
            (22 23 27 26)//
        );
    } 
    outTopInterface//
    {
        type cyclicAMI;
    neighborPatch inTopInterface;
        faces
        (
            (5 6 16 15)//
        );
    }


//*********************
    outBottomInterface
    {
        type cyclicAMI;
    neighborPatch inBottomInterface;
        faces
        (
            (3 4 14 13)//
        );
    }
    inBottomInterface
    {
        type cyclicAMI;
    neighborPatch outBottomInterface;
        faces
        (
            (20 21 25 24)//
        );
    }
//*********************
    leftRightInterface
    {
        type cyclicAMI;
    neighborPatch rightLeftInterface;
        faces
        (
            (1 8 18 11)//
        );
    }
    rightLeftInterface
    {
        type cyclicAMI;
    neighborPatch leftRightInterface;
        faces
        (
            (20 24 27 23)//
        );
    }

);

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

Unfortunately, it's giving me the following error:

Quote:

--> FOAM FATAL IO ERROR:
No "neighbourPatch" or "coupleGroup" provided.
I'm at a loss as to how to proceed.

Antimony July 18, 2017 22:28

Hi,

Seems to me that it is a simple issue with your spelling. ;)

neighbourPatch uses the British spelling, while you have used the American spelling.

Cheers,
Antimony

Algebraist July 19, 2017 09:29

Quote:

Originally Posted by Antimony (Post 657555)
Hi,

Seems to me that it is a simple issue with your spelling. ;)

neighbourPatch uses the British spelling, while you have used the American spelling.

Cheers,
Antimony

It's always the little things that get you. :o

Thanks Antimony.


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