|
[Sponsors] |
Progamming issue: how do i get acces to the actual values of k-epsilon? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 7, 2010, 13:18 |
Progamming issue: how do i get acces to the actual values of k-epsilon?
|
#1 |
Member
Sabin Ceuca
Join Date: Mar 2010
Location: Munich
Posts: 42
Rep Power: 16 |
Hi,
after some struggling with the setup of OpenFOAM simulations, I have now started to write my own models. My first difficulties arose when i wanted to get access to the desired variables. What I actualy mean is lets take for example the density or the specific heat capacity which can be called using "twoPhaseProperties.variableName". Now I would like to have access to the actual values of for instance k-epsilon variables, but I would like to understand how do I generally find out where certain variables are computed and how to access them? Greetings Sabin |
|
July 8, 2010, 04:18 |
|
#2 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hello Sabin,
could you tell me which solver and which version you're using? In your solver (interFoam.C) which might be for example rasInterFoam (older version) or now interFoam (actual version) you will find a line turbulence->correct(); which will actually call the turbulence model. the object turbulence is assigned in the createFields.H file in 00095 // Construct incompressible turbulence model 00096 autoPtr<incompressible::turbulenceModel> turbulence 00097 ( 00098 incompressible::turbulenceModel::New(U, phi, twoPhaseProperties) 00099 ); There you can see where it comes from. It is an incompressible turbulenceModel, so you have to search in src/turbulenceModel/incompressible/turbulenceModel or src/turbulenceModel/RAS/incompressible/RASModel, depending on the version you're using. . There you will find the files turbulenceModel.C turbulenceModel.H and newTurbulenceModel.C respectively RASModel.C RASModel.H and newRASModel.C Here you will find the reading from your turbulence dictionary and the setting of the turbulence model. From now on it depends which model you are using. If you give me more information I can try to help you figuring it out. Best Kathrin Last edited by kathrin_kissling; July 8, 2010 at 07:25. |
|
July 8, 2010, 07:12 |
|
#3 |
Member
Sabin Ceuca
Join Date: Mar 2010
Location: Munich
Posts: 42
Rep Power: 16 |
Morning Kathrin,
thanks for the answer Sorry that I forgot to mention which solver I am using (it's interFoam from OF 1.6) . By looking into this http://foam.sourceforge.net/doc/Doxygen/html/incompressible_2turbulenceModel_2turbulenceModel_8 H_source.html I would understand that if I need the turbulence kinetic energy (k) I should be able to call it by volScalarField turbKinEnergy = turbulence.k(); , because the turbulence kinetic energy is defined in the file turbulenceModel.H as: virtual tmp<volScalarField>k() const = 0; But it's not working.. During the compilation I get the error ‘class Foam::autoPtr<Foam::incompressible::turbulenceMode l>’ has no member named ‘k’ Do you have an idea how I can access this variable? Greetings Sabin |
|
July 8, 2010, 07:39 |
|
#4 |
Member
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17 |
||
July 8, 2010, 08:00 |
|
#5 |
Member
Sabin Ceuca
Join Date: Mar 2010
Location: Munich
Posts: 42
Rep Power: 16 |
Thanks r08n and Kathrin for helping me out, within such a short time.
|
|
August 29, 2012, 15:41 |
Could you please explain wht this works?
|
#6 | |
New Member
|
Quote:
Thanks a lot, Xinyu |
||
March 14, 2013, 04:29 |
|
#7 | |||
Senior Member
|
Dear Foamers,
I recently encountered the same problem regarding the access to the turbulence kinetic energy! By follwing the advice of this thread Quote:
Quote:
Quote:
Regards Marco |
||||
March 20, 2013, 21:50 |
|
#8 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Marco,
This is because you can't define a initialize a parameter in the constructor in the manner you are attempting. Code:
const volScalarField& turbKinEnergy = turbulence().k(), Code:
const volScalarField& turbKinEnergy, |
|
March 21, 2013, 02:18 |
|
#9 | |
Senior Member
|
Hi Daniel,
First I thanks you for your reply! I am dealing with another problem! I implement a homogenoeus multiphase problem using pimple loop! I add a new transport scalar equation with variable density and I want to update my density after tha computing of the scalar quantity! Here is the code : Quote:
Moreover, what about the rhoPhi variable? Here is the whole solver! Thanks Regards Marco |
||
Tags |
programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SimpleFoam k and epsilon bounded | nedved | OpenFOAM Running, Solving & CFD | 16 | March 4, 2017 09:30 |
k and epsilon Values for High Pressure Water | nikhiljain.iitk | FLUENT | 0 | March 12, 2010 07:06 |
SimpleFoam k and epsilon bounded | nedved | OpenFOAM Running, Solving & CFD | 1 | November 25, 2008 21:21 |
Modify, G_k,k and epsilon values on wall functions | Javier Larrondo | FLUENT | 0 | September 15, 2008 22:34 |
Values of k & epsilon in the moving wall | ghlee | Main CFD Forum | 1 | August 16, 1999 13:42 |