CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Cyclic boundaries in OF 21x (https://www.cfd-online.com/Forums/openfoam/108645-cyclic-boundaries-21x.html)

morard October 29, 2012 11:53

Cyclic boundaries in OF 21x
 
1 Attachment(s)
Hello to all,

first of all I want to apologize for opening a new thread although there is at least one with the similar name

http://www.cfd-online.com/Forums/ope...h-problem.html

but since I didn't find any answer I decided to post some questions here.
So, very briefly, I have a mesh which was ok in OF 1.7.1 but when I try to use it in 2.1.x version I've faced some errors with cyclic patches:

**Error in coupled point location: 300 faces have their 0th vertex not opposite their coupled equivalent. Average mismatch 0.0268041.

I was thinking that the problem might be in mesh numbering, so I try to re-number it but until now haven't found any solution.

Then I tried to investigate the mixer tutorial: incompressible/SRFSimpleFoam/mixer where the cyclic patches look like the patches in my case. I executed blockMesh and everything was fine. Then I tried to create just two blocks:

blocks
(
// hex (1 0 9 4 13 12 21 16) (10 20 40) simpleGrading (1 1 1)
hex (2 1 4 6 14 13 16 18) (2 20 40) simpleGrading (1 1 1)
hex (3 2 6 8 15 14 18 20) (10 20 40) simpleGrading (1 1 1)
// hex (5 10 0 1 17 22 12 13) (10 20 40) simpleGrading (1 1 1)
// hex (11 7 2 3 23 19 14 15) (10 20 40) simpleGrading (1 1 1)
);


with the following cyclic patch:

cyclic_half0
{
type cyclic;
neighbourPatch cyclic_half1;
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
faces
(
//(0 9 21 12)
//(10 0 12 22)

(1 4 16 13)
);
}
cyclic_half1
{
type cyclic;
neighbourPatch cyclic_half0;
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
faces
(
//(3 15 20 8)
//(11 23 15 3)

(3 8 20 15)
);
}


and then I got the following error:

--> FOAM FATAL ERROR:
face 0 area does not match neighbour by 0.0664441% -- possible face ordering problem.
patch:cyclic_half0 my area:0.999336 neighbour area:1 matching tolerance:0.0001
Mesh face:1 fc:(0.553 0.507 1)
Neighbour fc:(0 0.75 1)
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.


which is solved by adjusting the matchTolerance. But still, why does this error appear? The geometry is pretty simple, it should work without setting matchTolerance.

I'll also attach a blockMeshDict of the simple test case where the error mentioned at the top of the thread can be reproduced.

I think that there might be some convection about the block numbering in order to create good cyclics?
Does anybody have some comments, suggestions, ideas about this issue?

Regards,
Dejan

morard October 30, 2012 06:05

Hi again,

I've realised that the error appears only if the center of the patch rotational axis is not placed in the center of the coordinate system (0 0 0).

So, if I create a geometry in such a way that the center of the rotational axis is in the center of the coordinate system (0 0 0) the mesh is created without any problem.
But, If I now use the same mesh and shift it in x direction so that the rotational axis center is in (50 0 0), the error will appear! Why, I don't know!

Maybe it's a bug, but maybe not!

Regards,
Dejan

maddalena November 14, 2012 06:04

Hello Dejan,
I am experiencing the same "Error in coupled point location" running OF 2.1.0. Have you seen this: http://www.openfoam.org/mantisbt/view.php?id=403 ?
I think this may be helpful for you as well.

Please report if you have any news on the subject

mad

morard November 14, 2012 08:17

Hi Maddalena

thanks for your message. Yes, I saw that.
Well, that error depends somehow on the number of cells. When I put, for example, (20 15 50) cells for a certain block, everything is ok, but when I change it to, let say ( 30 20 50) - error! But this is just a small issue.

The big problem in my case is the following one:

--> FOAM FATAL ERROR:
More than one patch accessing the same transform but not of the same sign.
patch:fluid2_half0 transform:0 sign:1 current transforms:(1 0 0)

From function Foam::label Foam::globalIndexAndTransform::addToTransformIndex
(
const label,
const label,
const bool
) const

in file lnInclude/globalIndexAndTransformI.H at line 240.

FOAM exiting


This I cannot understand and I don't have time to check all those functions just for one geometry... If you understand what is wrong here, please let me know.

Dejan

maddalena November 15, 2012 10:45

Hi Dejan,
I think the problem is related to point order on faces. The second error you are getting follows from the first. I doubt that renumbering mesh helps at all.

I solved my problems using OF 2.1.1 and using the createPatch utility on original (not defined cyclic) patches. As for your case: try to change blockmesh cell number on the original mesh and then run createPatch.

Hope this helps.

mad

morard November 15, 2012 12:50

Hi Maddalena,

yes, point order might be the problem. But I'm not sure that the second error follows from the first one. Several times I've managed to create the mesh without first error, but still the second one appeared. I have also tried to change blockMesh cell number and to use createPatch, but nothing helped.
Anyhow, I'll try again by following your suggestion. Thanks.

Dejan

michael1023 December 18, 2012 20:26

Quote:

Originally Posted by maddalena (Post 392019)
Hello Dejan,
I am experiencing the same "Error in coupled point location" running OF 2.1.0. Have you seen this: http://www.openfoam.org/mantisbt/view.php?id=403 ?
I think this may be helpful for you as well.

Please report if you have any news on the subject

mad

Hi, Maddalena.

I have the same problem (Error in coupled point location), could you do me a favor to solve this error? Thank you very much.
If I use the createPatch, there is another error happening as below.


--> FOAM FATAL ERROR:
Attempt to cast type patch to type cyclic

From function refCast<To>(From&)
in file lnInclude/typeInfo.H at line 114.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 Foam::cyclicPolyPatch::neighbPatchID() const in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3 Foam::cyclicPolyPatch::calcGeometry(Foam::PstreamB uffers&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 FoamlyBoundaryMesh::calcGeometry() in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 FoamlyMesh::addPatches(Foam::List<FoamlyPa tch*> const&, bool) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/createPatch"
#7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#8
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/createPatch"
Aborted

maddalena December 19, 2012 03:39

Hi,
Quote:

Originally Posted by michael1023 (Post 398160)
Attempt to cast type patch to type cyclic

I believe this is not due to the cyclic patch creation, but to your boundary condition definition. Check that 0/* files content matches constant/polyMesh/boundary definition.

mad

michael1023 December 19, 2012 04:51

Quote:

Originally Posted by maddalena (Post 398183)
Hi,

I believe this is not due to the cyclic patch creation, but to your boundary condition definition. Check that 0/* files content matches constant/polyMesh/boundary definition.

mad

Hi, Maddalena.

Thank you for your quick reply. Before I have createPatch, I checked the boundary condition definition settings in 0/* files to match constant/polyMesh/boundary definition. However it also had the error as I showed before.
Would you like send me your 0/* files and createPatchDict to me? I wanna compare the difference between us. Or could you give me some other suggestions?
Thank you again.

Michael

maddalena December 19, 2012 05:21

Quote:

Originally Posted by michael1023 (Post 398192)
Would you like send me your 0/* files and createPatchDict to me?

No, I cannot. You could post here your BC before and after the patch creation and the createPatchDict as well. I can give a look to them

Anyway: double posting is NEVER a good idea. You should be aware of this...

mad

michael1023 December 19, 2012 06:11

1 Attachment(s)
Hi, Maddalena.

Sorry for my discourtesy and thank you for your remind and quick reply.
The attachment is my BC and createPatchDict. I will be very appreciated if you can read them.
Thank you very much.

your sincerely
Michael



Quote:

Originally Posted by maddalena (Post 398198)
No, I cannot. You could post here your BC before and after the patch creation and the createPatchDict as well. I can give a look to them

Anyway: double posting is NEVER a good idea. You should be aware of this...

mad


maddalena December 19, 2012 06:46

Hi,
indeed there are some incoherency in your createPatchDict file:
Code:

    {
        // Name of new patch
        name front_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  back_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( front );
    }

    {
        // Name of new patch
        name back_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  front_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( back );
    }

you must use the newly created patch name as neighbor. Try to run createPatch once again and let me know.

mad

michael1023 December 19, 2012 07:02

Quote:

Originally Posted by maddalena (Post 398207)
Hi,
indeed there are some incoherency in your createPatchDict file:
Code:

    {
        // Name of new patch
        name front_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  back_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( front );
    }

    {
        // Name of new patch
        name back_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  front_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( back );
    }

you must use the newly created patch name as neighbor. Try to run createPatch once again and let me know.

mad

Hi, Maddalena.

Thank you a lot for your constructional suggestion. It can work well. Thank you again.

your sincerely
Michael

michael1023 January 31, 2013 22:01

Quote:

Originally Posted by maddalena (Post 398207)
Hi,
indeed there are some incoherency in your createPatchDict file:
Code:

    {
        // Name of new patch
        name front_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  back_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( front );
    }

    {
        // Name of new patch
        name back_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  front_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( back );
    }

you must use the newly created patch name as neighbor. Try to run createPatch once again and let me know.

mad

Hi,Maddalena.

The createPatch cannot work when I preform in OpenFOAM-1.7.1 with the same createPatchDict. The errors shows that the neighbourPatch cannot recognized. Do you have the createPatchDict in OpenFOAM-1.7.1 or suggestions for me?
Thank you.

michael1023 February 1, 2013 01:36

Quote:

Originally Posted by maddalena (Post 398207)
Hi,
indeed there are some incoherency in your createPatchDict file:
Code:

    {
        // Name of new patch
        name front_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  back_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( front );
    }

    {
        // Name of new patch
        name back_cyclic;

        // Type of new patch
        patchInfo
        {
            type            cyclic;
            matchTolerance  0.001;
            neighbourPatch  front_cyclic;
        }

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches ( back );
    }

you must use the newly created patch name as neighbor. Try to run createPatch once again and let me know.

mad

Hi,Maddalena.

The error is shown as below

Found "neighbourPatch" entry when reading cyclic patch front_cyclic
Is this mesh already with split cyclics?
If so run a newer version that supports it, if not comment out the "neighbourPatch" entry and re-run

Thank you.

maddalena February 1, 2013 03:29

Hello, have you try this?
Quote:

Originally Posted by michael1023 (Post 405435)
comment out the "neighbourPatch" entry and re-run

anyway, this is the patch definition required for any openFoam before 2.0:
Code:

patches
(
    {
        // Name of new patch
        name cyclicSides;

        // Type of new patch
    dictionary
    {
            type cyclic;

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

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (right left);

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


michael1023 February 2, 2013 00:48

Quote:

Originally Posted by maddalena (Post 405446)
Hello, have you try this?

anyway, this is the patch definition required for any openFoam before 2.0:
Code:

patches
(
    {
        // Name of new patch
        name cyclicSides;

        // Type of new patch
    dictionary
    {
            type cyclic;

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

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

        // If constructFrom = patches : names of patches. Wildcards allowed.
        patches (right left);

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


Hi,Maddalena.

I have tried this method.
Quote:

Originally Posted by michael1023
comment out the "neighbourPatch" entry and re-run
.
But it didn't work.
I think there are some difference in createPatchDict between OF-2.1.1 and OF-1.7.1.
Meanwhile, neighbourPatch cannot recognized in OF-1.7.1.
I still try the other methods. Anyway, thank you very much.

sam1364 April 28, 2013 21:23

Hi Michael,

I have the same issue defining cyclic B.C in OpenFoam version 2.1.0. can you please let me know how the createpatchDict should look like? and any other tricky part related to the version 2.1.0 of OpenFoam in doing so?

Thanks,
Pooyan


Quote:

Originally Posted by michael1023 (Post 398212)
Hi, Maddalena.

Thank you a lot for your constructional suggestion. It can work well. Thank you again.

your sincerely
Michael


maddalena April 30, 2013 10:12

Quote:

Originally Posted by sam1364 (Post 423716)
can you please let me know how the createpatchDict should look like?

you should have an example under application/utilities/mesh/manipulation/createPatch. Anyway: https://github.com/OpenFOAM/OpenFOAM...reatePatchDict

michael1023 May 1, 2013 22:36

Hi, Sam

you can read the example of createPatch as below:

patches
(
{
// Name of new patch
name cyclicSides;

// Type of new patch
dictionary
{
type cyclic;

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

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

// If constructFrom = patches : names of patches. Wildcards allowed.
patches (right left);

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

);


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