CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   KOmega Turbulence model from wwwopenFOAMWikinet (https://www.cfd-online.com/Forums/openfoam-solving/58056-komega-turbulence-model-wwwopenfoamwikinet.html)

philippose March 4, 2007 14:08

Hello, Yet another blue Sun
 
Hello,

Yet another blue Sunday to everyone!

I had been thinking about integrating the k-omega turbulence models available in the OpenFOAM Wiki into my version of openFOAM for a long time, and today I decided to take the jump.....

Well...the fact that I am writing this would make it clear that I hit bottom faster than I expected :-)!

Anyway... I downloaded the files, and extracted them into the turbulence models directory of the OpenFOAM source, and modified "files" in "Make" to include the k-Omega models.

I replaced the "turbulenceModel.C" and .H with "turbulenceModelOmega.C" and .H, and also the file "laminar.C" and .H with "laminarOmega.C" and .H

The compilation went through very smoothly.... ending up with a successful library of turbulence models (I "added" on the k-Omega models along with the existing turbulence models, rather than replacing the entire set with only the k-Omega models)

However, it seems that the files available at the wiki are not really geared towards co-existing with the other turbulence models....

When I tried running turbFoam with the kEpsilon model after recompiling the turbulence model with kOmega included, it gave me an error and quit.

On looking into the file "turbulenceModelOmega.C", I found that occurances of "epsilon" had been replaced with "omega".... which means the k-Epsilon model wouldnt work (I think).

Has anyone successfully integrated the k-Omega turbulence models into an existing openFOAM installation such that all the other models work too? And if so, could I get some pointers?

Have a nice day!

Philippose

panara March 5, 2007 03:56

Hi Philippose, (Philippose
 
Hi Philippose,

(Philippose is your name or surname? =) )

just follow the tread
http://www.cfd-online.com/cgi-bin/Op...cus/discus.cgi

I followed as well the good suggestions of Bernhard Gschaider and I have now two libraries for k-omega and k-omega compressible turbulence models that work perfectly together with the old k-epsilon models,

I will upload them in the wiki as soon as I find some time..

Daniele

philippose March 5, 2007 06:08

Hi Daniele, Thanks for the
 
Hi Daniele,
Thanks for the response, and a good day to you :-)!

Last night after posting the message, I tried making a second library... following the suggestions of Bernhard Gschaider... and it works fine now :-)! (Though, I havent tried the k-omega models yet)

Now that I have the system up and running... here come the questions regarding the turbulence model itself...

Could you give me a brief overview of the situations in which one would use the BSL, SST and SSTsas variants of the k-Omega turbulence model?

If I am not mistaken, the SST and SSTsas models do not use wall functions right? Is there anything special I need to specify...? Or can I still use the "wall" boundary condition for a wall?

And as for starting values of omega... is there a manner in which I could calculate a realistic starting value like in the case of the k-epsilon models (using the equations for k and epsilon with expected maximum velocities i.e.)?

Hmmm... well.. thats all I can think of at the moment :-)!

Have a nice day!

(Philippose is my first name.. so your usage was right :-)!)

Philippose

philippose March 5, 2007 13:51

Hello, Just a status update
 
Hello,
Just a status update.... As I mentioned before, I had compiled the k-Omega turbulence models into a separate library as suggested by Bernhard Gschaider.

Some time back I recompiled one of the solvers (a variant of simpleFoam) after including the k-Omega library into the "options" file.

Things are working fine, and I was able to select the k-Omega turbulence model... the simulation is currently running, but intermediate results are looking good :-)! So far.. converging very comfortably... shall get back regarding accuracy (compared to experiments).

The k-Epsilon model gave me around 7% error on the flow compared to measurements... hoping to get something better with the k-Omega!

I would still like you to give me an insight into the other k-Omega model types (BSL, SST and SSTsas) :-)!

Have a nice day!

Philippose

panara March 6, 2007 05:01

Hi Philippose, I suggest y
 
Hi Philippose,

I suggest you to read the articles I used as reference for the model implementation (see the Wiki)

in short, the k-omega BSL is a mix of k-omega near the wall and k-epsilon outside the near wall region.
This is done because it is easier to give freestream condition in terms of epsilon rather than omega.

at the wall you have to specify omega using the relation

omega=10*(6*nu)/(0.075*Dy1^2)

where Dy1 is the distance from the wall at the first grid point. Dy1 should be in the laminar sublayer.

