- **OpenFOAM**
(*https://www.cfd-online.com/Forums/openfoam/*)

- - **How to get reference to k and epsilon in the epsEqn and kEqn**
(*https://www.cfd-online.com/Forums/openfoam/85960-how-get-reference-k-epsilon-epseqn-keqn.html*)

How to get reference to k and epsilon in the epsEqn and kEqnNow 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::ddt(k_) + fvm::div(phi_, k_) - fvm::Sp(fvc::div(phi_), k_) - fvm::laplacian(DkEff(), k_) == G - fvm::Sp(epsilon_/k_, k_) ); // Dissipation equation tmp<fvScalarMatrix> epsEqn ( fvm::ddt(epsilon_) + fvm::div(phi_, epsilon_) - fvm::Sp(fvc::div(phi_), epsilon_) - fvm::laplacian(DepsilonEff(), epsilon_) == C1_*G*epsilon_/k_ - 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? Thanks |

All times are GMT -4. The time now is 07:29. |