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   January 28, 2016, 04:05
Default
  #21
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
Hi Francis,

Thank you for your advice. It also lets me solve my problem.

BR.
shipman is offline   Reply With Quote

Old   February 26, 2016, 12:37
Default
  #22
New Member
 
S Atkinson
Join Date: Mar 2015
Posts: 14
Rep Power: 11
satkinson is on a distinguished road
Hi,

I am using a Cht K epsion model using Openfoam and I keep getting this error.

I have tried changing the maxiter to 10000 and still get the problem too. Did anyone get to the bottom of this? I completely remade my mesh and still get this same error although I have a few overly skewed faces (64 failed skewness faces) and 900 faces failing nonOrthag check, however due to the geometry even if I used SHM these errors would still occur.

I tried Francis's method and this has't solved it.

I have noticed a sharp (impossible) rise in density in certain regions of the fluid, this was so sharp that it shouted alarm. However I am unfamiliar with this type of modelling so thought I would ask for some advice.

I previously attended the Advanced Openfoam training course and have emailed the guy who ran it (as has my work mate) regarding problems which he encouraged. Unfortunately he does not respond to emails, which has left me a bit discouraged.

Cheers
satkinson is offline   Reply With Quote

Old   June 28, 2016, 07:27
Default
  #23
New Member
 
Moritz
Join Date: Nov 2015
Posts: 16
Rep Power: 11
Momo1805 is on a distinguished road
Hey everyone,

I recently ran into the same issue using the sprayFoam solver with version OF2.4 and an implemented ignition. The error especially ocurrs when I ignite more than one cell and I think it must be due to the Newton solver used to calculate the temperature. Eventually it ocurrs with only one ingiting cell as well though. Has anyone solved this issue so far?

@sahul could you provide the implented brent solver?

Thanks in advance

Moritz
Momo1805 is offline   Reply With Quote

Old   July 5, 2016, 11:34
Default
  #24
New Member
 
S Atkinson
Join Date: Mar 2015
Posts: 14
Rep Power: 11
satkinson is on a distinguished road
Hi Moritz,

Have you had any luck on this one?

I have noticed that my temperatures are diverging too for no reason. I riginally solved the issue by switching to the plane wall 2d solver, however I have got the error again now.
satkinson is offline   Reply With Quote

Old   July 5, 2016, 16:53
Default Maximum number of iterations exceeded
  #25
New Member
 
Henry
Join Date: May 2016
Posts: 15
Rep Power: 10
hbrist7 is on a distinguished road
I've been having a lot of trouble tracing the source of this error. I know it happens in the thermoI.H file, but I can't trace what is calling that, or figure out any reason why this is happening. I've had no luck trying to fix this on my own for a while now.

The case i am running is a simple wedge (meshed with snappy hex mesh) inside a blockmesh region using rhoCentral foam.

any help would be really appreciated

this is the error log file

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 3.0.1-119cac7e8750
Exec   : rhoCentralFoam -parallel
Date   : Jul 01 2016
Time   : 12:54:38
Host   : "cfd01"
PID    : 30359
Case   : /----/wedge15maxIterError
nProcs : 36
Slaves : 
35
(
"cfd01.30360"
"cfd01.30361"
"cfd01.30362"
"cfd01.30363"
"cfd01.30364"
"cfd01.30365"
"cfd01.30366"
"cfd01.30367"
"cfd01.30368"
"cfd01.30369"
"cfd01.30370"
"cfd02.26571"
"cfd02.26572"
"cfd02.26573"
"cfd02.26574"
"cfd02.26575"
"cfd02.26576"
"cfd02.26577"
"cfd02.26578"
"cfd02.26579"
"cfd02.26580"
"cfd02.26581"
"cfd02.26582"
"cfd03.29133"
"cfd03.29134"
"cfd03.29135"
"cfd03.29136"
"cfd03.29137"
"cfd03.29138"
"cfd03.29139"
"cfd03.29140"
"cfd03.29141"
"cfd03.29142"
"cfd03.29143"
"cfd03.29144"
)
Pstream initialized with:
    floatTransfer      : 0
    nProcsSimpleSum    : 0
    commsType          : nonBlocking
    polling iterations : 0
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package 
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

Reading field U

Creating turbulence model

Selecting turbulence model type laminar
fluxScheme: Kurganov

Starting time loop

