CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Setting up cyclic boundary condition

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By nimasam

Reply
 
LinkBack Thread Tools Display Modes
Old   October 20, 2015, 08:46
Default Setting up cyclic boundary condition
  #1
Senior Member
 
Join Date: Mar 2015
Posts: 180
Rep Power: 3
KateEisenhower is on a distinguished road
Hello foamers,

I am trying to set up cyclic boundary condition for the front and back patch of my wind tunnel-like mesh. My /constant/polyMesh/boundary file looks as follows:

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      binary;
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

7
(
    front
    {
        type            cyclic;
        nFaces          139111;
        startFace       16106807;
        matchTolerance  0.0001;
        neighbourPatch  back;

    }
    bottom
    {
        type            wall;
        physicalType    wall;
        nFaces          6981;
        startFace       16245918;
    }
    back
    {
        type            cyclic;
        nFaces          139111;
        startFace       16252899;
        matchTolerance  0.0001;
        neighbourPatch  front;
    }
    outlet
    {
        type            patch;
        physicalType    outlet;
        nFaces          15639;
        startFace       16392010;
    }
    object
    {
        type            wall;
        physicalType    wall;
        nFaces          16029;
        startFace       16407649;
    }
    top
    {
        type            wall;
        physicalType    wall;
        nFaces          9321;
        startFace       16423678;
    }
    inlet
    {
        type            patch;
        physicalType    inlet;
        nFaces          12168;
        startFace       16432999;
    }
)
My /0/U file is the following:

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       volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (10 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform (10 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

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



    front
    {
        type            cyclic;
    }

    back
    {
        type            cyclic;
    }

    top
    {
        type            slip;
    }

    bottom
    {
        type            slip;
    }

}
The p, k, omega and nut files are set up accordingly.

When running potentialFoam on this case, I get the following:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.3.1-262087cdf8db
Exec   : potentialFoam
Date   : Oct 20 2015
Time   : 14:02:12
Host   : "asdf.asdf.local"
PID    : 43912
Case   : /Users/kateeisenhower/Documents/asdf/asdf_cyclic
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0



--> FOAM FATAL ERROR: 
face 6981 area does not match neighbour by 0.0936416% -- possible face ordering problem.
patch:front my area:9.84893e-10 neighbour area:9.85816e-10 matching tolerance:0.0001
Mesh face:16113788 fc:(0.750509 -0.05 -0.165463)
Neighbour fc:(0.750509 0.05 -0.165463)
If you are certain your matching is correct you can increase the 'matchTolerance' setting in the patch dictionary in the boundary file.
Rerun with cyclic debug flag set for more information.

    From function cyclicPolyPatch::calcTransforms()
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 221.

FOAM exiting
Because I am relatively certain that my matching is correct, I increased my matchTolerance to 1. Then potentialFoam runs as expected. But I guess simply setting the matchTolerance to 1 is not the solution.

When I set the matchTolerance to 0.1, I get a similar Error as with 0.0001:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.3.1-262087cdf8db
Exec   : potentialFoam
Date   : Oct 20 2015
Time   : 14:36:32
Host   : "asdf.asdf.local"
PID    : 6940
Case   : /Users/kateeisenhower/Documents/asdf/asdf_cyclic
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 0



--> FOAM FATAL ERROR: 
face 7012 area does not match neighbour by 10.2174% -- possible face ordering problem.
patch:front my area:4.48033e-09 neighbour area:4.96274e-09 matching tolerance:0.1
Mesh face:16113819 fc:(0.751172 -0.05 -0.163784)
Neighbour fc:(0.751174 0.05 -0.163784)
If you are certain your matching is correct you can increase the 'matchTolerance' setting in the patch dictionary in the boundary file.
Rerun with cyclic debug flag set for more information.

    From function cyclicPolyPatch::calcTransforms()
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 221.

FOAM exiting
In order to solve this problem and to make sure my matching is correct, I would like to view the mentioned face 7012 in ParaView. Maybe I can get some clue then. How can I do that?

I'd appreciate any help/comments/ideas on this.

Best regards,

Kate

p.s.: Sorry but I'm not allowed to share my mesh.

Quick update: It seems to run with cyclicAMI instead of cyclic. Don't know why and don't know really what cyclicAMI is doing but I am looking into this right now.

Another update: I found this website (http://www.openfoam.org/version2.3.0/ami.php) which was part of the OpenFOAM 2.3.0 release notes. The first sentence of this document tells the reader that

Quote:
AMI was introduced to enable simulation across disconnected, adjacent, mesh domains.
I donít understand this. Disconnected is the opposite of adjacent, right? Iím not a native speaker, so please correct me if Iím wrong.

Next, as I understand it a face doesnít have to match exactly with its counterpart. If this is the case, a face takes contributions from several counterpart-faces. This is no problem as far as the whole face is covered by parts of the counterpart faces. Then the weight of the face equals 1. But it may also be the case that the weight of a face deviats from 1.
Now my question is: How can this happen if the surface mesh doesn't have holes in it? Doesnít the simulation diverge then? The only possibility I can imagine is, that the border lines of the two patches donít match.

As already mentioned, in my case with cyclicAMI potentialFoam is working. But I get the following message:

Code:
AMI: Creating addressing and weights between 139111 source faces and 139111 target faces
AMI: Patch source sum(weights) min/max/average = 0.999985, 1.00001, 1
AMI: Patch target sum(weights) min/max/average = 0.999975, 1.00003, 1
No finite volume options present
I think this means that not all of my faces are completely matched. Do I have to worry about it?

Overall, you can only use cyclic boundary condition if the two patches are exactly the same. You have to use cyclicAMI for all the rest, right? This means if you work with an unstructured mesh, you have to use cyclicAMI?

Last edited by KateEisenhower; October 20, 2015 at 11:16.
KateEisenhower is offline   Reply With Quote

Old   October 22, 2015, 05:40
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,189
Blog Entries: 1
Rep Power: 15
nimasam is on a distinguished road
nice job!

Quote:
I think this means that not all of my faces are completely matched. Do I have to worry about it?
1- you are right there is no exact match between faces.
2- nope, its ok!
Quote:
Overall, you can only use cyclic boundary condition if the two patches are exactly the same. You have to use cyclicAMI for all the rest, right? This means if you work with an unstructured mesh, you have to use cyclicAMI?
1- again you right
2-absolutely true ,
KateEisenhower likes this.
__________________
Telegram channel (https://telegram.me/openfoam4Iranian)
My Weblog (http://openfoam.blogfa.com/)
Training Course on OpenFOAM at (http://www.isme.ir/)
nimasam is offline   Reply With Quote

Old   November 12, 2015, 08:44
Default
  #3
New Member
 
Hannes Grimm-Strele
Join Date: Sep 2015
Posts: 7
Rep Power: 2
HannesGS is on a distinguished road
Quote:
Originally Posted by KateEisenhower View Post
Overall, you can only use cyclic boundary condition if the two patches are exactly the same. You have to use cyclicAMI for all the rest, right? This means if you work with an unstructured mesh, you have to use cyclicAMI?
I disagree with this part. To my knowledge it is true that the cyclic boundary condition requires the location of all points to match. Patches with cyclicAMI can have non-matching points, but the patch boundaries should match, too.

Why should it be impossible to have matching connections with an unstructured mesh?

Odd cyclic boundary... please help!

How do you generate your mesh? It seems odd to me that the matching error increases after you change your mesh tolerance. Can you read your mesh into Paraview? Are the cyclic boundaries rotational or translational?
HannesGS is offline   Reply With Quote

Old   November 12, 2015, 09:43
Default
  #4
Senior Member
 
Join Date: Mar 2015
Posts: 180
Rep Power: 3
KateEisenhower is on a distinguished road
Hello Hannes and thank you for your answer!

Your first paragraph is confusing to me. Are you refering to the nodes of the individual elements when you are talking of points?

Regarding the unstructered mesh, maybe there is a misunderstanding. In a unstructered mesh it is highly unlikely that all the faces on two different boundaries do match, isn't it?

I generated a structured mesh with gmsh and then imported it with gmshToFoam. My cyclic boundaries are translational and yes, I can read my mesh into paraview.

Best regards,

Kate

PS: Also many thanks to Nima for her input!
KateEisenhower is offline   Reply With Quote

Old   November 12, 2015, 12:33
Default
  #5
New Member
 
Hannes Grimm-Strele
Join Date: Sep 2015
Posts: 7
Rep Power: 2
HannesGS is on a distinguished road
Quote:
Originally Posted by KateEisenhower View Post
Hello Hannes and thank you for your answer!

Your first paragraph is confusing to me. Are you refering to the nodes of the individual elements when you are talking of points?
Yes that's what I meant. I called them points since they are saved in the points file of OpenFOAM.

Quote:
Regarding the unstructered mesh, maybe there is a misunderstanding. In a unstructered mesh it is highly unlikely that all the faces on two different boundaries do match, isn't it?
I would say it's a question of how the mesh is generated. There certainly are unstructured meshes with periodic connections.

Quote:
I generated a structured mesh with gmsh and then imported it with gmshToFoam. My cyclic boundaries are translational and yes, I can read my mesh into paraview.
Anyway, if your connection is non-matching and you are happy with using cyclicAMI, there is no need for further discussion :-) I basically wanted to comment on the issue of periodic connections with unstructured meshes.
HannesGS is offline   Reply With Quote

Old   August 2, 2016, 05:16
Default
  #6
New Member
 
Fynn
Join Date: Feb 2016
Posts: 14
Rep Power: 2
PanPeter is on a distinguished road
hi together,
I experience the same problem:
A structured mesh for a simple cylinder flow benchmark is generated in starccm+ and converted to openfoam with ccm26toFoam.
The periodic boundary is then created through the createPatch function in which I have to use an enormous match tolerance of 0.1 to avoid getting the same error as Ms Eisenhower, namely:
Code:
--> FOAM Serious Error : 
    From function cyclicPolyPatch::order(const primitivePatch&, labelList&, labelList&) const
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 1402
    Patch:PB_A2 : Cannot match vectors to faces on both sides of patch
    Perhaps your faces do not match? The obj files written contain the current match.
    Continuing with incorrect face ordering from now on!


--> FOAM FATAL ERROR: 
face 175 area does not match neighbour by 18.5333% -- possible face ordering problem.
patch:PB_A1 my area:1e-06 neighbour area:8.30385e-07 matching tolerance:0.001
Mesh face:646158 fc:(-0.0435 0.0395 0.03)
Neighbour fc:(-0.0364698 0.0165608 -1.10462e-16)
If you are certain your matching is correct you can increase the 'matchTolerance' setting in the patch dictionary in the boundary file.
Rerun with cyclic debug flag set for more information.

    From function cyclicPolyPatch::calcTransforms()
    in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 221.

FOAM exiting
This is my createPatch file:

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

pointSync true;

// Patches to create.
patches
(
    {
        name PB_A1;

        patchInfo
        {
            type cyclic;
            neighbourPatch PB_A2;
            matchTolerance  0.001;
        }

        constructFrom patches;
        patches (SymA1);
    }
    {
        name PB_A2;

        patchInfo
        {
            type cyclic;
            neighbourPatch PB_A1;
            matchTolerance  0.001;
        }

        constructFrom patches;
        patches (SymA2);
    }
);

// ************************************************************************* //
This should be a very simple example for parallel periodic boundary surfaces and thus I want to see why I can't have a match tolerance of 1e-3. Furthermore, I refrain from trying cyclicAMI, as it sounds as it's doing some serious remapping and that should not be necessary for my simple test case.

Thanks for your help!
PanPeter is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The difference of cyclic boundry condition and mapped boundary condition caitao OpenFOAM Running, Solving & CFD 0 January 29, 2015 23:25
About cyclic boundary condition mmkr825 OpenFOAM 0 December 17, 2012 00:44
About cyclic boundary condition mmkr825 OpenFOAM 0 December 14, 2012 02:36
Boundary condition setting regarding turbine simulation using CFX Lacerlacer CFX 11 March 12, 2012 10:32
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 04:23


All times are GMT -4. The time now is 05:49.