- **OpenFOAM**
(*http://www.cfd-online.com/Forums/openfoam/*)

- - **Maximum number of iterations exceeded**
(*http://www.cfd-online.com/Forums/openfoam/78599-maximum-number-iterations-exceeded.html*)

Maximum number of iterations exceeded1 Attachment(s)
I use sonicFoam and 3D model (calculation grid from ANSYS), then Mach is small all calculated good, but if Mach>2, i see this error:
Time = 4e-05 Courant Number mean: 7.45518e-06 max: 50.5163 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 0.000171815, Final residual = 4.66354e-06, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 0.0136957, Final residual = 4.54394e-06, No Iterations 3 DILUPBiCG: Solving for Uz, Initial residual = 0.0133979, Final residual = 4.08719e-06, No Iterations 3 DILUPBiCG: Solving for e, Initial residual = 0.000582351, Final residual = 1.84041e-06, No Iterations 2 --> 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/opencfd/OpenFOAM/OpenFOAM-1.7.0/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 67. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam170/lib/linuxGccDPOpt/libOpenFOAM.so" #1 Foam::error::abort() in "/opt/openfoam170/lib/linuxGccDPOpt/libOpenFOAM.so" #2 Foam::ePsiThermo<Foam::pureMixture<Foam::constTran sport<Foam::specieThermo<Foam::eConstThermo<Foam:: perfectGas> > > > >::calculate() in "/opt/openfoam170/lib/linuxGccDPOpt/libbasicThermophysicalModels.so" #3 Foam::ePsiThermo<Foam::pureMixture<Foam::constTran sport<Foam::specieThermo<Foam::eConstThermo<Foam:: perfectGas> > > > >::correct() in "/opt/openfoam170/lib/linuxGccDPOpt/libbasicThermophysicalModels.so" #4 in "/opt/openfoam170/applications/bin/linuxGccDPOpt/sonicFoam" #5 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6" #6 in "/opt/openfoam170/applications/bin/linuxGccDPOpt/sonicFoam" I know that P<0 or T<0 but i do not know why, help me please! |

Hi,
your problem is the function T in the file specieThermoI.H. This function is used to get the temperature for a given enthalpy. In this function, a simple Newton solver is used. Your error is related to the fact that the Newton solver can't find the correct temperature to the given enthalpy. What type of thermophysical model do you use? Firstly, you could try to increase the "h" relaxation. The second option might be to modify or even replace the Newton solver. You could use a more stable version of the Newton solver. The other option is to use a completely different solver like the Brent solver (numerical Recipes). Regards, Christian |

I got exactly the same problem in my case !
I use buoyantPisoFoam with following LESProperties :LESModel oneEqEddy;delta vanDriest; printCoeffs on; turbulence on; My thermophysicalProperties looks like the tutorials : thermoTypehRhoThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>>; mixture air 1 28.9 1000 0 1.8e-05 0.7; pRef 100000; I use linear models in divSchemes. My simulations blow up after some thousand timesteps, k value suddenly increasing without any valuable reason ... @Christian : First of all thank you for your answer. Could you explain us how to change the "h relaxation", in my 0/ directory I have no such parameter :confused:. About the solver, I did not try buoyantBoussinesq yet, does anybody know if it is more relevant for a turbulent case ?Thank you in advance |

Hi Norbert,
you can change the h relaxation in system/fvSolution. Maybe you have to include the command yourself. If so, have a look at other tutorials. Regards, Christian |

Hi Christian,
I found this in my FsSolution : h { solver PBiCG; preconditioner DILU; tolerance 1e-05; relTol 0; } When you said to increase the h relaxation, you meant to increase the solver tolerance ? Regards |

Chris Lucas thank you for your answer!
my thermoType ePsiThermo<pureMixture<constTransport<specieThermo <eConstThermo<perfectGas>>>>>; I tried simulated my unit in ANSYS CFX, and they give me the same result. Near supersonic nozzle pressure less than zero. Image: http://imglink.ru/pictures/28-07-10/...ddd9518d5f.jpg Near supersonic nozzle P<0 in ANSYS CFX >Firstly, you could try to increase the "h" relaxation. It does not help >The second option might be to modify or even replace the Newton solver. You could use a more stable version of the Newton solver. The other option is to use a completely different solver like the Brent solver (numerical Recipes). How can I do this? I'm new in OpenFoam Thank you! |

Hi,
about the relaxation, have a look at the tutorials e.g. rhoPimpleFoam. You will find this relaxationFactors { U 0.7; p 0.3; rho 0.05; h 0.7; k 0.7; omega 0.7; } You should then decrease the value behind the h. About changing the solver. Have a look at the file a said before. You will find the Newton solver in this file. Have a look in a numeric’s book and find a better solver in change in solver in OpenFoam. Have a look at: (Have a look at the copyright) http://kolhoz.tiera.ru/M_Mathematics...281018s%29.pdf You will find the code of a brent solver in this book. You could also use the open Source library "gsl". However, if you get negative pressure, the problem might be related to your case setup. The problem is that if you have a positive enthalpy or internal energy and a negative pressure in one cell. The enthalpy (h= cp * T) is positive and cp is positive and constant. So the temperature is positive and the density is negative due to the perfect gas law. So, have a look at your case setup. Regards, Christian |

Chris
I am using rhoPimpleFoam. In my case rhoMin decreases sharply. I think from this discussion that my problem is same.I have been stuck at this error for the last 5 weeks. I am a beginner with CFD and Openfoam doing my postgrad work. I have modified h values by decreasing and increasing it. I cannot solve this. Kindly advise how can I develop a new solver because I do not have much programming experience and if there is an easy way out. You pdf link for Brent solver is also not working. If you can send me your email, I can send you my folder as it is 178KB and this forum does not permit more than 97KB attachment to see if this is the same problem which everyone is discussing. If you have any key to developing solvers in Openfoam, kindly let me know. Regards |

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