In the freestream remember that omega is
equal to epsilon/k.

The k-Omega SST is the same as the BSL but it satisfy also the Bradshaw assumption that the shear stress in a boundary layer is proportional to the turbulent kinetic energy. (see the article for details)

The k-Omega SST sas is very different. In stable flow it behaves exactly as the k-Omega SST but in 3D flows with instabilities it behaves like an LES computation. When instabilities appear the model tends to decrease the turbulent viscosity up to the LES like value. The result is analogous to a LES computation. (see articles for details)

Hope that this helps you,

have fun,
Daniele

philippose March 6, 2007 13:04

Hi again, Thanks for the cl
 
Hi again,
Thanks for the clean and precise descriptions of the k-Omega Variants.

I have been running some simulations using the k-Omega and k-Omega SST on models I have already run using the k-Epsilon model, and also have measurements for.... the results have not been looking too good.

Basically, the simulations are all steady state, run using simpleFoam. I first started with the k-Omega Turbulence Model, and then tried the k-Omega SST... Here is the process I followed:

I renamed the original "epsilon" file present in the "0" time folder to "omega", changed the name of the volScalarField to "omega" and the units to [0 0 -1 0 0 0 0] as I had seen in the test case you had provided.

The rest of the data (including the initial value of the internal field and the inlet, and all the boundary conditions) were left as it was.

I assume that the solver takes these values as initial values only, and in case the values are bad, it takes longer to converge.

Here is the "omega" file:

dimensions [0 0 -1 0 0 0 0];

internalField uniform 5000;

boundaryField
{
fixedWalls
{
type zeroGradient;
}

inlet
{
type fixedValue;
value uniform 5000;
}

outlet
{
type zeroGradient;
}

outletLS
{
type zeroGradient;
}

}

For completion, here is my "boundary" file of the mesh (the mesh was also exactly the same as the one in the k-Epsilon run):

4
(
fixedWalls
{
type wall;
physicalType wallFunctions;
nFaces 37358;
startFace 278856;
}

inlet
{
type patch;
physicalType pressureInlet;
nFaces 212;
startFace 316214;
}

outlet
{
type patch;
physicalType pressureOutlet;
nFaces 48;
startFace 316426;
}

outletLS
{
type patch;
physicalType pressureOutlet;
nFaces 94;
startFace 316474;
}
)


I left the "k" file exactly as it was in the k-Epsilon case.

Further, I changed the files "fvSolution" and "fvSchemes"... replacing occurances of "epsilon" with "omega" so that the solvers and the schemes work with k-Omega.

The convergence values, relaxation factors (for simpleFoam) and the kinematic viscosity (nu) were left as it was in the k-epsilon case.

The Kinematic viscosity is 1.76e-05 m^2/s

Using this configuration, I ran the simulation, and ended up with a total flow through the inlet and outlet patches to be around 10 times smaller than the expected values (k-Epsilon and measurements).

The pressure field looks good, but the velocities are much lower than they are supposed to be.

The k-Omega SST case also came up with a similar difference in the flow.

Could it be that I am doing something wrong? Do I need to change any boundary conditions when I switch to the k-Omega Turbulence Model? Or is the turbulence model very sensitive to the initial conditions that are given?

I was looking through the source code of the k-Omega Turbulence Model and comparing it with the k-Epsilon model, and noticed that though there are the following header files in the directory:

wallFunctionsOmega.H
wallDissipationOmega.H

These files are never called within the k-Omega source code. Does this mean that the k-Omega does not use wall functions?

The mesh I use is a 100% tetrahedral mesh generated by NetGen (a free tetrahedral mesh generator). These meshes have worked very well so far with the k-Epsilon turbulence model.

Could there be some bug in the source code of the Turbulence Models?

I am hoping its only some simple error... because I have heard and read a lot about the k-Omega Turbulence Models, and have been wanting to try them out in an attempt to increase the accuracy of my simulations.

Have a nice day!

Philippose

rolando April 27, 2007 05:17

Hello Daniele, you´re trying
 
Hello Daniele,
you´re trying two different things above.
In your first attempt you try to set values at the boundary faces.
In your second attempt you try to set the values in the wall nearest cells. (For that you are using y-values at the wall, which have to be zero => division by zero).

What do you precisely want to do?
Setting values at the wall faces or in the wall cells?

