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

FOAM FATAL ERROR Maximum number of iterations exceeded

Register Blogs Community New Posts Updated Threads Search

Like Tree17Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2006, 11:04
Default Hi all, I met the error as
  #1
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
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
liugx212 is offline   Reply With Quote

Old   February 13, 2007, 04:11
Default Hi Guoxiang, I have the sam
  #2
mss
Guest
 
Posts: n/a
Hi Guoxiang,

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

thanks,
Rita
  Reply With Quote

Old   February 13, 2007, 05:55
Default My guess, is that your source
  #3
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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.

Dragos
dmoroian is offline   Reply With Quote

Old   February 13, 2007, 15:48
Default Dragos, In which file is th
  #4
New Member
 
Cesar Belaunde Zarate
Join Date: Mar 2009
Location: Quillota, V region, Chile
Posts: 8
Rep Power: 17
cesarbz is on a distinguished road
Dragos,

In which file is the maxIter_ value ?... sometimes I think it's necessary increase the maximum of iteration number.
Thanks.
Cesar.
cesarbz is offline   Reply With Quote

Old   February 14, 2007, 04:46
Default Hi Cesar, grep -r maxIter_
  #5
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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.

Dragos
dmoroian is offline   Reply With Quote

Old   February 20, 2007, 08:28
Default Hej Dragos, Could u give me
  #6
mss
Guest
 
Posts: n/a
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,
Rita
  Reply With Quote

Old   February 20, 2007, 11:17
Default Hi Rita, I'm not too much of
  #7
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
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.

Dragos
amin_jalalian likes this.
dmoroian is offline   Reply With Quote

Old   February 20, 2007, 11:39
Default Hi Dragos, I have looked in
  #8
mss
Guest
 
Posts: n/a
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
  Reply With Quote

Old   January 17, 2010, 11:35
Default Maximum number of iterations exceeded
  #9
Member
 
Join Date: Dec 2009
Location: Kanpur, India
Posts: 54
Rep Power: 16
Shoonya is on a distinguished road
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....

thanks
Shoonya is offline   Reply With Quote

Old   July 16, 2013, 08:30
Default
  #10
New Member
 
Rahul Soni
Join Date: Feb 2013
Location: IIT Kanpur
Posts: 13
Rep Power: 13
srahul is on a distinguished road
I was able to solve this problem by using 1st order scheme for temporal discretization
srahul is offline   Reply With Quote

Old   August 25, 2013, 09:17
Default error of maximum no of iteration exceeded ..
  #11
Member
 
sonu
Join Date: Jul 2013
Location: delhi
Posts: 92
Rep Power: 13
yash.aesi is on a distinguished road
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 )
yash.aesi is offline   Reply With Quote

Old   August 25, 2013, 11:48
Default
  #12
New Member
 
Rahul Soni
Join Date: Feb 2013
Location: IIT Kanpur
Posts: 13
Rep Power: 13
srahul is on a distinguished road
Hello,

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.
srahul is offline   Reply With Quote

Old   March 4, 2014, 11:11
Default
  #13
New Member
 
Pam
Join Date: Feb 2011
Posts: 15
Rep Power: 15
prameelar is on a distinguished road
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?
__________________
Pam
prameelar is offline   Reply With Quote

Old   March 5, 2014, 01:37
Default
  #14
New Member
 
Rahul Soni
Join Date: Feb 2013
Location: IIT Kanpur
Posts: 13
Rep Power: 13
srahul is on a distinguished road
Hi,

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.

Regards,
Rahul
srahul is offline   Reply With Quote

Old   July 7, 2015, 22:03
Default
  #15
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello,