Mean and max Courant Numbers = 0.00521015 0.119072
deltaT = 2.4e-06
Time = 2.4e-06

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 0.999285, Final residual = 0.00389594, No Iterations 5
smoothSolver:  Solving for Uy, Initial residual = 0.999999, Final residual = 8.69665e-17, No Iterations 5
smoothSolver:  Solving for Uz, Initial residual = 1, Final residual = 8.81879e-17, No Iterations 5
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 1.46977e-11, Final residual = 1.46977e-11, No Iterations 0
ExecutionTime = 0.68 s  ClockTime = 1 s

Mean and max Courant Numbers = 0.00625242 0.142579
deltaT = 2.88e-06
Time = 5.28e-06

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUz, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Ux, Initial residual = 6.23273e-10, Final residual = 6.23273e-10, No Iterations 0
smoothSolver:  Solving for Uy, Initial residual = 1.24042e-05, Final residual = 6.5351e-18, No Iterations 5
smoothSolver:  Solving for Uz, Initial residual = 0.00028774, Final residual = 4.85118e-17, No Iterations 5
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for e, Initial residual = 5.7298e-12, Final residual = 5.7298e-12, No Iterations 0
[0] [1] 
[1] 
[1] --> FOAM FATAL ERROR: 
[1] Maximum number of iterations exceeded
[1] 
[1]     From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar)const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar)const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar)const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
[1]     in file /home/openfoam/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 66.
[1] 
FOAM parallel run aborting
[1] 
[2] 
[2] 
[2] --> FOAM FATAL ERROR: [3] 
[3] 
[3] --> FOAM FATAL ERROR: 
[3] Maximum number of iterations exceeded
[3] 
[3]     From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar)const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar)const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar)const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
[3]     in file /home/openfoam/OpenFOAM/OpenFOAM-3.0.1/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 66[7] 
[7] 
[7] --> FOAM FATAL ERROR: 
[7] Maximum number of iterations exceeded
[7] 
.
for reference, my P/T/U files are here:

p:

Code:
dimensions      [1 -1 -2 0 0 0 0];
internalField   uniform 18822.7;
boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 18822.7;
    }
    outlet
    {
        type            zeroGradient;
    }
    airplane
    {
	type		zeroGradient;
    }
    bottom
    {
        type            zeroGradient;
    }
    top
    {
        type            zeroGradient;
    }
    symmetry
    {
	type		symmetryPlane;
    }
    left
    {
	type 		zeroGradient;
    }
    defaultFaces
    {
        type            zeroGradient;
    }
}
T:

Code:
dimensions      [0 0 0 1 0 0 0];
internalField   uniform 216.65;
boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 216.65;
    }
    outlet
    {
        type            zeroGradient;
    }
    airplane
    {
	type		zeroGradient;
    }
    bottom
    {
        type            zeroGradient;
    }
    top
    {
        type            zeroGradient;
    }
    left
    {
	type		zeroGradient;
    }
    symmetry
    {
	type		symmetryPlane;
    }
    defaultFaces
    {
        type            zeroGradient;
    }
}
U:

Code:
dimensions      [0 1 -1 0 0 0 0];
internalField   uniform (400 0 0); //(246.933 0 0);
boundaryField
{
    inlet
    {
        type		fixedValue;
        value           uniform (400 0 0); //(246.933 0 0);
    }
    outlet
    {
        type            zeroGradient;
    }
    airplane
    {
	type		slip;
    }
    bottom
    {
        type            zeroGradient; 
    }
    top
    {
        type            zeroGradient; 
    }
    left
    {
	type		zeroGradient;
    }
    symmetry
    {
	type		symmetryPlane;
    }
    defaultFaces
    {
        type            zeroGradient;
    }
}
hbrist7 is offline   Reply With Quote

Old   July 6, 2016, 00:06
Default
  #26
Senior Member
 
Baris (Heewa)
Join Date: Jan 2013
Location: Japan
Posts: 130
Rep Power: 13
shipman is on a distinguished road
Hi Henry,

Most probably your T value is going to negative or extremely high. To see in into T.Eqn file add Info << T.min() << " " << T.min() <<endl;

then you can understand reason.

hope it helps you.

Baris
shipman is offline   Reply With Quote

Old   July 6, 2016, 16:54
Default
  #27
New Member
 
