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

Stopping run when converged.

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 4 Post By gillimaniac
  • 1 Post By gillimaniac

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2009, 10:59
Default Stopping run when converged.
  #1
New Member
 
Krzysztof Przysowa
Join Date: Mar 2009
Location: Frimley, Surrey, United Kingdom
Posts: 13
Rep Power: 17
kprzysowagmailcom is on a distinguished road
I have noticed that simleFoam doesn't automatically stop the run when converged (after having residuals with lower values than specified by tolerances in fvSolution). It just doesn't make any iterations to any parameter. The next

Is there any way to stop the run, when converged?

Most intuitive place should be controlDict but I could not find anything else than "stopAt endTime;", which is obviously not applicable.

I have seen as well convergenceCheck but its not compiled from the box so I did not check it yet. I could not find any documentation for that.

There is as well pyFoamRunner, http://openfoamwiki.net/index.php/Co...yFoamRunner.py
But I don't want to use it on the cluster.

For sure there is very simple default way of doing it.
Cheers
kprzysowagmailcom is offline   Reply With Quote

Old   August 22, 2009, 12:18
Default I have found solution by myself.
  #2
New Member
 
Krzysztof Przysowa
Join Date: Mar 2009
Location: Frimley, Surrey, United Kingdom
Posts: 13
Rep Power: 17
kprzysowagmailcom is on a distinguished road
I have found solution googling the web.
http://ww3.cad.de/foren/ubb/Forum527/HTML/000005.shtml

Its in german, so few words of explanations:
You need to recompile the simpleFoam (wmake for newbies), using the contents of the convergenceCheck.H, initConvergenceCheck.H, pEqn.H, UEqn.H from mentioned file.


I have changed ("Div" -> "div") in this files since compiler returned error for "Div".


Do not forget to make backup of these files before starting to compile.
Cheers

Last edited by kprzysowagmailcom; August 22, 2009 at 13:16.
kprzysowagmailcom is offline   Reply With Quote

Old   August 5, 2013, 06:25
Default
  #3
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 12
mina.basta is on a distinguished road
Dear Krzysztof Przysowa,

I am a new OF user, and I realized that even I set convergence criterion in fvSolution (tolerances), hhe run didn't stop. So how can i know using simpleFOam that the run is converged ? each time i put the run till 3000 and it took a lot of time to calculate. Also after 3000 I don't know if the run is well converged or not !!!! Could you explain for me how it works on OF?
mina.basta is offline   Reply With Quote

Old   August 5, 2013, 06:27
Default
  #4
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 12
mina.basta is on a distinguished road
* the run didn't stop
mina.basta is offline   Reply With Quote

Old   August 6, 2013, 02:47
Default
  #5
New Member
 
Stefan Gaerling
Join Date: Dec 2012
Posts: 22
Rep Power: 13
gillimaniac is on a distinguished road
Hey its a lot easier. Just add:

SIMPLE
{
residualControl
{
p 1e-2;
U 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}

in your fvsolution - file. Then you can set the convergence criteria for any variable.
With the entry "tolerance" in the specific solvers (smoothSolver, GAMG, etc.) you only specify when the solver should stop iterating "within one outer iteration".
The "outer iterations" convergence criteria (per timestep) are controlled by the "residualControl" keyword within the SIMPLE brackets (see upper).

Cheers
gillimaniac is offline   Reply With Quote

Old   August 6, 2013, 03:44
Default
  #6
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 12
mina.basta is on a distinguished road
Dear Stefan Gaerling,

Attached is my fvSolustion. I already added the residual control, but my problem didn't been solved. The run stops only with the number of iterations which is fixed in the controlDict which means that if I put endTime:2000, the run will stop at 2000 and if I put endTime: 50000 the run will stop after 50000 even if I set the residualControl. Could you explain to me with more details?

Thanks in advance,
Mina
Attached Files
File Type: txt fvSolution.txt (2.1 KB, 67 views)
mina.basta is offline   Reply With Quote

Old   August 6, 2013, 08:11
Default
  #7
New Member
 
Stefan Gaerling
Join Date: Dec 2012
Posts: 22
Rep Power: 13
gillimaniac is on a distinguished road
Hey,

the reason why simpleFoam is running your specified number of maximum iterations is because it is not able to reach the specified convergence level within these iterations.

The numbers specified within residualControl only says: stop if the initial residuals fall below these values.
If they do not (because of divergence, instationary behaviour or bad mesh initialized instabilities) it will not stop because the residuals wont reach your convergence level.

You will have to take a look at your residuals' behaviour/ boundary conditions etc.

Cheers
mina.basta likes this.
gillimaniac is offline   Reply With Quote

Old   August 6, 2013, 08:32
Default
  #8
New Member
 
Basta
Join Date: Jul 2013
Posts: 28
Rep Power: 12
mina.basta is on a distinguished road
Thanks a lot Stefan for your quick response
mina.basta 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
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
Windows 64-bit, Distributed Parallel Run Issues... Erich CFX 3 March 28, 2006 16:36
problems with LES run Tim CFX 1 February 27, 2006 07:28
stopping the model run co2 FLUENT 1 April 23, 2004 04:18
Cycling a transient run Chetan Mistry Phoenics 0 March 3, 2004 09:50


All times are GMT -4. The time now is 18:17.