CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Help with k epsilon values of turbulence (http://www.cfd-online.com/Forums/openfoam/67728-help-k-epsilon-values-turbulence.html)

 vw.cfd August 25, 2009 04:33

Help with k epsilon values of turbulence

Hi,

I am simulating a two phase flow with one phase as 'oil' and the other as 'air' with RAScavitatingFOAM. I would like to use the realizable k epsilon model. For starters i have obtained the parameters of a similar model simulated with FLUENT.

Now, for defining the boundary conditions for the turbulence parameters. I have the following specification from FLUENT test run.
At inlet(FLUENT)
Intensity and Hydraulic diameter:
Turbulence intensity:15%
Hydraulic diameter:0.0017m

How can i calculate the value of k and epsilon required to be supplied for the OpenFOAM BC defintion. I went through the FLUENT userguide and could did not find satisfactory explanations.

In the meanwhile i tried simulating with k omega+SST model in OpenFOAM and my simulation crashes due to unbounded omega value.
:confused:

ThnX!!

 Schag August 25, 2009 04:41

For k and epsilon, have a look in User Guide, U-41, in cavity turbFoam tutorial.

Then, for k-omega, maybe you can try to initialise omega in a different way (maybe bigger than expected).

Regards,

Julien

 vw.cfd August 25, 2009 04:55

hi,

Thank you Julien, i have already gone through the the pages you have specified. I was just wondering if it was possible to use the values i know from the Fluent test case and calculete k and epsilon using these values.

ThnX!!!

 l_r_mcglashan August 25, 2009 05:14

There is a boundary condition allowing you to specify the turbulent intensity:

turbulentIntensityKineticEnergyInlet

You can find it in OpenFOAM-1.6/src/finiteVolume/fields/fvPatchFields/derived/
Or you can just use the following relations:

Where I = turbulent intensity and l = mixing length.

 chiven August 25, 2009 07:22

Hello, Laurence and other friends,

I believe all of you are the experts of multi-phase flow simulation. Would you please give some comments to me about the problem shown in:
http://www.cfd-online.com/Forums/ope...lculation.html

Thank you very much.

Best regards,
Chiven

 vw.cfd August 26, 2009 05:27

Hi Laurence and Julien,

Thank you both for your help.One other small question when we change the turbulence model in RASproperties from K-omega+SST to Realizable k-epsilon what are equations which have to be used in the fvSchemedict.

ThnX!

Varun

 vishal January 13, 2011 11:12

Hi All,

I am trying to simulate flow Simulation over a city model. but here I dont know the charectarastic length. But rhater I have a ratio of (nut/nu). If i am trying to use following formula for calculation of epsilon as inlet boundary condition.

Note : i am using parabolic profile at inlet.

http://www.cfd-online.com/W/images/m...7849438c8e.png

I am getting time step continuity error.

what can I do to stabilize solution. Is there any other way so that I can introduce terbulance viscosity ratio in play.

 paka January 13, 2011 18:18

Vishal,

I find you simulation model quite interesting. Can you by any chance write a little bit more what you are solving for and how large is your model?

Particularly, I would like to learn about the size of your city model and your computational gird size which you plan to employ.

Thanks, wish you all great day,
Krystian

 vishal January 14, 2011 07:57

Hi paka,

Actually my domain is about 2 km in length and 0.5 km in hight and I have used unstructured mesh. And the city is located at some distance from inlet. The total mesh size is approximately 4 -5 million cells.

I have used the same mesh with uniform and parabolic velocity prof at inlet.
However I calculate Epsilon using char length = length of longest building

I have used power law for calculation of velocity values at inlet.Using these velocity values and above mentioned formulas for K and epsilon I did the calculations and implemented as inlet boundary condition. I have zero pressure outlet.

but when I don't assume char length and use above formula (without length) for calculation of epsilon I am getting high values for epsilon for turbulence viscosity ration of 3. and the solution is no more stable.

Do I have some error in boundary value calculation method...??? can we introduce this turbulence viscosity ratio using some other way.....???

I am using this ratio as it was the same way in the FLUENT simulation did by my friend. and I think it calculates the boundary values at inlet in same manner as I did....????. pls help.... :( :( :(

 vkrastev January 18, 2011 05:45

Quote:
 Originally Posted by vishal (Post 290411) Hi paka, Actually my domain is about 2 km in length and 0.5 km in hight and I have used unstructured mesh. And the city is located at some distance from inlet. The total mesh size is approximately 4 -5 million cells. I have used the same mesh with uniform and parabolic velocity prof at inlet. However I calculate Epsilon using char length = length of longest building I have used power law for calculation of velocity values at inlet.Using these velocity values and above mentioned formulas for K and epsilon I did the calculations and implemented as inlet boundary condition. I have zero pressure outlet. but when I don't assume char length and use above formula (without length) for calculation of epsilon I am getting high values for epsilon for turbulence viscosity ration of 3. and the solution is no more stable. Do I have some error in boundary value calculation method...??? can we introduce this turbulence viscosity ratio using some other way.....??? I am using this ratio as it was the same way in the FLUENT simulation did by my friend. and I think it calculates the boundary values at inlet in same manner as I did....????. pls help.... :( :( :(
1) How do you set k at the inlet to derive epsilon from the formula you posted above? Is also the turbulence intensity a given datum?

2) I'm not sure that using the longest building size as the characteristic lenght is a proper assumption

3) To found the reasons of your simulation's instability it would be useful for us to know something more about your settings (solver, bc's, fvSchemes, fvSolution, etc.)

