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

Relation between k and UPrime2Mean etc in LES

Register Blogs Community New Posts Updated Threads Search

Like Tree26Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2011, 03:51
Default Relation between k and UPrime2Mean etc in LES
  #1
Senior Member
 
Tarak
Join Date: Aug 2010
Location: State College, PA
Posts: 111
Rep Power: 16
Tarak is on a distinguished road
Hii,

While doing LES using OF, I found that the value of k and the value of 0.5*(UPrime2Meanxx+UPrime2Meanyy+UPrime2Meanzz) are very different. Can someone please elaborate why is it so? They are supposed to be exactly the same, according to the definition of turbulent kinetic energy.

Thanks,
Tarak
Tarak is offline   Reply With Quote

Old   May 16, 2011, 09:18
Default
  #2
Member
 
longamon's Avatar
 
David Aljure
Join Date: Mar 2011
Location: CTTC Universidad Politécnica de Catalunya. Spain
Posts: 38
Rep Power: 15
longamon is on a distinguished road
I think the difference is that the k calculated in LES refers to the sub-grid-scale kinetic energy, whereas the 0.5*(u'_ii) refers to the total turbulent kinetic energy
deji, tariq and Haitham Osman CFD like this.
longamon is offline   Reply With Quote

Old   May 16, 2011, 12:10
Default
  #3
Senior Member
 
Tarak
Join Date: Aug 2010
Location: State College, PA
Posts: 111
Rep Power: 16
Tarak is on a distinguished road
Hii,

Thanks for the reply. But while prescribing the boundary value in k, suppose say at inlet, we set the value of the TKE from k=1.5(I*U)^2. That's not sgs kinetic energy. So doesn't these 2 contradict each other?

Thanks,
Tarak
Tarak is offline   Reply With Quote

Old   May 16, 2011, 13:39
Default
  #4
Member
 
longamon's Avatar
 
David Aljure
Join Date: Mar 2011
Location: CTTC Universidad Politécnica de Catalunya. Spain
Posts: 38
Rep Power: 15
longamon is on a distinguished road
I'm not sure of that boundary value for k, however, if you take a look at the source codes of the LES models you'll see how the k is calculated.

When using oneEqEddy models the sub-grid kinetic energy is calculated through a transport equation and then used to calculate the subgrid viscocity.

In smagorinsky models the sub-grid kinetic energy is calculated from the velocity gradient.

In LES modeling the SGS quantities are used to close the model. The value of k is an instantaneus value, different from the total turbulent kinetic energy calculated from the Reynolds stress tensor
longamon is offline   Reply With Quote

Old   May 16, 2011, 13:42
Default
  #5
Senior Member
 
Tarak
Join Date: Aug 2010
Location: State College, PA
Posts: 111
Rep Power: 16
Tarak is on a distinguished road
Thanks a lot. Ya I'm sure that the k is indeed sgs k, but then it becomes difficult to prescribe the inlet condition, as the sgs ke is not known beforehand. So, is it wise to prescribe a relatively low value of k, that is lower than the total turb kinetic energy? I you have some personal experience with this, please do not hesitate to advice.

Thanks,
Tarak
Tarak is offline   Reply With Quote

Old   May 16, 2011, 13:51
Default
  #6
Member
 
longamon's Avatar
 
David Aljure
Join Date: Mar 2011
Location: CTTC Universidad Politécnica de Catalunya. Spain
Posts: 38
Rep Power: 15
longamon is on a distinguished road
For the problem I'm solving now i'm using a turbulent inlet velocity profile, and for k i'm setting a low value, 2e-5. I'm getting accepable results with this. You should be worried for this condition if using oneEqEddy or kOmega type models, smagorinsky models do not depend on k as it is calculated from the velocity
longamon is offline   Reply With Quote

Old   May 16, 2011, 13:54
Default
  #7
Senior Member
 
Tarak
Join Date: Aug 2010
Location: State College, PA
Posts: 111
Rep Power: 16
Tarak is on a distinguished road
Thanks a lot.

I am using dynamicOneeqEddy model, that's why I am so concerned about it. I am presently simulating the flow over a circular cylinder for Re=3900, but not managing to get an acceptable recirculation length. So, the way you prescribed now may help. If you had any luck with the flow over a circular cylider please do let me know.

Thanks,
Tarak
Tarak is offline   Reply With Quote

Old   May 17, 2011, 04:43
Default
  #8
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
k is indeed the turbulent sgs energy (see http://foam.sourceforge.net/doc/Doxy...OneEqEddy.html), but UPrime2Meanxx are the variances of the resolved and time averaged scales http://foam.sourceforge.net/doc/Doxy...0b4d6940d1b9e4.
So your 0.5*tr(UPrime2Mean) is more like kinetic energy of the resolved turbulent scales.
deji, tariq, beatlejuice and 3 others like this.

Last edited by gregor; May 17, 2011 at 05:01.
gregor is offline   Reply With Quote

Old   January 20, 2012, 21:08
Default
  #9
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 15
sam1364 is on a distinguished road
Hi gregor

I am trying to find out how Uprime2Mean is calculated. I went to the source code of fieldaveraging, but still I could not figure out how this parameter is calculated. I am looking for a Reynolds stress definition as below

R=<u'iu'j>+<uiuj>-<ui><uj>

the first trem is unresolved Reynolds stress and the addition of the other two terms are the resolved Reynolds Stress. Is Uprime2Mean the same as above equation?

any comment on the Uprime2Mean calculation will be of great help to me.

Thanks
sam1364 is offline   Reply With Quote

Old   January 24, 2012, 09:16
Default
  #10
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
Uprime2Mean is simply the variance of the resolved scales. Which is the quadratic value of the standard deviation sigma. Standard deviation gives you an idea on how much your values deviate around a mean value.

var = sigma^2 = 1/(N) sum^N(phi - <phi>)^2, where <.> is a time averaged value

So it is the averaged deviation around a mean value . The definition of Reynoldstresses has nothing to do with how the variances a calculated.

Gregor
tariq likes this.
gregor is offline   Reply With Quote

Old   January 24, 2012, 13:30
Default
  #11
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 15
sam1364 is on a distinguished road
Thanks Gregor

Now, I have an idea on how Uprime2Mean is claculated.
I want to get the time average of Reynolds stress tensor during the run. In Kepsilon Model, R is calculated like this

tmp<volSymmTensorField> kEpsilon::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
k_.boundaryField().types()
)
);
}

