CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   Inlet BC for k-epsilon model (

Per March 6, 2012 07:47

Inlet BC for k-epsilon model

I am simulating pipe flow using simpleFoam. Instead of using a fixed value for k and epsilon at the inlet I am considering using for instance the turbulentIntensityKineticEnergyInlet condition for k.

Internal field and inlet conditions for k are:

internalField uniform 9.375e-4;

type turbulentIntensityKineticEnergyInlet;
intensity 0.05; // Turbulent intensity
value $internalField;

Does (value $internalField) mean that it is calculated based on the initial internal field for k or the inlet BC for U, which is (0.5 0 0)? My (internalField uniform 9.375e-4) is calculated as k=1.5(Uavg*I)^2, where I=0.05. The turbulentIntensityKineticEnergyInlet condition is copied from an OpenFOAM tutorial case.

The k and epsilon file is renamed k.old and epsilon.old when I run simpleFoam. The new OpenFOAM generated k file has this inlet condition:

type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
U U;
phi phi;
value uniform 0.0009375;


calim_cfd March 6, 2012 21:34

what you stated seems right

and the turbulentIntensityKineticEnergyInlet BC is inletoutlet type if im not mistaken.. which means it will fix the value for inflow and zerograd for outflow

and at line 146 of the respect *.C file you have it

    this->refValue() = 1.5*sqr(intensity_)*magSqr(Up);
and the renaming of files is nothing to worry about.. just more complete statements nothing rly new :D

Per March 7, 2012 05:42

Thanks for the reply calim :)

I have actually not thought about that inlet condition as an inletOutlet (or outletInlet?) type. This certainly makes it more versatile. I found out (by experimenting with my initial conditions) that the inlet value for k (or epsilon for that matter) is calculated based on the intensity and initial magnitude of the velocity at the inlet (as you said) and is kept throughout the simulation, while the other fields are reference values used for startup of the simulation. Does anyone know why wall conditions (uniform value) not are kept for k and epsilon when using wall functions? Or more precise: are zeroGradient condition used (and appropriate) at walls for k and epsilon when using a wall function?


calim_cfd March 7, 2012 14:03

when you use wall functions, the value you set for k/epi at the wall patches is not rly used as result/input. It's just an initialization option and sort of requirement for paraview regarding time 0/

you specify the values for k/epis based at inlet/oultet based on you flow/geometry. These are fixed until the end of your simulation!

The value at the wall boundaries will change throughout the simulation. Constant values at the wall will be true only for, say a straight pipe with developed flow...:eek:.. sth like that...

vahid.najafi July 29, 2012 02:20

tell me please???
Hello Dear foamers.
I have a question???

I want to add k(kinetic turbulence energy) in solver interPhaseChangeFoam.
for this reason, added next line in this:

const volScalarField &k=U_.db().lookupObject<volScalarField>("k")
and wmake was Successfully .

but How can I Understand that this k is the same with k(kinetic turbulence energy)???Is it true?????
I replased M Instead k in Top Line :

const volScalarField &M=U_.db().lookupObject<volScalarField>("M")
but nothing error was not occured!!!!!!??????

Thanks alot.

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