CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   OF 2.0.0: Residual control does not work in interFoam (http://www.cfd-online.com/Forums/openfoam/89798-2-0-0-residual-control-does-not-work-interfoam.html)

LarsPT June 22, 2011 11:49

OF 2.0.0: Residual control does not work in interFoam
 
Hi everybody,

I want to use the new convergence check for the PIMPLE solvers in interFoam (OpenFOAM-2.0.0). So, I specified the following in fvSolution:

Code:

PIMPLE
{
    momentumPredictor no;
    nOuterCorrectors 3;
    //nCorrectors    3;
    nNonOrthogonalCorrectors 0;
   
    nAlphaCorr      1;
    nAlphaSubCycles 2;
    cAlpha          1;
   
    residualControl
    {
        p_rgh    1e-3;
    }
}

However, when I run interFoam I get this output at the beginning

Code:

PIMPLE: max iterations = 3
    field p_rgh    : relTol 0, tolerance 0

and for each time step

Code:

PIMPLE: not converged within 3 iterations
althoug the residual is way under 1e-03!

Is that a bug or am I just missing a switch or something else? I already checked the source files but I could not find any valuable information in there.

Thanks in advance!

Lars

wyldckat June 24, 2011 17:46

Greetings Lars,

Have you also tested it with OpenFOAM 1.7.1 or 1.7.x? If it works with those and not 2.0.0 nor 2.0.x, then you might want to report it as bug!

Best regards,
Bruno

LarsPT June 28, 2011 07:25

According to the OF-2.0.0 Release Notes this is a new feature for all SIMPLE/PIMPLE solvers. It was implementent in simpleFoam in OF-1.7.1 and I tested it successfully, also in OF-2.0.0. However, it is new for interFoam.

Simon Lapointe August 20, 2011 08:34

Maybe you've already solved your problem, but have you tried something like this:

residualControl
{
p_rgh
{
tolerance 1e-3;
absTol 0;
}
}

I had the same problem as you described in pimpleFoam and solved it using this syntax.

LarsPT August 20, 2011 09:03

Sorry, I didn't work too much on that issue the last weeks. Your hint works perfectly, thank you. I just had to add relTol, so now it looks like this:

Code:

residualControl
{
        p_rgh
        {
            tolerance 1e-06;
            relTol 0;
            absTol 0;
        }
}


Dr.Faustus August 6, 2012 08:53

Hi guys! I've tried to modify the commands as suggested by Simon and LarsPT, but this doesn't work for me :
Code:


PIMPLE
{
    momentumPredictor yes;

    nCorrectors    1;
    nNonOrthogonalCorrectors 0;

    nAlphaCorr      1;
    nAlphaSubCycles 1;
    cAlpha          1;

    maxCo          0.9;
    maxAlphaCo      0.2;
    nAlphaSweepIter 1;

    rDeltaTSmoothingCoeff 0.1;
    rDeltaTDampingCoeff 1;
    maxDeltaT      1;

residualControl
    {
        p_rgh
        {
            tolerance 1e-02;
            relTol 0;
            absTol 0;
        }
       
    }

}

Could you take a look if there's something wrong?
Thanks :)

wyldckat August 7, 2012 07:28

Greetings Alessandro,

A couple of more details would come in handy, such as:
  • What solver are you trying to use? We can assume it's interFoam, but you could be using some other one....
  • What OpenFOAM version are you using?
  • Can this be reproduced in one of OpenFOAM's tutorials? If so, which one?
Best regards,
Bruno

Dr.Faustus August 7, 2012 08:51

;)
I'm using LTSInterFoam on OF 2.1.1
the test case is the /multiphase/LTSInterFoam/wigleyhull

wyldckat August 7, 2012 10:25

Little class on "Know your PIMPLE"
 
OK, let's do a little class on "Know your PIMPLE" :D

First we look into the file where the "residualControl" is read:
Quote:

Originally Posted by src/finiteVolume/cfdTools/general/solutionControl/pimpleControl/pimpleControl.C
Code:

Foam::pimpleControl::pimpleControl(fvMesh& mesh)
:
    solutionControl(mesh, "PIMPLE"),
    nCorrPIMPLE_(0),
    nCorrPISO_(0),
    corrPISO_(0),
    turbOnFinalIterOnly_(true),
    converged_(false)
{
    read();

    if (nCorrPIMPLE_ > 1)
    {
        Info<< nl;
        if (residualControl_.empty())
        {
            Info<< algorithmName_ << ": no residual control data found. "
                << "Calculations will employ " << nCorrPIMPLE_
                << " corrector loops" << nl << endl;
        }
        else
        {
            Info<< algorithmName_ << ": max iterations = " << nCorrPIMPLE_
                << endl;
            forAll(residualControl_, i)
            {
                Info<< "    field " << residualControl_[i].name << token::TAB
                    << ": relTol " << residualControl_[i].relTol
                    << ", tolerance " << residualControl_[i].absTol
                    << nl;
            }
            Info<< endl;
        }
    }
    else
    {
        Info<< nl << algorithmName_ << ": Operating solver in PISO mode" << nl
            << endl;
    }
}


In bold are the main details to look at. Basically, besides the need for "residualControl", you also need nCorrPIMPLE_, which apparently is "nOuterCorrectors", as you can see in the original post!

Also as you can see, without this value, it will operate in PISO mode! Which the tutorial "multiphase/LTSInterFoam/wigleyHull" uses by default.
There is another example for LTSInterFoam in the latest 2.1.x: https://github.com/OpenFOAM/OpenFOAM...tem/fvSolution
As you can see, neither one use the "nOuterCorrectors", so I do not know if LTSInterFoam is meant to be executed in PISO only or if it can be executed in PIMPLE mode...

Best regards,
Bruno

Dr.Faustus August 27, 2012 02:49

Hi Wyldckat, sorry for the late reply, but i wasn't able to work on it in past weeks...
I'm taking a look at the controls you've posted... i've added nOuterCorrectors in the fvsolution ( erasing ncorr) and now it runs in PIMPLE and not in Piso... i let you know if the convergence controls works...
But at this steps i would to know if for a problem like the wigley hull is better to run in PISO or in Pimple.... :rolleyes: anyway thank you very much for your help... another little piece of the jigsaw puzzle added :D

vahid.najafi October 16, 2012 02:01

Please help me???
 
2 Attachment(s)
Hi dear foamers.
I have a question:
I plot residual for velocity with gnuplot succefully.but have a problem yet!!!
in my controlDict(pic attachmented) deltaT=1e-6 and writeInterval=0.001 , with this options I stop my run and seen 1024 folders in my tutorial.

but I seen in my residual(pic attachmented) ,number of iterations:120000 and we underestand that in my tutorial That have been runed,should be i have 120 folders.????

my Supervisor tell me ,my residual not true???!!!please help me?????


All times are GMT -4. The time now is 01:46.