CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

gradient schemes

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 2 Post By simt
  • 1 Post By RodriguezFatz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2013, 14:27
Default gradient schemes
  #1
New Member
 
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 13
callumso is on a distinguished road
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
callumso is offline   Reply With Quote

Old   October 11, 2013, 09:23
Post
  #2
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 18
Tushar@cfd is on a distinguished road
Quote:
Originally Posted by callumso View Post
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
Hello Callum,

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!
Tushar@cfd is offline   Reply With Quote

Old   October 12, 2013, 16:58
Default
  #3
New Member
 
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 13
callumso is on a distinguished road
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".
callumso is offline   Reply With Quote

Old   October 14, 2013, 07:04
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
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.
RodriguezFatz is offline   Reply With Quote

Old   October 14, 2013, 10:35
Default
  #5
Member
 
Join Date: Apr 2013
Posts: 32
Rep Power: 13
simt is on a distinguished road
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; )
Kummi and Gang Wang like this.
simt is offline   Reply With Quote

Old   October 14, 2013, 10:37
Default
  #6
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
?!?
But he said that everything else than upwind diverges...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 14, 2013, 20:42
Default
  #7
New Member
 
Jialin Su
Join Date: Mar 2013
Location: Loughborough
Posts: 29
Rep Power: 13
callumso is on a distinguished road
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 k-omega 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.
callumso is offline   Reply With Quote

Old   October 15, 2013, 04:47
Default
  #8
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Quote:
Originally Posted by callumso View Post
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.
That's what I was trying to say. But you were talking about pressure and there is no transport equation for pressure. So this argument doesn't hold for pressure.

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;
}
and

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;
}
1) Did you try to switch to higher order scheme as I suggested?
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...
Kummi likes this.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 13:52.