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

rhoSimplefoam with error " Maximum number of iterations exceeded "

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2017, 03:49
Question rhoSimplefoam with error " Maximum number of iterations exceeded "
  #1
New Member
 
Raye XIe
Join Date: Jun 2017
Posts: 14
Rep Power: 9
raye_xie is on a distinguished road
Hi All,

I was running NACA0012 airfoil (AoA=15 deg) with rhoSimpleFoam with Re=6million. I ran checkMesh and the mesh was okay. The following error happened when the residuals seem to be fine (~ 1e-5) (also see my log file attached).

1) Is there any way (or Should I try) to increase the maximum # iterations allowed?
2) What might cause this error?

Code:
--> FOAM FATAL ERROR: 
Maximum number of iterations exceeded

    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>]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-4.1/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 66.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:?
#3  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:?
#4  ? at ??:?
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6  ? at ??:?
Aborted (core dumped)
Here's my fvSolution file

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.1;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20; 
    }

    "(U|e|nuTilda)"
    {
        solver          smoothSolver;
        tolerance       1e-08;
        relTol          0.05;
        smoother        GaussSeidel;
        nCellsInCoarsestLevel 20;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    rhoMin          0.1;
    rhoMax          1.0;
    transonic       yes;
    consistent      yes;

    residualControl
    {
        p               1e-5;
        U               1e-5;
        e               1e-5;
	nuTilda		1e-5;
    }
}

relaxationFactors
{
    fields
    {
        p               0.15;
        rho             0.05;
    }
    equations
    {
        p               0.3;
        U               0.3;
        e               0.3;
	nuTilda		0.3;
    }
}
I would really appreciate it if anyone could give me some advice!

Thanks,
Raye
Attached Files
File Type: txt log.txt (165.8 KB, 13 views)
File Type: txt p.txt (1.2 KB, 23 views)
File Type: txt T.txt (1.3 KB, 18 views)
File Type: txt U.txt (1.4 KB, 18 views)
File Type: txt thermophysicalProperties.txt (1.3 KB, 46 views)

Last edited by raye_xie; June 15, 2017 at 17:36. Reason: add attachment
raye_xie is offline   Reply With Quote

Old   June 19, 2017, 08:23
Default
  #2
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
There is a way to increase the iterations for the thermo model by modifying the src and recompiling it. However, from my experience, this is not necessary and you should not do that.
It's like when a guy tells you that your car has a flat tire. But instead of fixing it you blindfold the guy or tell him to be more tolerant towards flat tires in general.

This might not be the fix, but I am curious:
You calculate at ambient pressure and compressible. Your rho limiter keeps the density below 1 while the density of air at 300k and 1atm is already 1.184 kg/m3 (source wolframalpha).
What I mean is that you don't let the solver calculate the actual rho values but instead give him an unrealistic limiter (from my point of view). This can lead to miscalculation of the internal energy. Try increasing the max to 1.3 and see how it turns out. Also, after the first 100 iterations, you can start increasing your URF for anything except p to around 0.7.

Cheers
Alex
Kina is offline   Reply With Quote

Old   June 20, 2017, 00:55
Default
  #3
New Member
 
Raye XIe
Join Date: Jun 2017
Posts: 14
Rep Power: 9
raye_xie is on a distinguished road
Hi Alex,

Thank you for the advice. The Rhomax was actually the origin of my problem. I copied the fvSolution file from another tutorial and never noticed that there is a density limiting setting. One follow up question. Why do you suggest I turn down the URF after 100 iteration, not from the beginning?

Best,
Raye

Quote:
Originally Posted by Kina View Post
There is a way to increase the iterations for the thermo model by modifying the src and recompiling it. However, from my experience, this is not necessary and you should not do that.
It's like when a guy tells you that your car has a flat tire. But instead of fixing it you blindfold the guy or tell him to be more tolerant towards flat tires in general.

This might not be the fix, but I am curious:
You calculate at ambient pressure and compressible. Your rho limiter keeps the density below 1 while the density of air at 300k and 1atm is already 1.184 kg/m3 (source wolframalpha).
What I mean is that you don't let the solver calculate the actual rho values but instead give him an unrealistic limiter (from my point of view). This can lead to miscalculation of the internal energy. Try increasing the max to 1.3 and see how it turns out. Also, after the first 100 iterations, you can start increasing your URF for anything except p to around 0.7.

Cheers
Alex
raye_xie is offline   Reply With Quote

Old   June 20, 2017, 02:30
Default
  #4
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
Well, my point with the URF was not that you should keep them low for 100 iterations but that you should set them higher at some point in your simulation.
With the rho-based solvers, there can be certain instabilities while initializing the flow field. That's why low URF make sense in the beginning. Later, you should be able to set them to around 0.7 and 1 for rho. As always, this also depends on the mesh and the schemes of course.

Cheers
Alex
Kina is offline   Reply With Quote

Old   June 20, 2017, 02:34
Smile
  #5
New Member
 
