CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   limitation of k and epsilon (https://www.cfd-online.com/Forums/openfoam/81793-limitation-k-epsilon.html)

 mrshb4 November 7, 2010 02:20

limitation of k and epsilon

Dear Foamers
I'm modeling a centrifugal fan with MRFSimpleFoam and kEpsilon model, and I want to limit k and epsilon between 1e-10 and 30. How can I do that. I read userGuide and so I managed below fvSchemes dictionary, but it didn't work. How can I do that?!
Anybody knows?!!!!

ddtSchemes
{
}

{
default cellLimited Gauss linear 1;
//grad(k) Gauss limitedVanLeer phi 1e-10 30;
//grad(epsilon) Gauss limitedVanLeer phi 1e-10 30;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwindV cellMDLimited Gauss linear 1;
//div(phi,k) Gauss upwind phi;
div(phi,k) Gauss limitedVanLeer 1e-10 30;
//div(phi,k) Gauss linearUpwind cellLimited Gauss linear 1;
//div(phi,epsilon) Gauss upwind phi;
div(phi,epsilon) Gauss limitedVanLeer 1e-10 30;
//div(phi,epsilon) Gauss linearUpwind cellLimited Gauss linear 1;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss upwind phi limited 1;
laplacian((1|A(U)),p) Gauss upwind phi limited 1;
laplacian(DkEff,k) Gauss limitedVanLeer phi 1e-10 30 limited 1;
laplacian(DepsilonEff,epsilon) Gauss limitedVanLeer phi 1e-10 30 limited 1;
}

interpolationSchemes
{
default upwind phi;
interpolate(epsilon) limitedLinear 1e-10 30;
interpolate(k) limitedLinear 1e-10 30;
}

{
default bounded;
}

fluxRequired
{
default no;
p ;
}
// ************************************************** *********************** //

Best regards

 nimasam November 7, 2010 08:28

i dont know any way from Dic u can limit ur k or e
but in source code you can add something like that:
k =min(max(k,scalar(0)),scalar(30))

 mrshb4 November 7, 2010 08:58

min-max

Dear Nima
I will test it. The only question here is I should write for term k like this?

k=max(k,scalar(0));
k=min(k,scalar(30));

or like what you wrote:

k=min(max(k,scalar(0),scalar(30)))

they have the same meaning or not?!!!

Thank you again