Can you term a reference for the wall omega?

Rolando

panara April 27, 2007 05:30

Hi Rolando, I want to set t
 
Hi Rolando,

I want to set the value at the face that is the same of setting a fixedValue boundary condition with a constant value of omega=omega_wall

omega_wall = 60/beta*nu/sqr(dy)

where dy is the wall nearest cell center.

as it is described in Menter, Two-Equation Eddy-Viscosity Turbulence Models for Engineering Applications, AIAA Journal Vol.32, No8,August 1994.

Thanks for your feedback,do you have any ideas?

Daniele

rolando April 27, 2007 05:36

Try something like the followi
 
Try something like the following, it should only set the values at the boundaries and use the wall nearest cell values for the calculation:

const fvPatchList& patches = mesh_.boundary();

forAll(patches, patchI)
{
const fvPatch& curPatch = patches[patchI];

if (isType<wallfvpatch>(curPatch))
{
omega_.boundaryField()[patchI]
=
60.0
* nuw.boundaryField()[patchI].patchInternalField()
/ sqr(y.boundaryField()[patchI].patchInternalField())
/ 0.075;
}
}

Rolando

panara April 27, 2007 09:33

Thanks Rolando, it seems to
 
Thanks Rolando,

it seems to work very well =)

Thank you,

Daniele

qtian August 6, 2007 08:30

Dear all, I am starting to
 
Dear all,

I am starting to use K-Omega model for my simulation and have a few questions regarding the boundary setting and wall function. As Daniele Panara suggested, we need to specify a fix value of omega at the wall. The problem I had is if I tried to used a fixed value at the wall, I got a error message like this:

--> FOAM FATAL ERROR : fixedValue is the wrong omega patchField type for wall-functions on patch bottomWall
should be zeroGradient

From function wall-function evaluation
in file kOmegaSST/checkkOmegaPatchFieldTypes.H at line 13.

Then I went to check the file kOmegaSST/checkkOmegaPatchFieldTypes.H, and found something like this in the file:
if (!isType<zerogradientfvpatchscalarfield>(k_.bounda ryField()[patchi]))
{
FatalErrorIn("wall-function evaluation")
<< k_.boundaryField()[patchi].type()
<< " is the wrong k patchField type for wall-functions on patch "
<< curPatch.name() << nl
<< " should be zeroGradient"
<< exit(FatalError);
}

if (!isType<zerogradientfvpatchscalarfield>(omega_.bo undaryField()[patchi]))
{
FatalErrorIn("wall-function evaluation")
<< omega_.boundaryField()[patchi].type()
<< " is the wrong omega patchField type for wall-functions on patch "
<< curPatch.name() << nl
<< " should be zeroGradient"
<< exit(FatalError);
}

I got quite confused. Does this mean I have to set "zero gradient" NOT "fixed value" at the wall for omega? Does the SST model in 1.4 version use wall function or not? BTW, I defined my "bottomWALL" patch as "wall" not "wall function" in the polyMesh/boundary file. Thanks for your help.

Best regards

Quinn

make August 6, 2007 09:39

Hi Quinn, I'm also using kO
 
Hi Quinn,

I'm also using kOmegaSST.

The kOmegaSST model delivered together with OpenFOAM 1.4 uses wall functions. Have a look in kOmegaSST.C:

# include "kOmegaWallFunctionsI.H"
# include "kOmegaWallViscosityI.H"

So you have to defin omega and k as zeroGradient at the wall patches. I haven't experienced any difficulties so far using this BCs. Hope I'm not mistaken. Seems that there exists another version of kOmega without wall function.

qtian August 6, 2007 09:57

Matthias, Thank you so much
 
Matthias,

Thank you so much for your reply. Can you please answer one more question for me, how can I define the boundary condition for omega at inlet? I read Menter's 1994 paper. At the wall omega_wall=60/0.075*nu/(dy)^2 and free stream omega = U/L or epsilon/k. I have a non uniform k and velocity profile at inlet. I had no experience to define non uniform omega. Can you please share some of your experience. Thanks

Quinn

make August 6, 2007 10:57

Hi Quinn, you don't have to
 
Hi Quinn,

