CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   calculation of k, epsilon and omega (https://www.cfd-online.com/Forums/openfoam-pre-processing/81498-calculation-k-epsilon-omega.html)

kroetenechse October 28, 2010 10:50

calculation of k, epsilon and omega
 
Hello, i´m a new OpenFOAM user.

Could somebody give me a advice, how I can calculate k (turbulent kinematic energy) and epsilon (dissipation rate) on every boundary for my k-epsilon-model.

And the calculation of epsilon, k and omega for my k-w-SST-Model. Do I need also nuTilda for the k-w-SST-Model?

If someone can help me, I would be very happy.

Thank you in advance.
phil

Simon Lapointe October 28, 2010 12:02

Hi,

At the inlet, the values of k and epsilon can be calculated using the level of turbulence intensity and viscosity ratio (or turbulent length scale) you want to achieve. The relations found on this page can be useful:
http://www.cfd-online.com/Wiki/Turbu...ary_conditions

On wall boundary conditions, you use kqRWallFunction and epsilonWallFunction since the k-epsilon model makes use of wall functions.

For the k-w SST model, you need to specify BCs for k and omega, not epsilon nor nuTilda.

Hope this helps.

kroetenechse November 4, 2010 14:50

Hi Simon,

thank you very much! Now I could calculate epsilon, k and omega. This was one of my main problems. You don´t know, how you helped me with that information :-). Also for these three variables I found some functions:
turbulentIntensityKineticEnergyInlet for k in the inlet (under that you make the description of the intensity and the value)
turbulentMixingLengthFrequencyInlet for omega in the inlet (then description mixing length, k and value)
turbulentMixingLengthDissipationRateInlet for epsilon in the inlet (then description mixing length and value)
...like that for example k

inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.02;
value uniform 0.0006;
}

But relating to the wallfunctions I need a little bit more support, please. I´m really sorry.

- For the k-epsilon-model I can use kqRWallFunction for k and for epsilon I can use
epsilonWallFunction?
like that?
[k]
wall
{
type kqRWallFunction;
value uniform ...;
}

- Are there more wallfunctions for the k-omega-SST model?

- what can I use for the outlet?

- what means type zerogradient? The variabel will not change in that boundary?

Thank you in Advance
phil

Gerard November 9, 2010 09:33

Hi Philipp,

as far as I know you can use kqRWallFunction for k, epsilonWallFunction for epsilon and omegaWallFunction for omega. Furthermore there are Wall Functions for nut (implying that you want to do incompressible calculations), such as nutWallFunction or nutSpalartAllmarasWallFunction. Have a look at the code in your Openfoam directory /src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions for details and further wall functions.
If you want to use kOmegaSST it is clear that you need to specify omega instead of epsilon.
I hope this helps a little bit. I am afraid, but I am new both to CFD in general and to OpenFoam in particular.


Hi everybody,

as I just mentioned, I'm new to CFD and OpenFoam. So I hope it is not to annoying to ask you a simple question:
the value specified for a wall function, should it be the value at the wall (k=0,...) or at the first grid point let's say at 40 y+?

Thanks.
Gerard

vkrastev November 9, 2010 10:10

Quote:

Originally Posted by Gerard (Post 282752)
Hi Philipp,

as far as I know you can use kqRWallFunction for k, epsilonWallFunction for epsilon and omegaWallFunction for omega. Furthermore there are Wall Functions for nut (implying that you want to do incompressible calculations), such as nutWallFunction or nutSpalartAllmarasWallFunction. Have a look at the code in your Openfoam directory /src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions for details and further wall functions.
If you want to use kOmegaSST it is clear that you need to specify omega instead of epsilon.
I hope this helps a little bit. I am afraid, but I am new both to CFD in general and to OpenFoam in particular.


Hi everybody,

as I just mentioned, I'm new to CFD and OpenFoam. So I hope it is not to annoying to ask you a simple question:
the value specified for a wall function, should it be the value at the wall (k=0,...) or at the first grid point let's say at 40 y+?

Thanks.
Gerard

