CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   SimpleFoam convergence problems (http://www.cfd-online.com/Forums/openfoam-solving/58365-simplefoam-convergence-problems.html)

 brahim October 31, 2008 10:36

Hi All I'm trying to find o

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) :
http://www.cfd-online.com/OpenFOAM_D...ges/1/9776.jpg

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;

http://www.cfd-online.com/OpenFOAM_D...ges/1/9777.jpg

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;

http://www.cfd-online.com/OpenFOAM_D...ges/1/9778.jpg

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;

http://www.cfd-online.com/OpenFOAM_D...ges/1/9779.jpg

For comparison, here the CFX residuals:
http://www.cfd-online.com/OpenFOAM_D...ges/1/9780.jpg

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

 bastil November 3, 2008 10:57

What are you settings for solv

What are you settings for solvers/discretisation schemes and tolerances?

 brahim November 4, 2008 06:14

Here are the fvSolution and fv

Here are the fvSolution and fvSchemes files:
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif fvSolution
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif fvSchemes

Thanks,
Brahim

 bastil November 4, 2008 14:57

AFAIK these are the defualt se

AFAIK these are the defualt settings from the tutorial, right? Did you compare hem with the CFX settings?

Regards

 bastil November 4, 2008 16:26

Another hint: - Residal defin

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

 brahim November 5, 2008 05:46

Hello BastiL First thanks a

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

 bastil November 6, 2008 16:59

In CFX I got a good solution a

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

 brahim November 10, 2008 10:52

"good solution" means the rms

"good solution" means the rms residuals are below 1e-7 and the max residuals are below 1e-5.

Regards,
Brahim

 jaswi June 29, 2009 12:33

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

 matejfor June 30, 2009 02:38

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

 albcem August 14, 2009 01:41

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

 kprzysowagmailcom August 22, 2009 10:08

Convergence problem in car aerodynamics case

5 Attachment(s)
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,
- 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.

 kprzysowagmailcom October 26, 2009 06:33

tolerances in fvSolution

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

 chiven October 26, 2009 07:27

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

 marine June 14, 2010 06:07

looking for a good 2nd order scheme

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

 Toorop October 5, 2011 11:05

2 Attachment(s)
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!

 caramelo October 6, 2011 08:13

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

 caramelo October 6, 2011 11:02

I tink it is because of the wallfunctions you use.

If you try
epsilon
{
wall
{
}
}
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

 Toorop October 10, 2011 10:51

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.

 s.m May 31, 2013 10:55

Quote:
 Originally Posted by albcem (Post 226323) 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:)

All times are GMT -4. The time now is 16:31.