CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   CyclicAMI issues (https://www.cfd-online.com/Forums/openfoam-pre-processing/162748-cyclicami-issues.html)

vabishek November 16, 2015 15:59

CyclicAMI issues
 
Hello FOAMers,

I am trying to set-up a very simple geometry ( a rectangular channel) that has cyclic boundary conditions on the side walls. The createPatch works perfectly when the rectangular channel is perfectly straight. The blockMeshDict file looks like:

Code:


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

convertToMeters 1;

vertices
(
  (-0.040 0.5 0.0)      //1
  (0.0400 0.5 0.0)      //2
  (0.04 1 0.0)  //3
  (-0.04 1 0.0)      //4
  (-0.040 0.5 0.05)    //5
  (0.0400 0.5 0.05)    //6
  (0.04 1 0.05)          //7
  (-0.04 1 0.05)    //8
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (20 20 20) simpleGrading (1 1 1)
 
);

edges
(
);

boundary
(
  topWall
  {
  type symmetry;
  faces
  (
    //top
    (4 5 6 7)
  );
  }

  bottomWall
  {
  type symmetry;
  faces
  (
    //Bottom
    (0 1 2 3)
  );
  }

  Inlet
  {
  type patch;
  faces
  (
    (0 1 5 4)
  );
  }
 
  leftWall_1
  {
  type patch;
  faces
  (
    (0 4 7 3)
  );
  }


  rightWall_1
  {
  type patch;
  faces
  (
    (1 5 6 2)
    );
  }
 
  Outlet
  {
  type patch;
  faces
  (
    (3 2 6 7)
  );
  }
);

mergeMatchPairs();
// ************************************************************************* //

And, my createPatchDict

Code:


/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.1                                |
|  \\  /    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. cyclicAMIAMI;s).
pointSync false;

// Patches to create.
patches
(
    {
        //- Master side patch
        name            leftWall;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  rightWall;
            transform      rotational;
        rotationAxis    (0 0 1);
        rotationCentre  (0 0 0);
        matchTolerance 1e-7;
        }
        constructFrom patches;
        patches (leftWall_1);
    }

    {
        //- Slave side patch
        name            rightWall;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  leftWall;
            transform      rotational;
            rotationAxis    (0 0 1);
            rotationCentre  (0 0 0);
        matchTolerance 1e-7;
        }
        constructFrom patches;
        patches (rightWall_1);
    }
);

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

The result from createPatch -overwrite is

Code:


Doing topology modification to order faces.

AMI: Creating addressing and weights between 400 source faces and 400 target faces
AMI: Patch source sum(weights) min/max/average = 1, 1, 1
AMI: Patch target sum(weights) min/max/average = 1, 1, 1
Not synchronising points.

However, when I make the channel inclined, the patches do not match perfectly. The blockMeshDict for this case looks like:

Code:

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

convertToMeters 1;

vertices
(
  //inclined
  (-0.04 0.5 0.0)      //1
  (0.04 0.5 0.0)      //2
  (0.54 1 0.0)      //3
  (0.46 1 0.0)      //4
  (-0.04 0.5 0.05)    //5
  (0.04 0.5 0.05)    //6
  (0.54 1 0.05)      //7
  (0.46 1 0.05)    //8
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (20 20 20) simpleGrading (1 1 1)
 
);

edges
(
);

boundary
(
  topWall
  {
  type symmetry;
  faces
  (
    //top
    (4 5 6 7)
  );
  }

  bottomWall
  {
  type symmetry;
  faces
  (
    //Bottom
    (0 1 2 3)
  );
  }

  Inlet
  {
  type patch;
  faces
  (
    (0 1 5 4)
  );
  }
 
  leftWall_1
  {
  type patch;
  faces
  (
    (0 4 7 3)
  );
  }


  rightWall_1
  {
  type patch;
  faces
  (
    (1 5 6 2)
    );
  }
 
  Outlet
  {
  type patch;
  faces
  (
    (3 2 6 7)
  );
  }
);

mergeMatchPairs();
// ************************************************************************* //

The corresponding createPatchDict is

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.1                                |
|  \\  /    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. cyclicAMIAMI;s).
pointSync false;

// Patches to create.
patches
(
    {
        //- Master side patch
        name            leftWall;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  rightWall;
            transform      rotational;
        rotationAxis    (0 0 1);
        rotationCentre  (0.5 0 0);
        matchTolerance 1e-7;
        }
        constructFrom patches;
        patches (leftWall_1);
    }

    {
        //- Slave side patch
        name            rightWall;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  leftWall;
            transform      rotational;
            rotationAxis    (0 0 1);
            rotationCentre  (0.5 0 0);
        matchTolerance 1e-7;
        }
        constructFrom patches;
        patches (rightWall_1);
    }
);

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

The result from createPatch -ovewrite for this case looks like:

Code:

Doing topology modification to order faces.

AMI: Creating addressing and weights between 400 source faces and 400 target faces
--> FOAM Warning :
    From function AMIMethod<SourcePatch, TargetPatch>::checkPatches()
    in file lnInclude/AMIMethod.C at line 57
    Source and target patch bounding boxes are not similar
    source box span    : (0.5 0.5 0.05)
    target box span    : (0.45792892 0.53879598 0.05)
    source box          : (-0.04 0.5 0) (0.46 1 0.05)
    target box          : (0.0010730179 0.4611636 0) (0.45900194 0.99995958 0.05)
    inflated target box : (-0.034370599 0.42571998 -0.035443617) (0.49444555 1.0354032 0.085443617)
AMI: Patch source sum(weights) min/max/average = 0.98000598, 1, 0.9990003
AMI: Patch target sum(weights) min/max/average = 0.98000598, 1, 0.9990003
Not synchronising points.

It looks like there is no perfect match between the faces, and some "points' on the target face are not being captured accurately. Am I missing something here? Any comments/suggestions would help.

Thanks,

Abishek

PS: Link for test cases: https://www.dropbox.com/sh/uwj5uq6mo...v15KWIqma?dl=0

wyldckat December 6, 2015 16:37

Quick answer: The transformation here cannot be rotational, it has to be translational:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.1                                |
|  \\  /    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. cyclicAMIAMI;s).
pointSync false;

// Patches to create.
patches
(
    {
        //- Master side patch
        name            leftWall;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  rightWall;
            transform      translational;
            separationVector  (0.08 0.0 0.0);
            matchTolerance 1e-7;
        }
        constructFrom patches;
        patches (leftWall_1);
    }

    {
        //- Slave side patch
        name            rightWall;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  leftWall;
            transform      translational;
            separationVector  (-0.08 0.0 0.0);
            matchTolerance 1e-7;
        }
        constructFrom patches;
        patches (rightWall_1);
    }
);

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



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