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 Tree11Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 26, 2010, 16:14
Default
  #21
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by Mo-ITB View Post
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
The gradient scheme is used only with some of the schemes, and OpenFOAM will return an error if the syntax is not appropriate for the scheme you are using.

The upwind schemes does not require anything:

div(phi, U) Gauss upwind;

The gradient scheme is used, for example, by the linearUpwind scheme:

div(phi, U) Gauss linearUpwind Gauss linear;

Quote:
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?
Depending on what you need to do, you can either use one of the bounded schemes between 0 and 1, if that's the range you need, or do as explained on the user's guide, using the prefix "limited" and specifying the range.

Best,
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   May 26, 2010, 17:28
Default
  #22
Member
 
Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 7
Mo-ITB is on a distinguished road
hi alberto,
thanks a lot for your reply.
i want to limit k and epsilon and dont know how to make that.

e.g. for k, would it work like that?

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

if not, could you give me an example?

thanks a lot,
Moritz
Mo-ITB is offline   Reply With Quote

Old   May 26, 2010, 22:54
Default
  #23
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by Mo-ITB View Post
hi alberto,
thanks a lot for your reply.
i want to limit k and epsilon and dont know how to make that.

e.g. for k, would it work like that?

div(phi, k) Gauss linearUpwind Gauss limitedLinear 1e-10 30;
Are their values actually limited between the bounds you specify? Meaning, is your model including that limitation? If yes, it is correct to use a limiter on the scheme to keep the quantity bounded whenever it goes out of those bounds due to numerical reasons.

If the equations do not include that physical limit, I would not use a limiter, but a bound, as done in the codes already.

The syntax, explained at page U-113 of the user's guide, is, for example:

div(phi, U) Gauss limitedVanLeer a b;

where a and b are the bounds of your range [a,b]. Schemes that support the limitation in this way are listed in the same page.

Best,
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   May 27, 2010, 05:08
Default
  #24
Member
 
Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 7
Mo-ITB is on a distinguished road
Quote:
Originally Posted by alberto View Post
Are their values actually limited between the bounds you specify? Meaning, is your model including that limitation? If yes, it is correct to use a limiter on the scheme to keep the quantity bounded whenever it goes out of those bounds due to numerical reasons.
I want to find out a drag coefficient with the LamBremhorst-model, and i have the problem that epsilon tends to explode without any obvious reason inside the volume mesh (not close to walls). So if i want to limit epsilon to a value between 1e-30 and 30, do i have to do that in both the divScheme and the laplacianScheme?

What i dont understand is, that in these Schemes you calculate divergence and divgrad, but not the scalar values themselves, so can you limit the values themselves there?



Quote:
Originally Posted by alberto View Post
If the equations do not include that physical limit, I would not use a limiter, but a bound, as done in the codes already.
Is it right, that the bounding limits the change of a value during one interation? That means in a few timesteps it can diverge although values are bounded?

Quote:
Originally Posted by alberto View Post
The syntax, explained at page U-113 of the user's guide, is, for example:

div(phi, U) Gauss limitedVanLeer a b;

where a and b are the bounds of your range [a,b]. Schemes that support the limitation in this way are listed in the same page.

Best,
in this example, would i limit the magnitude of the velocity?
what parameters have to be given, when you use e.g. limitedVanLeerV?

Thank you so much for your time!!
Mo-ITB is offline   Reply With Quote

Old   May 27, 2010, 17:11
Default
  #25
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by Mo-ITB View Post
I want to find out a drag coefficient with the LamBremhorst-model, and i have the problem that epsilon tends to explode without any obvious reason inside the volume mesh (not close to walls). So if i want to limit epsilon to a value between 1e-30 and 30, do i have to do that in both the divScheme and the laplacianScheme?
You clearly have a problem in the setup of your case if some variable tends to explode. Limiters to impose arbitrary ranges won't be of much help if you do not understand the reason why this is happening.

Let's try to understand what is the cause. What solver are you using, what turbulence model, and what boundary condition setup?

