CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   Convergence crtieria (

lam April 3, 2007 12:31

Hi I am trying to test SIMP

I am trying to test SIMPLEFOAM with a Bird-Carreau law and I have a very trivial question: I noticed that, when running the non linear computation, I have to specify the number of iterations a priori, (their number is being suggested by the proogramme itself).

Is it possible to run the programme in such a way that the computation interrupts automatically as soon as convergence is reached ? (comvergence criterium).

Thank you in davance,


lam April 4, 2007 05:07

Oh, THANKS a lot Mark, for rep
Oh, THANKS a lot Mark, for replying me!

I am going give a go right now!



olesen April 5, 2007 04:40

I guess I wasn't explicit enou
I guess I wasn't explicit enough. You can either solve the equation and ignore the return value:

solve(UEqn() == -fvc::grad(p));

OR solve the equation and use the return value:

eqnResidual = solve(UEqn() == -fvc::grad(p)).initialResidual();

but not both.

It is also essential to capture the mass residual. ie. replace


if (nonOrth == 0)
eqnResidual = pEqn().solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);

The residuals from the turbulence equation are not directly accessible, but this might change in OpenFOAM 1.4

olesen April 5, 2007 06:46

It looks mostly reasonable exc
It looks mostly reasonable except you don't need this line twice.

eqnResidual = solve(UEqn() == -fvc::grad(p)).initialResidual();

lam April 5, 2007 09:20

Hi again Mark, I had remove
Hi again Mark,

I had removed the line which is not needed as you said. And of course, I did the Allmake to update the simpleFoam.C file.
I made a computation, but the result has not changed.
You can take a look at my fvSolution file:



p ICCG 1e-03 0.01;
U BICCG 1e-03 0.1;
k BICCG 1e-03 0.1;
epsilon BICCG 1e-03 0.1;
R BICCG 1e-03 0.1;
nuTilda BICCG 1e-03 0.1;



I just want a 1e-03 solver tolerance.
But the computation still stopps at the endtime (=4000 itrations). I just have a solution wich seems to not menage to reach the convergence.

Can you give some advice to get it right?

Thanks in advance,


olesen April 5, 2007 09:50

I don't wish to be impolite, b
I don't wish to be impolite, but re-check the original suggestion:
# include "readSIMPLEControls.H"
if (simple.found("convergence"))

Check "readSIMPLEControls.H" file to see what is being read there and its relation to the following if (simple.found(..)) conditional.

Again, I really don't wish to be impolite, but I really don't have enough time to help much more than I already did. Sorry but you need to do this alone (or keep some basic commercial support).


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