CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   How to get reference to k and epsilon in the epsEqn and kEqn (

cfd_explorer March 10, 2011 10:58

How to get reference to k and epsilon in the epsEqn and kEqn
Now I am using the standard k-epsilon turbulence model using openFoam

And the k-epsilon equations are implemented in the file src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C, and the codes exactly representing the k equation and epsilon equation are as follows:

================================================== ========
// Turbulent kinetic energy equation
tmp<fvScalarMatrix> kEqn
+ fvm::div(phi_, k_)
- fvm::Sp(fvc::div(phi_), k_)
- fvm::laplacian(DkEff(), k_)
- fvm::Sp(epsilon_/k_, k_)

// Dissipation equation
tmp<fvScalarMatrix> epsEqn
+ fvm::div(phi_, epsilon_)
- fvm::Sp(fvc::div(phi_), epsilon_)
- fvm::laplacian(DepsilonEff(), epsilon_)
- fvm::Sp(C2_*epsilon_/k_, epsilon_)
================================================== ========
Now I want to use the values of "k" and "espilon" in the k-epsilon equations in other functions or files to compute the source terms and then add them to the k and epsilon equation.

Previously, I found in the use of porousMedia class which adds the source term to the Momentum equation, when we have:
================================================== =========
tmp<fvVectorMatrix> UEqn
fvm::div(phi, U)
+ turbulence->divDevReff(U)
================================================== ==========
Then the use and reference to the velocity and source term in the above momentum equation are achieved by using "UEqn.source( )" and "UEqn.psi( )" in the code,
So I wonder whether can I use kEqn.source( ) or kEqn.psi( ) or kEqn.otherfunction( ) to get the values of k and epsilon?

Could anyone give some suggestions or hints?


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