Regards

 paka January 18, 2011 06:47

I don't really know for what you are solving, what's your principle question which you try to answer. Nonetheless, I think the longest building length scale might be a bit too large, unless you have some other work on which your work is based.

I do have some questions to your inlet boundary. I'm just guessing you are trying to simulate city flooding resulted from possible hurricane or tsunami inundation.

1. Why did you decide to use the parabolic velocity profile at inlet? Do you have any literature reference? I would gladly read more about it. It is more a consideration whether this function represent real life conditions?
PS. If you can share your inlet function that would be interesting.

2. You said you used "power law for calculation of velocity values at inlet". Does it mean the high velocity, as soon as it enters, immediately decreases in magnitude? Does it mean you try to simulate more kind of an incoming wave boundary condition? So the initial high spike in velocity decreases as soon as it enters the domain?

3. You said you "have zero pressure outlet". I assume this is your atmosphere BC surrounding the city, is it right?

Thanks,
K

 vishal January 20, 2011 07:24

3 Attachment(s)
I am besically trying to solve for flow simulation around a city model. and I am performing validation against wind tunnel and FLUENT results.

As it is a case of flow over surface. I have to use parabolic profile for inlet velocity (POWER LAW).

K an Epsilon are calculate using following formulas.

U' = 0.1 U.

K = 0.5 (U').(U') and http://www.cfd-online.com/W/images/m...7849438c8e.png

However for epsilon ciscosity ration = 3 is used http://www.cfd-online.com/W/images/m...41315997b2.png

I got stable results using same model but when I used large assumbed char. Length (141 meters).

However with this approach I am getting large values for epsilon and the solution is getting crashed. (I think its coz of unstabilities during solving for Pressure)

please find attached files for FvSchemes and FvSolutions

 vishal March 10, 2011 05:25

1 Attachment(s)
Hi,

Hear is the check mesh logfile attached.

I have one more query. I never understand what do we exactly mean by time step continuity error. As it suddenly overshoots for my case resulting in simulation blow up.

Hello,
checkmesh says everything is ok from the mesh point of view...
However, looking at the log file, I see continuity error is too high from the very first time step. It should be something on the order of 10^-5 or less.
And within 2 time steps you have k and epsilon bounding...
I guess some of your BC are not ok. The problem may be on k and epsilon values, but (more probably) you had some bad idea on how to declare everything, i.e. you set U fixed value at the inlet AND at the outlet. Check how you declare everything.
Bye

 vishal March 10, 2011 10:15