you don't have to set omega at the wall only at the inlet. There I use the relation omega = epsilon/k as you mentioned. I use uniform boundary conditions for omega, so I don't have experiences with nonuniform conditions for omega. How do you define your nonuniform inlet velocity? I guess you can do it with omega in the same way. Knowing your degree of turbulence and the integral length scale you can calculate k and epsilon and then omega by epsilon/k.
So your omega is a function of these three values U, Degree of Turbulence and integral length scale.

qtian August 6, 2007 11:38

Matthias, Thanks for the gr
 
Matthias,

Thanks for the great answer. For the velocity and tke, I had LDV data and just did interpolation at inlet for the nonuniform boundary. I was mistaken that epsilon/k is only valid at the freestream. I realized this is a universal relationship, which we can find in Pope's turbulence book. Thanks for pointing out this. Thanks again for your help.

ivan_cozza January 25, 2009 06:16

Hi Foamers! I'm wondering if
 
Hi Foamers!
I'm wondering if the kOmegaSST model without wallfunctions present on the wiki is available also for 1.5 version. If not, there's someone that could give me some guidelines to modify it?
Thanks!

roth March 23, 2009 12:03

freestream omega
 
I see a few posts suggesting that omega = epsilon / k is a good initialization for the freestream. However, when I examine the code (kOmegaSST.H), the calculation for epsilon is

epsilon = betaStar * k * omega

where betaStar is typically Cmu i.e. 9/100. So shouldn't a better estimate of omega be

omega = 100/9 * epsilon / k ?

Michael

lakeat May 6, 2009 09:09

Also note on CFD-Online WIKI,
http://www.cfd-online.com/Wiki/Turbu...ary_conditions
\epsilon = C_\mu^\frac{3}{4} \, \frac{k^\frac{3}{2}}{l}
\omega = C_\mu^{-\frac{1}{4}} \, \frac{\sqrt{k}}{l}
I dont see \omega = \frac{\epsilon}{k}
Am I missing sth??

lakeat May 6, 2009 09:11

Hi Quinn,
Can you email me a copy of that paper (Menter 1994)? It's not available for my university. Much appreciated.

maruthamuthu_venkatraman July 1, 2009 07:18

Could anyone give some step by step illustration of implimenting these low reynolds number K omega models in OpenFoam 1.5 as referred in link below:

http://openfoamwiki.net/index.php/Tu...e_models_files

I tried to extract the contents and complied them by typing " wmake libso " in the terminal from incompresible directory.

I got an error

kOmega/kOmega.C:111: error: no matching function for call to ‘Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject, Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >, Foam::wordList)’ ...................

Let me know the right way of implimenting the same..

Thanks,
Muthu

gschaider July 1, 2009 10:01

Quote:

Originally Posted by maruthamuthu_venkatraman (Post 221061)
Could anyone give some step by step illustration of implimenting these low reynolds number K omega models in OpenFoam 1.5 as referred in link below:

http://openfoamwiki.net/index.php/Tu...e_models_files

I tried to extract the contents and complied them by typing " wmake libso " in the terminal from incompresible directory.

I got an error

kOmega/kOmega.C:111: error: no matching function for call to ‘Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject, Foam::tmp<Foam::GeometricField<Foam::SymmTensor<do uble>, Foam::fvPatchField, Foam::volMesh> >, Foam::wordList)’ ...................

Let me know the right way of implimenting the same..

The problem is probably that the last change to the page was 2007. That means that the code is for 1.4 or earlier. There were some slight changes to the interface of turbulence-models in the mean time that mean that the code won't compile with 1.5.

Why don't you use the k-omega-model that is already in OF nowadays?

maruthamuthu_venkatraman July 1, 2009 11:17

Thanks for your quick Reply.
Presently iam using OF 1.5 version. I cannot see any K omega model which is implimented with low Reynolds number correction.

The SST k omega version is based on HRN version. May be iam wrong, but i cannot see them in src directory... Pls clarify.

Thanks,
Muthu

gschaider July 1, 2009 11:33

Quote:

Originally Posted by maruthamuthu_venkatraman (Post 221104)
Thanks for your quick Reply.
Presently iam using OF 1.5 version. I cannot see any K omega model which is implimented with low Reynolds number correction.

The SST k omega version is based on HRN version. May be iam wrong, but i cannot see them in src directory... Pls clarify.

Thanks,
Muthu

Don't look at me: I'm no turbulence-expert.

One way to port that turbulence-model is to have a look at (for instance) kEpsion for version 1.5 and version 1.4, compare them and apply the changes to the sources you loaded from the Wiki.

