# Explanation bounding k and bounding epsilon

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

May 26, 2010, 16:14
#21
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27
Quote:
 Originally Posted by Mo-ITB 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 Gauss upwind Gauss upwind Gauss 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.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

 May 26, 2010, 17:28 #22 Member   Moritz Wied Join Date: Mar 2010 Location: suttgart, germany Posts: 35 Rep Power: 8 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

May 26, 2010, 22:54
#23
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27
Quote:
 Originally Posted by Mo-ITB 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.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

May 27, 2010, 05:08
#24
Member

Moritz Wied
Join Date: Mar 2010
Location: suttgart, germany
Posts: 35
Rep Power: 8
Quote:
 Originally Posted by alberto 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 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 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!!

May 27, 2010, 17:11
#25
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27
Quote:
 Originally Posted by Mo-ITB 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.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

 May 27, 2010, 22:43 #26 Senior Member     Louis Gagnon Join Date: Mar 2009 Location: Québec, QC, Canada Posts: 226 Rep Power: 10 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

May 27, 2010, 23:10
#27
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27
Quote:
 Originally Posted by louisgag 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,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

 May 28, 2010, 11:26 #28 Senior Member     Louis Gagnon Join Date: Mar 2009 Location: Québec, QC, Canada Posts: 226 Rep Power: 10 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

May 28, 2010, 16:02
#29
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27
Quote:
 Originally Posted by 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!
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.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

 May 29, 2010, 10:18 #30 Senior Member     Louis Gagnon Join Date: Mar 2009 Location: Québec, QC, Canada Posts: 226 Rep Power: 10 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.

 June 15, 2010, 10:27 MRFSimpleFoam bounding k & epsilon #31 Member   Aldo Iannetti Join Date: Feb 2010 Posts: 48 Rep Power: 8 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

 June 15, 2010, 16:10 #32 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,910 Rep Power: 27 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. OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using.

June 16, 2010, 04:01
#33
Member

Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 8
Quote:
 Originally Posted by alberto 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

June 16, 2010, 10:48
#34
Senior Member

Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 27
Quote:
 Originally Posted by aldo.iannetti 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.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.

June 16, 2010, 12:15
#35
Member

Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 8
Quote:
 Originally Posted by alberto 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 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;
}

{
default corrected;
}

fluxRequired
{
default no;
p ;
}
__________________________________________________ ___

Thanks

June 19, 2010, 12:33
MRF Divergence
#36
Member

Aldo Iannetti
Join Date: Feb 2010
Posts: 48
Rep Power: 8
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
 log.zip (47.1 KB, 18 views) fvSchemes.txt (1.8 KB, 107 views)

 June 20, 2010, 15:10 #37 Senior Member   Alberto Passalacqua Join Date: Mar 2009 Location: Ames, Iowa, United States Posts: 1,910 Rep Power: 27 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. OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using.

 February 5, 2014, 13:01 How can I bound own Scalar value in equations? #38 New Member   Mahdi Join Date: Jul 2013 Posts: 1 Rep Power: 0 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.

September 21, 2016, 04:31
#39
Member

annn
Join Date: Jun 2016
Posts: 39
Rep Power: 2
Quote:
 Originally Posted by Mo-ITB 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?

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Stylianos OpenFOAM 6 September 21, 2016 04:52 nedved OpenFOAM Running, Solving & CFD 13 November 4, 2013 15:13 renyun0511 OpenFOAM Running, Solving & CFD 0 November 19, 2009 03:11 nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 21:21 openfoam_user OpenFOAM Running, Solving & CFD 0 October 23, 2008 08:48

All times are GMT -4. The time now is 15:30.