The value you specify for a wall function is only an initial guess (as it is the initial value for the internal field), so theoretically speaking it could be quite arbitrary. However, you can (of course) "accomodate" the convergence of the solver by choosing a more "reasonable" value: one common practice (you can see it also in some of the tutorials, for instance the pitzDaily incompressible steady-state case) is to estimate the initial turbulent quantities for the internal field and then use the same values as initial guesses for the wall function entry.
Hope this helps

V.

Gerard November 9, 2010 10:41

Hi Vesselin,

thank you for your reply!
Do I get you right, that the values specified for the wall functions are initial values and not "classical boundary conditions", that need to be fulfilled within every time step?
So theoretically it would be desirable to set it to the estimated value of the first grid point next to the wall? At the moment I just define uniform values for the internal field:o
Thanks again.

Gerard

vkrastev November 9, 2010 10:53

Quote:

Originally Posted by Gerard (Post 282767)
Do I get you right, that the values specified for the wall functions are initial values and not "classical boundary conditions", that need to be fulfilled within every time step?

Yes. If you have a look in the source code, you will see that the wall function for k simply impose a zeroGradient condition at the wall, while the while function for epsilon calculate (for each timestep) the first grid point value by using an algebraic expression derived from the classical logarithmic law-of the wall approach.

Quote:

Originally Posted by Gerard (Post 282767)
So theoretically it would be desirable to set it to the estimated value of the first grid point next to the wall?

Yes, but if you use a reasonable assumption for the internal field initial value (for instance, estimating a turbulence intensity and a turbulent lenght scale for the bulk or free-stream flow), then it should do a good job as well.

Best regards

V.

Gerard November 9, 2010 11:23

Thank you very much! That really helped me.

Best regards
Gerard

kroetenechse November 25, 2010 11:02

Thanks to all,

my calculation did run now. You were a great help.

Thanks a lot.

phil

vishal January 17, 2011 17:51

Hi,

I have some same problem please have a look at following post... :)



http://www.cfd-online.com/Forums/ope...urbulence.html

jms March 9, 2011 12:52

Dear all,

while solving one case of flow over an airfoil with the turbulence model k-omega SST I would like to compute the values of omega at the wall. In OpenFOAM it seems that you can only call it as a "fixedValue", not as "calculated". I tried to call the wall as a "patch" instead of a "wall" and it does not work either. I get the following error:

gradientInternalCoeffs cannot be called for a calculatedFvPatchField
on patch blabla of field omega in file "/.../omega"
You are probably trying to solve for a field with a default boundary condition.

The reason why I want to set it as "calculated" is because I have run the same case in ANSYS CFX and I saw that it gave different values for this omega at the wall. Thus, by fixing it, maybe it is affecting to the results obtained.

Thank you very much for your help,

Regards,

José

Gerard March 9, 2011 17:19

Hi José,

I'm not sure because I have just used OF for a few months now, but maybe you use an older version of OF which automatically applies wallfunctions to omega with SST? Did you check that?

Gerard

umer.chaudrey October 19, 2011 03:10

Hey everyone,

I have a query regarding K-epsilon values too.

I am using a transient compressible rhoPimpleFoam solver, RAS turbulence model but without any wall functions for k and epsilon.

Whatever I read in various threads on this forum, I understand that initial values of internal fields of k & epsilon are independent of the solution.

But however in my case, if I use different values my solution behaviour and values change. Can anyone please comment on that?

I had written on another thread too, but no one replied regarding specific k & epsilon intial values for internal field. I am not using a velocity boundary condition, rather pressure difference.

Thanks, I will really appreciate some advice.

romant October 19, 2011 05:20

Quote:

Originally Posted by umer.chaudrey (Post 328527)
Hey everyone,

I have a query regarding K-epsilon values too.

I am using a transient compressible rhoPimpleFoam solver, RAS turbulence model but without any wall functions for k and epsilon.

Whatever I read in various threads on this forum, I understand that initial values of internal fields of k & epsilon are independent of the solution.

But however in my case, if I use different values my solution behaviour and values change. Can anyone please comment on that?

I had written on another thread too, but no one replied regarding specific k & epsilon intial values for internal field. I am not using a velocity boundary condition, rather pressure difference.

