CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Production and Destruction terms

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Tobermory
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 12, 2024, 03:57
Default Production and Destruction terms
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 232
Rep Power: 10
gu1 is on a distinguished road
Hello,

If I want to obtain the production values and in particular, destruction term of the equation below, how do I do it? Could anyone guide me?

Code:
tmp<fvScalarMatrix> kEqn
    (
        fvm::ddt(alpha, rho, k_)
      + fvm::div(alphaRhoPhi, k_)
      - fvm::laplacian(alpha*rho*DkEff(), k_)
     ==
        alpha*rho*G
      - fvm::SuSp((2.0/3.0)*alpha*rho*divU, k_)
      - fvm::Sp(this->Ce_*alpha*rho*sqrt(k_)/this->delta(), k_)
      + kSource()
      + fvModels.source(alpha, rho, k_)
    );
Thanks
gu1 is offline   Reply With Quote

Old   January 23, 2024, 10:51
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 717
Rep Power: 14
Tobermory will become famous soon enough
I used to think that this was impossible, without creating your own clone of the turbulence model and explicitly adding in coding to make the field write to disk. However - I found this recently: at the bottom of the controlDict in the simpleFoam/pitzDaily tutorial (foundation v8) is the following:

Code:
cacheTemporaryObjects
(
    kEpsilon:G
);

functions
{
    #includeFunc writeObjects(kEpsilon:G)
}
and you can probably guess what it is doing - cacheing the production term in the Registry, thereby making it available for the writeObject FO. Sure enough, when you run the tutorial case, there is the data.

So, you can force the code to write tmp<> variables ... which is not quite what you are after since the destruction term is expressed as a composite term, and not as a tmp<> volField, but it may be a step in the right direction? Good luck.
dlahaye likes this.
Tobermory is offline   Reply With Quote

Old   January 26, 2024, 06:49
Default
  #3
Senior Member
 
NotOverUnderated's Avatar
 
ONESP-RO
Join Date: Feb 2021
Location: Somwhere on Planet Earth
Posts: 127
Rep Power: 5
NotOverUnderated is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
I used to think that this was impossible, without creating your own clone of the turbulence model and explicitly adding in coding to make the field write to disk. However - I found this recently: at the bottom of the controlDict in the simpleFoam/pitzDaily tutorial (foundation v8) is the following:

Code:
cacheTemporaryObjects
(
    kEpsilon:G
);

functions
{
    #includeFunc writeObjects(kEpsilon:G)
}
and you can probably guess what it is doing - cacheing the production term in the Registry, thereby making it available for the writeObject FO. Sure enough, when you run the tutorial case, there is the data.

So, you can force the code to write tmp<> variables ... which is not quite what you are after since the destruction term is expressed as a composite term, and not as a tmp<> volField, but it may be a step in the right direction? Good luck.
That's interesting, thank you for sharing that tip

I use OpenFOAM v2312 so that trick doesn't work unfortunately.

But I am not sure why do you need to clone the turbulence model to compute the production term when it could be simply computed using:

P = \tau_{ij} \frac{\partial u_i}{\partial x_j}

The production term of TKE is the double inner product of the Reynolds stress tensor and the velocity gradient tensor.

This can be computed using a coded function object (or expressions?).

Regards
__________________
Don't keep making the same mistakes. Try to make new mistakes.
NotOverUnderated is offline   Reply With Quote

Old   January 26, 2024, 07:24
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 717
Rep Power: 14
Tobermory will become famous soon enough
The benefit of cloning the model rather than trying to calculate it yourself is that you see exactly the values that are being used in the turbulence model ... the value you calculate may be slightly different.
NotOverUnderated likes this.
Tobermory is offline   Reply With Quote

Reply

Tags
openfoam9


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
Point implicit treatment of k-e source terms andy Main CFD Forum 5 June 9, 2006 11:03


All times are GMT -4. The time now is 15:59.