CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

turbulence->k()

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2019, 04:22
Default turbulence->k()
  #1
Member
 
Vivek
Join Date: Mar 2018
Location: India
Posts: 54
Rep Power: 8
vivek05 is on a distinguished road
Hi,
I want to access "turbulent kinetic energy" and "nut" value in each cell. I am using OF-5.0 version. So I have implemented in following manner.

PHP Code:
volScalarField turb_nut turbulence->nut();
     
volScalarField turb_k turbulence->k();
     
forAll(mesh.cells(),celli) {
     if (
condition) {
     
Source[celli] = (...*(turb_k[celli]/(a+turb_nut[celli]))*...).value();
     } 
     else {
     
Source[celli] = scalar(0.0);
      }
     } 
where Source is volScalarField
a is dimensionedScalar
... represents combination of constant and volScalarField
The way I am accessing "k" and "nut" is it correct??
What does -> operator do in turbulence->k()
Thanks,
Vivek S
vivek05 is offline   Reply With Quote

Old   June 21, 2019, 03:27
Default
  #2
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Quote:
Originally Posted by vivek05 View Post
Hi,
I want to access "turbulent kinetic energy" and "nut" value in each cell. I am using OF-5.0 version. So I have implemented in following manner.

PHP Code:
volScalarField turb_nut turbulence->nut();     volScalarField turb_k turbulence->k();     forAll(mesh.cells(),celli) {     if (condition) {     Source[celli] = (...*(turb_k[celli]/(a+turb_nut[celli]))*...).value();     }      else {     Source[celli] = scalar(0.0);      }     } 
where Source is volScalarField
a is dimensionedScalar
... represents combination of constant and volScalarField
The way I am accessing "k" and "nut" is it correct??
What does -> operator do in turbulence->k()
Thanks,
Vivek S
turbulence->k() is the RESIDUAL turbulent kinetic energy. the total tke would be the sum of the resolved tke and said residual tke.
Santiago is offline   Reply With Quote

Old   June 21, 2019, 04:03
Talking
  #3
Member
 
Vivek
Join Date: Mar 2018
Location: India
Posts: 54
Rep Power: 8
vivek05 is on a distinguished road
Quote:
Originally Posted by Santiago View Post
turbulence->k() is the RESIDUAL turbulent kinetic energy. the total tke would be the sum of the resolved tke and said residual tke.
Thanks Santiago for your reply.

In LES simulation k() gives us subgrid kinetic energy. But I want to know how can I access ksgs in each cell? First I am storing turbulence-k() in variable called turb_k which is volumetric scalar field.

volScalarField turb_k = turbulence->k();
volSclarField turb_nut = turbulence->nut();

Then I am using forAll loop for spatial marching over cells

PHP Code:
forAll(sourceElsa celli) {
If(
condition)
sourceElsa = (...*turb_k[celli]/turb_nut[celli]*...);

Is it correct way to access turbulent kinetic energy?
It has also taking lot of time to calculate sourceElsa. How can I program it efficiently?


Thanks
Vivek S
vivek05 is offline   Reply With Quote

Reply


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
Average Turbulence Intensity in LES M_Hego Visualization & Post-Processing 0 July 24, 2018 16:18
Turbulence postprocessing Mohsin FLUENT 2 October 3, 2016 15:18
Turbulence length scale Leonpolou FLUENT 2 January 23, 2013 08:26
How to implement turbulence in one Solver??? vahid.najafi OpenFOAM Programming & Development 0 July 29, 2012 06:46
Code release: Flow Transition and Turbulence Chaoqun Liu Main CFD Forum 0 September 26, 2008 18:15


All times are GMT -4. The time now is 14:33.