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

SteadyState

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2007, 12:06
Default Hey all, one short question a
  #1
tutlhino
Guest
 
Posts: n/a
Hey all,
one short question about the steadyState setting. Is it possible that the simulation stops when it has reached the desired residual, or does it do that automatically? 'Cause I need to measure the time when it has converged, but I've seen that after 1000 iterations, which was the default setting, all residuals were far below the desired residual!? And is it possible to get a convergence plot of the simulation?

Cheers
Florian
  Reply With Quote

Old   July 2, 2007, 12:35
Default Hello there, In the standar
  #2
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello there,

In the standard steady state incompressible solver, for example "simpleFoam", there is no option to automatically stop the simulation once a specific variable has converged to a desired level, though it would not be difficult, to modify a solver to include such a functionality.

As for viewing plots of residuals.... use the command "foamLog". This utility basically extracts data (such as the residuals, etc..) from the log file into separate data files, which you can then plot using programs like "gnuplot" or "kst", etc...etc...

Have a nice day!

Philippose
philippose is offline   Reply With Quote

Old   July 2, 2007, 12:42
Default No. The standard (steady) solv
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
No. The standard (steady) solvers happily keep working until endTime is reached.

Convergence plots you can get if you produce a log file (for instance by starting a job with foamJob) and then use a script to process the output (it's delivered with OpenFOAM, but I can'T remember the name).

What I use in such situations is a script from pyFoam (http://openfoamwiki.net/index.php/Contrib_PyFoam):

pyFoamPlotRunner.py --steady simpleFoam . pitzDaily

It starts the simulation and monitors ther output. Using that output it
* plots the residuals
* tells the simulation to stop and write a result once none of the linear solvers iterates anymore

pyFoamSteadyRunner.py simpleFoam . pitzDaily

does the same without the plotting.
Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 2, 2007, 13:22
Default Thanks a lot guys! Especially
  #4
tutlhino
Guest
 
Posts: n/a
Thanks a lot guys! Especially the last hint was what I was looking for, perfect!
  Reply With Quote

Old   July 3, 2007, 03:12
Default As Philippose mentioned, it is
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
As Philippose mentioned, it is not so hard to add in a convergence check.

In the top-level code, you can add a convergence lookup just after re-reading the SIMPLE controls:

# include "readSIMPLEControls.H"

// add in convergence criterion
scalar eqnResidual = 1, maxResidual = 0;
scalar convergenceCriterion = 0;

if (simple.found("convergence"))
{
convergenceCriterion = readScalar(simple.lookup("convergence"));

if (convergenceCriterion <0> 1)
{
Info<< "out-of-range convergence criterion: "
<< convergenceCriterion
<< endl;
convergenceCriterion = 0;
}
}


For each of the solved variables, just extend the change the solve() method with initialResidual() method.
eg,

eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);


Just remember to only capture the first value from the pressure correction:

// retain the residual from the first iteration
if (nonOrth == 0)
{
eqnResidual = pEqn().solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
}
else
{
pEqn().solve();
}


Back in the top-level code, you can now add the convergence check at the bottom of the loop:

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;

if (maxResidual < convergenceCriterion)
{
Info<< "convergence criterion satisfied: "
<< convergenceCriterion
<< endl;

runTime.writeAndEnd();
Info<< "latestTime = " << runTime.timeName() << endl;
}

-----
olesen is offline   Reply With Quote

Old   April 30, 2009, 09:10
Default
  #6
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
To plot the residuals on-the-fly on screen graphically, I wrote a short tutorial.

See thread http://www.cfd-online.com/Forums/ope...residuals.html
wolle1982 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
Steadystate pressurebased compressible solver cosimobianchini OpenFOAM Running, Solving & CFD 1 July 19, 2010 14:45
Steadystate settlingFoam darrin OpenFOAM Running, Solving & CFD 0 February 28, 2007 04:51
Steadystate Vs Transient solver amitshah OpenFOAM Running, Solving & CFD 1 August 23, 2006 02:54
Steadystate Euler solver jelmer OpenFOAM Running, Solving & CFD 1 June 19, 2006 08:24
NonNewtonianIcoFoam for steadystate problem mpml OpenFOAM Running, Solving & CFD 7 July 20, 2005 19:09


All times are GMT -4. The time now is 10:55.