How to calculate tke?
Hello,
I'm trying to calculate the tke in interfoam but I can't call k. This file goes next to the Courant calculation in the solver structure. Can anybody help me to call k? Thank you. This is the code: Code:
scalar TkeSum = 0.0; I get this error: Code:
allTke.H: In function ‘int main(int, char**)’: |
Hi lourencosm,
You should do: scalarField Tke (rho*mesh.V().field()*k.value()); Best Regards, GoodLuck ! T.D. Quote:
|
Thank you T.B. but it still no working.
(k is meant to be from the k-epsilon turbulent model) Now I get this error: Code:
allTke.H: In function ‘int main(int, char**)’: |
Hi,
@lourencosm Where do you try to add this code? Inside the solver, inside the turbulence model, somewhere else? Compiler tried to do its best to guess what you are trying to say, but was not successful as he suggested you Boltzmann constant instead of kinetic turbulent energy. |
In the interfoam.C file, therefore the solver main file.
Code:
int main(int argc, char *argv[]) |
Hi,
In this case you have turbulence variable of type autoPtr<incompressible::turbulenceModel> turbulence, which is created in createFields.H file. incompressible::turbulenceModel class has k method which returns TKE. So finally your code should be something like: Code:
dimensionedScalar totalTKE(fvc::domainIntegrate(rho*turbulence->k())); |
Thank you very much alexeym!
I was driving nuts! I had already tried RASModel->k() and turbulenceModel->k() with no result. Thank you. I ended up by using this function because I need the air, water and interface values as well: Code:
scalar waterTkeSum = 0.0; |
All times are GMT -4. The time now is 21:55. |