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

"Residuals" in residualControl

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 2 Post By knuckles
  • 1 Post By Kina
  • 5 Post By Bloerb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2016, 14:59
Default "Residuals" in residualControl
  #1
Member
 
Join Date: Aug 2015
Posts: 37
Rep Power: 10
knuckles is on a distinguished road
In system/fvSolution, I can specify tolerances on matrix solvers:

Code:
solvers
{
    p
    {
        solver         PGC;
        preconditioner DIC;
        tolerance      1e-08;
        relTol         0;
    }
}
My understanding is that openfoam will construct an equation of the form Ax = b, solve it in some iterative way, and will stop iterating when the residual, |Ax - b|, is less than 1e-08 (relTol = 0 so it is not a factor here).

With SIMPLE/PIMPLE, it's also possible to specify a residualControl:

Code:
PIMPLE
{
    nOuterCorrectors  50; 
    nCorrectors        3;
    nNonOrthogonalCorrectors 3; 

    residualControl
    {
        U
        {
            tolerance 1e-3;
            relTol       0;
        }
        p
        {
            tolerance 1e-2;
            relTol       0;
        }
    }
}
The code above means that the "outer" PIMPLE loops will continue until either
  • 50 (nOuterCorrectors) loops have been completed
  • The residuals of both U and p fall below the specified values
I'm unclear on which "residuals" are considered here. If they are the same variety as described above, then it seems to me that setting residualControl tolerances which are more generous than the solver tolerances should give only one pimple loop. My test cases show that this is not how this works.

I assume that the residuals being considered here quantify, in some way, how well the pressure/momentum coupling is being resolved. Does anyone know which residuals are considered here?
cdunn6754 and neelarun like this.
knuckles is offline   Reply With Quote

Old   March 7, 2016, 15:23
Default
  #2
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
This is my interpretation of the problem:
the matrix solver setting (for example GAMG) solves the equation until the tolerance is reached - that's correct. However, this is only valid for the current time step. When the residual of the solver loop (inner loop) is reached, it considers its work done for the timestep. The final residual of the inner loop of this time step is used for the initial residual of the solver in the next pimple loop.
So in short: the solver tolerance determines the residual of the GAMG solver for the final residual of THIS current time step while the residual control watches the change of the initial residuals from each time step to the next.
granzer likes this.
Kina is offline   Reply With Quote

Old   March 7, 2016, 16:09
Default
  #3
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
You have one equation for conservation of mass and one (to be nitpicky three) for conservation of momentum. The Problem is that you need to couple these two equations.
If you have ax=y and y=b you could combine them into ax=b. Problem however with mass and momentum equations is that you can't do this that easily. Both depend on p and U but for incompressible fluids for example there is no pressure in your mass balance because the density cancels out. Long story short it ain't that easy in this case.

In The PIMPLE algorithm (a combination of simple and piso) this is therefore done iteratively. In my example you'd guess x (some initial value) and solve ax=y. Now you check if y=b is fullfilled. If not you correct x until it is.

This is what is checked with residualControl and solver tolerance. Solver tolerance is to which error ax=y is solved. residual Control is which error for the actual solution you are interested in ax=b or y=b is allowed. Or to be more precise the initial residual of ax=y after correcting x.

Read up on the workings of simple or piso algorithms if you are interested in more specific parts since this seems like a crude way of describing it to me.
Bloerb 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
residualControl with coupled solver itchy OpenFOAM Running, Solving & CFD 0 December 13, 2014 11:37
[swak4Foam] groovyBC and residualControl Tobi OpenFOAM Community Contributions 3 September 14, 2014 08:24
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 08:35
Error when I try a case with pimple instead of simple solver samiam1000 OpenFOAM 6 July 29, 2013 12:56


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