# SimpleFoam convergence criterion?

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 August 13, 2011, 09:57 SimpleFoam convergence criterion? #1 Senior Member   Pei-Ying 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 pela145 likes this.

 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 sub-dictionary: Code: SIMPLE { nNonOrthogonalCorrectors 0; // Residual here (all residuals must go below this) convergenceCriterion 1.0e-6; } If you use OpenFOAM 2.0.x, the syntax is: 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 1e-2; U 1e-3; "(k|epsilon|omega)" 1e-3; } } I hope this helps. atg, hawkeye321, JR22 and 1 others like this. __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

 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 1e-06 field U tolerance 1e-06 field k tolerance 1e-06 field epsilon tolerance 1e-06 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.0e-6; } Does the simulation stop when all the variables has a residual lower than 1.0e-6? Do you know if it's possible to stop the simulation when the residuals are lower of 1.0e-4 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). __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

 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.02058e-06, Final residual = 8.02058e-06, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 9.42366e-06, Final residual = 9.42366e-06, No Iterations 0 DILUPBiCG: Solving for Uz, Initial residual = 8.13976e-06, Final residual = 8.13976e-06, No Iterations 0 DICPCG: Solving for p, Initial residual = 1.09339e-05, Final residual = 9.86413e-07, No Iterations 70 time step continuity errors : sum local = 0.000183096, global = -8.98498e-07, 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 1e-06; relTol 0.01; } U { solver PBiCG; preconditioner DILU; tolerance 1e-05; 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 1e-5; U 1e-5; // Add other variables here } } __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

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 chief-engineer 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
Attached Images
 10°.jpg (41.0 KB, 341 views) 26°.jpg (40.9 KB, 228 views) 65°.jpg (41.4 KB, 199 views) 60Miocells_reference.jpg (43.5 KB, 250 views)

 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 steady-state 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.0e-12), let the simulation run for a good number (depends on the case) of iterations, and then check the residual curves. If residuals reach 1.0e-12 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, Claudio87, JR22 and wayne14 like this. __________________ Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. OpenQBMM - An open-source implementation of quadrature-based moment methods

 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 e--4 final residuals= 6.2 e-10 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:
 Originally Posted by Naresh yathuru 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 e--4 final residuals= 6.2 e-10 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
Running OpenFoam successfully is not everyone's cup of tea

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 1e-12; relTol 1e-12; smoother GaussSeidel; nPreSweeps 0; nPostSweeps 2; cacheAgglomeration on; agglomerator faceAreaPair; nCellsInCoarsestLevel 10; mergeLevels 1; } "(U|k|epsilon|omega|R|nuTilda)" { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-12; relTol 1e-12; } } SIMPLE { nNonOrthogonalCorrectors 0; /* residualControl { p 1e-2; U 1e-3; "(k|epsilon|omega)" 1e-3; }*/ //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.3957841e-14, No Iterations 7 smoothSolver: Solving for Uy, Initial residual = 0.00035219196, Final residual = 5.6268315e-14, No Iterations 7 smoothSolver: Solving for Uz, Initial residual = 0.000529688, Final residual = 8.2691583e-14, No Iterations 7 GAMG: Solving for p, Initial residual = 0.0062565687, Final residual = 9.9888366e-13, No Iterations 143 time step continuity errors : sum local = 2.4610067e-14, global = 5.1314876e-17, cumulative = 1.6021426e-16 smoothSolver: Solving for omega, Initial residual = 0.00023592505, Final residual = 7.3934347e-13, No Iterations 17 smoothSolver: Solving for k, Initial residual = 0.0003149381, Final residual = 9.8133224e-13, No Iterations 18 ExecutionTime = 943.83 s ClockTime = 951 s Time = 5518 smoothSolver: Solving for Ux, Initial residual = 0.00026770097, Final residual = 4.3982852e-14, No Iterations 7 smoothSolver: Solving for Uy, Initial residual = 0.00035250148, Final residual = 5.6302256e-14, No Iterations 7 smoothSolver: Solving for Uz, Initial residual = 0.00053021843, Final residual = 8.2741381e-14, No Iterations 7 GAMG: Solving for p, Initial residual = 0.0062455933, Final residual = 9.9992215e-13, No Iterations 150 time step continuity errors : sum local = 2.4576868e-14, global = 5.0798341e-17, cumulative = 2.110126e-16 smoothSolver: Solving for omega, Initial residual = 0.00023601326, Final residual = 7.3802878e-13, No Iterations 17 smoothSolver: Solving for k, Initial residual = 0.00031391878, Final residual = 9.7660363e-13, No Iterations 18 where would i have possibly gone wrong. Thank you for your help in advance . Regards, Naresh

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Centurion2011 FLUENT 26 Today 15:46 tH3f0rC3 OpenFOAM 7 February 23, 2013 06:37 titio OpenFOAM Running, Solving & CFD 1 February 6, 2010 02:34 Dominique FLUENT 5 November 24, 2006 03:36 Vidya FLUENT 5 August 6, 2006 16:46

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

 Contact Us - CFD Online - Top