CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

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

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2015, 16:08
Default 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: 10
LuisAlberto is on a distinguished road
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?
LuisAlberto is offline   Reply With Quote

Old   August 23, 2015, 17:58
Default
  #2
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 12
ssss is on a distinguished road
Then go to pimpleFoam and adjust the nOuterCorrectors and the residualControl in the fvSolution
ssss is offline   Reply With Quote

Old   August 24, 2015, 03:29
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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.
alexeym is offline   Reply With Quote

Old   August 24, 2015, 05:50
Default
  #4
New Member
 
Luis Alberto
Join Date: Aug 2015
Location: Spain
Posts: 8
Rep Power: 10
LuisAlberto is on a distinguished road
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;
}
But it still seems to solve for epsilon and k only at the end:

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.68577e-08, global = -3.98478e-09, cumulative = 8.04357e-09
PIMPLE correct: corrPISO = 2
GAMG:  Solving for p, Initial residual = 0.0099846, Final residual = 7.91935e-05, No Iterations 5
time step continuity errors : sum local = 6.54434e-08, global = 1.00246e-09, cumulative = 9.04603e-09
PIMPLE correct: corrPISO = 3
PIMPLE loop: corr = 2
PIMPLE: iteration 2
smoothSolver:  Solving for Ux, Initial residual = 0.000216099, Final residual = 4.86046e-06, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 0.000245147, Final residual = 5.2476e-06, No Iterations 3
PIMPLE correct: corrPISO = 1
GAMG:  Solving for p, Initial residual = 0.0140186, Final residual = 6.54587e-05, No Iterations 6
time step continuity errors : sum local = 5.41333e-08, global = 1.7189e-09, cumulative = 1.07649e-08
PIMPLE correct: corrPISO = 2
GAMG:  Solving for p, Initial residual = 0.0088667, Final residual = 6.87224e-08, No Iterations 15
time step continuity errors : sum local = 5.65003e-11, global = -4.88256e-12, cumulative = 1.076e-08
PIMPLE correct: corrPISO = 3
smoothSolver:  Solving for epsilon, Initial residual = 0.0020472, Final residual = 3.64493e-06, No Iterations 4
smoothSolver:  Solving for k, Initial residual = 0.00445836, Final residual = 3.36889e-06, No Iterations 5
PIMPLE loop: corr = 3
ExecutionTime = 1.11 s  ClockTime = 1 s
Any ideas of what might I be doing wrong?

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;
            }
I thought it sould be 'pimpleControl' as the file starts by
Code:
defineTypeNameAndDebug(pimpleControl, 0);
. However it does not work, and there is something I am surely not understanding. Any clues?

Many thanks,
LuisAlberto is offline   Reply With Quote

Old   August 24, 2015, 06:18
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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
    {
        "(U|k|epsilon)"
        {
            relTol          0;
            tolerance       0.0001;
        }
    }

    turbOnFinalIterOnly off; // or no if you prefer
}
UPD. This piece:

Code:
DebugSwitches
{
    pimpleControl          1;
}
defines verbosity of pimpleControl class and has nothing to do with relevant behaviour of the solver itself.

Last edited by alexeym; August 24, 2015 at 06:20. Reason: clarification
alexeym is offline   Reply With Quote

Old   August 24, 2015, 06:33
Default
  #6
New Member
 
Luis Alberto
Join Date: Aug 2015
Location: Spain
Posts: 8
Rep Power: 10
LuisAlberto is on a distinguished road
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!
LuisAlberto is offline   Reply With Quote

Reply

Tags
pisofoam, solvers, turbulence

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:37.