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)

Tarak December 1, 2010 18:05

Regarding periodic BC in ICEM generated grid
 
Hii,

I need to give periodic BC to 2 surfaces in my geometry to run in Openfoam. I am generating the mesh by ICEM and exporting in fluent format, but while doing fluentMeshToFoam, I am getting the error "fluent patch type periodic not recognised."

Can you please let me know of a way to give periodic condition in this case.

Thanks,
Tarak

maddalena December 2, 2010 02:27

Quote:

Originally Posted by Tarak (Post 285661)
Can you please let me know of a way to give periodic condition in this case.

Hi Tarak,
what I would do is to export the mesh defining these two faces as a normal patch (inlet for instance), use fluentMeshToFoam and then make them cyclic (= periodic) with the createPatch tool.
Enjoy,

mad

Tarak December 2, 2010 15:48

Hii Mad (:))

I tried in exactly the same way you mentioned, but that too gives error after submitting the job (although the mesh gets converted):


FOAM FATAL ERROR:
face 0 area does not match neighbour 17884 by 101.991% -- possible face ordering problem.
patch:sides my area:2.50258e-06 neighbour area:7.71114e-06 matching tolerance:0.001
Mesh face:3306619 vertices:3((0.0296821 0.0723499 0.03) (0.0320687 0.0731075 0.03) (0.0303774 0.0746678 0.03))
Neighbour face:3324503 vertices:3((0.228765 0.132171 0) (0.231386 0.135573 0) (0.233447 0.132364 0))
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



I even tried converting the mesh by fluent3DMeshToFoam, and this case the mesh got converted, but while running the code I got the error:

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

From function refCast<To>(From&)
in file /home/44792/OpenFOAM/OpenFOAM-1.7.1/src/OpenFOAM/lnInclude/typeInfo.H at line 114.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/storage/software/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/storage/software/OpenFOAM/OpenFOAM-1.7.1/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) in "/storage/software/OpenFOAM/OpenFOAM-1.7.1/applications/bin/linux64GccDPOpt/pisoFoam".........
...........


I would like to mention that the surfaces I'm trying to set as periodic are exactly parallel to each other.

Can you please help me to find a way out of this problem. In the meantime, I'm using slip wall in place of periodic.


Thanks,
Tarak

kalle December 3, 2010 02:41

Hi,

the face area mis match problem is sometimes caused by round off errors. If you write out your mesh in ascii format (check controlDict) you should set the writePrecision fairly high. Try setting it to 12 and see if that solves the problem.

Good luck,
Kalle

maddalena December 3, 2010 02:56

Hi Tarak,
Quote:

Originally Posted by Tarak;285785[COLOR=Black
][/COLOR]I would like to mention that the surfaces I'm trying to set as periodic are exactly parallel to each other.

Thus you set the separation vector, do not you? Well...
Quote:

Originally Posted by Tarak (Post 285785)
face 0 area does not match neighbour 17884 by 101.991% -- possible face ordering problem

The tolerance error is quite high! From my experience, this may be due to a separation vector with the wrong sign. i.e: if your separationVector is (1 0 0) probably you must set it as: (-1 0 0).
Hope this help...


mad

Tarak December 3, 2010 03:07

@kalle

Thanks for the reply. I did that too, but I think as Mad said, since the angle is too high, it may not be caused by the precision error.

@ Mad,

Thanks. Can you please tell me what do you mean by separation angle? I do not set it either during grid generation or solving. In which folder can I find it?

Thanks,
Tarak

maddalena December 3, 2010 03:13

Quote:

Originally Posted by Tarak (Post 285818)
Thanks. Can you please tell me what do you mean by separation angle? I do not set it either during grid generation or solving. In which folder can I find it?

Well, it is a keyword of createPatchDict!
Code:

        // 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);
        }

This is the line of the file you are interested in...

mad

markto January 6, 2011 08:48

Hi,
I'm new to this forum and to openFOAM as well and I am facing almost the same problem. For my studies I have to simulate a combustion chamber.To get familiar, I first generated a very simple model with ICEM, exported it as a fluent file, and converted it with fluent3DMeshToFoam. When I try to set the cyclic boundary conditions with createPatches I get this error:

--> FOAM FATAL ERROR:
face 0 area does not match neighbour 121 by 22.834% -- possible face ordering problem.
patch:SYM1 my area:0.322757 neighbour area:0.405954 matching tolerance:0.001
Mesh face:21982 vertices:3((-2.04504 0 0) (-2.99377 0 0) (-2.34913 0.680393 0))
Neighbour face:22103 vertices:3((-1.62165 5.7133 0) (-0.803681 6.35418 0) (-0.796178 5.36747 0))
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

