CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Getting started with CyclicAMI (https://www.cfd-online.com/Forums/openfoam/190620-getting-started-cyclicami.html)

Algebraist July 18, 2017 11:46

Getting started with CyclicAMI
 
Hello all,

I'm trying to model the flow interaction between two connected channels, and I've set up the following geometry for the left channel 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.

I'd like to use cyclicAMI to connect the rough and fine areas of the mesh, as it seems impossible to merge the mesh and cyclicAMI is the next best thing.

Unfortunatly, I'm quite a novice at using OpenFOAM and I've been unable to find a good example of cyclicAMI being used with blockMesh.

This is my blockMeshDict file:

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 not sure what this error even means, in terms of how it pertains to my code.

Am I even correct in including the cyclicAMI boundary conditions in the blockMeshDict file?

C-L July 24, 2017 07:18

It seems you have spelt 'neighbour' wrong .. although I'm not sure if there are other more appropriate boundary conditions. Have you had a look at snappyHexMesh ? You will be able to refine the dark blue region without splitting up your blockMesh.

Algebraist July 26, 2017 17:17

Quote:

Originally Posted by C-L (Post 658211)
It seems you have spelt 'neighbour' wrong .. although I'm not sure if there are other more appropriate boundary conditions. Have you had a look at snappyHexMesh ? You will be able to refine the dark blue region without splitting up your blockMesh.

I feel rather silly now. :p

I've boon considering snappyHexMesh, but my supervisor would like to see if it's possible to do in just blockMesh first.

I've got it working below, but there are anomalies around the cyclicAMI patches:

https://s1.postimg.org/4k8hruji7/cavity18_velocity.png

At first I assumed they might just be the due to some oddity in how it dealt with the initial conditions, but running it for increasing time-steps has shown that while the sudden jump in pressure and velocity sometimes goes away, there are always some discontinuities present along the boundary.

Irrespective of whether I should just use snappyHexMesh (and I would welcome any advice on the pros and cons of it compared to the current method), I'm curious as to what causes the discontinuities seen above. Does anyone have an idea?

C-L July 27, 2017 04:07

The advantage of SHM in this case would be that you don't have to worry about specifying any interior boundary conditions - such as the cyclic part. Also, the mesh that SHM will generate may lead to a more accurate solution since the cell nodes will be shared rather than having to interpolate between them.

I think the image you have printed shows a feature of the paraview interpolation rather than the cell values. If you change the variable to its cell values rather than the interpolated point fields the issues may disappear.

Jikst February 11, 2019 01:39

Edit boundary file so its similar to mine. Obviously without the exact numbers and use whatever patch names you have.

AMI2
{
type cyclicAMI;
nFaces 9878;
startFace 4084895;
neighbourPatch AMI1;
}
AMI1
{
type cyclicAMI;
nFaces 10174;
startFace 4094773;
neighbourPatch AMI2;

*I know this thread is old but for anyone else who finds this thread.


All times are GMT -4. The time now is 19:51.