
[Sponsors] 
kEpsilon and pisoFoam: when transport equations for k and eps are solved 

LinkBack  Thread Tools  Display Modes 
August 23, 2015, 15:08 
kEpsilon and pisoFoam: when transport equations for k and eps are solved

#1 
New Member
Luis Alberto
Join Date: Aug 2015
Location: Spain
Posts: 8
Rep Power: 3 
Hello everyone!
Looking at pisoFoam solver, I am seeing now that, if I am not mistaken, the transport equations for the turbulent kinetic energy (k) and dissipation rate (epsilon) are solved outside piso algorithm loops, i.e., the sentence turbulence>correct() is called upon only when the velocity and pressure fields have already converged. This implies that the equations are written using the nut field computed in the previous time step, and when using wall functions, the term kp used is also from the previous time step. Is this correct or there is something I am not understanding correctly? Could the transport equations be solved inside the loop and checked for convergence too, as in Verteeg and Malasakera? 

August 23, 2015, 16:58 

#2 
Senior Member
anonymous
Join Date: Aug 2014
Posts: 198
Rep Power: 4 
Then go to pimpleFoam and adjust the nOuterCorrectors and the residualControl in the fvSolution


August 24, 2015, 02:29 

#3 
Senior Member
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,409
Rep Power: 25 
Hi,
You should also set turbOnFinalIterOnly to no in PIMPLE dictionary, so turbulent properties transport equations are solved on each outer iteration. Otherwise it will not differ much from pisoFoam. 

August 24, 2015, 04:50 

#4 
New Member
Luis Alberto
Join Date: Aug 2015
Location: Spain
Posts: 8
Rep Power: 3 
Many thanks for your responses, this is clearer now.
However, I have tried that: set nOuterCorrectors to 2 in fvSolutions, and turbOnFinalIterOnly to no in controlDict: Code:
turbOnFinalIterOnly no; DebugSwitches { pimpleControl 1; } Code:
PIMPLE { nNonOrthogonalCorrectors 0; nCorrectors 2; nOuterCorrectors 2; } Code:
Courant Number mean: 0.673517 max: 3.12374 deltaT = 0.000142857 Time = 0.0128571 PIMPLE loop: corr = 1 PIMPLE: iteration 1 smoothSolver: Solving for Ux, Initial residual = 0.0029383, Final residual = 0.000143759, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.00595536, Final residual = 0.00034865, No Iterations 2 PIMPLE correct: corrPISO = 1 GAMG: Solving for p, Initial residual = 0.0154173, Final residual = 0.000117566, No Iterations 5 time step continuity errors : sum local = 9.68577e08, global = 3.98478e09, cumulative = 8.04357e09 PIMPLE correct: corrPISO = 2 GAMG: Solving for p, Initial residual = 0.0099846, Final residual = 7.91935e05, No Iterations 5 time step continuity errors : sum local = 6.54434e08, global = 1.00246e09, cumulative = 9.04603e09 PIMPLE correct: corrPISO = 3 PIMPLE loop: corr = 2 PIMPLE: iteration 2 smoothSolver: Solving for Ux, Initial residual = 0.000216099, Final residual = 4.86046e06, No Iterations 3 smoothSolver: Solving for Uy, Initial residual = 0.000245147, Final residual = 5.2476e06, No Iterations 3 PIMPLE correct: corrPISO = 1 GAMG: Solving for p, Initial residual = 0.0140186, Final residual = 6.54587e05, No Iterations 6 time step continuity errors : sum local = 5.41333e08, global = 1.7189e09, cumulative = 1.07649e08 PIMPLE correct: corrPISO = 2 GAMG: Solving for p, Initial residual = 0.0088667, Final residual = 6.87224e08, No Iterations 15 time step continuity errors : sum local = 5.65003e11, global = 4.88256e12, cumulative = 1.076e08 PIMPLE correct: corrPISO = 3 smoothSolver: Solving for epsilon, Initial residual = 0.0020472, Final residual = 3.64493e06, No Iterations 4 smoothSolver: Solving for k, Initial residual = 0.00445836, Final residual = 3.36889e06, No Iterations 5 PIMPLE loop: corr = 3 ExecutionTime = 1.11 s ClockTime = 1 s P.D.1: ssss comments on adjusting the residualControl in fvSolution. Is there a specific residualControl for this? P.D.2. By the way, another related question. I am trying to turn on the debug switch in pimpleControl.C that activates this piece of code: Code:
if (debug) { Info<< algorithmName_ << " loop:" << endl; Info<< " " << variableName << " PIMPLE iter " << corr_ << ": ini res = " << residualControl_[fieldI].initialResidual << ", abs tol = " << residual << " (" << residualControl_[fieldI].absTol << ")" << ", rel tol = " << relative << " (" << residualControl_[fieldI].relTol << ")" << endl; } Code:
defineTypeNameAndDebug(pimpleControl, 0); Many thanks, 

August 24, 2015, 05:18 

#5 
Senior Member
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,409
Rep Power: 25 
Hi,
1. turbOnFinalIterOnly goes to PIMPLE dictionary in fvSolution file (just like nOuterCorrectors). 2. Either you can use forum search with keyword "residualControl", or "grep r residualControl *" in tutorial folder. Unfortunately there are lots of examples for SIMPLE family of solvers, yet only one for PIMPLE (in compressible/rhoPimpleFoam/ras/angledDuct/system/fvSolution). Though even the example is from compressible solver, it is quite relevant to your case, you PIMPLE dictionary in fvSolution file should be something like: Code:
PIMPLE { momentumPredictor no; nOuterCorrectors 20; // solver will make 20 outer iterations, or less if residuals drop below threshold more rapidly nCorrectors 2; nNonOrthogonalCorrectors 0; // this value depends on the quality of your mesh residualControl { "(Ukepsilon)" { relTol 0; tolerance 0.0001; } } turbOnFinalIterOnly off; // or no if you prefer } Code:
DebugSwitches { pimpleControl 1; } Last edited by alexeym; August 24, 2015 at 05:20. Reason: clarification 

August 24, 2015, 05:33 

#6 
New Member
Luis Alberto
Join Date: Aug 2015
Location: Spain
Posts: 8
Rep Power: 3 
Thanks! I was writting turbOnFinalIterOnly in the wrong place.
I find it strange that the turbulence transport equations are only solved at the end of the loop in pisoFoam, so that the PISO algorithm works with the nut from the previous time step. Of course, it is a matter of modifying it or using pimpleFoam. Thanks! 

Tags 
pisofoam, solvers, turbulence 
Thread Tools  
Display Modes  

