CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   how to use the cyclic boundary conditions (http://www.cfd-online.com/Forums/openfoam/111258-how-use-cyclic-boundary-conditions.html)

 bryant_k January 2, 2013 02:09

how to use the cyclic boundary conditions

2 Attachment(s)
hello everyone
I am simulating fully developed flow in a duct. I want to use cyclic boundary according to channelFoam.Because the flow is laminar so I decided to turn off the turbulence contribution in channelFoam.I have successfully complied the solver.However, after putting out several calculating results, I find the results( both the pressure and velocity) are not correct.
I have attached my case and solver here.I hope you can check it and give me some advice.

Thank you very much!
regards!

bryant

 Lieven January 2, 2013 06:46

Hi Bryant,

You should not remove the viscosity term from the momentum equation as you did it in mychannelFoam. Now, no viscosity is included at all which is not really what you want since you have a laminar flow (basically viscosity dominated flow).

Instead, write it in the generic way as done in pisoFoam and set simulationType in constant/turbulenceProperties to laminar. This way, turbulence is not modelled (so no RANS or LES) but the kinematic viscosity is still included in the momentum equation.

Regards,

L

 chegdan January 2, 2013 16:55

@Bryant

Lieven's suggestion will certainly work and is a good exercise, but changes to channelFoam aren't necessary to do what you want. To run the code on a laminar flow, just change the LESModel in constant/LESProperties to laminar and add some schemes to your fvSchemes file

Code:

`    div((nu*dev(T(grad(U))))) Gauss linear;`
and

Code:

`    laplacian(nu,U) Gauss linear corrected;`
in the correct subdict.

 Lieven January 2, 2013 17:56

Quote:
 Originally Posted by chegdan (Post 399823) just change the LESModel in constant/LESProperties to laminar
Did not know this was possible :D

 bryant_k January 4, 2013 02:54

2 Attachment(s)
Thanks to Lieven and chegdan.
I think I know how to modified the solver.But now I met a new problem after I converted the mesh into openfoam.When I run createPatch command,I got errors like this:
Code:

```Create time Reading createPatchDict. Create polyMesh for time = 0 Adding new patch sinout as patch 4 from {     type            cyclic;     transform      translational;     separationVector ( 0 0 -1 ); } Moving faces from patch SINLET to patch 4 Moving faces from patch SOUTLET to patch 4 Doing topology modification to order faces. cyclicPolyPatch::getGeometricHalves : Writing half0 faces to OBJ file "/home/lg88/pipeflow/solid/sinout_half0_faces.obj" cyclicPolyPatch::getGeometricHalves : Writing half1 faces to OBJ file "/home/lg88/pipeflow/solid/sinout_half1_faces.obj" cyclicPolyPatch::getGeometricHalves : Writing half0 face centres to OBJ file "/home/lg88/pipeflow/solid/sinout_half0.obj" cyclicPolyPatch::getGeometricHalves : Writing half1 face centres to OBJ file "/home/lg88/pipeflow/solid/sinout_half1.obj" --> FOAM Serious Error :     From function cyclicPolyPatch::getGeometricHalves(const primitivePatch&, labelList&, labelList&) const     in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 515     Patch sinout gets decomposed in two zones ofinequal size: 423 and 437 This means that the patch is either not two separate regions or one region where the angle between the different regions is not sufficiently sharp. Please adapt the featureCos setting. Continuing with incorrect face ordering from now on!     From function void polyMesh::initMesh()     in file meshes/polyMesh/polyMeshInitMesh.C at line 82     Truncating neighbour list at 2960 for backward compatibility --> FOAM FATAL ERROR: face 429 area does not match neighbour 859 by 0.682879% -- possible face ordering problem. patch:sinout my area:0.000394872 neighbour area:0.000397577 matching tolerance:0.001 Mesh face:3809 vertices:4((-0.194753 0.471314 0.02) (-0.190602 0.462201 0.02) (-0.153875 0.4756 0.02) (-0.157228 0.48502 0.02)) Neighbour face:4239 vertices:4((-0.359964 0.361206 0.02) (-0.387117 0.331664 0.02) (-0.379107 0.325644 0.02) (-0.352399 0.354623 0.02)) Other errors also exist, only the largest is reported. Please rerun with cyclic debug flag set for more information.     From function cyclicPolyPatch::calcTransforms()     in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 200. FOAM exiting```
I have checked in this forum for solution the similar problem.They said that increasing the matchTolerance.So I increased the tolerance in file createPatchDict,but I found that the tolerance occuring at the error message didn't change at all.I think my createPatchDict file have some problem. I have uploaded my case here which is mainly about the heat transfer problem.