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

SimpleFoam convergence problems

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree29Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 31, 2008, 10:36
Default Hi All I'm trying to find o
  #1
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 17
brahim is on a distinguished road
Hi All

I'm trying to find out:
- a good 1st order numerical scheme
- a good 2nd order numerical scheme
for the solver simpleFoam. Therefore I used the pitzDaily tutorial case and tried quite a number of numerical schemes - unfortounatly with limited success! The only one which converged was Gauss upwind. But also this was much slower than with CFX.

The fallowing pictures show the residual plot for the different schemes.

Here the residuals of the original setup of the tutorial case (upwind) :


Here the residual plot of the case by using Gamma 1:
I changed to these lines in fvSchemes
div(phi,U) Gauss GammaV 1;
div(phi,k) Gauss Gamma 1;
div(phi,epsilon) Gauss Gamma 1;
div(phi,R) Gauss Gamma 1;
div(phi,nuTilda) Gauss Gamma 1;




Here the residual plot of the case by using limitedLinear 1:
I changed to these lines in fvSchemes
div(phi,U) Gauss limitedLinearV 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,R) Gauss limitedLinear 1;
div(phi,nuTilda) Gauss limitedLinear 1;




Here the residual plot of the case by using QUICK:
I changed to these lines in fvSchemes
div(phi,U) Gauss QUICK;
div(phi,k) Gauss QUICK;
div(phi,epsilon) Gauss QUICK;
div(phi,R) Gauss QUICK;
div(phi,nuTilda) Gauss QUICK;




For comparison, here the CFX residuals:


In all schemes I used the following relaxation factors
(specified in fvSolution):

relaxationFactors
{
p 0.2;
U 0.7;
k 0.5;
epsilon 0.5;
omega 0.5;
R 0.7;
nuTilda 0.7;
}

What can I do to get a better convergence with simpleFoam? Any hints are welcome!

Thanks a lot for any help,
Brahim
AlexaB likes this.
brahim is offline   Reply With Quote

Old   November 3, 2008, 10:57
Default What are you settings for solv
  #2
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
What are you settings for solvers/discretisation schemes and tolerances?
bastil is offline   Reply With Quote

Old   November 4, 2008, 06:14
Default Here are the fvSolution and fv
  #3
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 17
brahim is on a distinguished road
Here are the fvSolution and fvSchemes files:
fvSolution
fvSchemes

Thanks,
Brahim
brahim is offline   Reply With Quote

Old   November 4, 2008, 14:57
Default AFAIK these are the defualt se
  #4
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
AFAIK these are the defualt settings from the tutorial, right? Did you compare hem with the CFX settings?

Regards
bastil is offline   Reply With Quote

Old   November 4, 2008, 16:26
Default Another hint: - Residal defin
  #5
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Another hint:
- Residal definitions may be different, search forum...
- How do you judge "convergence"? Look at residuals or flow quantities?
- How to judge speed? Total run time? Time per Iteration? Parallelisation?

Regards
bastil is offline   Reply With Quote

Old   November 5, 2008, 05:46
Default Hello BastiL First thanks a
  #6
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 17
brahim is on a distinguished road
Hello BastiL

First thanks a lot for your hints!

- I mostly used the default settings, but changed the relaxationFactors and the relTol in fvSolution.
- As far as possible I tried to use the same setup of the case in CFX.
- The residuals in CFX and OF are different computed, but I don't know how exactly. Do you know why the residuals in OF first came down (as I want) and then go up...? Also it would be helpful to know, if the residuals in OF are a mean value or a max value?
- I judged the convergence just by comparing the residuals and the speed by comparing the total run time. In CFX I got a good solution already after 100 Iterations.

Regards,
Brahim
brahim is offline   Reply With Quote

Old   November 6, 2008, 16:59
Default In CFX I got a good solution a
  #7
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
In CFX I got a good solution already after 100 Iterations.

How do you define "good solution"? I will try the case during weekend.

Regards
bastil is offline   Reply With Quote

Old   November 10, 2008, 10:52
Default "good solution" means the rms
  #8
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 17
brahim is on a distinguished road
"good solution" means the rms residuals are below 1e-7 and the max residuals are below 1e-5.

Regards,
Brahim
atg and immortality like this.
brahim is offline   Reply With Quote

Old   June 29, 2009, 13:33
Default
  #9
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Guys

Greetings.

