CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Regarding periodic BC in ICEM generated grid (https://www.cfd-online.com/Forums/openfoam/82659-regarding-periodic-bc-icem-generated-grid.html)

wlamont December 20, 2012 13:57

Similar problem with createPatch
 
Hello,

I get the following error:
Code:

--> FOAM FATAL IO ERROR:
"ill defined primitiveEntry starting at keyword 'patches' on line 49 and ending at line 159"

file: /home/wlamont/OpenFOAM/wlamont-2.1.1/run/dp73/system/createPatchDict at line 159.

    From function primitiveEntry::readEntry(const dictionary&, Istream&)
    in file lnInclude/IOerror.C at line 132.

FOAM exiting


Attached is my createPatchDict which is stored in my system folder:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.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.
// - always: remove zero-sized (non-coupled) patches (that were not added)

// 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 of new patch
        name per1a;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch per1b;
            matchTolerance  0.1;

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

        // How to construct: either from 'patches' or 'set'
        constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (per1a-part_3-5450200-101_aero1v);

        // If constructFrom = set : name of faceSet
        set f0;
    }
    {
        // Name of new patch
        name per1b;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch per1a;
            matchTolerance  0.1;

            transform rotational;
            rotationAxis (0 0 1);
            rotationCentre (0 0 0);
        }

        // How to construct: either from 'patches' or 'set'
        constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (per1b-part_3-5450200-101_aero1v);

        // If constructFrom = set : name of faceSet
        set f0;
    }


    {
        // Name of new patch
        name per1asolid;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch per1bsolid;
            matchTolerance  0.1;
            // Optional: explicitly set transformation tensor.
            // Used when matching and synchronising points.
            transform rotational;
            rotationAxis (0 0 1);
            rotationCentre (0 0 0);
        }

        // How to construct: either from 'patches' or 'set'
        constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (per1a-part_3-solid);

        // If constructFrom = set : name of faceSet
        set f0;
    }
    {
        // Name of new patch
        name per1bsolid;

        // Dictionary to construct new patch from
        patchInfo
        {
            type cyclic;
            neighbourPatch per1asolid;
            matchTolerance  0.1;
            transform rotational;
            rotationAxis (0 0 1);
            rotationCentre (0 0 0);
        }

        // How to construct: either from 'patches' or 'set'
        constructFrom patches;

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (per1b-part_3-solid;

        // If constructFrom = set : name of faceSet
        set f0;
    }

);

Any help would be greatly appreciated.

maddalena December 21, 2012 01:42

Hi,
Code:

"ill defined primitiveEntry starting at keyword 'patches' on line 49 and ending at line 159"
says that something is wrong at line 49. Look at your line 49 and compare with this file: $FOAM_UTILITIES/mesh/manipulation/createPatch/createPatchDict.
See here as well.

mad

e.ahmadiyan April 21, 2013 02:55

Hi dear Gabriel
I am same problem as you.
If you were successful in resolve this problem please give your experiences to me.
Thanks

wangqiangele April 21, 2013 04:34

Hi,

I generated the periodic patches using createPatchDict with the following specifications. (where 25 is the distance between inlet and outlet)

Hope it helps~
Qiang

patches
(
name inletOutlet_half0;
patchInfo
{
type cyclic;
neighbourPatch inletOutlet_half1;
transform translational;
separationVector (25 0 0);
}
constructFrom patches;
patches (inlet);
set f0;
}
{
name inletOutlet_half1;
patchInfo
{
type cyclic;
neighbourPatch inletOutlet_half0;
transform translational;
separationVector (-25 0 0);
}
constructFrom patches;
patches (outlet);
set f0;
}
);

Quote:

Originally Posted by e.ahmadiyan (Post 422043)
Hi dear Gabriel
I am same problem as you.
If you were successful in resolve this problem please give your experiences to me.
Thanks


e.ahmadiyan April 21, 2013 07:22

3 Attachment(s)
Hi dear Qiang
Thanks for your reply very much.
My geometry and createPatchDict file are as below:
Attachment 20981
Attachment 20982

When running the case this error reported:

This probably means your geometry is not consistent with the specified separation and might lead to problems.
Continuing with specified separation vector (0.0002 0 0.0002)
patch:outlet1 neighbour:inlet1
--> FOAM Warning :
From function cyclicPolyPatch::calcTransforms()
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 368