Thanks, I will really appreciate some advice.


If you use wall function less RANS models (RAS in OF) then you need to check with the turbulence model which boundary conditions it suggests for k and epsilon. those models usually require also that the first cell is within y+ < 1.

umer.chaudrey October 19, 2011 05:23

First of all thanks for your reply Roman.

But how do I check y+ values in OF when I am not using any wall functions.

According to my knowledge, the yPlusRAS utility in OF only gives y+ values when wall functions are being used. Not without them.

Correct me if I am wrong, as I am only new to this.

romant October 19, 2011 05:30

you can check with this thread

http://www.cfd-online.com/Forums/ope...-testcase.html

where somebody has posted a tool in order to calculate the y+ values for low reynolds number models which do not use wall functions.

umer.chaudrey October 19, 2011 05:33

Roman

Thanks, for the link. I will just have a look at it.

umer.chaudrey October 19, 2011 05:37

One Last Thing
 
And Roman, please comment on this last thing before I check the y+ code.

The thing is the documentations I have read about OpenFOAM and in the threads here, for k-epsilon model to calculate the initial values of k and epsilon, I need mean flow velocity and a turbulent length scale.

k= 3/2*(UI)^2 or k = 1/2 U'.U'

I can determine the turbulent length scale based on my geometry. But I do not know the mean flow velocity, because I am generating flow based on pressure difference. The initial velocity everywhere in the model is zero at time zero. The initial conditions I mean.

So I was wondering just for that initial values in my 0 folder, how do I determine the k and epsilon value based on these relations given for my internal field and outlet, even before I run my solution.

Thanks.

romant October 19, 2011 05:39

I would use an estimate of the mean flow velocity and then run the simulation once. you then will see what your velocity becomes. you can then also see your k values and epsilon values, which can then be used as your inlet conditions.

umer.chaudrey October 19, 2011 05:42

Okay thanks again for the help, appreciate it. I'll just do that.

Sunxing January 5, 2013 05:13

Quote:

Originally Posted by umer.chaudrey (Post 328527)
Hey everyone,

I have a query regarding K-epsilon values too.

I am using a transient compressible rhoPimpleFoam solver, RAS turbulence model but without any wall functions for k and epsilon.

Whatever I read in various threads on this forum, I understand that initial values of internal fields of k & epsilon are independent of the solution.

But however in my case, if I use different values my solution behaviour and values change. Can anyone please comment on that?

I had written on another thread too, but no one replied regarding specific k & epsilon intial values for internal field. I am not using a velocity boundary condition, rather pressure difference.

Thanks, I will really appreciate some advice.

Hi umer.chaudrey

I am also simulating a case using the rhoPimpleFoam solver, RAS turbulence model. In my case--wall-jet flow, I set the inlet velocity as fixed value. However, I don't know how to set the the outlet condition for velocity and inlet/outlet condition for pressure. I wander that how do you set these condition in your case?

Regards,
Sunxing

sdharmar January 11, 2013 13:01

Hi Sunxing,

You can use zeroGradient BC or inletOutlet BC for U at the outlet.
For p you can use zeroGradient at the inlet and fixedvalue at the outlet. I am also a new member so please double check my suggestions.

If any senior members can support/oppose my comment that would be really appreciated.

BR,
Suranga.

Sunxing January 11, 2013 21:09

Hi Suranga,

Thanks for your reply. I have already tested this condition that you have suggested, however it has turned out to be a bad setting.

regards,
Sunxing

idefix May 26, 2013 03:55

Hello,

at the moment I have some problems with one simulation.
k and epsilon have very high values at the wall. I think that there is something wrong with the wall function.
But I am not familiar with this topic.
I read this sentence here in the discussion.

Quote:

Yes. If you have a look in the source code, you will see that the wall function for k simply impose a zeroGradient condition at the wall, while the while function for epsilon calculate (for each timestep) the first grid point value by using an algebraic expression derived from the classical logarithmic law-of the wall approach.
Where can I find this mentioned source code?
Are there any literature explaining the wall function model used in OF in k epsilon-model?

Sorry for this simple question, but I am very confused at the moment and I am not very good in C++.