The perodic patches are parallel as well (1/2 model of the combustor). I tried to change the separationVector, but this does not work (even if I change the axis from e.g. (1 0 0) to (0 1 0) the percentage of the error stays the same). Did you solve the problem, Tarak?
Thanks for help,
Mark

Tarak April 5, 2011 17:22

Hii Mark,

I couldn't solve it yet, can you please tell about your status regarding this?

Thanks,
Tarak

Tarak April 5, 2011 18:40

Hii Mad,

I am still stuck with the same problem. Can you please tell me in detail how to use the createPatch tool to get the desired patch? I can send you my constant directory if you need. I understood that you are asking to create the cyclic faces as two different faces (in ICEM), and then use the createPatch tool to make them cyclic. Can you please elaborate on this? So, after doing this will the two faces be treated as one single boundary? Waiting eagerly for your reply.

Thanks,
Tarak

maddalena April 6, 2011 03:00

Quote:

Originally Posted by Tarak (Post 302381)
Hii Mad,

I am still stuck with the same problem. Can you please tell me in detail how to use the createPatch tool to get the desired patch? I can send you my constant directory if you need. I understood that you are asking to create the cyclic faces as two different faces (in ICEM), and then use the createPatch tool to make them cyclic. Can you please elaborate on this? So, after doing this will the two faces be treated as one single boundary? Waiting eagerly for your reply.

Thanks,
Tarak

There is not too much to add on the subject...
  1. create the cyclic faces as two different and EXACTLY the same faces (in ICEM): copy paste is a good option
  2. define them as different boundaries
  3. Export from ICEM
  4. Convert to OpenFOAM
  5. Check constant/polyMesh/boundary: the two boundaries should be there
  6. use the createPatch tool to make them cyclic using the dictionary shown above
  7. Check constant/polyMesh/boundary: the two boundaries are no longer there, but there is the newly create cyclic. From now on, this is the only boundary you have.
Hope this is clear now

mad

Tarak April 6, 2011 03:07

Hii Mad,

Thanks a lot for the reply. Can you please tell me what do u exactly mean by "use the createPatch tool to make them cyclic using the dictionary shown above". Means how do I use that? Just typing createPatch in the /constant/polymesh directory is enough, or are there any arguments required?

Thanking you,
Tarak

maddalena April 6, 2011 03:13

Quote:

Originally Posted by Tarak (Post 302429)
Hii Mad,

Thanks a lot for the reply. Can you please tell me what do u exactly mean by "use the createPatch tool to make them cyclic using the dictionary shown above". Means how do I use that? Just typing createPatch in the /constant/polymesh directory is enough, or are there any arguments required?

Thanking you,
Tarak

Well, you should have a createPatchDict on your system folder, an example of it is here: ./applications/utilities/mesh/manipulation/createPatch/createPatchDict.
After editing it according to your case, you should go on your main folder (where 0, constant and system folders are) and type createPatch. As you made before...

mad

Tarak April 6, 2011 03:17

Thanks a lot Mad for your prompt reply. I'll let you know if I'm stuck again!

Tarak April 6, 2011 20:53

Hii Mad,

I tried exactly in the same way you mentioned, but still I'm getting errors.

My createPatchDict file looks like:
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 (FRONT BACK);

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

// {
// name bottom;

// Type of new patch
// dictionary
// {
// type wall;
// }

// constructFrom set;

// patches ();

// set bottomFaces;
// }

);


after running createPatch I get the following output:


Reading createPatchDict.

Using relative tolerance 0.001 to match up faces and points

Create polyMesh for time = 0.000000e+00

Adding new patch sidePatches as patch 6 from
{
type cyclic;
separationVector ( -1 0 0 );
transform rotational;
rotationAxis ( 1 0 0 );
rotationCentre ( 0 0 0 );
}


Moving faces from patch FRONT to patch 6
Moving faces from patch BACK to patch 6

Doing topology modification to order faces.

cyclicPolyPatch::order : Writing half0 faces to OBJ file "sidePatches_half0_faces.obj"
cyclicPolyPatch::order : Writing half1 faces to OBJ file "sidePatches_half1_faces.obj"
cyclicPolyPatch::order : Dumping currently found cyclic match as lines between corresponding face centres to file "/storage/tnandi/OpenFOAM/tnandi-1.7.1/run/testing/sidePatches_faceCentres.obj"
--> FOAM Serious Error :
From function cyclicPolyPatch::order(const primitivePatch&, labelList&, labelList&) const
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 1566
Patch:sidePatches : 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!
Dumping sidePatches half0 faces to "coupled_sidePatches_half0.obj"
Dumping sidePatches half1 faces to "coupled_sidePatches_half1.obj"
Dumping cyclic match as lines between face centres to "coupled_sidePatches_match.obj"
Synchronising points.

