# Problem with cyclic boundaries in Openfoam 1.5

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 6, 2009, 11:26 Problem with cyclic boundaries in Openfoam 1.5 #1 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 Sponsored Links Hello, I have a really annoying problem concerning cylic boundaries with OpenFoam 1.5. The mesh generator is Gambit and I convert the mesh with fluentMeshToFoam and for cyclic boundaries is use the createPatch utility. With a simple channel everything works fine but the thats not what I am interested in. My focus lies on a circular cylinder with perodic boundary in spanwise direction. Gambit exports the mesh without any problems and my periodic boundary is defined as "wall". FluentMeshToFoam converts the mesh and I have to change in constants/polymesh/boundary the wall entry of my perodic boundary to cyclic. In createPatchDict I have to define every periodic patch, a matchingTolerance and if I want to have a synchronisation of coupled points. I set matchingTolerance to 1E-3 and Sync to true. And this is what I get after using createPatch utility: face 0 area does not match neighbour 2520 by 188.925% -- possible face ordering problem. patch_z15 my area:0.00822951 neighbour area:0.000234351 matching tolerance:0.001 Mesh face:914248 vertices:4((1.37852 1.44903 4) (1.25963 1.32406 4) (1.29225 1.29225 4) (1.41421 1.41421 4)) Neighbour face:916768 vertices:4((0.428847 0.450783 4) (0.418304 0.439701 4) (0.429136 0.429136 4) (0.439952 0.439952 4)) Rerun with cyclic debug flag set for more information. From function cyclicPolyPatch::calcTransforms() in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 150. Increasing the matchingTolerance produces the same error, exept if it becomes greater than 2, than it works ... but I dont trust the periodic boundary, because 2 seems to be a little bit to high for a tolerance? Where is my mistake? I dont have any idea. Please help

 May 6, 2009, 23:25 Change write precision #2 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 612 Rep Power: 22 Try changing your write precision in your controlDict to 10 before you convert your mesh. If it is 3D try using the fluent3DMeshToFoam command. Also, make sure you have linked your edges correctly in Gambit. I had a similar problem a few weeks ago. Dan

 May 7, 2009, 05:02 #3 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 Thx for your quick help, but this doesn't work. :-/ 1) I tested the writePrecision but nothing changed ... I still have this anoying error. I guess this was a major problem of earlier OpenFoam versions and should be fixed in 1.5. 2) fluent3DMeshToFoam produces a segmentation fault: Creating cellZone 0 name: fluid type: fluid #0 Foam::error:rintStack(Foam::Ostream&) #1 Foam::sigSegv::sigSegvHandler(int) ... Segmentation fault 3) During my test with the channel I recognized, that linking the faces of the periodic boundary produces an error in createPatch and without linking everything is fine. For my cylinder mesh I tried first without linking, which produces the error above. Now due to your reply I linked every face of my perodic boundary (I have to decompose my boundary in serveral parts to help gambit with meshing) and the error above is still the same. I dont have any idea what to do. The cylinder test case is just a simplification of my real problem and I need this periodic boundaries and Gambit for meshing (blockMesh utility is no option). I am open for any idea which could fix my problem. If anybody needs my mesh-files, please tell me I will upload them. Thx, fs82

 May 7, 2009, 13:39 #4 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 612 Rep Power: 22 Try posting your mesh and let me know what patches are cyclic. If you have a .jou file to go with it so I can generate the mesh myself that would be great. I had this problem a few months ago and it was incredibly annoying. I found some posts on the message board that helped. Dan

 May 8, 2009, 02:45 #5 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 This would be great if you could try it. I have no more idea, what to try next :/ I uploaded the files to my webaccount. If you klick on the link below, you will find a zip-archiv with all neccesary gambit files included and my createPatchDict. I think I named everything in english, except the file name Periodic are all "p_z" patches. Thanks a lot. Fabian http://wwwpub.zih.tu-dresden.de/~fschleg/cylinder.zip

 May 10, 2009, 13:18 still not sure #6 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 612 Rep Power: 22 I took a look at your mesh file and imported the mesh with no problems. I did however get the same problem that you have. I would make sure of a few things. 1. Make sure that you liked the faces correctly. I had a similar problem and I wasn't linking the faces correctly and reversing the direction correctly. Make sure that you pick the mirror image of the vertex on opposing sides and the arrows that leave the opposing vertices are going the same direction. Since your mesh is nice, it may be hard to tell if you have the right direction. If you use a tet mesh the mesh becomes twisted and its obvious that its going the wrong direction. I suspect that this is it. 2. Make sure you change the write precision. Once i fixed my mesh linking problem, that was another problem. I think that this problem was pointed out in: http://www.cfd-online.com/Forums/ope...-boundary.html 3. Try making the the periodic boundaries as separate faces in GAMBIT (after the edges/faces have been linked and volume meshed), then check to make sure that the number of points and cells match. After that you can make them into cyclic patches in OF. Thats all I can think of right now. Try some of those and if it doesn't work, then go back to a simple geometry and try that until you have the method down. Dan

 May 11, 2009, 10:57 glad I could help #8 Senior Member     Daniel P. Combest Join Date: Mar 2009 Location: St. Louis, USA Posts: 612 Rep Power: 22 Glad I could help.

 May 13, 2009, 09:31 #9 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 I still have another problem with periodic boundaries. I tried another Gambit mesh to convert it to OpenFoam. This is a simple channel with two periodic boundaries. With the steps I described above I get a error during the second run of createPatch: Synchronising points. --> FOAM Warning : From function syncTools::syncPointList(const polyMesh&, UList&, const CombineOp&, const T&, const bool) in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/syncToolsTemplates.C at line 1047 There are decomposed cyclics in this mesh with transformations. This is not supported. The result will be incorrect Points changed by average:0.00458973012292 max:7.02481475253 I am not really sure what synchronisation of points does, but if I turn it of everything works fine. Is this problem due to my TWO periodic boundaries? May be the converter is not able to distinguish between the two periodic patches? Fabian

 May 13, 2009, 21:46 #10 Member   John Wang Join Date: Mar 2009 Location: Singapore Posts: 72 Rep Power: 10 I've had similar problem before. It turned out that I set the write tolerance too small (it was initially set as 1e-6 or something, now it's happily staying at 2e-2 and works great.) I'll try and see if I can get your grid working when I get back into my lab later today, though (that's where I have openfoam installed,I'm still trying to figure out how to scp a file on a windows machine to a linux machine.) ________ EDIT: Yeah, I just realized that I do have X windows on my current workstation and downloaded your file through firefox. Anyway, I think there's a few problem with your setup. First of all, I don't think the createPatchDict are setup to handle more than two patches, so you should probably group all the faces on the RHS into a boundary patch called sidewall_right and the faces on LHS into sidewall_left (they should be in the same order when you assign the faces to BC in Gambit, e.g. top to down, front to back or something similar). Hope that helps. If you need more than one patch on each wall, create the cyclic sets on a 1 to 1 basis just to make sure the face order does not get messed up. Last edited by cwang5; May 13, 2009 at 22:42.

 May 14, 2009, 04:44 #11 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 Thx for having a look to my mesh. Linux offers you a nice little tool called dos2unix which converts Linux files for usage in a microsoft environment. By default is is not installed but you can simple download it via your package manager. So my cyclinder is now working fine with the process discribed some posts before. Which variable have you set to 2e-2? WritePrecision or matchingTolerance ? I know the easiest way to get createPatch work is adjusting the matchingTolerance, but for my cylinder mesh I have to set the matchingTolerance to a value greater than 2. So if you try my way with two times createPatch, first to combine the two boundaries which should be periodic into one patch and second to make this patch periodic, this works ... that was what I thought until yesterday. I need a channel mesh, so I created one with Gambit and tried my way to get periodic/cyclic boundaries in flow and crossflow direction. But this does not work and I get the error mentioned one post before. The solution was to turn of syncronisation of points for the last run of createPatch. So for me it would be interesting what synconisation really does and why it sometimes works and sometimes not. It is not satisfying do figure out a special way of creating periodic boundaries for every new mesh. While having a closer look to the channel395 tutorial I also noticed another mystery. In this tutorial the cyclic boundaries are in several patches for every side. So one patch for left side, one for right side, one for inflow and one for outflow. I thought you have to have one patch for every perodic boundary, for this example one patch in- and outflow and one patch left and right ... if I try this for my channel I get the annoying possible face ordering problem. I dont know where is my problem?

 May 14, 2009, 05:36 #12 Member   John Wang Join Date: Mar 2009 Location: Singapore Posts: 72 Rep Power: 10 I don't really understand the whole process of channel395 either, but from observation I've concluded that the boundary setup they used for that case only works if the boundary is meshed uniformly. I've never looked further into the problem since I've managed to get the cyclic patch working by grouping each side of the wall with one patch and combining the two using createPatch, and since I deal more with airfoil simulation instead of channel flow, I guess I never felt the need to look further into the issue. Hope that helps.

 May 14, 2009, 06:47 #13 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 I get the problem ... try and error and a hint in a thread. I have the situation of two periodic boundaries which are orthogonal to each other and this is a problem. CreatePatch is not able to synchronize the nodes which are situated along the corner egde which connect both boundaries. This is because of a different transformation tensor for the same node belonging to several patches. For one the synchronization works but not for both. The nice thing is - may be only for my channel - that the mesh with and without synchronization is the same, so it doesn't mather (a diff on all files in polymesh shows no difference). This could be a result of my writePrecision of 12 but I am not sure. So if you have two periodic boundaries which are connected and lie on different planes turn off pointSync and it will work! Thx for help P.S.: May be anybody know what pointSync really does I guess it adjusts the point coordinates?

 May 28, 2009, 10:23 #15 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 This looks pretty good, but while reading your post I figured out two possible problems. 1) When you define your boundary conditions in gambit use "wall" not "periodic" or something else. But make sure that you link all your periodic faces. 2) After your step 9 you have to use createPatch again and you will get another directory like in step 7 with a new polymesh (remove the directory from step 7 before you start createPatch again) Try this and hopefully this will work.

 June 1, 2009, 06:13 creating cyclic boundary condition #16 New Member   parham momeni Join Date: Mar 2009 Location: glasgow, uk Posts: 25 Rep Power: 9 Hi I did what you told me but I still have problems,.....

 June 2, 2009, 08:25 #17 Senior Member   Dr. Fabian Schlegel Join Date: Apr 2009 Location: Dresden, Germany Posts: 222 Rep Power: 11 You still get the error you posted a view days ago? May be you could upload your mesh anywhere? I would try to convert it to OpenFoam for myself.

 January 23, 2011, 16:32 cyclic bc problem #18 Member   Santiago Join Date: Dec 2009 Posts: 85 Rep Power: 9 I have the exact same problem with cyclic BCs and mesh exported from Gambit/Fluent. I followed the procedures described above and still cannot make it work. Did you guys find what the problem was? I'm running out of ideas of how to fix this problem. Thanks

 January 23, 2011, 19:18 #19 Member   Santiago Join Date: Dec 2009 Posts: 85 Rep Power: 9 Aha! I figure it out. I did what mcjicpm2 did above, however, i used Fluent3DtoFoam instead of FluenttoFoam and that made all the difference. Make sure that the faces are properly linked in Gambit though.

September 24, 2011, 06:23
#20
New Member

mehdy
Join Date: May 2011
Posts: 4
Rep Power: 8
Quote:
hi fabian
that realy worked, thanks a lot!!

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post bigphil OpenFOAM Installation 16 April 29, 2009 06:28 mirko OpenFOAM Installation 2 August 12, 2008 18:07 srinath OpenFOAM Running, Solving & CFD 2 July 15, 2008 09:34 jussi OpenFOAM Installation 0 April 24, 2008 14:25 K. I. Chan Main CFD Forum 0 December 10, 2000 23:56