CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Defining "cyclic" B.C. problem (http://www.cfd-online.com/Forums/openfoam/80508-defining-cyclic-b-c-problem.html)

maysmech September 28, 2010 09:27

Defining "cyclic" B.C. problem
 
Dear Foamers,
i made a 3-D mesh with Gambit for backward facing step. i want define front and back boundary condition as "cyclic". the problem is after writing polymesh by fluent3DMeshToFoam and creation of polyMesh i can't use pisoFoam because of error.
typing checkMesh led to:

HTML Code:

Create time

Create polyMesh for time = 0



--> FOAM FATAL ERROR:
face 0 area does not match neighbour 102850 by 139.834% -- possible face ordering problem.
patch:frontAndBack my area:5.42258e-07 neighbour area:9.60035e-08 matching tolerance:0.001
Mesh face:5438360 vertices:4((0.49476 0.1143 -0.0127) (0.5 0.1143 -0.0127) (0.5 0.114197 -0.0127) (0.49476 0.114197 -0.0127))
Neighbour face:5541210 vertices:4((0.0644278 0.1143 0.0127) (0.0635 0.1143 0.0127) (0.0635 0.114197 0.0127) (0.0644278 0.114197 0.0127))
Rerun with cyclic debug flag set for more information.


Simon Lapointe September 28, 2010 09:42

Hi,

I've run into this problem before. I suggest you create your cyclic patch in OF afterwards using "createPatch". Instead of defining one cyclic patch in Gambit, just make two patches that you'll merge with "createPatch" once the mesh in imported. When creating the mesh on these patches, use "Link Face Meshes" in Gambit to have a good face ordering.

maysmech September 28, 2010 11:35

By using Link Face Meshes of gambit the problem of cyclic B.C is solved.
Now, the problem is ib boundary file of polyMesh folder frontAndBack_shadow is added and i don't know what should be it defined in U, P, ... of 0 folder.

Simon Lapointe September 28, 2010 11:41

Is frontAndBack_shadow your cyclic patch created using "createPatch" ? If so, the boundary definition should be "type cyclic" for all variables.

maysmech September 28, 2010 11:44

no, it is export of gambit. i don't know how to use createPatch :confused:

maysmech September 28, 2010 14:36

i searched whole of forum and didn't find any acceptable answer for cyclic B.C in openFoam when importing from Gambit.

Is it any idea?

tcarrigan September 29, 2010 00:03

I've seen this problem before as well. The issue is with the grid. In order to use the cyclic bc, the two patches must be point matched. The fact that you are getting tolerance and face ordering problems is because your two cyclic patches are not point matched, meaning they don't match up EXACTLY.

If you happen to be using the 1.5-dev version, I suggest switching to cyclicGgi which does not require the two patches to be point matched. It relies on weighting factors and allows for more freedom when constructing the grid, which is really useful for turbo applications.

maysmech September 29, 2010 01:32

Quote:

Originally Posted by tcarrigan (Post 277033)
I've seen this problem before as well. The issue is with the grid. In order to use the cyclic bc, the two patches must be point matched. The fact that you are getting tolerance and face ordering problems is because your two cyclic patches are not point matched, meaning they don't match up EXACTLY.

If you happen to be using the 1.5-dev version, I suggest switching to cyclicGgi which does not require the two patches to be point matched. It relies on weighting factors and allows for more freedom when constructing the grid, which is really useful for turbo applications.

i am using OpenFOAM 1.7 :(

maddalena September 29, 2010 02:42

Hello,
Quote:

Originally Posted by maysmech (Post 276984)
Is it any idea?

create cyclic BC in Gambit works as importing mesh from other software, unless you have a specific OF exporter, as in Pointwise. Thus, I will suggest to look in ./applications/utilities/mesh/manipulation/createPatch/createPatchDict. There is an example there that shows how to use createPatchDict. If you still have problems, post here and I will answer.
Cheers

mad

maysmech September 29, 2010 03:12

Thanks for your reply.
You mean i should create mesh with Pointwise instead of Gambit?

maddalena September 29, 2010 03:34

Quote:

Originally Posted by maysmech (Post 277047)
You mean i should create mesh with Pointwise instead of Gambit?

Of course, NO! If you use Pointwise, you can create cyclics directly on the software and then export into OF without any adding steps.This is a feature of Pointwise. I do not know if it is possible or not with other software.
In any case, you can create your mesh with your preferred software, define two separate patches in it, export in OF and create the cyclic using createPatchDict. What you must assure is that the two patches are exactly equals.
Clearer?

mad

maysmech September 29, 2010 03:49

Quote:

What you must assure is that the two patches are exactly equals.
Two questions:
What should be it defined in gambit: periodic,wall,...?
Is it needed to link faces(Front and back) in Gambit?

maddalena September 29, 2010 05:03

Never used Gambit before for this kind of problems... however:
Quote:

Originally Posted by maysmech (Post 277053)
What should be it defined in gambit: periodic,wall,...?

It does not matter. They should be patches in OF, so you can define them as you like and then change them as patch in constant/polymesh/boundary.
Quote:

Originally Posted by maysmech (Post 277053)
Is it needed to link faces(Front and back) in Gambit?

What do you mean? in your BC definition or in mesh creation? In BC definition: no, the two boundaries must be defined separately in order to use createPatch. In mesh creation: yes, if this help to keep faces correspondence.

mad

panda60 September 30, 2010 03:18

Dear maddalena ,
two kinds of periodic boundary condition exist, one is translational, another is rotational. I know the meaning of rotational, but for translational, should define "separationVector(-2289 0 0)", do you konw the meaning of separationVector ?

maddalena September 30, 2010 03:56

Hello,
Quote:

Originally Posted by panda60 (Post 277218)
do you konw the meaning of separationVector ?

The separationVector is the distance between the two patches you want to connect.This kind of cyclic is useful if you have two patches that need to be connected in such a way that values on one patch are copied on the second patch. An example of this kind of usage is the Fan BC. More about the latter that can be found here.
Enjoy

mad

panda60 October 2, 2010 23:02

Dear maddalena ,
Thans for your explanation, Now I unstand the meaning.

farhagim March 11, 2011 18:58

Quote:

Originally Posted by maddalena (Post 277226)
Hello,

The separationVector is the distance between the two patches you want to connect.This kind of cyclic is useful if you have two patches that need to be connected in such a way that values on one patch are copied on the second patch. An example of this kind of usage is the Fan BC. More about the latter that can be found here.
Enjoy

mad

Hello Maddalena,

It seems that you are expert in Cyclic B.C. Would you please help me with my problem:
I create a 3D mesh(ex. cube) in Gambit, I linked the MEsh of front and Back face and make it periodic in Gambit) then I named it ex. periodic.1 and export as cube.msh.
Then I imported by fluent3DMeshToFoam to OF 1.7.1. it created two boundary in boundary file. periodic.1 &periodic.1_shadow. I changed the periodic.1_shadow to periodic.2 and use createPatch Dict. to create cyclic B.c. here is my createPatch Dict.

matchTolerance 1e-3;

// Do a synchronisation of coupled points.
pointSync true;


// Patches to create.
// If no patches does a coupled point and face synchronisation anyway.
patches
(
{
// Name of new patch
name periodic.2;

// Type of new patch
type cyclic;

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

// If constructFrom = patches : names of patches
patches ("periodic.*");

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

everythings was fine and I copied the new polyMesh file which was created after running createPatch in to my constant directory. I can run it in serial and works fine. But when I want to run it in Parallel I got this error. I have to mention that I use interDyMFoam for my case.

Selecting turbulence model type laminar


Reading g
Calculating field g.h


time step continuity errors : sum local = 8.951529e-06, global = -8.951529e-06, cumulative = -8.951529e-06
DICPCG: Solving for pcorr, Initial residual = 1, Final residual = 9.610304e-11, No Iterations 492
time step continuity errors : sum local = 1.227278e-15, global = -3.512952e-18, cumulative = -8.951529e-06
Courant Number mean: 0.0008794369 max: 0.009276953


Starting time loop


Interface Courant Number mean: 3.106989e-06 max: 0.2330362
Courant Number mean: 0.04397184 max: 0.4638476
deltaT = 5e-05
Time = 5e-05


Selected 704 cells for refinement out of 405600.
--> FOAM Warning :
From function syncTools<class T, class CombineOp>::syncEdgeList(const polyMesh&, UList<T>&, const CombineOp&, const T&, const bool)
in file /home/farhangi/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/syncToolsTemplates.C at line 1311
There are decomposed cyclics in this mesh with transformations.
This is not supported. The result will be incorrect

Any help ??

Thanks,

Mehran

maddalena March 14, 2011 03:25

Hi Mehran.,
Quote:

Originally Posted by farhagim (Post 299052)

Selected 704 cells for refinement out of 405600.
--> FOAM Warning :
From function syncTools<class T, class CombineOp>::syncEdgeList(const polyMesh&, UList<T>&, const CombineOp&, const T&, const bool)
in file /home/farhangi/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/syncToolsTemplates.C at line 1311
There are decomposed cyclics in this mesh with transformations.
This is not supported. The result will be incorrect

this sounds a little bit strange for me... Have you done some kind of mesh refinement? this is not a problem connected with cyclicBC itself... and in that case my "expertise" is not so useful..

mad

aloeven March 14, 2011 09:44

Did you decompose with:

preservePatches (CyclicPatches);

This should be in system/decomposeParDict

The cyclic patches should be on the same processor. Looking at your error, you have you cyclic patches decomposed and distributed over multiple processors.

farhagim March 14, 2011 11:19

Hi Alex,

Yes After that error I use preservePatches (CyclicPatches); for decomposing. It works with Parrallel but the problem is now with reconstructing the Meshes. Since I am using interDyMFoam, First, I have to run reconstructMesh(because the mesh has been changed) and then reconstruct it. Here is the error that I got by running the reconstructMesh:

Merge tolerance : 1e-07
Write tolerance : 1e-07
Doing geometric matching on correct procBoundaries only.
This assumes a correct decomposition.
Found 8 processor directories

Reading database "testparallelcyclic/processor0"
Reading database "testparallelcyclic/processor1"
Reading database "testparallelcyclic/processor2"
Reading database "testparallelcyclic/processor3"
Reading database "testparallelcyclic/processor4"
Reading database "testparallelcyclic/processor5"
Reading database "testparallelcyclic/processor6"
Reading database "testparallelcyclic/processor7"
Setting master time to 0.239

Reading points from "testparallelcyclic/processor0" for time = 0.239

Reading points from "testparallelcyclic/processor1" for time = 0.239

Reading points from "testparallelcyclic/processor2" for time = 0.239

Reading points from "testparallelcyclic/processor3" for time = 0.239

Reading points from "testparallelcyclic/processor4" for time = 0.239

Reading points from "testparallelcyclic/processor5" for time = 0.239

Reading points from "testparallelcyclic/processor6" for time = 0.239

Reading points from "testparallelcyclic/processor7" for time = 0.239

Overall mesh bounding box : (-1.401849e-10 0 0) (0.23858 0.235 0.04)
Relative tolerance : 1e-07
Absolute matching distance : 3.372616e-08

Constructing empty mesh to add to.

Reading mesh to add from "testparallelcyclic/processor0" for time = 0.239

Adding to master mesh


Reading mesh to add from "testparallelcyclic/processor1" for time = 0.239

Adding to master mesh



--> FOAM FATAL ERROR:
face 0 area does not match neighbour 2337 by 186.979% -- possible face ordering problem.
patch:periodic.2 my area:4.58316e-06 neighbour area:1.54214e-07 matching tolerance:0.001
Mesh face:423717 vertices:4((0.02625 0.079155 0.04) (0.02625 0.0864881 0.04) (0.025625 0.0864881 0.04) (0.025625 0.079155 0.04))
Neighbour face:426054 vertices:4((0.0529859 0.0342575 0.04) (0.053981 0.0342322 0.04) (0.0539878 0.0343869 0.04) (0.052991 0.0344122 0.04))
Rerun with cyclic debug flag set for more information.

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

FOAM exiting

Any idea why I got this message??
looking forward to hearing back from you,

Thanks,

MEhran

Quote:

Originally Posted by aloeven (Post 299322)
Did you decompose with:

preservePatches (CyclicPatches);

This should be in system/decomposeParDict

The cyclic patches should be on the same processor. Looking at your error, you have you cyclic patches decomposed and distributed over multiple processors.



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