The discussion was very useful but I am wondering how far Brahim persued this question any further. AFAIK CFX curves are always very tempting but how far they are correct is still a doubt to me.

OpenFOAM is like a strict teacher, won't let you through until all is correct or better say until one has understood the sensitivities of a problem. By the way I am also struggling to get convergence with simpleFoam but still not successfull. If you guys have found the grail then please give me some tips. In my case I am using simpleFoam and all goes well until Re 1000 or so but for anything higher when I switch turbulence model on , all blows up. If anybody knows why that happens or witnessed something similar, please share.

Thanks
BR
jaswi
seav and hrikarthikeyan like this.
jaswi is offline   Reply With Quote

Old   June 30, 2009, 03:38
Default
  #10
Senior Member
 
matej forman
Join Date: Mar 2009
Location: Brno, Czech Republic
Posts: 182
Rep Power: 17
matejfor is on a distinguished road
Hi,

I have not been working with CFX for about 2 years, but as far as I remember, CFX is using coupled solver with some sort of Mutligrid. I'm pretty sure the solver employs also some correctors and limiters be default which you do not see in a basic setup. These things will be behind the convergence speed and smoothness.
Non of these was used in brahim case with OpenFOAM.

Regarding your turbulence problem, Jaswi, my experience with OpenFOAM tells me it is always boundary settings which are behind the disaster. Mainly the epsilon settings. Check the inlet values, check all BC three times.

good luck

matej
atg and Makkus like this.
matejfor is offline   Reply With Quote

Old   August 14, 2009, 02:41
Default
  #11
Member
 
Cem Albukrek
Join Date: Mar 2009
Posts: 52
Rep Power: 17
albcem is on a distinguished road
Here is my 2 cents on the issue:
  • Double check boundary conditions on all variables.
  • Utilize potentialFoam to initialize volume field on velocity
  • Turn turbulence off & iterate solution until your residuals are steady on velocity and pressure.
  • Play with relaxation values for velocity and pressure to see if you can push the residuals down any further (with each gradual relaxation change, you will see an initial jump in residuals, so let it run a little to see if you beat your previous residual levels...)
  • Finally turn the turbulence on, reducing pressure relaxation (increasing its numerical value). This seems to allow pressure solution to adapt to turbulence driven fluctuations better. If pressure solution is too much relaxed it seems to trigger instabilities.
  • As you increase/decrease relaxation on pressure, you do the opposite on velocity - I am using P_relax + U_relax = 1.
It seems relaxation parameters play a much more important role in convergence than stated anywhere in these forums. I do not believe one can expect to have a constant, "works for all cases" type of values for relaxation. The right approach seems to be to couple the OpenFoam solvers with a "watcher" type of application that will heuristically adjust the relaxation parameters dynamically as the simulation progresses.

I hope my observations and suggestions are in line with "iterative relaxation techniques" literature, which I am yet to read.

Cem
bennn, fumiya, atg and 12 others like this.
albcem is offline   Reply With Quote

Old   August 22, 2009, 11:08
Default Convergence problem in car aerodynamics case
  #12
New Member
 
Krzysztof Przysowa
Join Date: Mar 2009
Location: Frimley, Surrey, United Kingdom
Posts: 13
Rep Power: 17
kprzysowagmailcom is on a distinguished road
Hi,
I have similar problem with convergence in simpleFoam aerodynamics case.
I have made the assumption that my convergence tolerance should be
1e-6 no matter the order of the solution scheme. I could go with less
tight tolerance but then the forces/coefficients values are not so
stable, which can latter on impact quality of optimization/field
prediction.
So, I went back to Ahmed model in order to neglect the geometry impact.
The problem is that I am not able to get convergence tolerance lower
than 1.5e-6 for pressure, 1-2e-6 for velocity and 5e-6 for turbulence
coefficients. Please see attached charts.


So, I have done so far:
- boundary condition check,
- potentialFoam run at the beginning of sim,
- turbulence on/off,
- relaxation coefficient change (the best so far are dafault - p 0.3 U 0.7)
- nNonOrthogonalCorrectors change,
- grad(p), grad(U), grad(nuTilda), chnage - (leastSquares, Gauss linear)
- div (phi, U) change - Gauss upwind, GammaV

I have even tried alternative turbulence model (omega SST) with similar results.

As far as model is concerned I tried to follow the paper here:
https://online.tu-graz.ac.at/tug_onl...cumentNr=81599

