CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Explanation bounding k and bounding epsilon

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

Like Tree9Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 19, 2010, 05:05
Default Explanation bounding k and bounding epsilon
  #1
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 7
idrama is on a distinguished road
Hey Foamers,

I have no idea what is bounding k and bounding epsilon supposed to mean. Can anybody explaing, please? Druing my simulation I am getting such messages with even negative values.

Cheers in advance
idrama is offline   Reply With Quote

Old   May 19, 2010, 06:06
Default
  #2
Member
 
Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 6
Mo-ITB is on a distinguished road
Hi Claus,

as i understood it, bounding means, that the actual calculated values are limited not to get too huge. bounding then should mean that the calculated value was the bounded amount higher than it is being used for the next iteration/timestep.
hope this is right, if not please anyone correct me .

bye,
mo
Mo-ITB is offline   Reply With Quote

Old   May 20, 2010, 02:21
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Quote:
Originally Posted by Mo-ITB View Post
Hi Claus,

as i understood it, bounding means, that the actual calculated values are limited not to get too huge. bounding then should mean that the calculated value was the bounded amount higher than it is being used for the next iteration/timestep.
hope this is right, if not please anyone correct me .
Bound the given scalar field if it has gone unbounded below a lower bound.

Having really large values for k/epsilon may not be great, but avoiding divide-by-zero is the real issue:
Code:
// source in k or epsilon equations have this:
rho_*epsilon_/k_

// mut calculation has this:
rho_*Cmu_*sqr(k_)/epsilon_
In any case, avoiding zero or near zero values for k/epsilon is required, which is what bound() does.

The source code is found under src/finiteVolume/cfdTools/general/bound/bound.C
olesen is offline   Reply With Quote

Old   May 21, 2010, 01:33
Default
  #4
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 7
idrama is on a distinguished road
Thanks for your replies!

When the minimum bound value for k is e.g. -136 do I have to worry about something? I think the value should never fall below 0.

Cheers
idrama is offline   Reply With Quote

Old   May 21, 2010, 02:27
Default
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 774
Rep Power: 17
olesen will become famous soon enough
Quote:
Originally Posted by idrama View Post
Thanks for your replies!

When the minimum bound value for k is e.g. -136 do I have to worry about something? I think the value should never fall below 0.
The k/epsilon are bounded with SMALL (1e-15 for double) so that will stop the divide-by-zero issues. If your problem always produces negative values throughout the solution, it could indicate that something else needs attention - eg, system needs more relaxation or something.
wangjl likes this.
olesen is offline   Reply With Quote

Old   May 21, 2010, 03:17
Default
  #6
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 7
idrama is on a distinguished road
It was obvious to me that something is wrong! Okay, I used Gauss linear for all convection terms, because I wanted to keep accuracy as best as possible. I changed to limitedLinear(V) 1; know the negative min values increases toward to zero and, eventually, they vanished.

Cheers
idrama is offline   Reply With Quote

Old   May 21, 2010, 03:33
Default
  #7
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 7
idrama is on a distinguished road
Now, there is no occurrence of bounding k or epsilon anymore. However, it crossed my mind: can I use a better scheme instead of limitedLinear 1 for the approximation of epsilon and k, respectively?
idrama is offline   Reply With Quote

Old   May 22, 2010, 03:46
Default
  #8
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 6
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
To explain your problem, we need to look at the boundness of the differencing scheme of the convection term. Upwind differencing scheme usually gives bounded results, but introduces a numerical diffusion which is not good for the accuracy. However, the second-order central differencing scheme, i.e. Gauss linear, does not assure the boundness of the result. That is why you got a unbounded result in your earlier calculation.

The limitedLinear scheme you are using now is a blended one of the upwind and central differencing, I guess. (I am now considering the same problem to increase the accuracy of the calculation) So you can obtain a bounded result with it. The limitedLinear scheme may have a accuracy between first and second order???

I am looking forward to a discussion about this.

Thanks for reading.
wangjl likes this.
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   May 24, 2010, 08:10
Default
  #9
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 7
idrama is on a distinguished road
Hallo JinBiao!

Actually, I am not really sure about the usage of lmitedLinear 1; I spotted it in a tutorial. Basically, I tend to use schemes which are both of high order and bounded. However, as we both know there a no higher order bounded schemes, therefore, I would like to know which schemes gives the best results? Which e.g. TVD scheme would you prefere? I simulation two-phase flows (water-air) through bendend pipe with a maximal velocity of 9.6 m/s. Additionally, in this pipes there holes where the water can flow out.

Cheers in advance
idrama is offline   Reply With Quote

Old   May 24, 2010, 21:57
Default
  #10
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 6
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
Hi there,