Henry
Join Date: May 2016
Posts: 15
Rep Power: 10
hbrist7 is on a distinguished road
It looks like that was the problem, but I'm lost as to how to go about solving it. What can I do to prevent T from going out of control like that?
hbrist7 is offline   Reply With Quote

Old   July 13, 2016, 16:52
Default
  #28
New Member
 
Moritz
Join Date: Nov 2015
Posts: 16
Rep Power: 11
Momo1805 is on a distinguished road
Hey together,

could anyone please explain me how I can compile the thermo files if I want for example some output debugging in the thermoI.H file??? I somehow don't understand where these files are included in any Make/files...

Any help would be sincerely appreciated

Thanks and cheers

moritz
Momo1805 is offline   Reply With Quote

Old   July 13, 2016, 17:50
Default
  #29
New Member
 
Henry
Join Date: May 2016
Posts: 15
Rep Power: 10
hbrist7 is on a distinguished road
go to the directory that includes the thermoI.H file, and once you edit whatever debugging code you want into that file, type "wclean" and then "wcompile", which should recompile all the files in that directory for you
hbrist7 is offline   Reply With Quote

Old   July 14, 2016, 05:26
Default
  #30
New Member
 
Moritz
Join Date: Nov 2015
Posts: 16
Rep Power: 11
Momo1805 is on a distinguished road
Hi henry,

I didnt want to do it as root but I guess it is easier. But still it's not giving me the info in my logfile I acutally wrote in the code. Why?
Code:
template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::species::thermo<Thermo, Type>::T
(
    scalar f,
    scalar p,
    scalar T0,
    scalar (thermo<Thermo, Type>::*F)(const scalar, const scalar) const,
    scalar (thermo<Thermo, Type>::*dFdT)(const scalar, const scalar)
        const,
    scalar (thermo<Thermo, Type>::*limit)(const scalar) const
) const
{
    scalar Test = T0;
    scalar Tnew = T0;
    scalar Ttol = T0*tol_;
    int    iter = 0;
    
    Info<< "Test = " << Test << endl;
    Info<< "   f = " << f << endl;
    do
    {
        Test = Tnew;
        Tnew =
            (this->*limit)
            (Test - ((this->*F)(p, Test) - f)/(this->*dFdT)(p, Test));
            
            scalar Thilf = mag(Tnew - Test);
            Info<< "DeltaT = " << Thilf << endl;
        if (iter++ > maxIter_)
        {
            FatalErrorIn
            (
                "thermo<Thermo, Type>::T(scalar f, scalar T0, "
                "scalar (thermo<Thermo, Type>::*F)"
                "(const scalar) const, "
                "scalar (thermo<Thermo, Type>::*dFdT)"
                "(const scalar) const, "
                "scalar (thermo<Thermo, Type>::*limit)"
                "(const scalar) const"
                ") const"
            )   << "Maximum number of iterations exceeded"
                << abort(FatalError);
        }

    } while (mag(Tnew - Test) > Ttol);

    return Tnew;
}
Momo1805 is offline   Reply With Quote

Old   July 14, 2016, 06:10
Default
  #31
New Member
 
Moritz
Join Date: Nov 2015
Posts: 16
Rep Power: 11
Momo1805 is on a distinguished road
Ok, sorry for the stupid question. You have to compile the whole thermophysical folder if anyone faces the same problem at some point.

Thanks anyway guys!
Momo1805 is offline   Reply With Quote

Old   July 21, 2016, 18:44
Default chtMultiRegionSimpleFoam - Solution suggestion
  #32
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Hello Everybody,

Increasing the Mesh quality by increasing the number of cells solved my divergence problem and no error massage appeared anymore.

- My mesh is created by blockMesh

- chtMultiRegionSimpleFoam has been used as a test

- I left the maximum iterations by 100 (did not followed the suggestion above)

- in my test I gave: runTimeModifiable false

I hope it can helps

Regards

Peter
peterhess is offline   Reply With Quote

Old   July 25, 2016, 10:33
Default
  #33
New Member
 
Moritz
Join Date: Nov 2015
Posts: 16
Rep Power: 11
Momo1805 is on a distinguished road
Dear foamer,

I solved the problem. In my case, the error occurred because of different values for T_common in the therm.dat file. Make sure that all reactants involved in the chemical reactions have the same value for T_common. But I think in the current version this bug is already fixed.

Cheers
zhangyan likes this.
Momo1805 is offline   Reply With Quote