I am also currently having that problem, picture attached below. I have changed the script in thermo.C for the max iterations to a much larger number. I cannot find the specieThermo.C script though. I also have increased the tolerance in the thermo.C script. I believe my script is in Euler form, as it states in the fvSchemes folder. (Is that where I need to change it to Euler or is there another thing I'm missing?) I am also using the function: sonicFoam. As a side note, even when I changed the max iterations and tolerance numbers in the thermo.C script, the program still ended at the exact same time: 2.67835e-05 and produced the same error message. Can anyone help me fix my error?

Thank you so much,
~Michu
Attached Images
File Type: jpg Error Part 1.jpg (80.3 KB, 447 views)
File Type: jpg Error Part 2.jpg (88.9 KB, 309 views)
michu is offline   Reply With Quote

Old   July 8, 2015, 06:34
Default
  #16
New Member
 
Rahul Soni
Join Date: Feb 2013
Location: IIT Kanpur
Posts: 13
Rep Power: 13
srahul is on a distinguished road
Hi Michu,

You can find the the script in here
OpenFOAM-2.2.0/src/thermophysicalModels/specie/thermo/thermo/thermoI.H

In this file Newton solver (Line no. 41 - 88) is utilized to calculate the T. I implemented brent solver and now that problem is solved.
amin_jalalian and michu like this.
srahul is offline   Reply With Quote

Old   July 8, 2015, 07:32
Default
  #17
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hello srahul,

Thank you for responding and helping. I am still a little confused.

Previously I changed the ThermoI.H script through the thermophysical Models/specie/lnInclude but when I changed the script in that directory, somehow the script ThermoI.H in the thermophysicalModels/specie/thermo/thermo directory also changed. (Just something weird I noticed).

When I changed line 64: if (iter++ > maxIter_) to this: if (iter++ > 100000000000000000000)
the program still provided the problem shown in my image above.

My coding is a little rusty so sorry if this seems simple, but I thought the problem is the maximum iterations. Do I also have to change line 80: } while (mag(Tnew - Test) > Ttol); in order to fix this problem? Is there something else I should also change?

Thank you for your help,
~Michu
michu is offline   Reply With Quote

Old   August 7, 2015, 04:22
Default
  #18
Member
 
Michu
Join Date: Jun 2015
Location: PA, USA
Posts: 32
Rep Power: 0
michu is on a distinguished road
Hi all,

When you make a change in the scripts, do you have to re-load openfoam or something for the changes in the script to take place?

Like if I changed the max temperature from 100 to 100000 in the script. Will that automatically change the way sonicFoam works, or will I have to do something like click a button that says apply update?

Thank you,
~Michu
michu is offline   Reply With Quote

Old   October 28, 2015, 16:09
Default Response to Max Iterations Exceeded
  #19
Member
 
Francis
Join Date: Jan 2014
Location: Toronto
Posts: 50
Rep Power: 12
afrotimy is on a distinguished road
I had this problem also using RhoCentralFoam and this were my remedial options:-

1. Switched ON adjustableTimeStep in the controlDict and choose maxCo as preferred.

2. Reduced the time-Step more with adjustableTImeStep =OFF;

The problem was resolved..
shipman, hogsonik and Sheng Juan like this.
afrotimy is offline   Reply With Quote

Old   November 27, 2015, 22:15
Default
  #20
New Member
 
Henryk Zaleski
Join Date: Sep 2015
Posts: 3
Rep Power: 11
henryk42 is on a distinguished road
Hi

I've been chasing the same problem for a while and found it popping up with different solvers, different circumstances.
I get the "maximum number of iteration exceeded" error when running constant transport model. When I switch to Suderland, I get a different error but also called from thermo::calculate.
The function that triggers the "maximum number of iteration exceeded" error calculates the temperature field given the value of a thermodynamic function and its derivative vrt temperature using Newton formula.
The thing is, I'm using epsiThermo model with a perfect gas, that means the internal energy, e, is temperature times Cv, the function is linear and the Newton algorithm should get it in one iteration.

Something is wrong here,
henryk42 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
maximum number of iterations solomon FLUENT 7 April 25, 2024 03:27
Maximum number of iterations exceeded liugx212 OpenFOAM Running, Solving & CFD 3 August 28, 2013 09:09
FOAM FATAL IO ERROR msrinath80 OpenFOAM Running, Solving & CFD 4 July 30, 2008 11:06
Internal Error: Number of tree levels exceeded ahlo CFX 0 March 4, 2008 14:45
FOAM FATAL ERROR derath OpenFOAM Pre-Processing 1 June 10, 2006 15:20


All times are GMT -4. The time now is 23:30.