CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   OF 2.0.0: Residual control does not work in interFoam (https://www.cfd-online.com/Forums/openfoam-solving/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?????

openfoammaofnepo April 2, 2016 13:46

Dear Bruno and other OFers,

Just for curiosity, in most tutorials the residualControl is not specified explicitly in the item for PIMPLE in fvSolution file. However, if we specify it, and then actually in the same file, we also specify the tleralence for each variable as follows:

Code:

    p_rgh
    {
        solver              GAMG;
        tolerance          1e-5;
        relTol              0.01;
        smoother            GaussSeidel;
        cacheAgglomeration  true;
        nCellsInCoarsestLevel  10;
        agglomerator    faceAreaPair;
        mergeLevels    1;
    };

So what is the relation between this tolerance and the one specified in PIMPLE as follows?

Code:

PIMPLE
{
    nNonOrthogonalCorrectors 0;
    nCorrectors          1;
    nOuterCorrectors    50;
 
    residualControl
    {
        U
        {
                tolerance  1e-5;
                relTol      0;
        }
        p_rgh
        {
                tolerance  1e-5;
                relTol      0;
        }
    }
}

I have the useful document in the following website:

https://openfoamwiki.net/index.php/O...hm_in_OpenFOAM
Quote:

Originally Posted by wyldckat (Post 375843)
OK, let's do a little class on "Know your PIMPLE" :D

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

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


wyldckat April 2, 2016 18:20

Quote:

Originally Posted by openfoammaofnepo (Post 593046)
So what is the relation between this tolerance and the one specified in PIMPLE as follows?

Quick answer:
  • The ones within "solvers" refer to the tolerance for the solving of a particular equation. In other words, it's related to one equation line in the output.
  • The ones within residual control refer to whether it should do another PIMPLE correction step or not, i.e. if it should do more lines.

openfoammaofnepo April 6, 2016 09:26

Thanks, Bruno.

So now we have two settings: one is set nOuterCorrectors = 4 for a PIMPLE loop, but do not use the residualControl for it; another one is to set nOuterCorrectors a higher value (say 50) but use the residualControl for it as described above. In my computations, for the latter, I can see the following output:

Code:

PIMPLE: converged in 8 iterations
I am just wondering, is there any effects for these two settings for the unsteady computations?

wyldckat April 10, 2016 14:26

Quote:

Originally Posted by openfoammaofnepo (Post 593669)
Code:

PIMPLE: converged in 8 iterations
I am just wondering, is there any effects for these two settings for the unsteady computations?

Quick answer: I thought the wiki page was pretty clear about what PIMPLE is really for... it allows to take larger steps in time (well, don't try to aim for Courant > 1 without doing some accuracy tests first with a relevant example case) and it relies on the SIMPLE loop to increase the accuracy for the current time step.
It's sort-of like doing a local steady-state analysis for the current time step, but it's time accurate because the "d/dt" term is present in the SIMPLE (if I remember correctly).

Keep in mind that SIMPLE can actually be used for transient simulations: http://openfoamwiki.net/index.php/Ma...ransientSimple


All times are GMT -4. The time now is 12:44.