My model has relatively fine mesh ~4.4M cells. I use the hexa interior
mesh configuration from ANSA. There is no problems with it in
checkMesh report, its attached. There are five boundary layers.

Please see attached checkMesh report.
I have attached as well the my model/solver settings.


I have performed few dozens of runs with few thousand of iterations each.
Obviously there is still something wrong. I would appreciate it, if
somepne could point me in right direction.

Thank you very much in advance for any help.
Attached Images
File Type: png snapshot1.png (26.4 KB, 861 views)
File Type: jpg snapshot2.jpg (34.4 KB, 811 views)
File Type: jpg snapshot3.jpg (39.3 KB, 735 views)
Attached Files
File Type: gz ahmed_settings.tar.gz (91.5 KB, 253 views)
File Type: txt chechMesh_results.txt (1.9 KB, 172 views)
Iose and hogsonik like this.
kprzysowagmailcom is offline   Reply With Quote

Old   October 26, 2009, 06:33
Default tolerances in fvSolution
  #13
New Member
 
Krzysztof Przysowa
Join Date: Mar 2009
Location: Frimley, Surrey, United Kingdom
Posts: 13
Rep Power: 17
kprzysowagmailcom is on a distinguished road
Hi,
Although I recently run SA not Omega SST turbulence model I have think I have overcome the convergence problem.

In fvSolution file the are tolerances for each field. On the begining I though this tolerance is stopping the solution when converged, but I was wrong.
Actually it is stopping iteration of solver of the defined field.
So in my case the problem was as following:
- tolerances of all field ware set to 1e-6
- after few thousands of iteration the level was reached for velocity but not for pressure,
- velocity was no longer being iterated,
- without the velocity better convergence the pressure residuals did not change

The very easy solution was to change all the tolerances to 1e-8 in fvSolution and stop solution by residuals level of 1e-5 or 1e-6.
The converged solution stopping is described here:
http://www.cfd-online.com/Forums/ope...converged.html
shereez234, AlexaB, dreiii and 2 others like this.
kprzysowagmailcom is offline   Reply With Quote

Old   October 26, 2009, 07:27
Default
  #14
Senior Member
 
J. Cai
Join Date: Apr 2009
Posts: 180
Rep Power: 17
chiven is on a distinguished road
In my case, I also met the same problem. Only the upwind for divergence can get a convergence. I have no idea how to use a second order scheme, such as QUICK, SFCD, etc..
Best regards,
Chiven
chiven is offline   Reply With Quote

Old   June 14, 2010, 07:07
Default looking for a good 2nd order scheme
  #15
Member
 
Marine
Join Date: Mar 2010
Posts: 38
Rep Power: 16
marine is on a distinguished road
Hi everybody !

Did you solve your problem and found out a good 2nd order scheme?

I'm running an external flow simulation with simpleFoam, when all my schemes are upwind it works well (velocity and forces are of the same order as what I obtain with Fluent or Starccm+) but when I try a second order only for U (div(phi, U)=linear) it doesn't work and the continuity equation explode (residuals very important).

I'd like a 2nd order for more accuracy, do you have some advice about which one I must use?

thank you very much,

Marine
marine is offline   Reply With Quote

Old   October 5, 2011, 12:05
Default
  #16
Member
 
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 17
Toorop is on a distinguished road
Hi,

I think I have run into the same problem, so I have revisited the pitzDaily simpleFoam sample case. I made some modifications to the tolerances, basically cranked up all of them in order to get a nice convergent run. I tested it with different k-epsilon turbulence models and the runs behaved fine.

Unfortunately I cannot reproduce the same expected steady-state run with my case. It doesn't really converge with upwind scheme and linearUpwind is even worse. The strange thing is that my initial k residual is quite low and remains so, so the solver just skips it, won't iterate it further - tried to introduce minIter but nothing, no iteration. The other freak thing is that my nut and k values do not evolve from the initial values as the simulation progresses (both upwind and linearUpwind). Just the realizableKE turbulent model produces stable runs.

Run Allrun script to test the case, at the end of the run pyFoam-rendered convergence history is created.

Any suggestions would be appreciated!
Attached Files
File Type: gz pitzDaily.tar.gz (3.4 KB, 92 views)
File Type: gz airFilter.tar.gz (5.9 KB, 60 views)
Toorop is offline   Reply With Quote

