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

createPatch cyclic boundary condition

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By PeterShi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2015, 06:28
Default createPatch cyclic boundary condition
  #1
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello,

I have some trouble with creating cyclic patches using createPatch and hope to find some help here.

I am simulating a wind tunnel flow with an airfoil which spans from the front to the back patch of the tunnel. It is a 3D case, but very similar to a 2D case because the mesh doesn't change in the y direction.

I created the mesh with gmsh and used gmshToFoam to get it working with OpenFoam 2.3.1. This works great so far.

Now the U_y Residuals are bothering me. I think they stay way to high and think this is related to the definition of my boundary codes front and back. Hence I want to try cyclic boundary condition on these two patches.

I got the default createPatchDict and set it up as follows (please note my questions in the first line of the code too):
Code:
pointSync false; // What does this mean?

// Patches to create.
patches
(
    {
        // Name of new patch
        name frontcy;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch backcy;

            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
            // transform rotational;
            // rotationAxis (1 0 0);
            // rotationCentre (0 0 0);
            // transform translational;
            // separationVector (0 0.1 0);

            // Optional non-default tolerance to be able to define cyclics
            // on bad meshes
            matchTolerance 0.1;
        }

        constructFrom patches;

        patches (front); // front is my original front patch

    }
    {
        // Name of new patch
        name backcy;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch frontcy;

            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
            // transform rotational;
            // rotationAxis (1 0 0);
            // rotationCentre (0 0 0);
            // transform translational;
            // separationVector (0 -0.1 0);
            matchTolerance 0.1;
        }

        constructFrom patches;

        patches (back); // back is my original back patch

    }
);

// ************************************************************************* //
Does this file look right to you? I am particularly unsure about the section with the transformation tensor which is commented out. Do I need it, or what is it for? Do I need the matchTolerance option in my case?

When running createPatch in terminal I get the following. This is only the beginning of the output but I think you are getting the point. If necessary I can upload the complete output too.
Code:
Kates-MacBook-Pro:2D_hkverfeinert_cyclic kateeisenhower$ createPatch
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  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   : createPatch
Date   : Aug 31 2015
Time   : 12:24:50
Host   : "Kates-MacBook-Pro.local"
PID    : 91192
Case   : /Users/kateeisenhower/Documents/gmsh/Daten/2D_hkverfeinert_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 polyMesh for time = 0

Reading createPatchDict

Adding new patch frontcy as patch 7 from 
{
    type            cyclic;
    neighbourPatch  backcy;
    matchTolerance  0.1;
}

Adding new patch backcy as patch 8 from 
{
    type            cyclic;
    neighbourPatch  frontcy;
    matchTolerance  0.1;
}


Moving faces from patch front to patch 7
Moving faces from patch back to patch 8

Doing topology modification to order faces.

Cannot find point in pts1 matching point 75283 coord:(-0.00588242 0.05 -0.0365509) in pts0 when using tolerance 0.000375467
Searching started from:0 in pts1
    Compared coord: (-0.00588281 0.05 -0.0392114) at index 0 with difference to point 0.00266053
    Compared coord: (-0.00588916 0.05 -0.0392308) at index 1 with difference to point 0.00267992
    Compared coord: (-0.00589583 0.05 -0.0392511) at index 2 with difference to point 0.0027003
    Compared coord: (-0.00590283 0.05 -0.0392725) at index 3 with difference to point 0.00272171
    Compared coord: (-0.00591018 0.05 -0.0392949) at index 4 with difference to point 0.00274421
Best regards,

Kate
KateEisenhower is offline   Reply With Quote

Old   September 6, 2015, 02:41
Default
  #2
Member
 
Yousef
Join Date: Feb 2015
Posts: 40
Rep Power: 11
ykanani is on a distinguished road
Hi, if your patches are not exactly identical, you cannot create Cyclic patch. use cyclicAMI instead.
please see this thread :
http://www.cfd-online.com/Forums/ope...port-icem.html
ykanani is offline   Reply With Quote

Old   August 14, 2018, 14:48
Default
  #3
Senior Member
 
Peter Shi
Join Date: Feb 2017
Location: Davis
Posts: 102
Rep Power: 9
PeterShi is on a distinguished road
Quote:
Originally Posted by KateEisenhower View Post
Hello,

I have some trouble with creating cyclic patches using createPatch and hope to find some help here.

I am simulating a wind tunnel flow with an airfoil which spans from the front to the back patch of the tunnel. It is a 3D case, but very similar to a 2D case because the mesh doesn't change in the y direction.

I created the mesh with gmsh and used gmshToFoam to get it working with OpenFoam 2.3.1. This works great so far.

Now the U_y Residuals are bothering me. I think they stay way to high and think this is related to the definition of my boundary codes front and back. Hence I want to try cyclic boundary condition on these two patches.

I got the default createPatchDict and set it up as follows (please note my questions in the first line of the code too):
Code:
pointSync false; // What does this mean?