Raye XIe
Join Date: Jun 2017
Posts: 14
Rep Power: 9
raye_xie is on a distinguished road
I see, Thank you!
raye_xie is offline   Reply With Quote

Old   June 20, 2017, 03:22
Default
  #6
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
One more thing. You have the transonic option turned on in the SIMPLE settings.
If your theoretical Mach No is below 0.8, you can put the option to "no", which further increases stability.
Kina is offline   Reply With Quote

Old   June 20, 2017, 03:35
Default
  #7
New Member
 
Raye XIe
Join Date: Jun 2017
Posts: 14
Rep Power: 9
raye_xie is on a distinguished road
Yeah, I also noticed that. It's pretty weird that when I had the wrong Rho setting, turning on transonic cancelled out the error and helped me get better pressure result (even my rho is wrong). Now I changed the rhomax and turned off the transonic option, I am able to get good results and the solver converges way better. But I'm still wondering what exactly does the transonic option do. Thanks!

Quote:
Originally Posted by Kina View Post
One more thing. You have the transonic option turned on in the SIMPLE settings.
If your theoretical Mach No is below 0.8, you can put the option to "no", which further increases stability.
raye_xie is offline   Reply With Quote

Old   June 20, 2017, 03:48
Default
  #8
Senior Member
 
Alex
Join Date: Jan 2014
Posts: 126
Rep Power: 12
Kina is on a distinguished road
Have you ever seen an experiment and theory of a CD (coverging diverging) nozzle? It shows that the physics of flows become highly unlinear when dealing with high Mach numbers. The solver doesn't know that beforehand so you have to give it a hint about what set of equations to set up for solving. So if you know the flow is not gonna reach Ma > 0.9 at some point you are better off turning the option to "no".
Kina is offline   Reply With Quote

Old   September 26, 2019, 13:17
Default
  #9
Member
 
Arthur
Join Date: Aug 2014
Location: Italy
Posts: 47
Rep Power: 12
Artur.Ant is on a distinguished road
In my case it was boundary conditions.
I solved the problem (no transitory) starting with lower values on BCs and increasing it sofetly once the previous solution converged!
Artur.Ant is offline   Reply With Quote

Old   May 29, 2024, 00:02
Default Maximum number of iterations openfoam
  #10
New Member
 
Ankit
Join Date: May 2024
Posts: 1
Rep Power: 0
Ankitra is on a distinguished road
Quote:
Originally Posted by Artur.Ant View Post
In my case it was boundary conditions.
I solved the problem (no transitory) starting with lower values on BCs and increasing it sofetly once the previous solution converged!
Hi , I am trying to perform simulation on server room and while running the simulation , I am facing this issue. Below is the breakdown of my problem:

Geometry:
1. Room: With floor, roof and side walls.
2. Server(Rack): I created a simple cube that will generate heat (to make it simple).

When i run "rhoSimpleFoam", i am getting below error. Please help.

-> FOAM FATAL ERROR: (openfoam-2206 patch=221104)
Maximum number of iterations exceeded: 100 when starting from T0:348.8794608 old T:467.2625449 new T:490.4542647 f:-45038.05359 p:101325 tol:0.03488794608

From 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::Boussinesq<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::Bou ssinesq<Foam::specie> >, Foam::sensibleInternalEnergy>]
in file ./src/thermophysicalModels/specie/lnInclude/thermoI.H at line 76.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::simpleExit(int, bool) at ??:?
#2 ? at ??:?
#3 ? at ??:?
#4 ? at ??:?
#5 ? in /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
#6 ? in /lib/x86_64-linux-gnu/libc.so.6
#7 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#8 ? in /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
Aborted (core dumped)


Below are the BC and log file

"U"
dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
"(roof|floor|side_walls|rack)"
{
type fixedValue;
value uniform (0 0 0);
}

"(intake_1|intake_2|intake_3|intake_4)"
{
type surfaceNormalFixedValue;
refValue uniform -1;
}

"(outlet_1|outlet_2|outlet_3|outlet_4|outlet_5 |out let_6|outlet_7|outlet_8|outlet_9)"
{
type zeroGradient;
}


}



"T"

dimensions [0 0 0 1 0 0 0];

internalField uniform 293;

boundaryField
{
"(roof|floor|side_walls)"
{
type zeroGradient;
}

rack
{
type externalWallHeatFluxTemperature;
mode flux;
q uniform 681; // W/m^2
value uniform 300;
kappaMethod fluidThermo;
kappa none;
Qr none;
}

"(intake_1|intake_2|intake_3|intake_4)"
{
type fixedValue;
value uniform 283;
}


"(outlet_1|outlet_2|outlet_3|outlet_4|outlet_5 |out let_6|outlet_7|outlet_8|outlet_9)"
{
type inletOutlet;
value $internalField;
inletValue $internalField;
}


}

// ************************************************** *********************** //



"U"

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
"(roof|floor|side_walls|rack)"
{
type fixedValue;
value uniform (0 0 0);
}