Old   October 6, 2011, 09:13
Default
  #17
New Member
 
Chris
Join Date: Jun 2011
Posts: 12
Rep Power: 15
caramelo is on a distinguished road
Seems like you deleted the /constant/polyMesh/boundary file because running blockMesh causes an error.

edit: its because you use another version. just had to make some changes in the blockMeshDict... I will have a look at your case

Last edited by caramelo; October 6, 2011 at 10:52.
caramelo is offline   Reply With Quote

Old   October 6, 2011, 12:02
Default
  #18
New Member
 
Chris
Join Date: Jun 2011
Posts: 12
Rep Power: 15
caramelo is on a distinguished road
I tink it is because of the wallfunctions you use.

If you try
epsilon
{
wall
{
type zeroGradient;
}
}
k
{
wall
{
type fixedValue;
value uniform 1e-10: // 0 will cause an error
}
}

the simulation should converge with your settings. Unfortunatly I don't know how to modify your settings if you want to use wallfunctions.

caromelo

p.s. using GAMG for the pressure should speed up your calculation
caramelo is offline   Reply With Quote

Old   October 10, 2011, 11:51
Default
  #19
Member
 
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 17
Toorop is on a distinguished road
Thx for your help!
You are right, the case produces the best convergence without wall functions, but with these settings the flow seems to be so blurred, no separation occurs.

I tweaked the k and epsilon files a bit so it resembles the pitzDaily solution. Actually, I set the initial and wall values equal to the inlet. This reduced the residuals but it's still far from ideal.

The other interesting thing is that with the initial setup the flow doesn't want to settle to steady state, it's like a transient solution. On the other hand, the pitzDaily like setup it's more or less steady.

I read numerous times that the value at the wall function is just a dummy, the solver overwrites it in the very next time step, and the initial condition is quite arbitrary, it can help if you guess it correctly but really doesn't matter unless you have complicated, unstable cases. Now I'm really dubious about the issue.

I wanted to check the pisoFoam solution but without success. No matter how small time step I choose, the simulation always blows up within a few iterations.
Toorop is offline   Reply With Quote

Old   May 31, 2013, 11:55
Default
  #20
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
Quote:
Originally Posted by albcem View Post
Here is my 2 cents on the issue:
  • Double check boundary conditions on all variables.
  • Utilize potentialFoam to initialize volume field on velocity
  • Turn turbulence off & iterate solution until your residuals are steady on velocity and pressure.
  • Play with relaxation values for velocity and pressure to see if you can push the residuals down any further (with each gradual relaxation change, you will see an initial jump in residuals, so let it run a little to see if you beat your previous residual levels...)
  • Finally turn the turbulence on, reducing pressure relaxation (increasing its numerical value). This seems to allow pressure solution to adapt to turbulence driven fluctuations better. If pressure solution is too much relaxed it seems to trigger instabilities.
  • As you increase/decrease relaxation on pressure, you do the opposite on velocity - I am using P_relax + U_relax = 1.
It seems relaxation parameters play a much more important role in convergence than stated anywhere in these forums. I do not believe one can expect to have a constant, "works for all cases" type of values for relaxation. The right approach seems to be to couple the OpenFoam solvers with a "watcher" type of application that will heuristically adjust the relaxation parameters dynamically as the simulation progresses.

I hope my observations and suggestions are in line with "iterative relaxation techniques" literature, which I am yet to read.

Cem
Hi Dear cem,
i wana you to say me if i understand your explenation above rigth or not?
i unerstand that,
first we should write potentialFoam instead of simoleFoam in controlDict, after some iteration we should turn the turbulence off in RAS properties, and then after some iteration we should set the turbulence on in RAS properties, is it rigth?
thank you very uch
s.m is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Problems with the RSM in simpleFoam sberg OpenFOAM Running, Solving & CFD 10 February 25, 2014 20:39
SimpleFoam Convergence problem skabilan OpenFOAM Running, Solving & CFD 6 May 31, 2013 04:21
SimpleFoam solution convergence pattern philippose OpenFOAM Running, Solving & CFD 0 June 26, 2008 15:18
SimpleFoam problems with converging maybe skewness hoochie OpenFOAM Running, Solving & CFD 4 May 14, 2007 08:23
SimpleFoam convergence problems schnitzlein OpenFOAM Running, Solving & CFD 6 June 24, 2005 10:51


All times are GMT -4. The time now is 05:56.