Thanks for your help
Idefix

cfdman_aero June 6, 2013 10:32

hi, I have a difficulty with discretization of source terms of k and epsilon. for example we have (du/dy)**2 in the k source term. my code is on FVM and explicit. Please guide me through.

cutter June 7, 2013 03:15

Please don't hijack other threads! What have you done so far and which discretization scheme are your trying to employ? What's your intention - writing an own solver?

Have a look at the book "Essential Computational Fluid Dynamics" by Oleg Zikanov. It covers the basics of FVM discretization pretty thoroughly. Many other CFD books do as well.

cutter

cfdman_aero June 7, 2013 03:24

Quote:

Originally Posted by cutter (Post 432582)
Please don't hijack other threads! What have you done so far and which discretization scheme are your trying to employ? What's your intention - writing an own solver?

Have a look at the book "Essential Computational Fluid Dynamics" by Oleg Zikanov. It covers the basics of FVM discretization pretty thoroughly. Many other CFD books do as well.

cutter

Thanks for reply. I am writing FVM for incompressible turbulent flow utilizing K-Epsilon. The scheme is explicit and I do not know how to discretize the nonlinear production in wich we have i.e. (du/dy)**2. I use some methods but the code doses not run and exit with "floating point error: invalid". I wonder if there is any method to linearized form of those terms.

payal05 August 20, 2013 13:05

regarding boundary conditions for omega
 
helo
I am relatively new in OF and would be grateful if some one can help me please. I am trying to set up a case using rhopimplefoam solver and the kOmegaSST model but I have difficulties defining the boundary conditions for omega. frankly speaking i dont have any clue about omega BC"S.

in my case i have inlet , axis , upperwall, outlet so hw to define BC's for that ?

joneill053 July 13, 2017 13:37

Hi All!

I would like to possibly revive this thread as I have a few questions regarding setting up k and omega for the SST model.

I am simulating moderate flow over a bumpy airfoil (Re =300,000) and I have calculated values for both k and omega based on a length scale of 7 percent of my chord length (ie 0.07*0.201768 meters) and an initial guess of turbulence intensity of 1%. I know most literature says for moderate flows to use 1-5% but I am unsure of how to adequately guess where I fall within that range.

The values I calculated with this become k = 0.083622 and omega = 37.38255.

(1) Should these values be initialized as the "internalField uniform" values or as the value uniform for the inlet?

(2) I have an inlet outlet condition with the inletValue uniform set to 0 for both k and omega so if there is any reverse or inlet flow in theory there should be little or no effect on my flow traveling over my airfoil if there is any reverse or back flow appearing(please forgive me if I misunderstand how the inletOutlet type works...I am relatively new with OpenFOAM). With a zero gradient at the outlet, would these be proper BC's to set?

Any help at all would be appreciated!

Thanks,

Joe

Anand895130 February 7, 2018 18:47

Regarding the Reynold's number in Rotational wall velocity
 
Hello Everyone

I'm using this code for running my Rotating wall,

bump
{
type rotatingWallVelocity;
origin (958.85 1755.17 0);
axis (0 0 1);
omega constant 230.3834; //rad per sec using 13200 deg/s=2200 rpm value;


In this what will be the reynold's number. and how to change the reynold's number if I want to ?

Thanks in Advance

Any reply will be helpful

igne July 22, 2019 11:25

What if I use my initial velocity and calculate k and epsilon values?

vava10 March 5, 2021 10:32

values of K, omega
 
1 Attachment(s)
Hey,

I am simulating a kayak for velocity 4.5 and 5.5 m/s and I am using K-omega SST. I found the formulas for finding the values as shown in the image. I am not an expert in CFD. I am getting really high value for omega. I don't know if I am making any mistakes consept.
But when I try these formula on some on the examples cases, I am not getting the correct answer

length 5.19

Following are the values

Code:


Re = 23355000
I = 0.0191
k = 0.0111
L/sqr(Re) = 1.073e-3
l =4.29e-4
omega =488

in some of the papers which I read they just assume the value of intensity I as 0.5%


can some one help?

thanks in advance
vava10


All times are GMT -4. The time now is 14:27.