CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to implement power law or hybrid schemes?? (https://www.cfd-online.com/Forums/openfoam-programming-development/88078-how-implement-power-law-hybrid-schemes.html)

 kamkari May 7, 2011 17:43

How to implement power law or hybrid schemes??

Hi every body
I am going to model a flow field in an enclosure by using power law scheme or hybrid scheme.
But in fvScheme I couldn’t find any of these schemes.
As far as I seen in openFoam solvers the most used scheme for divergence discritization are upwind scheme and linear scheme (also TVD, vanleer …). But these two schemes have some defects.
Upwind scheme: this scheme impose artificial dispersion (false diffusion) which Leeds to unrealistic solution.
Linear scheme (central differencing): causes oscillating answer for high Reynolds numbers and unrealistic solution.
Using power law scheme could overcome these infections.
Does anyone know how these schemes could be implemented?
Thanks for consideration

 elvis May 8, 2011 07:09

Hi,

http://openfoam-extend.svn.sourcefor.../viscoelastic/

http://openfoam-extend.svn.sourcefor...coelasticLaws/

http://openfoam-extend.svn.sourcefor...oelasticModel/

hope this goes in the direction you are looking for.

 kamkari May 8, 2011 10:07

Hi Elvis
I think I couldn’t convey my problem clearly. Power law scheme is not related to viscoelastic modeling. It is on the most famous way for discretizing the convective terms in momentum equation (like second order upwind, central, quick, ...) . It is also one of the special options in Fluent software for discretizing the equations. I couldn’t find this scheme as one of the standard scheme in fvscheme file.
May be it exist in openFoam library with another name!!!!

 deepsterblue May 8, 2011 11:40

Could you point to a published manuscript that describes the scheme? Does it belong to the TVD/NVD family?

Edit: Never mind. Found the sources in Fluent's User Guide. This looks like a relatively straightforward implementation. Derive a class from upwind, compute the local Peclet number, and assign phi_f on a face-by-face basis. The scheme is still first-order, so I'm not sure if there's any real accuracy benefit to this, besides stability.

 kamkari May 8, 2011 12:13

Following link is Fluent user guide which explain discretization schemes including power law

http://my.fit.edu/itresources/manual...ug/node992.htm

 kamkari May 8, 2011 15:03

May be it is better to ask which divergence scheme is closer to power law discrertization scheme.
Power law scheme is stable and doesn’t impose false diffusion to the solution. So it can lead to accurate results for convective terms in momentum equation.

 arjun May 8, 2011 17:34

Quote:
 Originally Posted by kamkari (Post 306700) May be it is better to ask which divergence scheme is closer to power law discrertization scheme. Power law scheme is stable and doesn’t impose false diffusion to the solution. So it can lead to accurate results for convective terms in momentum equation.

This is true only in 1D. Why? Because powerlaw scheme has basis on exact solution of transport equation in 1D. In 2D and 3D though, it loses its shine. Still I am big fan of hybrid schemes, they are much better than upwind type schemes.

 kamkari May 8, 2011 23:51

Hi Arjun
What kind of div scheme do you recommend for applying hybrid scheme? Having both acuurecy and minimum diffusion

 arjun May 9, 2011 00:02

Quote:
 Originally Posted by kamkari (Post 306725) Hi Arjun Thank you for your reply, What kind of div scheme do you recommend for applying hybrid scheme? Having both acuurecy and minimum diffusion Thank you in advance

if you have access to Patankar's book, I think he explains how to impliment powerlaw and hybrid schemes.

He also wrote about how and why one should prefer hybrid schemes over other schemes. That is an interesting read.

 benk May 9, 2011 09:09

I'm also interested in knowing how to implement power law/hybrid schemes, since these are the schemes that I've studied before and are well documented in CFD books. A good summary of these schemes is available in the book Versteeg and Malalasekera (An intro to computational fluid dynamics), chapter 5. QUICK is documented in Versteeg (and available in openFOAM) but they say that it may not be stable in certain circumstances.

When I first started to use openFOAM I was surprised not to see these schemes as options, but I also saw schemes that I didn't recognize so I figured that they might be implemented in other ways via blending in some way...still not sure.

 mirko May 9, 2011 10:29

Quote:
 Originally Posted by kamkari (Post 306636) Hi every body I am going to model a flow field in an enclosure by using power law scheme or hybrid scheme. But in fvScheme I couldn’t find any of these schemes. As far as I seen in openFoam solvers the most used scheme for divergence discritization are upwind scheme and linear scheme (also TVD, vanleer …). But these two schemes have some defects. Upwind scheme: this scheme impose artificial dispersion (false diffusion) which Leeds to unrealistic solution. Linear scheme (central differencing): causes oscillating answer for high Reynolds numbers and unrealistic solution. Using power law scheme could overcome these infections. Does anyone know how these schemes could be implemented? Thanks for consideration
When I was starting out in this field, Patankar's book was also my first reference, and my first code used the hybrid/power-law scheme.

In my second reference, much to my surprise, Ferziger and Peric strongly discourage its use (Computational Methods for Fluid Dynamics p. 64). I learned a lot from reading articles by Prof. Brian Leonard. For example, see (sorry about fonts -- cutting and pasting issues)
Why you should not use ‘Hybrid’, ‘Power-Law’ or related exponential schemes for convective modelling—there are much better alternatives

International Journal for Numerical Methods in Fluids

Special Issue: Numerical Methods for Thermal Problems
Volume 20, Issue 6, pages 421–442, 30 March 1995

As others have mentioned, the power-law/hybrid scheme is good for sourceless 1D convection-diffusion problems.

Once you add sources and move to 2D, you are better off using other methods. Here I defer to others to suggest them.

One of Fluent's basic tutorials (if you have access to it) demonstrates it quite nicely: fluid flow in an bend with a hot fluid added at a second point in the bend. The hybrid solution diffuses the added fluid much more than a second order scheme does.

Mirko

 amin_jalalian September 30, 2015 14:09

Quote:
 Originally Posted by kamkari (Post 306725) Hi Arjun Thank you for your reply, What kind of div scheme do you recommend for applying hybrid scheme? Having both acuurecy and minimum diffusion Thank you in advance
Hi
see this
http://cfd.direct/openfoam/user-guid...s/#x20-1100276

 arjun September 30, 2015 14:23

Quote:
 Originally Posted by mirko (Post 306825) In my second reference, much to my surprise, Ferziger and Peric strongly discourage its use (Computational Methods for Fluid Dynamics p. 64)
The reason is that these schemes are derived from 1d solution and thus does not go well in 2d andf three d.

 alimea January 13, 2018 07:35

Quote:
 Originally Posted by arjun (Post 306707) This is true only in 1D. Why? Because powerlaw scheme has basis on exact solution of transport equation in 1D. In 2D and 3D though, it loses its shine. Still I am big fan of hybrid schemes, they are much better than upwind type schemes.
Hi arjun
I agree with you that "hybrid" is the best choice for div terms. but why isn't there hybrid scheme in openfoam?
if it is available what is the name of that?
my foam is 2.3.1. is it in new versions? what should I do for download and install it?

I heared that limitedLinear is hybrid! is it correct? if it is correct, there is a problem here: it has limiter and I don't want to use limiter! because it dissipates a lot.

thanks

 All times are GMT -4. The time now is 20:34.