
[Sponsors] 
October 2, 2013, 13:27 
gradient schemes

#1 
New Member
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 5 
Hi dear Foamers,
I have been fiddling with different gradient schemes for my simulations. I used the following settings without problems: grad(p) Gauss linear; grad(p) Gauss upwind phi; My simulations only run with the following setting: grad(p) cellLimited Gauss upwind phi 1.0; I am concerned about the "upwind" scheme which I think would be very diffusive. As far as I understand, the interpolation scheme can be any scheme that calculates the face value from the cell values. Therefore I tried to experiment with the TVD interpolation schemes like grad(p) Gauss vanLeer01 phi; But this option doesn't work as the code runs into segmentation fault. I also tried some other schemes as well as linearUpwind. But just don't work. I have difficulty sussing out what parameters are needed from the code. Could anyone explain a bit how this gradient scheme can be set? Thanks in advance. Callum 

October 11, 2013, 08:23 

#2  
Senior Member
Tushar Chourushi
Join Date: Jul 2009
Location: IITIndore, India
Posts: 319
Blog Entries: 1
Rep Power: 10 
Quote:
What do you mean by "p"? Is it the pressure? If it is pressure then for finite volume method, I guess we have pressure at nodal grid points and for that different interpolation schemes (gradient schemes) will be applied you can refer some of these on Internet. Best Luck! 

October 12, 2013, 15:58 

#3 
New Member
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 5 
Hi yeah, yup "p" means pressure here. But I am just asking a general question, it can be any other variables.
According to the OpenFOAM documentations, it should be an interpolation scheme after "Gauss". So I just suppose I can use a TVD scheme to obtain the surface value for integration in the Gauss reconstruction method. BUt it seems it doesn't work in this way. To be honest, I haven't looked into what limiting method is used for "cellLimited" or "faceLimited". 

October 14, 2013, 06:04 

#4 
Senior Member
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,296
Rep Power: 19 
Callumso, this can also be a matter of initialization. Did you try to run the code with "upwind" for some iterations (let's say 500) and then switch the scheme?
Also: I am not sure if this "upwind=dissipation" holds for anything else than the velocity. If you set div(phi,U) to upwind, it will result in additional diffusion by the numerical error. But "p"? Can you (mathematically) see, that a first order pressure gradient has the form of the diffusion of "U"?
__________________
The skeleton ran out of shampoo in the shower. 

October 14, 2013, 09:35 

#5 
Member
Join Date: Apr 2013
Posts: 32
Rep Power: 5 
grad(p) is not a convection term and central differencing ( Gauss linear; ) can and should be used.
For grad(U) a limiter should be applied ( cellLimited Gauss linear 1; ) 

October 14, 2013, 09:37 

#6 
Senior Member
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,296
Rep Power: 19 
?!?
But he said that everything else than upwind diverges...
__________________
The skeleton ran out of shampoo in the shower. 

October 14, 2013, 19:42 

#7 
New Member
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 5 
Thank you all for the replies. But sorry for the misleading question.
My problem is actually with the turbulence equations instead of p or U. I have to use upwind and cell limited for grad(k) and grad(omega) and these appear in some explicit source terms in the komega SST models. I also need to use upwind convective schemes for k and omega equations now. Otherwise k and omega just blow up quickly. For Rodriguez: indeed when first order upwind is used, it will always be diffusive, no matter what variable it is. This can be easily shown by expanding the terms into power series and the second derivative term will appear which leads to diffusivity. When central scheme is used, the second derivative is cancelled out, but the third derivative persists which leads to dispersion, not too much a concern to me, though. For Smit: yes, I always use Gauss linear for grad(p). But I also use Gauss linear for grad(U). My p and U equations are alright. Just the k and omega equations have problems. It seems commercial packages like FLUENT tend to use first order upwind schemes for the turbulence equations. My research needs to capture the k more accurately than a usual case. URANS instead of LES is currently used to reduce the computational cost. That's why I try to keep the k equation as less dissipative as possible. The question about grad() is just a general one, and more about understanding of the code instead of the numerical method itself. 

October 15, 2013, 03:47 

#8  
Senior Member
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,296
Rep Power: 19 
Quote:
Try Code:
gradSchemes { default none; grad(p) faceMDLimited edgeCellsLeastSquares 1; grad(U) faceMDLimited edgeCellsLeastSquares 1; grad(omega) faceLimited edgeCellsLeastSquares 1; grad(k) faceLimited edgeCellsLeastSquares 1; } Code:
divSchemes { default none; div(phi,U) bounded Gauss linear; div(phi,k) bounded Gauss linearUpwind grad(k); div(phi,omega) bounded Gauss linearUpwind grad(omega); div((nuEff*dev(T(grad(U))))) Gauss linear; } 2) Do you have lowRe or highRe boundary conditions? What do you use for boundary conditions? 3) Fluent... you can choose the div scheme for the turbulent variables, but normaly only up to linear upwind ("2nd order upwind"). But for me it looks like Fluent uses limiters at every possible place. At least I can get convergence in OpenFoam with the same grids only when I set limiters everywhere...
__________________
The skeleton ran out of shampoo in the shower. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
discretization schemes for Gradient  rayan24  Fluent UDF and Scheme Programming  1  September 26, 2013 10:07 
Gradient schemes and backward second order time scheme  callumso  OpenFOAM Running, Solving & CFD  2  August 13, 2013 22:52 
vortex cause pressure gradient or pressure gradient induce vortex?  fruitkiwi  Main CFD Forum  4  June 12, 2012 01:12 
Errno 24 linux  ivanwhlau  OpenFOAM Running, Solving & CFD  6  July 1, 2009 10:16 
Gradient Estimation for Higher Order Schemes  jianxia  Main CFD Forum  0  June 6, 2000 19:40 