CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   second order schemes (https://www.cfd-online.com/Forums/openfoam/77362-second-order-schemes.html)

 marine June 21, 2010 10:08

second order schemes

Hello everybody !

I'm running a simulation of flow around a ship with a k-omega SST turbulent model.
I have an inlet, an outlet, four symmetry planes and a hull.

I did the simulation with first order schemes for divergence, linear schemes for gradschemes and interpolation schemes, linearCorrected for laplacian and corrected for snGradSchemes. It worked and I obtained coherent results for the velocity, pressure, and forces on the hull.

I'd like now to run it with second order schemes but I really don't know which one to choose because I tried some of them (linearUpwind, linearLimited, skewCorrected linear) on a previous simulation with an other hull and no one worked.

Do you have some advice? is there a advisable second order scheme for this type of simulation? Is there an other scheme (grad, interpolation) I must change?

thanks a lot for any advice !

Marine

 alberto June 21, 2010 20:31

Why didn't they work? Could you post your fvScheme?

 naveen June 22, 2010 00:15

second order schemes

hi marine,

Try leastsquares or liner which are second order schemes.If you use leastsquares you wil get da best results.

Regards

Naveen
Bangalore

 marine July 6, 2010 08:52

1 Attachment(s)
I tried linearUpwind then limitedLinear for the divergence terms, both time with limited 0.333 for laplacian and sngradschemes, and both worked. The problem was apparently the corrected shemes for laplacian and snGradschemes.
The linear scheme for divergence terms still doesn't work (pressure residuals decrease and continuity explode).
My question now is do you know which one between linearUpwind and limitedLinear is the best for 2nd order accuracy?

I attached the fvSchemes.

thank you very much.

Marine

 truong_nm July 6, 2010 08:54

Dear Marine,

Seems that Upwind implies 1st order. Default 2nd order scheme is Linear.

 marine July 6, 2010 09:01

linearUpwind is a blend of first and second order, I would like to know if it can be more accuracy than limitedLinear because I don't find a lot of documentation about limitedLinear and I don't know how it works.
Linear schemes don't work with my simulation.
Thanks !

Marine

 truong_nm July 6, 2010 09:04

Would you mind describing your case: Mach, boundary conditions.
Which solver do you use?:)

 marine July 6, 2010 09:13

I'm running a simulation of incompressible flow around a ship with a k-omega SST turbulent model. The solver is simpleFoam.
I have an inlet, an outlet, four symmetry planes (it's a "double model" simulation, I don't know the english term) and a hull.
The solver for pressure is GAMG, for U and turbulence PBICG.

at the inlet : u,k,omega=fixedvalue p=zeroGradient
at the outlet : u=zeroGradient p=fixedvalue k and omega=inletOutlet

thank you :)

Marine

 truong_nm July 6, 2010 09:17

Try under-relaxation

One possibility is to come back to "Gauss linear" for every div(x,y) scheme and try under-relaxing the solution for a few steps before increasing the U/R factors.

 fgal July 6, 2010 10:14

Hi,

And the problem can come from the mesh too, because higher order schemes are less dissipative and can require higher quality meshes. Can you post a screen shot of a cut of your mesh please ?
Cheers,

Francois.

 marine July 7, 2010 02:50

3 Attachment(s)
I already tried to under-relax the solution, it just postponed the divergence of the solution.
I attached three pictures of my mesh (it's a mesh with polyhedrons so the cut with paraview isn't nice ).

Regards,

Marine

 truong_nm July 7, 2010 03:42

Hum... I think I misunderstood. Have you already succeed in having a converged solution? For me, you succeeded, with 1st order schemes. Am I right ?

 marine July 7, 2010 05:40

Yes it worked with first order schemes and with limitedLinear 1 schemes but when I switch to linear schemes it doesn't work anymore.

 alberto July 7, 2010 06:03

Check your local (cell) Peclet number. The linear scheme requires it to be less than 2 (see Ferziger and Peric for a reference).

In your application you might want to use limitedLinear or linearUpwind anyway, which ensure the boundness of the solution.

Best,

 marine July 8, 2010 06:09

OK that explain why the linear scheme doesn't work, my Peclet number is too big.

I don't obtain the same results for the viscous forces on my hull with the linearUpwind scheme or the limitedLinear scheme (15% difference) . As they say in the book (Peric) that linearUpwind is unbounded I think is more accurate than limitedLinear ( I still don't know how this one works) and is comparable to the second order upwinded scheme we can find in Starccm+ or Fluent. Do you think I'm wrong?

regards,

Marine

 alberto July 8, 2010 07:07

Quote:
 Originally Posted by marine (Post 266342) I don't obtain the same results for the viscous forces on my hull with the linearUpwind scheme or the limitedLinear scheme (15% difference) . As they say in the book (Peric) that linearUpwind is unbounded I think is more accurate than limitedLinear ( I still don't know how this one works) and is comparable to the second order upwinded scheme we can find in Starccm+ or Fluent. Do you think I'm wrong?
