CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   "Glitches" in k and omega (https://www.cfd-online.com/Forums/openfoam-solving/112026-glitches-k-omega.html)

 buffi January 20, 2013 16:54

"Glitches" in k and omega

Hi,

I am simulating the flow in a channel using a modified simpleFoam and the k-omega-SST model. Every now and then, the solver can't solve for k or omega and their values just explode. Sometimes the simulation recovers from that state within a few hundred timesteps, sometimes it doesn't. Here is a sample output for a normal timestep and a problematic one:

Code:

```Time = 4180 DILUPBiCG:  Solving for Ux, Initial residual = 0.002454946797335455, Final residual = 2.118201461652769e-08, No Iterations 6 DILUPBiCG:  Solving for Uy, Initial residual = 0.001256415853039685, Final residual = 1.037692770489594e-08, No Iterations 6 DILUPBiCG:  Solving for Uz, Initial residual = 0.003283733002456741, Final residual = 2.981279918575045e-09, No Iterations 7 GAMG:  Solving for p, Initial residual = 0.02201556239585755, Final residual = 1.282423077370965e-07, No Iterations 16 GAMG:  Solving for p, Initial residual = 0.008240116175764454, Final residual = 8.139580885669834e-08, No Iterations 12 time step continuity errors : sum local = 1.531473863748542e-06, global = -7.156743507425181e-15, cumulative = -1.45393053629309e-12 DILUPBiCG:  Solving for omega, Initial residual = 8.626697921486998e-06, Final residual = 8.156673087094997e-11, No Iterations 5 bounding omega, min: -877.5914029924204 max: 9963507.932995282 average: 104575.2141635721 DILUPBiCG:  Solving for k, Initial residual = 0.003874747711704138, Final residual = 5.92104344143439e-09, No Iterations 7 bounding k, min: -0.0001332252168376633 max: 0.05713142005592581 average: 0.003205000635194682 S_PRO= 4.802711559863782e-06W/K S_PRO,D= 2.028083115231596e-06W/K S_PRO,D'= 2.774628444632186e-06W/K S_PRO,C= 0W/K S_PRO,C'= 0W/K ExecutionTime = 1411.6 s  ClockTime = 1434 s Time = 4181 DILUPBiCG:  Solving for Ux, Initial residual = 0.002460388678483852, Final residual = 9.17931475513598e-10, No Iterations 7 DILUPBiCG:  Solving for Uy, Initial residual = 0.001256478971499746, Final residual = 1.16998685088727e-08, No Iterations 6 DILUPBiCG:  Solving for Uz, Initial residual = 0.003284937635407826, Final residual = 2.670988173110144e-08, No Iterations 5 GAMG:  Solving for p, Initial residual = 0.02191503352549878, Final residual = 1.226826542535508e-07, No Iterations 16 GAMG:  Solving for p, Initial residual = 0.008195653865403671, Final residual = 7.521263032788438e-08, No Iterations 12 time step continuity errors : sum local = 1.415562053229773e-06, global = 1.775764236376485e-15, cumulative = -1.452154772056713e-12 DILUPBiCG:  Solving for omega, Initial residual = 8.719510075834142e-06, Final residual = 4808428634545.903, No Iterations 1001 bounding omega, min: -2.164755144508585e+21 max: 3.598949521217116e+21 average: 1.308210762796994e+17 DILUPBiCG:  Solving for k, Initial residual = 0.3147840750606549, Final residual = 1.995451694496316e-16, No Iterations 1 bounding k, min: -4.418770186074049e-05 max: 0.05208677946321078 average: 0.001778830031969948 S_PRO= 1262457298.893128W/K S_PRO,D= 2.02929169556324e-06W/K S_PRO,D'= 1262457298.893126W/K S_PRO,C= 0W/K S_PRO,C'= 0W/K ExecutionTime = 1448.59 s  ClockTime = 1471 s```
I changed some values in my fvSolution during this simulation, but not when this behavior occured.

My fvSchemes for k and omega:

Code:

```ddtSchemes {   default steadyState; } gradSchemes {   default cellLimited Gauss linear 1; } divSchemes {   default Gauss linear;   div(phi,U) Gauss limitedLinearV 1;   div(phi,T) Gauss upwind; } laplacianSchemes {   default Gauss linear limited 0.333; } interpolationSchemes {   default linear; } snGradSchemes {   default limited 0.333; } fluxRequired {   default no;   p; }```
relTol for k and omega is 1e-5, relaxationFactors are 0.7 (I had them as low as 0.3, but glitches occured as well)

Regards

Christoph

 msuaeronautics January 21, 2013 15:08

Try dropping your relaxation factor for omega and/or k to something less than 0.1, i.e. 0.05 or so.

I have recently run a kOmegaSST sim on a submarine and would have similar issues with the bounding omega exploding. Dropping the relaxation to 0.05 fixed it for me.

 chegdan January 21, 2013 19:00

Also, you have your default divScheme set to Gauss linear...which is unbounded. You might want to explicitly set the divScheme for your turbulence parameters to something bounded.

 buffi January 22, 2013 06:31

Thanks to both of you, I will have to try a number of different things now.

A relaxation factor of 0.1 or even 0.05 sounds really low, but I'll give it a shot if all else fails.

I tried a limited scheme:
Code:

`div(phi,omega) Gauss limitedLinear 0 1e9;`
which gave me a floating point exception when I restarted the simulation with this scheme enabled, but enabling it afterwards worked (odd!?)

I am currently using a smooth solver, which also seems to run without glithces in k and omega but it's slower than before.

 chegdan January 22, 2013 17:08

I personally have an affinity to the upwind family. For 2.1.x, you could try

Code:

`div(phi,omega) Gauss linearUpwind grad(omega);`
with
Code:

`grad(omega) cellLimited leastSquares 1.0;`
and then you can choose from the limiters

Code:

```cellMDLimited cellLimited faceMDLimited faceLimited```
where these are arranged in order or least diffuse to most diffuse (citation http://www.cfd-online.com/Forums/ope...tml#post281280). I like them because they are a little dissipative and help when finding a solution. Also, believe I read in some ANSYS documentation that limiters can lead to stalling of the solution (maybe only in FLUENT?), so be aware of that.

 buffi January 23, 2013 06:16

I have OF 2.0.1 here, but I can use your suggestion anyway (at least OF didn't complain). These are my fvSchemes now:

Code:

```gradSchemes {     default    cellLimited Gauss linear 1;     grad(omega) cellLimited leastSquares 1.0; } divSchemes {   default        Gauss linear;   div(phi,U)    Gauss limitedLinearV 1;   div(phi,omega) Gauss linearUpwind grad(omega); }```
Let's see if it blows up again!

 buffi January 24, 2013 14:51

Well, I'm not seeing any problems regarding the glitches I described, but as they only show up occasionally I can't be sure that the schemes you suggested actually did the trick.

One problem though: I have cyclic boundaries and it seems that the suggested schemes have amplified oscillations I already had in my solution.

 chegdan January 28, 2013 11:33

you're still using Gauss linear as a default scheme for some of your variables. This linear scheme may be the source of your errors. I would change your default scheme to none, run your solver and then set each one of the schemes manually in your fvSchemes dictionary.

 buffi January 29, 2013 04:57

Quote:
 Originally Posted by chegdan (Post 404537) you're still using Gauss linear as a default scheme for some of your variables. This linear scheme may be the source of your errors.
Are you now referring to the glitches I described in the first post or to the oscillations I mentioned in my latest post? However, I now have all schemes set manually, but I have no experience regarding what might be suitable or not.

 All times are GMT -4. The time now is 11:25.