"(intake_1|intake_2|intake_3|intake_4)"
{
type surfaceNormalFixedValue;
refValue uniform -1;
}

"(outlet_1|outlet_2|outlet_3|outlet_4|outlet_5 |out let_6|outlet_7|outlet_8|outlet_9)"
{
type zeroGradient;
}


}


// ************************************************** *********************** //






"Log.file"


/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : _8993af73-20221106 OPENFOAM=2206 patch=221104 version=2206
Arch : "LSB;label=32;scalar=64"
Exec : /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
Date : May 29 2024
Time : 10:26:46
Host : I7MS7D40
PID : 512545
I/O : uncollated
Case : /home/ubuntu/Desktop/Ankit_Projects/Ageing_room_simulation_with_rack/steady
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

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

Create mesh for time = 2


SIMPLE: convergence criteria
field p tolerance 0.001
field U tolerance 0.001
field k tolerance 0.001
field omega tolerance 0.001
field e tolerance 0.001

Reading thermophysical properties

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

Reading field U

Reading/calculating face flux field phi

pressureControl
pMax 202650
pMin 10132.5

Creating turbulence model

Selecting turbulence model type RAS
Selecting RAS turbulence model kOmegaSST
Selecting patchDistMethod meshWave
RAS
{
RASModel kOmegaSST;
turbulence on;
printCoeffs on;
alphaK1 0.85;
alphaK2 1;
alphaOmega1 0.5;
alphaOmega2 0.856;
gamma1 0.5555555556;
gamma2 0.44;
beta1 0.075;
beta2 0.0828;
betaStar 0.09;
a1 0.31;
b1 1;
c1 10;
F3 false;
decayControl false;
kInf 0;
omegaInf 0;
}

No MRF models present

Creating finite volume options from "constant/fvOptions"

Selecting finite volume options type limitTemperature
Source: limitT
- selecting all cells
- selected 880234 cell(s) with volume 903.022348

Starting time loop

Time = 3

DILUPBiCGStab: Solving for Ux, Initial residual = 1, Final residual = 0.0008832352532, No Iterations 1
DILUPBiCGStab: Solving for Uy, Initial residual = 1, Final residual = 0.0008911528477, No Iterations 1
DILUPBiCGStab: Solving for Uz, Initial residual = 1, Final residual = 0.0009263606855, No Iterations 1
DILUPBiCGStab: Solving for e, Initial residual = 0.99999996, Final residual = 0.0004638375708, No Iterations 1
limitTemperature limitT Lower limited 0 (0%) of cells, with min limit 101
limitTemperature limitT Upper limited 0 (0%) of cells, with max limit 600
limitTemperature limitT Unlimited Tmin 293
limitTemperature limitT Unlimited Tmax 293


--> FOAM FATAL ERROR: (openfoam-2206 patch=221104)
Maximum number of iterations exceeded: 100 when starting from T0:348.8794608 old T:466.3603085 new T:485.7612558 f:-48051.46157 p:101325 tol:0.03488794608

From 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::Boussinesq<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::Bou ssinesq<Foam::specie> >, Foam::sensibleInternalEnergy>]
in file ./src/thermophysicalModels/specie/lnInclude/thermoI.H at line 76.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::simpleExit(int, bool) at ??:?
#2 ? at ??:?
#3 ? at ??:?
#4 ? at ??:?
#5 ? in /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
#6 ? in /lib/x86_64-linux-gnu/libc.so.6
#7 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#8 ? in /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
Ankitra is offline   Reply With Quote

Old   June 17, 2024, 13:00
Default
  #11
New Member
 
Join Date: Feb 2020
Posts: 3
Rep Power: 6
mamba_ is on a distinguished road
Quote:
Originally Posted by

-> FOAM FATAL ERROR: (openfoam-2206 patch=221104)
Maximum number of iterations exceeded: 100 when starting from T0:348.8794608 old T:467.2625449 new T:490.4542647 f:-45038.05359 p:101325 tol:0.03488794608

From 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::Boussinesq<Foam::specie> >; Type = Foam::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::Bou ssinesq<Foam::specie> >, Foam::sensibleInternalEnergy>
in file ./src/thermophysicalModels/specie/lnInclude/thermoI.H at line 76.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::simpleExit(int, bool) at ??:?
#2 ? at ??:?
#3 ? at ??:?
#4 ? at ??:?
#5 ? in /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
#6 ? in /lib/x86_64-linux-gnu/libc.so.6
#7 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#8 ? in /usr/lib/openfoam/openfoam2206/platforms/linux64GccDPInt32Opt/bin/rhoSimpleFoam
Aborted (core dumped)

Hi Ankit,

I have the same problem.
Have you been able to solve this?
mamba_ 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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
courant number increases to rather large values 6863523 OpenFOAM Running, Solving & CFD 22 July 6, 2023 00:48
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
Unstabil Simulation with chtMultiRegionFoam mbay101 OpenFOAM Running, Solving & CFD 13 December 28, 2013 14:12
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37


All times are GMT -4. The time now is 14:08.