CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Using createPatch and cyclicAMI in FOAM Extend to create periodicbox

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By manuc

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2018, 04:21
Default Using createPatch and cyclicAMI in FOAM Extend to create periodicbox
  #1
Senior Member
 
Manu Chakkingal
Join Date: Feb 2016
Location: Delft, Netherlands
Posts: 129
Rep Power: 10
manuc is on a distinguished road
Hello All,
I am interested in creating a box, periodic in 2 directions (X and Z directions) with the wall in Y direction. I want to validate the capability of FOAM Extend 4.0 to carryout Rayleigh Benard convection with unstructured grid and no-turbulence models. As first step I create a structured mesh with ANSYS and try to work with it as below.

Steps I follow
1. I create mesh in ANSYS, covert it to a .cas file
2. FluentMeshToFoam *.cas

My boundary file would look like:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

6
(
    w_r
    {
        type            wall;
        nFaces          40000;
        startFace       5820400;
    }
    w_l
    {
        type            wall;
        nFaces          40000;
        startFace       5860400;
    }
    w_to
    {
        type            patch;
        nFaces          9800;
        startFace       5900400;
    }
    w_bo
    {
        type            patch;
        nFaces          9800;
        startFace       5910200;
    }
    w_fo
    {
        type            patch;
        nFaces          9800;
        startFace       5920000;
    }
    w_ko
    {
        type            patch;
        nFaces          9800;
        startFace       5929800;
    }
)


// ************************************************************************* //
Please note: w_to,w_bo,w_fo,w_ko had type wall which was changed to patch.

3. Make a system/reatePatchDict as below:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// This application/dictionary controls:
// - optional: create new patches from boundary faces (either given as
//   a set of patches or as a faceSet)
// - always: order faces on coupled patches such that they are opposite. This
//   is done for all coupled faces, not just for any patches created.
// - optional: synchronise points on coupled patches.

// 1. Create cyclicAMI:
// - specify where the faces should come from
// - specify the type of cyclicAMI. If a rotational specify the rotationAxis
//   and centre to make matching easier
// - pointSync true to guarantee points to line up.

// 2. Correct incorrect cyclicAMI:
// This will usually fail upon loading:
//  "face 0 area does not match neighbour 2 by 0.0100005%"
//  " -- possible face ordering problem."
// - change patch type from 'cyclicAMI' to 'patch' in the polyMesh/boundary file.
// - loosen match tolerance to get case to load
// - regenerate cyclicAMI as above

// Tolerance used in matching faces. Absolute tolerance is span of
// face times this factor. To load incorrectly matches meshes set this
// to a higher value.
matchTolerance 1E-3;

// Do a synchronisation of coupled points after creation of any patches.
pointSync false;

// Patches to create.
patchInfo
(
    {
        // Name of new patch
        name w_f;

        // Type of new patch
        dictionary
        {
            type       	cyclicAMI;
            transform  	translational;
            neighbourPatch  w_k;
           
        }
           constructFrom   patches;
           patches (w_fo);

        
    }

{
        // Name of new patch
        name w_k;

        // Type of new patch
        dictionary
        {
            type       	cyclicAMI;
            transform  	translational;
            neighbourPatch  w_f;
           
        }       
        constructFrom   patches;
        patches         (w_ko);

        
    }



{
        // Name of new patch
        name w_t;

        // Type of new patch
        dictionary
        {
            type       	cyclicAMI;
         transform  	translational;
            neighbourPatch  w_b;
           
        }
       
        constructFrom   patches;
        patches         (  w_to);

        
    }

{
        // Name of new patch
        name w_b;

        // Type of new patch
        dictionary
        {
            type       	cyclicAMI;
            transform  	translational;
            neighbourPatch  w_t;
           
        }
       
        constructFrom   patches;
        patches         ( w_bo);

        
    }

);


// ************************************************************************* //
4.Run createPatch -overwrite
5. After the step 4. my constant/boundary file looks like:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

6
(
    w_r
    {
        type            wall;
        nFaces          40000;
        startFace       5820400;
    }
    w_l
    {
        type            wall;
        nFaces          40000;
        startFace       5860400;
    }
    w_f
    {
        type            cyclicAMI;
        nFaces          9800;
        startFace       5900400;
        transform       translational;
        neighbourPatch  w_k;
    }
    w_k
    {
        type            cyclicAMI;
        nFaces          9800;
        startFace       5910200;
        transform       translational;
        neighbourPatch  w_f;
    }
    w_t
    {
        type            cyclicAMI;
        nFaces          9800;
        startFace       5920000;
        transform       translational;
        neighbourPatch  w_b;
    }
    w_b
    {
        type            cyclicAMI;
        nFaces          9800;
        startFace       5929800;
        transform       translational;
        neighbourPatch  w_t;
    }
)


// ************************************************************************* //
6. Below are my fvSchemes
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         Gauss linear;
    div(phi,U)      Gauss linear;
    div(phi,T)      Gauss linear;
    div(phi,k)      Gauss linear;
    div(phi,epsilon) Gauss linear;
    div(phi,R)      Gauss linear;
    div(R)          Gauss linear;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
    laplacian(kappaEff,T) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DREff,R) Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}




*/

