
[Sponsors] 
August 13, 2011, 09:57 
SimpleFoam convergence criterion?

#1 
Senior Member
PeiYing Hsieh
Join Date: Mar 2009
Posts: 275
Rep Power: 9 
Hi,
I am running a simpleFoam case. The print out messages said that, there is no convergence criterion. The case will run for 1000 steps. What is the reason behind it? Thanks! Pei 

August 14, 2011, 23:46 

#2 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,895
Rep Power: 26 
This happens because the convergence criterion is not specified in fvSolution.
If you use OpenFOAM 1.7.x, you need to specify it in the SIMPLE subdictionary: Code:
SIMPLE { nNonOrthogonalCorrectors 0; // Residual here (all residuals must go below this) convergenceCriterion 1.0e6; } Code:
SIMPLE { nNonOrthogonalCorrectors 0; // Residuals here (one per variable) // If one variable is not specified, zero is assumed as // desired residual (iterations will not stop) residualControl { p 1e2; U 1e3; "(kepsilonomega)" 1e3; } } 

August 16, 2011, 09:12 

#3 
Member
Alex
Join Date: Jun 2010
Location: Planet Earth
Posts: 43
Rep Power: 7 
Thanks Alberto, this has helped me.
When I run simpleFoam, I now get this: Code:
Create time Create mesh for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting RAS turbulence model realizableKE realizableKECoeffs { Cmu 0.09; A0 4; C2 1.9; sigmak 1; sigmaEps 1.2; } SIMPLE: convergence criteria field p tolerance 1e06 field U tolerance 1e06 field k tolerance 1e06 field epsilon tolerance 1e06 Starting time loop Time = 1 

September 19, 2011, 09:01 

#4 
New Member
Join Date: May 2011
Posts: 8
Rep Power: 6 
Hi all,
I would like to know what exactly happens if you introduce SIMPLE { nNonOrthogonalCorrectors 0; // Residual here (all residuals must go below this) convergenceCriterion 1.0e6; } Does the simulation stop when all the variables has a residual lower than 1.0e6? Do you know if it's possible to stop the simulation when the residuals are lower of 1.0e4 for 50 consecutive iterations instead of loooking just one iteration? Thanks in advance! Roger 

June 20, 2012, 16:36 

#5 
New Member
Join Date: Oct 2011
Posts: 14
Rep Power: 6 
In my Log file it also says:
SIMPLE: no convergence criteria found. Calculations will run for 2000 steps. In the fvSolution file entry looks as follows: SIMPLE { nNonOrthogonalCorrectors 0; } so my question is, whether the solver is now trying to reach zero as the desired residual? Are my simulations still correct?? Thanks for any answer... 

June 20, 2012, 16:39 

#6 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,895
Rep Power: 26 
Your results will simply have the residuals the solution gives after 2000 iterations. If such a number of iterations is sufficient for your case, the solution will be correct.
You can store the output of the solver in a text file and then examine them using foamLog. Alternatively, you can specify residuals (see tutorials). 

June 20, 2012, 16:46 

#7 
New Member
Join Date: Oct 2011
Posts: 14
Rep Power: 6 
At approximately timestep 500 the no of iterations change to zero.
Time = 572 DILUPBiCG: Solving for Ux, Initial residual = 8.02058e06, Final residual = 8.02058e06, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 9.42366e06, Final residual = 9.42366e06, No Iterations 0 DILUPBiCG: Solving for Uz, Initial residual = 8.13976e06, Final residual = 8.13976e06, No Iterations 0 DICPCG: Solving for p, Initial residual = 1.09339e05, Final residual = 9.86413e07, No Iterations 70 time step continuity errors : sum local = 0.000183096, global = 8.98498e07, cumulative = 0.00553493 ExecutionTime = 5461.38 s ClockTime = 5489 s Does this mean it converged? How come the other entries in the fvSolution file dont play a role for the convergence criterion? I mean the entries "tolerance" and "reltol"?? p { solver PCG; preconditioner DIC; tolerance 1e06; relTol 0.01; } U { solver PBiCG; preconditioner DILU; tolerance 1e05; relTol 0.1; } 

June 20, 2012, 16:55 

#8 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,895
Rep Power: 26 
They actually played a role. If you want convergence with a specified residual specify your criteria in fvSolution / SIMPLE
Code:
SIMPLE { nNonOrthogonalCorrectors 0; pRefCell 0; pRefValue 0; residualControl { p 1e5; U 1e5; // Add other variables here } } 

July 20, 2012, 08:26 
a recommandable convergence criterium?

#9 
Senior Member
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 5 
Hi,
how do you specify your convergence criteria? I mean how do you know that the residual must be below e.g. 10^5 to definitely reach convergence? I first was looking at my residuals to not fluctuate any more (ideal case would be a horizontal line but I've never reached that) but the chiefengineer told me that I must reach a convergence criteria of 10^5 at least. He said that it is a normally used criteria... but why...??? Can you help me with this question??? Attached are some pictures of my residuals. I would like to read your opinion  does these pictures proof convergence or not? This is kind of important for my graduating thesis... Thank you 

July 20, 2012, 16:48 

#10 
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,895
Rep Power: 26 
Hi Soren,
your plot show the solution behaviour is correct, and the solution is converging. However, for a steadystate solution, residuals are usually required to be very small (ideally close to machine precision) to declare the solution is converged. Also, note that at convergence, residual curves should be flat. In your case their slope is not negligible, indicating that the solution convergence can be further improved. I usually set convergence criteria to a very small number (1.0e12), let the simulation run for a good number (depends on the case) of iterations, and then check the residual curves. If residuals reach 1.0e12 or if they decreased many orders of magnitude and they stopped changing for a certain number of iterations, then I consider the solution converged. Best, 

March 3, 2015, 06:56 
Simple Foam stops before reaching the end iteration

#11 
Member
Naresh Yathuru
Join Date: Feb 2015
Posts: 54
Rep Power: 2 
Hi can some one help me out.
1. the simple foam stops in the middle with out any error. tolerance= 1 e^09 reltol= 1 e^o9 There is a huge difference between my initial and final residuals. is it ok? (approx) initial residuals= 2.4 e4 final residuals= 6.2 e10 so still the initial residuals are higher than the tolerance but why does the simulation stops? By stop i mean it gets stuck at a itereation and its not proceeding any further. i waited for almost an hour. can some one help me. Thank you Regards, Naresh 

March 3, 2015, 07:29 

#12  
New Member
Andrew Smith
Join Date: Jan 2015
Location: North Dakota
Posts: 18
Rep Power: 2 
Quote:
You gave very less information so I suggest you to first refer the "User guide of OF" and try some basic tutorials before jumping on to anything Advice: For tutorials refer the following post: Running OpenFOAM successfully with Chalmers 

March 3, 2015, 08:44 

#13 
Member
Naresh Yathuru
Join Date: Feb 2015
Posts: 54
Rep Power: 2 
Thank Andrew or your quick reply.
I m trying to simulate a room with inlet and outlet and a box inside in simple foam. This is my FVscheme ddtSchemes { default steadyState; } gradSchemes { default leastSquares;//Gauss linear } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind grad(U); // was bounded Gauss upwind which is first order but linearupwind is second order div(phi,k) bounded Gauss upwind; div(phi,epsilon) bounded Gauss upwind; div(phi,omega) bounded Gauss upwind; div(phi,R) bounded Gauss upwind; div(R) Gauss linear; div(phi,nuTilda) bounded Gauss upwind; div((nuEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; } And this is my FVsolution solvers { p { solver GAMG; tolerance 1e12; relTol 1e12; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration on; agglomerator faceAreaPair; nCellsInCoarsestLevel 10; mergeLevels 1; } "(UkepsilonomegaRnuTilda)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e12; relTol 1e12; } } SIMPLE { nNonOrthogonalCorrectors 0; /* residualControl { p 1e2; U 1e3; "(kepsilonomega)" 1e3; }*/ //as of we do not need } relaxationFactors { fields { p 0.7; // Before 0.3 :it means that 30 percentage of the ew value and 70 % of old value weighted to gether foe the next iteration. } // It helps in stability but takes longer for convergence. equations { U 0.3; k 0.7; epsilon 0.7; omega 0.7; R 0.7; nuTilda 0.7; } } 1. i ran the simulation for 5000 iterations but with no sucess for convergence. then i changed the relaxation factor for p and u. before : p= 0.3 u=0.7 now: p= 0.7 u= 0.3 The simulation runs for some 50 iterations and the iteration get stuck at some point and its not going further. Interesting is that the Initial residuals are lesser than the specified tolerance. Time = 5517 smoothSolver: Solving for Ux, Initial residual = 0.00026747233, Final residual = 4.3957841e14, No Iterations 7 smoothSolver: Solving for Uy, Initial residual = 0.00035219196, Final residual = 5.6268315e14, No Iterations 7 smoothSolver: Solving for Uz, Initial residual = 0.000529688, Final residual = 8.2691583e14, No Iterations 7 GAMG: Solving for p, Initial residual = 0.0062565687, Final residual = 9.9888366e13, No Iterations 143 time step continuity errors : sum local = 2.4610067e14, global = 5.1314876e17, cumulative = 1.6021426e16 smoothSolver: Solving for omega, Initial residual = 0.00023592505, Final residual = 7.3934347e13, No Iterations 17 smoothSolver: Solving for k, Initial residual = 0.0003149381, Final residual = 9.8133224e13, No Iterations 18 ExecutionTime = 943.83 s ClockTime = 951 s Time = 5518 smoothSolver: Solving for Ux, Initial residual = 0.00026770097, Final residual = 4.3982852e14, No Iterations 7 smoothSolver: Solving for Uy, Initial residual = 0.00035250148, Final residual = 5.6302256e14, No Iterations 7 smoothSolver: Solving for Uz, Initial residual = 0.00053021843, Final residual = 8.2741381e14, No Iterations 7 GAMG: Solving for p, Initial residual = 0.0062455933, Final residual = 9.9992215e13, No Iterations 150 time step continuity errors : sum local = 2.4576868e14, global = 5.0798341e17, cumulative = 2.110126e16 smoothSolver: Solving for omega, Initial residual = 0.00023601326, Final residual = 7.3802878e13, No Iterations 17 smoothSolver: Solving for k, Initial residual = 0.00031391878, Final residual = 9.7660363e13, No Iterations 18 where would i have possibly gone wrong. Thank you for your help in advance . Regards, Naresh 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Convergence  Centurion2011  FLUENT  26  Today 15:46 
problem with Min/max rho  tH3f0rC3  OpenFOAM  7  February 23, 2013 06:37 
Definition of convergence criterion in simpleFoam  titio  OpenFOAM Running, Solving & CFD  1  February 6, 2010 02:34 
convergence criterion  Dominique  FLUENT  5  November 24, 2006 03:36 
Setting convergence criterion  Vidya  FLUENT  5  August 6, 2006 16:46 