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

How to stop iterating when residuals fall down enough

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By alexeym
  • 1 Post By Tensian

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 12, 2014, 15:56
Smile How to stop iterating when residuals fall down enough
  #1
Member
 
Richardpluff
Join Date: May 2014
Posts: 95
Rep Power: 12
CRI_CFD is on a distinguished road
Hi guys,

When I used FLUENT, I remember that there exist a tolerance for residuals (I hardly remember it, but I think it was set by default to 1e-3 except for energy, 1e-6). When residuals fall down this values, the simulation stops and the result is considered as converged (I know, it can also be added another physical quantity like flow rate, averaged value or so to make sure the solution is really converged).

Now I want to stop my simulation with OpenFOAM when residuals fall below 1e-5 for p and 1e-7 for U and T. I am using my own version of simpleFoam with SIMPLE algorithm. How can I do this?

I have been playing with values in residualControls and tolerance of solvers, but the solver always continues iterating, even when I am seeing that residuals have drop down the specified value.

Anybody can help? This seems an easy question but I cannot find the solution yet...

THANKS!!!
CRI_CFD is offline   Reply With Quote

Old   December 12, 2014, 16:51
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

here's a excerpt from tutorials/incompressible/simpleFoam/pitzDaily/system/fvSolution

Code:
SIMPLE
{
    nNonOrthogonalCorrectors 0;
    
    residualControl
    {
        p               1e-2;
        U               1e-3;
        "(k|epsilon|omega)" 1e-3;
    }
}
Those residuals (under residualControl) are convergence criteria.
jherb and CRI_CFD like this.
alexeym is offline   Reply With Quote

Old   December 15, 2014, 07:01
Cool
  #3
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 13
Tensian is on a distinguished road
Hey CRI,

Did you remeber to include convergence criteria for new variable you have introduced? You said that you have your own simpelFoam based solver and I see you are computing T. So if you want to set a convergence criteria, you have to set it in the source code for all variables. Otherwise the solver will continue iterating until maximun number of iterations specified in controlDict is reached...

Hope it helps.

Regards,

Tensi
CRI_CFD likes this.
Tensian is offline   Reply With Quote

Old   December 15, 2014, 07:07
Talking
  #4
Member
 
Richardpluff
Join Date: May 2014
Posts: 95
Rep Power: 12
CRI_CFD is on a distinguished road
Thanks alexeym and Tensian for yur replies.

As I expected, the residualControl is the place where I should establish my convergence criteria. I have made several trial and error and nothing works...

Tensian, I think you have pointed me in the right direction. I have not implemented any kind of control over residuals in my solver source code, so, how can I expect it stops? This have no sense and I have to review the code and create something that makes T residuals to stop under any condition...

Thanks for the tips guys!
CRI_CFD is offline   Reply With Quote

Old   December 15, 2014, 07:11
Smile
  #5
Member
 
Richardpluff
Join Date: May 2014
Posts: 95
Rep Power: 12
CRI_CFD is on a distinguished road
Unfortunately I have no idea about the starting point to add this kind of condition over T residuals.

Has anybody implemented something similar? I have to put and "if" statement in somewhere, but I have no idea about classes or methods related to residuals.

Any hints?

Thanks in advance,

Best,

CRI
CRI_CFD 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
motorBike Residuals for SST k-omega... and mine JR22 OpenFOAM Running, Solving & CFD 6 August 1, 2013 10:08
residuals...how to make them fall laura_c Main CFD Forum 2 April 12, 2013 13:39
UDF:Is there a MICRO to stop iterating andy P. FLUENT 2 February 9, 2007 21:49
error when iterating - no residuals, no results Ralf Schmidt FLUENT 2 December 1, 2006 12:29
Stop iterating DAE FLUENT 0 January 7, 2004 07:58


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