Best,
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   May 27, 2010, 22:43
Default
  #26
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 208
Rep Power: 9
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi Alberto, I have a similar problem with my case using kOmegaSST model. However, I ran many different but similar meshes of this external flow and they all converge. Only this case diverges on k. All the BCs and other parameters are identical.

Also, the case runs fine in laminar, although it doesn't converge...

Could my mesh be the only cause of the divergence?


Thanks,


-Louis
louisgag is offline   Reply With Quote

Old   May 27, 2010, 23:10
Default
  #27
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by louisgag View Post
Could my mesh be the only cause of the divergence?
Let me guess: is the mesh tetrahedral (maybe generated with Salomé)?

Please run checkMesh, and if you have very skewed cells and/or a high degree of non-orthogonality, yes, the mesh can be the reason of the problem.
In this case you can easily see where this happens by saving solutions right before the crash and looking for peaks of values in the diverging variables.

Best,
sharonyue likes this.
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   May 28, 2010, 11:26
Default
  #28
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 208
Rep Power: 9
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Hi Alberto,

it is a hexmesh, from snappyHexMesh. Yes, it does have skewed faces but those skewed faces didn't seem to create a problem on my other meshes (well at least the bound on k worked for those other meshes). Thanks for your advice, I will try to slightly modify my snappyHexMesh parameters to get a slightly different mesh!

Cheers,

-Louis
louisgag is offline   Reply With Quote

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

it is a hexmesh, from snappyHexMesh. Yes, it does have skewed faces but those skewed faces didn't seem to create a problem on my other meshes (well at least the bound on k worked for those other meshes). Thanks for your advice, I will try to slightly modify my snappyHexMesh parameters to get a slightly different mesh!
OK. If you used snappyHexMesh, it is probably easier to fix than in tet meshes. Check in particular around surfaces, because sometime snappy adds some very thin cell there

Best,
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   May 29, 2010, 10:18
Default
  #30
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Québec, QC, Canada
Posts: 208
Rep Power: 9
louisgag is on a distinguished road
Send a message via ICQ to louisgag
I got it to converge by modifying the mesh on the triSurface file.stl I gave to snappyHexMesh.. Not the best solution but works as a fix

Thx,

-Louis
sharonyue likes this.
louisgag is offline   Reply With Quote

Old   June 15, 2010, 10:27
Default MRFSimpleFoam bounding k & epsilon
  #31
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 7
aldo.iannetti is on a distinguished road
Hi Foamers,
I have a great problem using MRFSimpleFoam with OF 1.6.
I'm studing (fluent Vs OpenFOAM) a 3D fan (mesh imported from GAMBIT) using the k-epsilon model and upwind schemes for convective fluxes, the under relaxation factors are 0.3, 0.7, 0.5, 0.5 for pressure, velocity, k and epsilon.
After 5600 iterations my OF residuals are very low and the message "bounding epsilon..." is printed very few times but the solution is far from the one obtained by Fluent using UDS. Trying to relaunch OF case from the 5600th iteration I faced the k and epsilon diverging and I haven't changed settings. I'm struggling to know what's going wrong.Can you please help me?
Is there anybody who know about bugs in MRFSimpleFoam in OF 1.6?
How to let k-epsilon converge?
Thanks
Aldo
aldo.iannetti is offline   Reply With Quote

Old   June 15, 2010, 16:10
Default
  #32
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Hi,

we do not have enough details to answer.

P.S. Please, when you have a question, open a new thread. Thanks! :-)
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   June 16, 2010, 04:01
Default
  #33
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 7
aldo.iannetti is on a distinguished road
Quote:
Originally Posted by alberto View Post
Hi,

we do not have enough details to answer.

P.S. Please, when you have a question, open a new thread. Thanks! :-)

Resume:

MRFSimpleFoam 1st order upwind-> convergence of u, p, k, epsilon untill 5800 iterations-> stop and restart-> residuals step-up (3 order) and divergence of k and epsilon (under zero) without any change in settings (I thought to get crazy but it's true).

MRFSimpleFoam 2nd order upwind-> divergence of k and epsilon (under zero), It seem there is not the possibility using other discretization schemes.

How to set up a 2nd order disc. scheme without any problem?
Is there anybody who know have tested MRFSimpleFoam comparing it to fluent? How arethe resulting fields?

Thanks
aldo
aldo.iannetti is offline   Reply With Quote

Old   June 16, 2010, 10:48
Default
  #34
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by aldo.iannetti View Post
MRFSimpleFoam 2nd order upwind-> divergence of k and epsilon (under zero), It seem there is not the possibility using other discretization schemes.

How to set up a 2nd order disc. scheme without any problem?
Is there anybody who know have tested MRFSimpleFoam comparing it to fluent? How arethe resulting fields?
How did you set a "second order upwind" scheme in OpenFOAM?

You might want to try
  • For gradients: cellLimited Gauss linear 1;
  • For divergence: Gauss linearUpwind cellLimited Gauss linear 1; (use linearUpwindV for div(phi,U) and other vector fields, with cellMDLimited).
  • Limit also laplacians and surface normal gradients.
P.S. What k-epsilon are you using, and what boundary conditions did you specify?
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   June 16, 2010, 12:15
Default
  #35
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 7
aldo.iannetti is on a distinguished road
Quote:
Originally Posted by alberto View Post
How did you set a "second order upwind" scheme in OpenFOAM?

You might want to try
  • For gradients: cellLimited Gauss linear 1;
  • For divergence: Gauss linearUpwind cellLimited Gauss linear 1; (use linearUpwindV for div(phi,U) and other vector fields, with cellMDLimited).
  • Limit also laplacians and surface normal gradients.
P.S. What k-epsilon are you using, and what boundary conditions did you specify?
K-epsilon standard, zerogradient on the outlet/inlet where the pressure is fixed to zero.

Sorry, I'm quite new in OF, can you please correct my fvSchemes dict (expecially the laplacian schemes)?
__________________________________________________ ______

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default cellLimited Gauss linear 1;
grad(p) cellLimited Gauss linear 1;
grad(U) cellLimited Gauss linear 1;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwindV cellMDLimited Gauss linear 1;
div(phi,k) Gauss linearUpwind cellLimited Gauss linear 1;
div(phi,epsilon) Gauss linearUpwind cellLimited Gauss linear 1;
div((nuEff*dev(grad(U).T()))) Gauss linearUpwind cellLimited Gauss linear 1;//Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}
__________________________________________________ ___


Thanks
aldo.iannetti is offline   Reply With Quote

Old   June 19, 2010, 12:33
Default MRF Divergence
  #36
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 7
aldo.iannetti is on a distinguished road
Hi Alberto,
I tried to follow your advices but It diverges after 4000 iter. and I don't understand why, can you please have a look at the attached log and fvSchemes files in order to correct my mistakes?
Thanks
Aldo
Attached Files
File Type: zip log.zip (47.1 KB, 16 views)
File Type: txt fvSchemes.txt (1.8 KB, 91 views)
aldo.iannetti is offline   Reply With Quote

Old   June 20, 2010, 15:10
Default
  #37
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
alberto will become famous soon enoughalberto will become famous soon enough
Are there zones of the system where you can observe some unphysical behaviour (velocity too high, for example?
Additionally, what under-relaxation factors are you using? Did you try to reduce them for k and epsilon?

P.S. You wrote you use OpenFOAM 1.6. Did you update it to 1.6.x?

Best,
__________________
Alberto Passalacqua

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.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   February 5, 2014, 13:01
Question How can I bound own Scalar value in equations?
  #38
New Member
 
Mahdi
Join Date: Jul 2013
Posts: 1
Rep Power: 0
manijm is on a distinguished road
Thanks all for information about bounded schemes
I need a method to bound own volScalarField that is solved in an equation has div , laplacian ,...

for example C1 in the concentration equation must be between [0,1]
anybody can tell me how can i add this limiter to the equation and force C1 to be in [0,1]?
thank you.
manijm 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 15: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 03:11
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 21: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 10:36.