In your mind are there any incorrect setting in createPatchDict file proportional to geometry?
What are separationVector and rotationAxis and rotationCentre ? please demonstrate for me. In fact I do not know how I should adjust this parameters in createPatchDict file proportional to my geometry.

All my case is as below
Attachment 20983

Thanks

wangqiangele April 21, 2013 08:50

Hi,

I am not sure about your case.
Maybe you can specify
transform rotational;
rotationAxis ( 0 0 1 );//maybe(0 0 -1)
rotationCentre ( x y 0 );//specify [x,y] to your case to ensure that the outlet boundary meet the inlet boundary after 270 degrees rotation around the center (anticlockwise)

Best,
Qiang


Quote:

Originally Posted by e.ahmadiyan (Post 422086)
Hi dear Qiang
Thanks for your reply very much.
My geometry and createPatchDict file are as below:
Attachment 20981
Attachment 20982

When running the case this error reported:

This probably means your geometry is not consistent with the specified separation and might lead to problems.
Continuing with specified separation vector (0.0002 0 0.0002)
patch:outlet1 neighbour:inlet1
--> FOAM Warning :
From function cyclicPolyPatch::calcTransforms()
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 368



In your mind are there any incorrect setting in createPatchDict file proportional to geometry?
What are separationVector and rotationAxis and rotationCentre ? please demonstrate for me. In fact I do not know how I should adjust this parameters in createPatchDict file proportional to my geometry.

All my case is as below
Attachment 20983

Thanks


e.ahmadiyan April 21, 2013 09:22

Dear mad
Have you any more suggestion ?

maddalena April 22, 2013 08:00

Quote:

Originally Posted by e.ahmadiyan (Post 422111)
Dear mad
Have you any more suggestion ?

(25 0 0) is NOT the separation vector between the two. inlet and outlet are rotated as well.

mad

e.ahmadiyan April 22, 2013 09:01

Dear mad
What is your suggestion about my geometry and createPatchDict that I was mentioned in above post numbering 25? please

maddalena April 22, 2013 09:32

Quote:

Originally Posted by e.ahmadiyan (Post 422309)
Dear mad
What is your suggestion about my geometry and createPatchDict that I was mentioned in above post numbering 25? please

My suggestion is to think once again to your case and to play a bit with createPatchDict. This is the way openFoam works.

mad

Mojtaba.a April 30, 2013 07:10

Hi guys,
I have a similar problem for defining cyclic boundary conditions but here for unstructured grids.

Well as you know cyclic boundary conditions defining is a bit different since OF 2.0.0, So as I understood, there is no need to use createPatch utility anymore. (Please correct me if I am wrong)

Here is the page for new features of OF 2.0.0:
http://www.openfoam.org/version2.0.0/meshing.php

as you can see, cyclic boundary conditions are defined like this (in boundary file):

patch0_half0
{
type cyclic;
nFaces 256;
startFace 11520;
matchTolerance 0.0001;
neighbourPatch patch0_half1;
}
patch0_half1
{
type cyclic;
nFaces 256;
startFace 11776;
matchTolerance 0.0001;
neighbourPatch patch0_half0;
}


So I did the same work and defined my cyclic patches like this:

inlet
{
type cyclic;
nFaces 543;
startFace 281225;
matchTolerance 0.0001;
neighbourPatch outlet;
}

outlet
{
type cyclic;
nFaces 530;
startFace 281768;
matchTolerance 0.0001;
neighbourPatch inlet;
}

but there is a problem here. As you can see, the number of faces is different between inlet and outlet patches. one is 543 and the other is 530.
by running checkMesh I get the following error:

--> FOAM FATAL ERROR:
For patch inlet there are 543 face centers, for the neighbour patch outlet there are 530

So its needed to make these numbers equal. But how is that possible for unstructured grids? any suggestions is greatly appreciated.

FYI: I am using ICEM to generate the mesh.

Thanks,
Mojtaba

maddalena April 30, 2013 10:09

Quote:

Originally Posted by Mojtaba.a (Post 424140)
So its needed to make these numbers equal. But how is that possible for unstructured grids? any suggestions is greatly appreciated.

Simple. create them equal in your meshing software...
Copy-paste worked as a charm in the past for me.

mad

Mojtaba.a April 30, 2013 14:46

Quote:

Originally Posted by maddalena (Post 424202)
Simple. create them equal in your meshing software...
Copy-paste worked as a charm in the past for me.

mad

Thank you maddalena, I will try. beginner in ICEM ;)
But am I correct? Is there any need of createPatch utility for cyclic patches anymore?


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