CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   FOAM FATAL ERROR Maximum number of iterations exceeded (

liugx212 July 5, 2006 10:04

Hi all, I met the error as
Hi all,

I met the error as follows when I run buoyantFoam case after I add the Sp() function as my source term in rhoEn. Could anybody help me this matter?

Thanks so much.

The error is:
--> FOAM FATAL ERROR : Maximum number of iterations exceeded

From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const
in file /home/liu/OpenFOAM/OpenFOAM-1.2/src/thermophysicalModels/specie/lnInclude/specie ThermoI.H at line 83.

FOAM aborting

mss February 13, 2007 03:11

Hi Guoxiang, I have the sam
Hi Guoxiang,

I have the same problem, how did u solve it?


dmoroian February 13, 2007 04:55

My guess, is that your source
My guess, is that your source term is triggering a divergent solution, which increases continuously the temperature. Once your T0 goes too high (I am not sure, but something like 5000K is the limit of the implemented thermodynamic properties) you get the error. What you can do very fast, is to modify the maxIter_ from 100 to something larger. Another thing is to modify the tolerance tol_ from 1.0e-4 to something higher (1.0e-3 or so), but this is not a good advice.

If you really need such high temperatures, like Rita, then I think you have to implement yourself the polynomials for the thermodynamic properties of your fluid.


cesarbz February 13, 2007 14:48

Dragos, In which file is th

In which file is the maxIter_ value ?... sometimes I think it's necessary increase the maximum of iteration number.

dmoroian February 14, 2007 03:46

Hi Cesar, grep -r maxIter_
Hi Cesar,

grep -r maxIter_ OpenFOAM/OpenFOAM-1.3/src/thermophysicalModels/specie

lnInclude/specieThermo.C:const int specieThermo<thermo>::maxIter_ = 100;
lnInclude/specieThermo.H: static const int maxIter_;
lnInclude/specieThermoI.H: if (iter++ > maxIter_)
thermo/specieThermo/specieThermo.C:const int specieThermo<thermo>::maxIter_ = 100;
thermo/specieThermo/specieThermo.H: static const int maxIter_;
thermo/specieThermo/specieThermoI.H: if (iter++ > maxIter_)

So, you can change the value in: specieThermo.C
It might be a bit different in version 1.2, as you have, but it should be simmilar.
But I suggest to have a check for the residuals first. If they grow, than you have a divergent solution, and increasing the maxIter_ will not help.


mss February 20, 2007 07:28

Hej Dragos, Could u give me
Hej Dragos,

Could u give me some hint about implemention the polynomials for the thermodynamic properties of my fluid?

I'm using Buoyancy case for Argon gas with teperature from 300 K upto 20 000K:
Name Argon
nMoles 1.0
molecularWeight 39.948
deltaH 1.0499e+05
viscosity 3.4079e-5
Pr 0.65

Thank u so much,

dmoroian February 20, 2007 10:17

Hi Rita, I'm not too much of
Hi Rita,
I'm not too much of help here. You can take a look in the OpenFOAM/OpenFOAM-1.3/src/thermophysicalModels for details.
Though, one sugestion I can make: try to use janafThermo instead of hConstThermo, if you have access to janaf tables.


mss February 20, 2007 10:39

Hi Dragos, I have looked in
Hi Dragos,

I have looked in it before. It didn't help to much. I'm not familiar with programming in OpenFOAM.
I can't understand where here is introduced the limit of temperature.

Do you have any suggestions?

thank u,
Rita January 17, 2010 10:35

Maximum number of iterations exceeded
Hi same thing I came across too.....

This problem came when I was using the number of interval more than 150 or so, in gambit, the exported mesh to OpenFoam was showing that error message i. e ..Maximum number of iterations exceeded..bla bla.......
before this it was running upto clock time 5 or 6 and than the error message. If I change the mesh intervals, the clock time of getting that massage had been changing accordingly. When I change the mesh intervals in gambit in 100 it worked i.e upto requried time ( ..which I had set in controlDict .....

Conclusion : change (decrease) the mess interval count in gambit. the exported mesh shall let u find the way....


srahul July 16, 2013 07:30

I was able to solve this problem by using 1st order scheme for temporal discretization

yash.aesi August 25, 2013 08:17

error of maximum no of iteration exceeded ..
helo ,
i got the same error of maximum no of iteration exceeded as posted above by many . i tried to solve it by changing residuel, time step etc whatever is suggested above but still m getting the same error . can anybody plz suggust me whr i am wrong ??? thanks in advance .(i am doin my simulation in rhopimple solver )

srahul August 25, 2013 10:48


I suppose you might be using second order schemes for temporal discretization, I had this error with 2nd order. When I switched to 1st order (euler) the error never popped up.

prameelar March 4, 2014 10:11

Hello Rahul,

I am using chtMultiRegionSimpleFoam and facing the same issue. I have tried changing ddtScheme to "Euler" which is first order implicit scheme. Could you please guide me if I need to change anything else?

srahul March 5, 2014 00:37


For me it worked fine only by changing to euler, however I recently changed newton solver to brent solver for temperature calculation and now it works completely fine.


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