How to setup cyclic BCs in simpleFOAM
I am trying to simulate fully developed turbulent flow in a square duct with cyclic BC in simpleFoam with KEpsilon model. The mesh was generated in pointwise, with cyclic BCs automatically specified. here attach my setup files, but it fail to get a converged solution. Any hits? Thanks in advance.
0/U &p dimensions [0 1 1 0 0 0 0]; internalField uniform (0.329 0 0); boundaryField { Cyclic { type cyclic; value uniform (0.329 0 0); } Wall { type fixedValue; value uniform (0 0 0); } } dimensions [0 2 2 0 0 0 0]; internalField uniform 0; boundaryField { Cyclic { type cyclic; } Wall { type zeroGradient; } } and I also set Ubar in constant/transportProperties Ubar Ubar [ 0 1 1 0 0 0 0 ] (0.329 0 0 ); transportModel Newtonian; nu nu [ 0 2 1 0 0 0 0 ] 1.003e06; in system/fvSchemes I set SIMPLE { nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; } I has been trying for days, but got no good results, even if I turned off turbulence. the maximum stream velocity from simpleFoam is 0.329, so the mass is not conserved. 
How about this,
Code:
Cyclic 
Any other solvers that can implement the periodic boundary conditions?

Have you looked into channelFoam? It can handle cyclics, while simpleFoam doesnt by default (I think).
Regards, Jose Santos 
However, if I just wanna run a laminar or RANS , what solver can I chose?

Try pisoFoam.

For laminar, change LESModel in channelFoam to laminar. For RANS I guess you need to make your own solver, combining eg pisoFoam (as suggested above) and channelFoam.
Regards, Jose Santos 
hi everybody,
i try to run the biperiodic tutorial channelOoddles initially proposed in LES, with the solver simpleFoam for steady RANS using the Komega SST model and taking the same parameters Ubar and nu. so i add the term gradP like in the channelOoddles solver in the Ueqn but the result was a laminar regime even after long time simulations. k and omega are not zero. can someone help me please, here after my proposed: fvVectorMatrix UEqn ( fvm::div(phi, U) + turbulence>divDevReff(U) == flowDirection*gradP ); UEqn.relax(); eqnResidual = solve ( UEqn == fvc::grad(p) ).initialResidual(); maxResidual = max(eqnResidual, maxResidual);  p.boundaryField().updateCoeffs(); volScalarField AU =UEqn.A(); volScalarField rUA = 1.0/UEqn.A(); U = UEqn.H()/AU; phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p); // Nonorthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian(1.0/AU, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); // retain the residual from the first iteration if (nonOrth == 0) { eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); } else { pEqn.solve(); } if (nonOrth == nNonOrthCorr) { phi = pEqn.flux(); } } # include "continuityErrs.H" // Explicitly relax pressure for momentum corrector p.relax(); // Momentum corrector U = fvc::grad(p)/AU; U.correctBoundaryConditions(); // Correct driving force for a constant mass flow rate // Extract the velocity in the flow direction dimensionedScalar magUbarStar = (flowDirection & U)().weightedAverage(mesh.V()); // Calculate the pressure gradient increment needed to // adjust the average flowrate to the correct value dimensionedScalar gragPplus = (magUbar  magUbarStar)/rUA.weightedAverage(mesh.V()); U += flowDirection*rUA*gragPplus; gradP += gragPplus; Info<< "Uncorrected Ubar = " << magUbarStar.value() << tab << "pressure gradient = " << gradP.value() << endl; 
channel flow with simpleFoam aka simpleChannelFoam
This is an old thread, but its close to what I would like to discuss. I have made some changes to simpleFoam using channelFoam as a guide to model steadystate channel flow using RANS. I noticed this thread that was left hanging....has anyone managed to get periodic boundary conditions in simpleFoam to work WITHOUT direct mapped patches? Ubar and gradP diverge after a few hundred iterations. Thoughts? Below is my code so far.
Dan Code:

Dear Dan,
in the thread above about „channel flow with simpleFoam aka simpleChannelFoam“ you wrote about having problems with convergence of Ubar and gradP. I'm having the same problem right now (not surprising since I'm using a quite similar solver) and I'm not able to find the problem. Have you been able to identify or even solve the problem of the solver you posted? It would be great to get some feedback :) Kind Regards Tom 
Quote:
Not yet. Regards, Dan 
Dear Dan,
Dear Foamers, the solver posted above by Dan should be correct. A very similar solver I used is running quite fine by considering the following aspects: 1. it is absolutely vital to use an upwind scheme for solving U (can be changed in the fvSchemesdictionary if not set by default) 2. relaxationFactors for pressure and velocity must be reduced and should not be bigger than p 0.15; U 0.5; (The relaxation factors can be changed in the fvSolution dictionary) 3. one should take at least 8000 iterationsteps ( set in the controldictfile), although in some cases 4000 iterations might be sufficient as well. I made best experiences with 10000 steps. In particular, I posted this for Dan in the hope of giving him, and anybody else having the same problem and reading this thread, an helpful answer, but I fear this is coming to late. Kind Regards Tom 
Tom,
Thanks. I'll give it a try and If I can add anything I'll get back here and post it. Thanks. Dan 
All times are GMT 4. The time now is 16:04. 