CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to get reference to k and epsilon in the epsEqn and kEqn

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2011, 10:16
Default How to get reference to k and epsilon in the epsEqn and kEqn
New Member
Xuan Cai
Join Date: Mar 2011
Location: Karlsruhe, Germany
Posts: 9
Rep Power: 15
cfd_explorer is on a distinguished road
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?

cfd_explorer is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
How to get reference to k and epsilon in the epsEqn and kEqn cfd_explorer OpenFOAM 0 March 10, 2011 09:58
Convergence Luiz Eduardo Bittencourt Sampaio (Sampaio) OpenFOAM Running, Solving & CFD 11 July 20, 2005 06:33

All times are GMT -4. The time now is 04:54.