// Patches to create.
patches
(
    {
        // Name of new patch
        name frontcy;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch backcy;

            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
            // transform rotational;
            // rotationAxis (1 0 0);
            // rotationCentre (0 0 0);
            // transform translational;
            // separationVector (0 0.1 0);

            // Optional non-default tolerance to be able to define cyclics
            // on bad meshes
            matchTolerance 0.1;
        }

        constructFrom patches;

        patches (front); // front is my original front patch

    }
    {
        // Name of new patch
        name backcy;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch frontcy;

            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
            // transform rotational;
            // rotationAxis (1 0 0);
            // rotationCentre (0 0 0);
            // transform translational;
            // separationVector (0 -0.1 0);
            matchTolerance 0.1;
        }

        constructFrom patches;

        patches (back); // back is my original back patch

    }
);

// ************************************************************************* //
Does this file look right to you? I am particularly unsure about the section with the transformation tensor which is commented out. Do I need it, or what is it for? Do I need the matchTolerance option in my case?

When running createPatch in terminal I get the following. This is only the beginning of the output but I think you are getting the point. If necessary I can upload the complete output too.
Code:
Kates-MacBook-Pro:2D_hkverfeinert_cyclic kateeisenhower$ createPatch
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  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   : createPatch
Date   : Aug 31 2015
Time   : 12:24:50
Host   : "Kates-MacBook-Pro.local"
PID    : 91192
Case   : /Users/kateeisenhower/Documents/gmsh/Daten/2D_hkverfeinert_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 polyMesh for time = 0

Reading createPatchDict

Adding new patch frontcy as patch 7 from 
{
    type            cyclic;
    neighbourPatch  backcy;
    matchTolerance  0.1;
}

Adding new patch backcy as patch 8 from 
{
    type            cyclic;
    neighbourPatch  frontcy;
    matchTolerance  0.1;
}


Moving faces from patch front to patch 7
Moving faces from patch back to patch 8

Doing topology modification to order faces.

Cannot find point in pts1 matching point 75283 coord:(-0.00588242 0.05 -0.0365509) in pts0 when using tolerance 0.000375467
Searching started from:0 in pts1
    Compared coord: (-0.00588281 0.05 -0.0392114) at index 0 with difference to point 0.00266053
    Compared coord: (-0.00588916 0.05 -0.0392308) at index 1 with difference to point 0.00267992
    Compared coord: (-0.00589583 0.05 -0.0392511) at index 2 with difference to point 0.0027003
    Compared coord: (-0.00590283 0.05 -0.0392725) at index 3 with difference to point 0.00272171
    Compared coord: (-0.00591018 0.05 -0.0392949) at index 4 with difference to point 0.00274421
Best regards,

Kate
Hi Kate,

I met the exactly same problem as you, have you solved your problem yet? Thanks.

Best regards,
Peter
manuc likes this.
PeterShi is offline   Reply With Quote

Old   September 4, 2018, 14:30
Default
  #4
Senior Member
 
Join Date: Aug 2015
Posts: 494
Rep Power: 14
clapointe is on a distinguished road
As mentioned previously, cyclicAMI patches are needed if the patches do not match exactly. I've used the following createPatchDict before to create cyclicAMI patches :

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.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 cyclic:
// - specify where the faces should come from
// - specify the type of cyclic. If a rotational specify the rotationAxis
//   and centre to make matching easier
// - always create both halves in one invocation with correct 'neighbourPatch'
//   setting.
// - optionally pointSync true to guarantee points to line up.

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


// 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. cyclics).
pointSync false;

// Patches to create.
patches
(
    { 
        name c1;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  c2;
            
            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
             transform rotational;
             rotationAxis (0 1 0);
             rotationCentre (0 0 0);
            // transform translational;
            // separationVector (0 0.1 0);

            // Optional non-default tolerance to be able to define cyclics
            // on bad meshes
            matchTolerance 0.1;
        }
        constructFrom patches;
        patches (t1);
        
    }
    
    { 
        name c2;
        patchInfo
        {
            type            cyclicAMI;
            neighbourPatch  c1;

            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
             transform rotational;
             rotationAxis (0 1 0);
             rotationCentre (0 0 0);
            // transform translational;
            // separationVector (0 0.1 0);

            // Optional non-default tolerance to be able to define cyclics
            // on bad meshes
            matchTolerance 0.1;
        }
        constructFrom patches;
        patches (t2);
        
    }
);

// ************************************************************************* //
I used the transform/rotational options because I was meshing a quarter of a cylinder -- they may not be necessary.

Caelan
clapointe 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
Understanding the cyclic boundary condition leroyv OpenFOAM Running, Solving & CFD 10 May 31, 2020 09:05
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
[mesh manipulation] CreatePatch to create cyclic boundary sbence OpenFOAM Meshing & Mesh Conversion 18 August 30, 2012 06:51
Cyclic Boundary Condition Asgarian OpenFOAM Running, Solving & CFD 3 December 29, 2011 19:45
cyclic boundary condition doesn't work in a tube ?? Cyp OpenFOAM 6 April 16, 2010 15:21


All times are GMT -4. The time now is 08:31.