Hi,

both limitedLinear and linearUpwind are bounded. What is different is how the boundness of the scheme is obtained (see table 4.10 of User's guide).
• limitedLinear is the linear scheme stabilized with the introduction of a limiter (Sweby limiter)
• linearUpwind in an upwinded scheme
About their accuracy, limitedLinear is in my experience slightly less diffusive, but I had good results with both the schemes.

I believe the second order upwind scheme in commercial codes is close to linearUpwind than to limitedLinear, probably with limiters turned on. Something along the lines of

div(phi, U) Gauss linearUpwindV cellMDLimited Gauss linear 1;

(notice linearUpwindV becomes linearUpwind for scalars) which limits also the gradients.

Best,

 marine July 8, 2010 08:30

Thanks Alberto you helped me a lot !

 vkrastev October 19, 2010 10:27

Quote:
 Originally Posted by alberto (Post 266354) Hi, both limitedLinear and linearUpwind are bounded. What is different is how the boundness of the scheme is obtained (see table 4.10 of User's guide). limitedLinear is the linear scheme stabilized with the introduction of a limiter (Sweby limiter) linearUpwind in an upwinded scheme About their accuracy, limitedLinear is in my experience slightly less diffusive, but I had good results with both the schemes. I believe the second order upwind scheme in commercial codes is close to linearUpwind than to limitedLinear, probably with limiters turned on. Something along the lines of div(phi, U) Gauss linearUpwindV cellMDLimited Gauss linear 1; (notice linearUpwindV becomes linearUpwind for scalars) which limits also the gradients. Best,
Hi Alberto,

I really need some advices about the convection schemes choice for an external aerodynamics case (hybrid prisms-tetrahedrons unstructured mesh)... For all the details about the case and my previous numerical trials you can have a look at this post: http://www.cfd-online.com/Forums/ope...red-grids.html
Apart from this, I would also like to know something more about the linearUpwind scheme: I've understood that this is a bounded "more than first order" upwinded scheme, but indeed in Ferziger and Peric's book it's mentioned like an unbounded scheme, so maybe you can adress me to some references about the limited implementation of such a scheme...

V.

 alberto October 19, 2010 11:08

I have a few comments on what you posted.

- First your case barely converges also with upwind (residuals of the pressure are the highest (yellow line)). Reduce the tolerances on the linear solvers to something closer to your machine precision (10^-12 for p, 10^-10 for the rest: yes it will take more iterations, it does not matter).

- Relax the turbulent quantities more than the velocity. Typically an URF = 0.4 works well.

- As schemes, linearUpwindV for div(phi, U) and linearUpwind for the rest, with cellLimited modifier for gradients should work just fine.

- Your mesh does not suffer of strong non-orthogonality, so I would not push the correctors too much (surely not to 8!).

- Stay away from SFCD, QUICK, UMIST. They won't give you any significant advantage. All the love for QUICK comes from the fact that it is formally third-order accurate, but its dissipation error is still high, and its stability is not good.

I hope this helps.

Best,

 vkrastev October 19, 2010 11:57

Quote:
 Originally Posted by alberto (Post 279811) I have a few comments on what you posted. - First your case barely converges also with upwind (residuals of the pressure are the highest (yellow line)). Reduce the tolerances on the linear solvers to something closer to your machine precision (10^-12 for p, 10^-10 for the rest: yes it will take more iterations, it does not matter). - Relax the turbulent quantities more than the velocity. Typically an URF = 0.4 works well. - As schemes, linearUpwindV for div(phi, U) and linearUpwind for the rest, with cellLimited modifier for gradients should work just fine. - Your mesh does not suffer of strong non-orthogonality, so I would not push the correctors too much (surely not to 8!). - Stay away from SFCD, QUICK, UMIST. They won't give you any significant advantage. All the love for QUICK comes from the fact that it is formally third-order accurate, but its dissipation error is still high, and its stability is not good. I hope this helps. Best,
First of all, thanks a lot for your suggestions. About the nonOrth correctors, the 8-option was only a trial to see if there is some significant dependence of such parameter in my case, but actually the residuals' graphs that you have seen are all referred to simulations with nonOrth correctors set to 3. About your other indications, If I understand properly from your previous posts the right setting in the fvSchemes dictionary should be:

div(phi, U) Gauss linearUpwindV cellMDLimited Gauss linear 1;
div(phi, k) Gauss linearUpwindV cellMDLimited Gauss linear 1;
div(phi, epsilon) Gauss linearUpwindV cellMDLimited Gauss linear 1;

am I right?
Apart from this, I'll try to follow your advices and then I'll let you know what happens.
Thank you once again

Regards

V.

PS-I'm sorry if I'm repetitive, but I'll be very glad if you can direct me to some more informations about the theoretical basis of the linearUpwind scheme in its bounded formulation

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