Do you have any idea how I can implement this in OpenFoam?
sam1364 is offline   Reply With Quote

Old   January 24, 2012, 13:43
Default
  #12
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
Quote:
Originally Posted by sam1364 View Post
tmp<volSymmTensorField> kEpsilon::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
k_.boundaryField().types()
)
);
}

Do you have any idea how I can implement this in OpenFoam?
Since you already have your modelled R field you could just add

Code:
functions
{
        fieldAverage1
        {
                type            fieldAverage;
                functionObjectLibs ( "libfieldFunctionObjects.so" );
                enabled         true;
                resetOnOutput   false;
                cleanRestart    true;
                outputControl   outputTime;

                fields
                (
                        R
                        {
                                mean        on;
                                prime2Mean  off;
                                base        time;
                        }

                );
        }
}
to your controlDict to average R over time.
gregor is offline   Reply With Quote

Old   January 24, 2012, 14:20
Default
  #13
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 15
sam1364 is on a distinguished road
I have already done that. But it gives me the following error

Requested Field R Does not exist in the database
sam1364 is offline   Reply With Quote

Old   January 25, 2012, 04:18
Default
  #14
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
Are you doing LES or RANS and what is your turbulence model ?
gregor is offline   Reply With Quote

Old   January 25, 2012, 05:31
Default
  #15
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
Hi,

I think that every field you want to average first has to be created here:

#include "createFields.H"

in your solver. So, go to solver you want to use, and add a new field in createField.H:
something like:

volSymmTensorField R_
...
...
Than, you'll have to add something like this into solver:

R_ = yourTurbulenceModel->R();

And than, field R_ can be averaged...
You'll have to play a little with solver, but this is not a big issue...

Regards,
Dejan
morard is offline   Reply With Quote

Old   January 25, 2012, 05:43
Default
  #16
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
Quote:
Originally Posted by morard View Post
Hi,

I think that every field you want to average first has to be created here:
Quote:
Originally Posted by morard View Post


#include "createFields.H"




It doesn't matter where you create it, as long as it is registred in the object registry.

Quote:
Originally Posted by morard View Post
R_ = yourTurbulenceModel->R();

Depending on if he is doing RANS or LES it could be

yourTurbulenceModel->B() (for LES)

aswell

Gregor
gregor is offline   Reply With Quote

Old   January 25, 2012, 05:51
Default
  #17
Member
 
Dejan Morar
Join Date: Nov 2010
Posts: 78
Rep Power: 17
morard is on a distinguished road
Ufff, sorry, my mistake. It's LES about (from the first post).
So, it's definitely:

yourTurbulenceModel->B() (for LES)
morard is offline   Reply With Quote

Old   January 25, 2012, 05:56
Default
  #18
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
Ok i just wondered, because its not the original guy asking anymore.

And if its LES then you have to create the field first (i.e. in #include createFields.H) and then assign it like B_ = yourLESturbMod->B().

I was just confused by his RANS example, where the R field gets created by default from the turbulence model.
gregor is offline   Reply With Quote

Old   January 25, 2012, 12:43
Default
  #19
Member
 
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 15
sam1364 is on a distinguished road
hi

I am using RANS and KEpsilon Model to solve my problem and the error still exists. I went through KEpsilon.C to find how R is calculated and saved. I see that in this file, k and epsilon are written in a file by using


k_
(
IOobject
(
"k",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateK("k", mesh_)

but for R, it is

tmp<volSymmTensorField> kEpsilon::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
"R",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
k_.boundaryField().types()
)
);
}

by Looking at the above file, I see that R is created but it is not written anywhere. I changed NO_WRITE to AUTO_WRITE, but nothing happened. Do you still believe that R is created and can be averaged?!

Thanks for your time. I do appreciate your help
sam1364 is offline   Reply With Quote

Old   January 25, 2012, 12:54
Default
  #20
Member
 
Gregor Olenik
Join Date: Jun 2009
Location: http://greole.github.io/
Posts: 89
Rep Power: 17
gregor is on a distinguished road
Ok i guess the reason is that you R field is only created as a tmp field if you are calling the R() function. So you should try what morad suggested and create a separate R field inside your createFields.H

as



Code:

volSymmTensorField R_
         (
             IOobject
             (
                 "R",
                 runTime_.timeName(),
                 mesh_,
                 IOobject::NO_READ,
                 IOobject::NO_WRITE // you could use auto_write aswell
             ),         
          turbulence->R() // don't know if that works ?
          )


and make sure that you update it every time step by

R_ =
turbulence->R()

Gregor
Hanzo likes this.
gregor is offline   Reply With Quote

Reply


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
Problems sampling UPrime2Mean leonardo.morita OpenFOAM Post-Processing 5 May 10, 2012 05:36
Bug in Dynamic 1Eq Eddy Viscosity LES Model Incompressible flow harishg OpenFOAM Bugs 5 December 2, 2008 19:18


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