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

Which "Initial residual" to plot in a residual history?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 18, 2016, 04:14
Question Which "Initial residual" to plot in a residual history?
  #1
Member
 
William Tougeron
Join Date: Jan 2011
Location: Czech Republic
Posts: 70
Rep Power: 15
taalf is on a distinguished road
Hi everybody,

I apology if this was already asked and answered but I didn't find any precise info about this here.

As everybody knows, the "Initial residuals" are those at which we should look to check convergence. I mean... of course it's not sufficient to check it but clients like to have somewhere a residual history plot.

For such charts, I always plot "Initial residuals". Now, the question is that when one uses correctors there can be several "Initial residuals" in a single "outer" iteration.

For example:

GAMG: Solving for p, Initial residual = 0.571166, Final residual = 0.011325, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0176414, Final residual = 0.00164592, No Iterations 1
GAMG: Solving for p, Initial residual = 0.00263673, Final residual = 0.000137864, No Iterations 2

The question is: honestly, which value to plot? The first or the last one?

Of course, the last one looks better But I have some doubt if this is the most suitable to demonstrate convergence of the computation.

What do you think (or know) about that?

Thanks for replies!

Best regards,
taalf is offline   Reply With Quote

Old   July 18, 2016, 09:36
Default
  #2
Member
 
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 13
blais.bruno is on a distinguished road
If you are looking to check if you have reached a converged steady solution, the first residual should be plotted. This residual means the "residual" when you begun solving this iteration. The other residual are only changed because of the updates in the pressure-correction scheme (PISO or whatever) and thus don't integrate the full non-linearity of the problem.

If you really wish to see if your problem has converged, the first residual should be as low as possible (1-e4 is a minimum IMO)



Quote:
Originally Posted by taalf View Post
Hi everybody,

I apology if this was already asked and answered but I didn't find any precise info about this here.

As everybody knows, the "Initial residuals" are those at which we should look to check convergence. I mean... of course it's not sufficient to check it but clients like to have somewhere a residual history plot.

For such charts, I always plot "Initial residuals". Now, the question is that when one uses correctors there can be several "Initial residuals" in a single "outer" iteration.

For example:

GAMG: Solving for p, Initial residual = 0.571166, Final residual = 0.011325, No Iterations 1
GAMG: Solving for p, Initial residual = 0.0176414, Final residual = 0.00164592, No Iterations 1
GAMG: Solving for p, Initial residual = 0.00263673, Final residual = 0.000137864, No Iterations 2

The question is: honestly, which value to plot? The first or the last one?

Of course, the last one looks better But I have some doubt if this is the most suitable to demonstrate convergence of the computation.

What do you think (or know) about that?

Thanks for replies!

Best regards,
blais.bruno is offline   Reply With Quote

Old   July 20, 2016, 01:30
Default
  #3
Member
 
William Tougeron
Join Date: Jan 2011
Location: Czech Republic
Posts: 70
Rep Power: 15
taalf is on a distinguished road
Quote:
Originally Posted by blais.bruno View Post
If you are looking to check if you have reached a converged steady solution, the first residual should be plotted.
Hi Bruno,

Thank you for the answer.

I would like to take a more complex case now. I am running something using pimpleFoam and in my fvSolution file I have this:

Code:
PIMPLE
{
    nNonOrthogonalCorrectors 1;
    nCorrectors         2;
    nOuterCorrectors    15;
 
    residualControl
    {
        (...)
        p
        {
                tolerance  1e-3;
                relTol      0;
        }
     }
}


That is a max residual for p of 1e-3. Now, in the log file one can see that OpenFOAM considers it converged when the second iteration (due to nCorrectors = 2) gives an initial residual below 1e-3.

Time = 1

PIMPLE: iteration 1
(...)
PIMPLE: iteration 2
(...)
GAMG: Solving for p, Initial residual = 0.0326319, Final residual = 0.00230812, No Iterations 2
GAMG: Solving for p, Initial residual = 0.000288383, Final residual = 2.5225e-05, No Iterations 2
time step continuity errors : sum local = 9.08306e-08, global = 1.15651e-08, cumulative = 1.2079e-08
GAMG: Solving for p, Initial residual = 0.00081177, Final residual = 5.08786e-05, No Iterations 2
GAMG: Solving for p, Initial residual = 0.000189682, Final residual = 3.53319e-05, No Iterations 1
(...)
PIMPLE: converged in 2 iterations
ExecutionTime = 520.33 s ClockTime = 555 s


So, the conclusion is that:
- additional iterations due to nNonOrthogonalCorrectors > 0 should NOT be taken into account when looking at convergence
- when additional iterations due to
nCorrectors > 1 should.

taalf is offline   Reply With Quote

Old   July 20, 2016, 09:20
Default
  #4
Member
 
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 13
blais.bruno is on a distinguished road
The non-orthogonal correctors should not be taken into account when looking at the history of the residual. When you are doing non-orthogonal corrections in a way you are solving a different system of equation to correct for non-orthogonality and you are not really solving the Poisson equation for Pressure. Absolute tolerance gives you the lowest residual value you can reach before you stop solving (i.e if you put 1e-4, none of your equation will solve to a residual below approx. 1e-4). Generally, if are doing a steady-state simulation, it is best to put a very low absolute tolerance and a relative tolerance that can be higher IMO.
blais.bruno is offline   Reply With Quote

Old   February 9, 2018, 09:12
Default
  #5
Member
 
Andreas P.
Join Date: May 2017
Posts: 41
Rep Power: 9
AndreasPe is on a distinguished road
Hi,

i have a similar question about the residual control of the PIMPLE algorithm.

I noticed, that the residual control for transient simulations takes the last initial residual of the PISO-Loop (inner iterations -> nCorrectors) as reference to stop the SIMPLE-Loop (outer iterations -> nOuterCorrectors).

So if for example six PISO-Iterations are done, the initial residual of the last PISO iteration is compared to the absolute tolerance of the residual control file. Wouldn't this mean, that the non-linearity of the problem is not taken into account?

I would assume that the nonlinear convergence of the pressure equation can only be assessed by looking at the first initial residual of every PISO-Loop.

Maybe this becomes more clear with an example:
In the attachement you can see the last two outer iterations of a simulation i was running with the PIMPLE Debug output. As we can see in the middle of the picture, the abs tol value of p refers to 2.92352087e-07.

So the solver compares this value to the absolute tolerance given in the dictionary (in this case 0) or it compares the initial residual of the first pimple loop (here refered to as ini res = 0.0128040077) devided by the abs tol value to the relative tolerance given in the dictionary (in this case 0.0001). Should'nt be the value of abs tol set to 1.00333041e-5 instead, to capture the whole nonlinearity of the problem? Or is there something, i am missing here, and the nonlinearity of the system is still inherent after doing several PISO-Corrector steps?
Attached Images
File Type: jpg pimple_residuals.jpg (193.5 KB, 90 views)
AndreasPe is offline   Reply With Quote

Reply

Tags
openfoam, residuals


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
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
Unstabil Simulation with chtMultiRegionFoam mbay101 OpenFOAM Running, Solving & CFD 13 December 28, 2013 14:12
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 09:35
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 06:24


All times are GMT -4. The time now is 13:22.