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

Explanation bounding k and bounding epsilon

Register Blogs Community New Posts Updated Threads Search

Like Tree33Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 26, 2010, 17:14
Default
  #21
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 26, 2010, 18:28
Default
  #22
Member
 
Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 16
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, 23:54
Default
  #23
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 27, 2010, 06:08
Default
  #24
Member
 
Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 16
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, 18:11
Default
  #25
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 27, 2010, 23:43
Default
  #26
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
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 28, 2010, 00:10
Default
  #27
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 28, 2010, 12:26
Default
  #28
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
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, 17:02
Default
  #29
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   May 29, 2010, 11:18
Default
  #30
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
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, 11:27
Default MRFSimpleFoam bounding k & epsilon
  #31
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 16
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, 17:10
Default
  #32
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   June 16, 2010, 05:01
Default
  #33
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 16
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, 11:48
Default
  #34
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   June 16, 2010, 13:15
Default
  #35
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 16
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, 13:33
Default MRF Divergence
  #36
Member
 
Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 16
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, 23 views)
File Type: txt fvSchemes.txt (1.8 KB, 131 views)
aldo.iannetti is offline   Reply With Quote

Old   June 20, 2010, 16:10
Default
  #37
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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 in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
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

Old   September 21, 2016, 05:31
Default
  #39
Member
 
annn
Join Date: Jun 2016
Posts: 40
Rep Power: 10
cleoo is on a distinguished road
Quote:
Originally Posted by Mo-ITB View Post
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.
So just to be clear,
for example say the bounding value for epsilon is 3 and the calculated was to be 2000, so the bounding epsilon would show up to be 1997? and so in the next iteratio they will use epsilons value as 3 instead of the calculated 2000?
cleoo is offline   Reply With Quote

Old   July 12, 2017, 09:59
Lightbulb accuracy of simpleFoam - bounding epsilon/k
  #40
rmz
New Member
 
rmz
Join Date: May 2017
Location: Paris
Posts: 12
Rep Power: 9
rmz is on a distinguished road
Hello,

I am working on a simulation of wind on buildings with a complex Mesh.
I am using a RASModel kEspilon with the simpleFoam solver.
I am applying ABL conditions (atmospheric boundary layer).

I am facing problems with bounding K and bounding epsilon.
the problem of bounding k and epsilon is caused by skew faces in my mesh.
I searched for schemes that can fix the problem, and found a modification that improved my simulation:
changing "laplacianSchemes" from "Gauss linear limited 1" to Gauss linear limited 0.333
changing "snGradSchemes" from "limited 1" to limited 0.333

simpleFoam ran for 800 steps before the "bounding k" / "bounding epsilon" warning appears.
the following is an output from the last steps of simpleFoam:

Quote:
Time = 2390

smoothSolver: Solving for Ux, Initial residual = 3.43286711522e-007, Final residual = 5.00656697633e-009, No Iterations 4
smoothSolver: Solving for Uy, Initial residual = 1.96835174901e-006, Final residual = 5.14760065778e-009, No Iterations 6
smoothSolver: Solving for Uz, Initial residual = 2.48971385257e-005, Final residual = 2.11086057017e-008, No Iterations 7
GAMG: Solving for p, Initial residual = 0.00550810426106, Final residual = 5.44662312053e-006, No Iterations 8
GAMG: Solving for p, Initial residual = 0.000618156877418, Final residual = 5.96389044258e-007, No Iterations 18
time step continuity errors : sum local = 3.24158762278e-010, global = -5.37971150415e-012, cumulative = 3.38998512783e-007
smoothSolver: Solving for epsilon, Initial residual = 9.37189059068e-008, Final residual = 3.66804560098e-011, No Iterations 6
bounding epsilon, min: 1.02539545302e-022 max: 2039304.52895 average: 383.995317993
smoothSolver: Solving for k, Initial residual = 8.19282585323e-007, Final residual = 5.03485913242e-010, No Iterations 10
bounding k, min: 3.00125902947e-016 max: 2992.53660103 average: 26.9353584992
ExecutionTime = 31197.191 s ClockTime = 31198 s
I am only interested in the results of p and U, and not interested in epsilon and k.
simpleFoam is stable and converging.

my question is:
-is simpleFoam converging to a correct solution (for p and U)?
-what is the accuracy of p and U results, does the bounding k and epsilon problem influence the results too much?

thank you
rmz is offline   Reply With Quote

Reply

Tags
bounding error, simplefoam stability


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
Bounding epsilon or bounding omega Stylianos OpenFOAM 8 February 23, 2018 14:41
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 16 March 4, 2017 09:30
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 09:48


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