I was also struggling to find out a scheme for the convection term. But now I think no method will solve all the problems. One solution will be refining your mesh at the location where you are expecting a peak value or a large gradient. It improves the boundness of the result, I think. The reason is, from my understanding, that the face value is more inclined to fall into the range between the value of the two neighbor points, if your mesh is refined.

The scheme I am now using is SFCD and QUICK. I am not sure it is good for you. I have no experience with two phase flow simulation, so I cannot provide more information.

Good luck.
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   May 25, 2010, 02:51
Default
  #11
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Hello,

just a quick clarification. The limitedLinear scheme is the linear scheme with a limiter (if I remember correctly, it uses Sweby's limiter). It's not a blended version of the "linear" scheme and the "upwind" scheme, which would be "linearUpwind" in OpenFOAM. So limitedLinear is a TVD scheme (take a look at ../OpenFOAM-1.6.x/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/limitedLinear), as also written in the user's guide.

Quote:
Originally Posted by idrama View Post
Actually, I am not really sure about the usage of lmitedLinear 1; I spotted it in a tutorial. Basically, I tend to use schemes which are both of high order and bounded.

However, as we both know there a no higher order bounded schemes, therefore, I would like to know which schemes gives the best results?
What schemes do you usually like to use?

For your application, you can either use the default works fine. You can try linearUpwind / linearUpwindV with the cellLimited option to have what many would call "second order upwind".

Best,
sharonyue likes this.
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   May 25, 2010, 02:55
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by JinBiao View Post
The scheme I am now using is SFCD and QUICK. I am not sure it is good for you. I have no experience with two phase flow simulation, so I cannot provide more information.
Do you notice significant improvements compared to limitedLinear or linearUpwind with these schemes?

In my experience, QUICK doesn't offer any particular advantage (it's either second or first order on general grids, more diffusive than limitedLinear).

Best,
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   May 25, 2010, 03:39
Default
  #13
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 6
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
In my case, QUICK converges better than TVD and NVA schemes. I am not quite sure about the reason. One of the explanations can be NVA and TVD has artificial switch which cause non-smooth change of the coefficient matrix.

This can be particular in my case because I am simulating a backward-facing step flow. There is large gradient at the edge of the step.

Regards,
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   May 25, 2010, 11:38
Default
  #14
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Interesting, because QUICK is known to have some trouble due to the possibility of having coefficients that change sign.

Did you try to estimate the influence of the numerical diffusion (QUICK is quite diffusive for what I know). This could explain the improved stability.
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   May 25, 2010, 21:50
Default
  #15
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 6
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
Hi Alberto,

Up to now, I have not analysed the numerical diffusion because it is difficult to find out a scheme to compare with. I think an ideal counterpart for comparison should be CDS, with which it is hard to obtain the bounded result. Also, I think TVD schemes, such as limitedLinear, have a better boundness because they introduce numerical diffusion. So it does not make sense to compare with them.

It is also good to know there are some defects in QUICK. I will be more careful when I am using it. I also tried to find some comments on QUICK in the textbooks. Mainly, people think QUICK has about the same accuracy with CDS because the integration on the surface is usually second-order in accuracy.

I have another question about TVD schemes. Does the prefix "limited" mean that Sweby's limit function is applied to the scheme indicated by the second half of the name. For example, limitedLinear is a limited CDS scheme?

Thanks for your discussion.

Regards,
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   May 26, 2010, 00:11
Default
  #16
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by JinBiao View Post
Hi Alberto,

Up to now, I have not analysed the numerical diffusion because it is difficult to find out a scheme to compare with. I think an ideal counterpart for comparison should be CDS, with which it is hard to obtain the bounded result. Also, I think TVD schemes, such as limitedLinear, have a better boundness because they introduce numerical diffusion. So it does not make sense to compare with them.
Correct. However also upwinded schemes (QUICK, for instance) are diffusive by nature ;-)

To compare with CDS you don't have to run a huge practical case. Just compare in a realistic but small test case, where you don't have problems to use the appropriate discretization. After all it's not so hard to obtain a solution with CDS, being it one of the schemes used in LES due to its central nature (=> no dissipation)

Quote:
It is also good to know there are some defects in QUICK. I will be more careful when I am using it. I also tried to find some comments on QUICK in the textbooks. Mainly, people think QUICK has about the same accuracy with CDS because the integration on the surface is usually second-order in accuracy.
I know a lot of people uses QUICK, also for LES, claiming it is "proven to give good results". In practice, if you analyze the dissipative error, you notice that it is significant, meaning the scheme is quite diffusive.
QUICK might have the same formal order of accuracy (not always), but CDS have zero dissipation error (only the dispersion error is present in central schemes).