Old   September 6, 2016, 06:02
Talking
  #34
New Member
 
Junqian CAI
Join Date: Jul 2016
Location: Tianjin,China
Posts: 9
Rep Power: 10
acaist is on a distinguished road
Quote:
Originally Posted by Momo1805 View Post
Dear foamer,

I solved the problem. In my case, the error occurred because of different values for T_common in the therm.dat file. Make sure that all reactants involved in the chemical reactions have the same value for T_common. But I think in the current version this bug is already fixed.

Cheers
Your suggestion is valuable and useful. By unify all T_common in chemistry, I solve the problem that the temperature show non-convergence in version 3.0 with reduced chemistry. And I found another post talking about this, which might be helpful to understand the cause.http://www.cfd-online.com/Forums/ope...ombustion.html
acaist is offline   Reply With Quote

Old   October 12, 2016, 10:12
Default Resolved
  #35
New Member
 
Vijaya Kumar. G
Join Date: Jun 2016
Location: Chennai, India & Aachen, Germany
Posts: 20
Rep Power: 10
VIJAYA KUMAR is on a distinguished road
1) Reduce delta T to a order 10000 times lower than the current value.

2) Set Max Courant Number to 1

3) Set ´adjustTimeStep´ to yes

try running the solver again, if it crashes yet again, reduce the delta T even lower then try running again.

This worked for me.

The problem was with higher courant number and that leading to a diverged solution.
VIJAYA KUMAR is offline   Reply With Quote

Old   March 29, 2017, 08:19
Default
  #36
Member
 
Hrushikesh Khadamkar
Join Date: Jul 2010
Location: Mumbai
Posts: 68
Rep Power: 16
Hrushi is on a distinguished road
Quote:
Originally Posted by srahul View Post
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 utilised to calculate the T. I implemented brent solver and now that problem is solved.
Dear Rahul,

We are also struggling with this issue of temperature update using N-R method. Can you share your brent method code implemented in thermoI.H file? We also feel that by using Brent method, this problem can be solved.

Hrushilesh
Hrushi is offline   Reply With Quote

Old   March 31, 2017, 18:42
Default
  #37
New Member
 
Andrea Matiz C
Join Date: Feb 2017
Posts: 10
Rep Power: 9
andreamc is on a distinguished road
hi
Did you find a solution to your problem? I'm having the same problem with the compressible solver rhoSimpleFoam.
Thanks in advance!
andreamc is offline   Reply With Quote

Old   April 3, 2017, 15:47
Default
  #38
New Member
 
Andrea Matiz C
Join Date: Feb 2017
Posts: 10
Rep Power: 9
andreamc is on a distinguished road
Hi
I'm having the same ṕroblem you mentioned. Did you manage to solve it? what did you do?
Thanks in advance

Andrea
andreamc is offline   Reply With Quote

Old   April 5, 2017, 10:53
Default
  #39
Member
 
amin jalalian
Join Date: Mar 2014
Posts: 34
Rep Power: 12
amin_jalalian is on a distinguished road
Quote:
Originally Posted by srahul View Post
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.

Hi srahul

I have some questions, How can make the thermoI.H file?
Can you send brent solver text in openFoam?

thanks
amin_jalalian is offline   Reply With Quote

Old   May 15, 2017, 06:45
Default My mistake was...
  #40
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Hello Everybody!

chtMultiRegionSimpleFoam has been used here!

I faced the problem also like many of you.

I tried almost everything has been written here without a success...

I increased the number of cells to a very high number (1 000 000) cells for 100 x 100 x 100 mm region(s).

That worked, but the results where very strange.

And I found the mistake I made!

I made the folowing:

- 3D Design FreeCAD then export as stl

- Used blockMesh to make my initial mesh

- In openFoam using snappyMesh to build my final mesh


The dimensions in my stl file were in mm. That means FreeCAD exports the 100...

snappyMesh read this 100 as 100 m instead of the 100 mm exported

My blockMesh mesh is also too big made (factor 1000)...

Reducing the dimensions in factor 1000 bei:

convertToMeters 0.001 in blockMeshDict

AND

in my exported stl file (FreeCAD)

Solved my problem!

Check up the dimensions (in your blockMeshDict as example) is my suggestion here.

Regards

Peter

Last edited by peterhess; May 15, 2017 at 16:45.
peterhess 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 15:10.