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

OF 2.0.0: Residual control does not work in interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 1 Post By Dr.Faustus
  • 6 Post By wyldckat
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 22, 2011, 11:49
Question OF 2.0.0: Residual control does not work in interFoam
  #1
Member
 
Lars Kiewidt
Join Date: Sep 2009
Location: Germany
Posts: 54
Rep Power: 16
LarsPT is on a distinguished road
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
LarsPT is offline   Reply With Quote

Old   June 24, 2011, 17:46
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   June 28, 2011, 07:25
Default
  #3
Member
 
Lars Kiewidt
Join Date: Sep 2009
Location: Germany
Posts: 54
Rep Power: 16
LarsPT is on a distinguished road
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.
LarsPT is offline   Reply With Quote

Old   August 20, 2011, 08:34
Default
  #4
Member
 
Simon Lapointe
Join Date: May 2009
Location: Québec, Qc, Canada
Posts: 33
Rep Power: 16
Simon Lapointe is on a distinguished road
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.
Simon Lapointe is offline   Reply With Quote

Old   August 20, 2011, 09:03
Default
  #5
Member
 
Lars Kiewidt
Join Date: Sep 2009
Location: Germany
Posts: 54
Rep Power: 16
LarsPT is on a distinguished road
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;
        }
}
LarsPT is offline   Reply With Quote

Old   August 6, 2012, 08:53
Default
  #6
New Member
 
Alessandro Pani
Join Date: Jul 2012
Posts: 21
Rep Power: 13
Dr.Faustus is on a distinguished road
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
Yage likes this.
Dr.Faustus is offline   Reply With Quote

Old   August 7, 2012, 07:28
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
__________________
wyldckat is offline   Reply With Quote

Old   August 7, 2012, 08:51
Unhappy
  #8
New Member
 
Alessandro Pani
Join Date: Jul 2012
Posts: 21
Rep Power: 13
Dr.Faustus is on a distinguished road

I'm using LTSInterFoam on OF 2.1.1
the test case is the /multiphase/LTSInterFoam/wigleyhull
Dr.Faustus is offline   Reply With Quote

Old   August 7, 2012, 10:25
Talking Little class on "Know your PIMPLE"
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
OK, let's do a little class on "Know your PIMPLE"

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
__________________
wyldckat is offline   Reply With Quote

Old   August 27, 2012, 02:49
Default
  #10
New Member
 
Alessandro Pani
Join Date: Jul 2012
Posts: 21
Rep Power: 13
Dr.Faustus is on a distinguished road
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.... anyway thank you very much for your help... another little piece of the jigsaw puzzle added
Dr.Faustus is offline   Reply With Quote

Old   October 16, 2012, 02:01
Default Please help me???
  #11
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
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?????
Attached Images
File Type: png controlDict.png (34.8 KB, 144 views)
File Type: jpg residual.jpg (28.4 KB, 254 views)
vahid.najafi is offline   Reply With Quote

Old   April 2, 2016, 13:46
Default
  #12
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
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 View Post
OK, let's do a little class on "Know your PIMPLE"

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
openfoammaofnepo is offline   Reply With Quote

Old   April 2, 2016, 18:20
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by openfoammaofnepo View Post
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 likes this.
__________________
wyldckat is offline   Reply With Quote

Old   April 6, 2016, 09:26
Default
  #14
Senior Member
 
Join Date: Jan 2013
Posts: 372
Rep Power: 14
openfoammaofnepo is on a distinguished road
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?
openfoammaofnepo is offline   Reply With Quote

Old   April 10, 2016, 14:26
Default
  #15
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by openfoammaofnepo View Post
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
openfoammaofnepo likes this.
__________________
wyldckat is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
icoLagrangianFoam OF1.6 myNewParticleSolver heavy_user OpenFOAM 23 June 2, 2020 02:18
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
TurbFoam problemlarge Co number sunnysun OpenFOAM Running, Solving & CFD 6 March 10, 2009 08:05
On the damBreak4phaseFine cases paean OpenFOAM Running, Solving & CFD 0 November 14, 2008 21:14
MRFSimpleFoam amp cyclic patches david OpenFOAM Running, Solving & CFD 36 October 21, 2008 21:55


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