Quote:
I have another question about TVD schemes. Does the prefix "limited" mean that Sweby's limit function is applied to the scheme indicated by the second half of the name. For example, limitedLinear is a limited CDS scheme?
Yes, limitedLinear is a limited CDS, as the name says. It's not a blend of upwind and linear.

About the implementation of the limiter, OF allows the implementation of generic limiter functions, so take a look at

~/OpenFOAM/OpenFOAM-1.6.x/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes

where you find the implementation of the abstract limited class and of the schemes.

Best,
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   May 26, 2010, 02:53
Default
  #17
Senior Member
 
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 7
idrama is on a distinguished road
Hallo alberto!

Actually, I really like to use central differencing, but I am facing ocillations when I am using it. Therefore, I used linearLimited(V) 1 successfully, however, there sill a question: Is there yet a better scheme?

Since limiters switches between UD and CD, I would like to use a limiter which switches in that moment to UD when it is really necessary. As far as I understand, the limiter switches depending on "r" and I think that limiters switches often to early. Is this correct?

Cheers

Claus
idrama is offline   Reply With Quote

Old   May 26, 2010, 03:00
Default
  #18
Member
 
Jinbiao Xiong
Join Date: Oct 2009
Location: China/Japan
Posts: 50
Rep Power: 6
JinBiao is on a distinguished road
Send a message via MSN to JinBiao
Thanks a lot for your patient explanation.

I am sorry but I really got confused about the words, diffusion, dispersion and dissipation.

I have not read the code quite in detail. It just come out in my mind that the limit function introduces nonlinearity which can be the reason for poor convergence of TVD scheme. How do you think?

But I still think the limitedLinear scheme falls into the blend of upwind and linear. Please see Hrvoje's doctor thesis page 98 eq.(3.66). The limit function performs as the blend factor. However, the blend factor goes larger than one, according to Sweby's constraint.

Thanks.
__________________
Jinbiao
JinBiao is offline   Reply With Quote

Old   May 26, 2010, 09:59
Default
  #19
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by JinBiao View Post
I am sorry but I really got confused about the words, diffusion, dispersion and dissipation.
It's bit technical to explain in detail, so please refer to the literature. In short, the terms dissipation error/diffusion are used with to indicate the same thing, meaning the numerical diffusion/viscosity added by the scheme. This error is due to the presence of non-zero imaginary part in the modified wavenumber. The real part of the wavenumber is responsible of what is called dispersion error. Upwinded schemes are affected by both, while central schemes are only affected by the dispersion error.

Quote:
But I still think the limitedLinear scheme falls into the blend of upwind and linear. Please see Hrvoje's doctor thesis page 98 eq.(3.66). The limit function performs as the blend factor. However, the blend factor goes larger than one, according to Sweby's constraint.
As far as I remember, the limitedLinear scheme was introduced in OpenFOAM later, and Hrv worked on the Gamma scheme (NVD).

Best,
__________________
Alberto

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   May 26, 2010, 13:02
Default
  #20
Member
 
Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 6
Mo-ITB is on a distinguished road
Hi Foamers,

as i also try to tune the solvers in the fvSchemes at the moment, i'd be great if you might answer if i the system works like this:

in the divSchemes dictionary i defined like that:

div(phi,U) Gauss upwind Gauss limitedLinear 0.7;

is it right that is is defined like that:

Gauss <interpolationScheme>
Gauss upwind <gradScheme>
Gauss upwind Gauss <interpolationScheme>
Gauss upwind Gauss limitedLinear 0.5


<interpolationScheme>
-> upwind <gradScheme>

<gradScheme>
-> Gauss <interpolationScheme>
<interpolationScheme>
-> limitedLinear 0.5



Another question: how can scalars be strictly bounded? As i understood the manual, the specific interpolation schemes are not defined in the interpolationSchemes dictionary, but in the divSchemes dictionary.
I dont understand how to limit scalar values, when divergence is calculated.
Would it maybe work like hits?

div(phi,k) Gauss limitedLinear Gauss linear 1e-10 30;

All the best,
Moritz
Mo-ITB is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 13 November 4, 2013 14:13
Bounding epsilon or bounding omega Stylianos OpenFOAM 5 June 9, 2011 00:40
MRFSimpleFOAM goes divergenced! renyun0511 OpenFOAM Running, Solving & CFD 0 November 19, 2009 02:11
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 20:21
Bounding epsilon and K with rasInterFoam openfoam_user OpenFOAM Running, Solving & CFD 0 October 23, 2008 08:48


All times are GMT -4. The time now is 01:00.