The other solution might be found at
https://openfoam-extend.svn.sourcefo...urbulence/src/

Bernhard

maruthamuthu_venkatraman July 2, 2009 01:24

Thanks for the directions. I went through the link that you gave me , that SSTF version is also based on High Reynlods number model,i.e. Wall function implimentation.

I prefer the first method i.e. By comparing the changes in src files for 1.5 and 1.4 and modify the same and then shall compile in 1.5 version.

I wonder there must be somebody who might use LRN version of SST k omega models in OF 1.5. If anybody there then just give me the right directions, it will save some time...

Thanks

gschaider July 2, 2009 05:26

Quote:

Originally Posted by maruthamuthu_venkatraman (Post 221148)
Thanks for the directions. I went through the link that you gave me , that SSTF version is also based on High Reynlods number model,i.e. Wall function implimentation.

I prefer the first method i.e. By comparing the changes in src files for 1.5 and 1.4 and modify the same and then shall compile in 1.5 version.

I wonder there must be somebody who might use LRN version of SST k omega models in OF 1.5. If anybody there then just give me the right directions, it will save some time...

Thanks

I'm sure that if you succeed you'll either upload it to the Wiki or contact the guys from the Turbulence-SIG to include it in the repository or ask the guys from OpenCFD to include it in the release

Bernhard

maruthamuthu_venkatraman July 6, 2009 04:42

Hi ,
I cannot able to find OF 1.4 version in Web to download the src files. I went this main website

http://www.opencfd.co.uk/openfoam/do....html#download

OF 1.4 is not available there. Let me know is there is anyway to download the src files of the same.


Thanks

gschaider July 6, 2009 14:58

Quote:

Originally Posted by maruthamuthu_venkatraman (Post 221563)
Hi ,
I cannot able to find OF 1.4 version in Web to download the src files. I went this main website

http://www.opencfd.co.uk/openfoam/do....html#download

OF 1.4 is not available there. Let me know is there is anyway to download the src files of the same.


Thanks

Have a look at
http://sourceforge.net/projects/foam/files/

Bernhard

barath.ezhilan July 26, 2009 12:02

Hi,

@Maruthamuthu Venkatraman,

Were you able to implement the model in OpenFoam 1.5?! If yes, can you please share it!!!

waynezw0618 July 26, 2009 22:51

Quote:

Originally Posted by lakeat (Post 215308)
Also note on CFD-Online WIKI,
http://www.cfd-online.com/Wiki/Turbu...ary_conditions
\epsilon = C_\mu^\frac{3}{4} \, \frac{k^\frac{3}{2}}{l}
\omega = C_\mu^{-\frac{1}{4}} \, \frac{\sqrt{k}}{l}
I dont see \omega = \frac{\epsilon}{k}
Am I missing sth??

it seems that you have loss the betaStar..

maruthamuthu_venkatraman July 27, 2009 08:09

Quote:

Originally Posted by barath.ezhilan (Post 224169)
Hi,

@Maruthamuthu Venkatraman,

Were you able to implement the model in OpenFoam 1.5?! If yes, can you please share it!!!

Not yet succeeded!

maolongliu August 4, 2010 10:26

Hi, sorry that I can not find a reference about komega BSL model. Would you please give me a list or link?
Thank you.

Quote:

Originally Posted by panara (Post 199274)
Hi Philippose,

I suggest you to read the articles I used as reference for the model implementation (see the Wiki)

in short, the k-omega BSL is a mix of k-omega near the wall and k-epsilon outside the near wall region.
This is done because it is easier to give freestream condition in terms of epsilon rather than omega.

at the wall you have to specify omega using the relation

omega=10*(6*nu)/(0.075*Dy1^2)

where Dy1 is the distance from the wall at the first grid point. Dy1 should be in the laminar sublayer.

In the freestream remember that omega is
equal to epsilon/k.

The k-Omega SST is the same as the BSL but it satisfy also the Bradshaw assumption that the shear stress in a boundary layer is proportional to the turbulent kinetic energy. (see the article for details)

The k-Omega SST sas is very different. In stable flow it behaves exactly as the k-Omega SST but in 3D flows with instabilities it behaves like an LES computation. When instabilities appear the model tends to decrease the turbulent viscosity up to the LES like value. The result is analogous to a LES computation. (see articles for details)

Hope that this helps you,

have fun,
Daniele



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