// ************************************************************************* //
fvSolution
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{

  p
    {
        solver           GAMG;
        tolerance        1e-7;
        relTol           1e-3;

        smoother         GaussSeidel;

        cacheAgglomeration  true;
        nCellsInCoarsestLevel 10;
        agglomerator     faceAreaPair;
        mergeLevels      1;
    }

pFinal
    {
        $p;
        tolerance        1e-7;
        relTol           0;
    }



    U
    {
        solver          BiCGStab;
        preconditioner  DILU;
        minIter          1;
        maxIter          1000;
        tolerance        1e-7;
        relTol           0.0001;

    }

    T
    {
        solver          BiCGStab;
        preconditioner  DILU;
        minIter          0;
        maxIter          1000;
        tolerance        1e-7;
        relTol           0.0001;

    }

    k
    {
        solver          BiCGStab;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0.1;
    }

    epsilon
    {
        solver          BiCGStab;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0.1;
    }

    R
    {
        solver          BiCGStab;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       0;
}

relaxationFactors
{
    rho             1;
    p               0.7;
    U               0.2;
    T               0.7;
    k               0.7;
    epsilon         0.7;
    R               0.7;
}



// ************************************************************************* //
7. The 0 Folder has:
a. 0/T
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300.5;

boundaryField
{
    w_l
    {
        type            fixedValue;
        value           uniform 301;

    }
    w_r
    {
        type            fixedValue;
        value           uniform 300;
    }
    ".*"
    {
        type            cyclicAMI;
        value    $internalField;
    }
}


// ************************************************************************* //
0/p
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    w_r
    {
        type            buoyantPressure;
        rho             rhok;
        value           uniform 0;
    }

    w_l
    {
        type            buoyantPressure;
        rho             rhok;
        value           uniform 0;
    }

    ".*"
    {
        type            cyclicAMI;
        rho             rhok;
        value $internalField;
    }
}


// ************************************************************************* //
0/U
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0.01);

boundaryField
{
    w_l
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    w_r
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }

    w_f
    {
        type            cyclicAMI;
        value           $internalField;
    }
w_k
    {
        type            cyclicAMI;
        value           $internalField;
    }

w_t
    {
        type            cyclicAMI;
        value           $internalField;
    }

w_b
    {
        type            cyclicAMI;
        value           $internalField;
    }

}


// ************************************************************************* //
8. Run buoyantBoussinesqSimpleFoam
9. I get the error message below

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  | For copyright notice see file Copyright         |
\*---------------------------------------------------------------------------*/
Build    : 4.0-efcc2b1b7df8
Exec     : buoyantBoussinesqSimpleFoam
Date     : Nov 27 2018
Time     : 09:15:57
Host     : hpc11
PID      : 19825
CtrlDict : "/home/manuchakkingal/foam/manuchakkingal-4.0/run/HOLLOW/werner/hex/system/controlDict"
Case     : /home/manuchakkingal/foam/manuchakkingal-4.0/run/HOLLOW/werner/hex
nProcs   : 1
SigFpe   : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: no convergence criteria found. Calculations will run for 50000 steps.


Reading g
Reading thermophysical properties

Reading field T

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Creating turbulence model

Selecting RAS turbulence model laminar
Calculating field beta*(g.h)


Starting time loop

--> FOAM Warning :
    From function timelineFunctionObject::timelineFunctionObject
    in file timelineFunctionObject/timelineFunctionObject.C at line 88
    No entry 'writeStartTime' in "::NusseltNumber_hot". Assuming 'no'
--> FOAM Warning :
    From function timelineFunctionObject::timelineFunctionObject
    in file timelineFunctionObject/timelineFunctionObject.C at line 88
    No entry 'writeStartTime' in "::NusseltNumber_cold". Assuming 'no'
--> FOAM Warning :
    From function dlLibraryTable::open(const dictionary& dict, const word& libsEntry, const TablePtr tablePtr)
    in file lnInclude/dlLibraryTableTemplates.C at line 67
    library "libsampling.so" did not introduce any new entries

Searching for probe point locations
Time = 1



--> FOAM FATAL ERROR:

    gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type cyclicAMI)
    on patch w_f of field U in file "/home/manuchakkingal/foam/manuchakkingal-4.0/run/HOLLOW/werner/hex/0/U"
    You are probably trying to solve for a field with a generic boundary condition.

    From function genericFvPatchField<Type>::gradientInternalCoeffs() const
    in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 832.

FOAM exiting
Threads used as reference

Periodic cyclic AMI + MRF crashing on pressure
problem with wallFunctions (kEpsilon model)

Can someone please help me to solve the same .


Thanks in advance

Regards
Manu
saidc. likes this.
__________________
Regards
Manu
manuc is offline   Reply With Quote

Old   April 12, 2022, 12:36
Default
  #2
New Member
 
Juan Salazar
Join Date: Jun 2019
Posts: 19
Rep Power: 7
saladbowl is on a distinguished road
For anyone following this thread, see post below:

CyclicAMI BC error
saladbowl is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using AMI vinz OpenFOAM Running, Solving & CFD 298 November 13, 2023 09:19
Setting cyclicAMI and cyclic Boundary conditions (ICEM Mesh to OpenFoam) bowen1024 OpenFOAM Pre-Processing 4 March 1, 2018 20:28
CyclicAMI issues vabishek OpenFOAM Pre-Processing 1 December 6, 2015 17:37


All times are GMT -4. The time now is 12:11.