I dont think BC are problem.

Now for test sake, I have tried the same model for constant velocity inlet

with really small values for k and epsilon at inlet. I am not facing any continuity errors anymore and as of now it looks stable.

However, I actually wanted to simulate flow through a city model following boundary conditions.

zeroGradient Pressuer inlet const pressuer outlet (uniform 0)
k and epsilon has same BC as velocity....:)

bottom is ground wall.
lateral walls and top is set as symmetry plane.

I am using above mentioned formulas for calculation of k and epsilon.
assuming terbulence viscosity ratio =3 (Can't predict char length for problem)...:confused:

But this is giving high values of epsilon and the solution no more stable even in I used upwind for divergence and really small relaxation factors (P 0.2, k 0.5, epsilon 0.5).........:mad:

However the results obtained from fluent has almost the same exponential inlet values for (U,k, epsilon) but still having stable results using GAMG for solving P,U,K,Epsilon.........

 amgode March 17, 2011 07:45

I would suggest some changes in the fvSchemes and fvSolution files:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
}

{
default Gauss linear;
}

divSchemes
{
default Gauss upwind;
div(phi,U) Gauss upwind;
div(phi,nuTilda) Gauss upwind;

}

laplacianSchemes
{
default Gauss linear corrected;
laplacian(nuEff,U) Gauss linear limited 0.5;
laplacian((1|A(U)),p) Gauss linear corrected;;
laplacian(DnuTildaEff,nuTilda) Gauss linear limited 0.5;
laplacian(1,p) Gauss linear corrected;

}

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

{
default limited 0.5;// corrected;
}

fluxRequired
{
default no;
p ;
}

// ************************************************** ***********************

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
// modifies as per fluent
p
{
solver GAMG;
tolerance 1e-08;
relTol 0.01;
smoother GaussSeidel;
nPreSweeps 1;
nPostSweeps 2;
cacheAgglomeration true;
nCellsInCoarsestLevel 50;
agglomerator faceAreaPair;
mergeLevels 1;
}

U smoothSolver
{
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-7;
relTol 0.05;
};

k smoothSolver
{
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-7;
relTol 0.1;
};
epsilon smoothSolver
{
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-7;
relTol 0.1;
};

}

SIMPLE
{
nNonOrthogonalCorrectors 1;
pRefCell 0;
pRefValue 0;
}

relaxationFactors // modifies as per fluent
{
p 0.3;
U 0.5;
epsilon 0.8;
k 0.8;
}

// ************************************************** *********************** //

Moreover, try using leastSquares gradient schemes for pressure and velocity.

{
default leastSquares;
}

Cheers !:)

 vishal April 4, 2011 05:18

Thanks a ton for your advices. actually the issue behind explosion in epsilon value was and bonding warnings was due to lack of knowledge for calculating epsilon.

For others who are working on the same type of problems.... :)

Initially I have used above mentioned formula for calculation. Rather the correvt one is mentioned in

OpenFOAM1.7.1/scr/turbulanceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilon.H file.

It works absolutely fine. Rater you can also use atmBoundaryLayerInlet itself instead of list of values for exponential inlet velocity and epsilon boundary condition. or modify the formula as per need.

:D :D :D

 sam.ho December 12, 2013 06:57

meaning of frac in atmBoundaryLayerInletEpsilon

Hi,

I am simulating a flow valve with incompressible fluid flow using simpleFOAM and facing a problem of bonding values of k and epsilon. Can i use atmBoundaryLayerInletEpsilon boundary condition at inlet ?

And what is the meaning of frac in the following formulae ?
\epsilon = \frac{(U^*)^3}{K(z - z_g + z_0)}
U^* = K \frac{U_{ref}}{ln\left(\frac{Z_{ref} + z_0}{z_0}\right)}
Can you please give formulae for these as i am not getting it ?

Thanks :)

 All times are GMT -4. The time now is 12:59.