On coupled patch sidePatches forcing uniform rotation of (1 0 0 0 0.9889049576 -0.1485496039 0 0.1485496039 0.9889049576)
On coupled patch sidePatches forcing uniform rotation of 1((1 0 0 0 0.9889049576 -0.1485496039 0 0.1485496039 0.9889049576))
Synchronising points.
Points changed by average:0.0004458551642 max:0.06340637218



--> FOAM FATAL ERROR:
face 1 area does not match neighbour 53133 by 66.6667% -- possible face ordering problem.
patch:sidePatches my area:2.50856e-05 neighbour area:1.25428e-05 matching tolerance:0.001
Mesh face:10982591 vertices:4((0 0.00874805 0.0628) (0.00300002 0.00874805 0.0628) (0.00300002 0.0171098 0.0628) (0 0.0171098 0.0628))
Neighbour face:11035723 vertices:4((0 0.00932891 0.0621032) (0 0.0262489 0.0595616) (0.00300002 0.0262489 0.0595616) (0 0.0179799 0.0608037))
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


Can you please have a look at these and help me in some way? Another thing I wanted to tell you is that although you told me to edit the mesh in ICEM such that the cyclic surfaces are exactly opposite and equal, they were indeed like that, because they are 2 opposite faces of a cube.

Thanks,
Tarak

maddalena April 7, 2011 02:47

Hi, why createPatch should work if you do not use it correctly?!?:confused: Have you looked to what you are doing?
Quote:

Originally Posted by Tarak (Post 302577)
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);
}

[...]

hey were indeed like that, because they are 2 opposite faces of a cube

You specified the separation vector AND than you use a rotational transformation. And then you say that the two faces are the faces of a cube. :confused: Is there any rotation between the two faces if they are faces of a cube??? I guess there is only a translation, or am I wrong?
your createPatchDict should be something like:
Code:

transform translational;
            separationVector (-1 0 0); here specify the direction from the slave to the master!
            //transform rotational;
            //rotationAxis (1 0 0);
            //rotationCentre (0 0 0)

Please, check everything before posting!

mad

wangqiangele November 7, 2012 11:36

I don't quite understand the first step
 
Hi maddalena,

I am right now also facing the problem. I want to make two walls (front & back) of a square tank cyclic.

I don't quite understand your first step:
"1 create the cyclic faces as two different and EXACTLY the same faces (in ICEM): copy paste is a good option"

in ICEM I have two surfaces called ''inlet" and "outlet".

Shall I create two surfaces called "cyclic01" & "cyclic02" containing both "inlet" and "outlet". and then define them as different boundaries?



Looking forward for your reply & big thanks in advance!

Qiang

Quote:

Originally Posted by maddalena (Post 302427)
There is not too much to add on the subject...
  1. create the cyclic faces as two different and EXACTLY the same faces (in ICEM): copy paste is a good option
  2. define them as different boundaries
  3. Export from ICEM
  4. Convert to OpenFOAM
  5. Check constant/polyMesh/boundary: the two boundaries should be there
  6. use the createPatch tool to make them cyclic using the dictionary shown above
  7. Check constant/polyMesh/boundary: the two boundaries are no longer there, but there is the newly create cyclic. From now on, this is the only boundary you have.
Hope this is clear now

mad


maddalena November 9, 2012 01:39

Hi,
what are the faces you want to make cyclic? Front and back or inlet and outlet?

NB: cyclic definition changed in the latest OF version.

mad

wangqiangele November 9, 2012 08:02

Hi mad,

I want to make inlet and outlet cyclic, I have tried the new version of createPatch. Though it states some warning, I can view the mesh correctly in paraView. I will try to run the case.

Actually I just define my inlet and outlet face as two patches in ICEM, and export it convert it to foam mesh. Here is my createPatchDict. Is it ok?

pointSync false;
patches
(
{
// Name of new patch
name inletOutlet_half0;

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

// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.

transform translational;
separationVector (-1 0 0);

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

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

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

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

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

transform translational;
separationVector (1 0 0);
}

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

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

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

Originally Posted by maddalena (Post 391146)
Hi,
what are the faces you want to make cyclic? Front and back or inlet and outlet?

NB: cyclic definition changed in the latest OF version.

mad


wangqiangele November 9, 2012 08:17

Dear mad,

When running the case, it generates warning as following:

Specified separationVector (1 0 0) differs from computed separation vector 1((-25 0 -1.387779e-17))
This probably means your geometry is not consistent with the specified separation and might lead to problems.
Continuing with specified separation vector (1 0 0)
patch:inletOutlet_half1 neighbour:inletOutlet_half0

why is the separation vector become so strange...

Best regards & Big thanks in advance
Qiang

Quote:

Originally Posted by maddalena (Post 391146)
Hi,
what are the faces you want to make cyclic? Front and back or inlet and outlet?

NB: cyclic definition changed in the latest OF version.

mad



All times are GMT -4. The time now is 21:03.