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

LES best practice: resolved and modelled turbulence kinetic energy

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree15Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2018, 08:13
Default LES best practice: resolved and modelled turbulence kinetic energy
  #1
New Member
 
Emily
Join Date: Nov 2017
Posts: 24
Rep Power: 8
em17 is on a distinguished road
Hello,

I am running an LES simulations with the WALE subgrid-scale model and am looking for some clarification on turbulence properties. To help validate my mesh, I would like to know how much of the turbulence kinetic energy is directly resolved and how much is modelled with the subgrid-scale model. Could anyone tell me how this can be done directly in OpenFOAM? I.e. what calculations I need to perform?

Reading through the forums, some people have said that R gives the modelled Reynolds stress tensor and that Uprime2Mean gives the resolved Reynolds stress tensor. Is this correct? If that's the case, does that mean the total Reynolds stress tensor is simply given by R + Uprime2Mean? Then I can simply find the percentage of resolved k as Uprime2Mean/(R + Uprime2Mean)? Please correct me if I am wrong.

Since looking into this, it has raised further questions regarding the run time output of the turbulence kinetic energy, k. Is this the total, resolved or modelled turbulence kinetic energy?

Thank you,
Em
em17 is offline   Reply With Quote

Old   December 13, 2018, 10:25
Default
  #2
ano
Member
 
ano
Join Date: Jan 2017
Location: Delft
Posts: 58
Rep Power: 10
ano is on a distinguished road
Quote:
Reading through the forums, some people have said that R gives the modelled Reynolds stress tensor and that Uprime2Mean gives the resolved Reynolds stress tensor. Is this correct? If that's the case, does that mean the total Reynolds stress tensor is simply given by R + Uprime2Mean?
Yes that is correct.

Quote:
Then I can simply find the percentage of resolved k as Uprime2Mean/(R + Uprime2Mean)? Please correct me if I am wrong.
Basically yes, you have to take the trace to get the kinetic energy from the Reynolds stress tensor, i.e. (1/2*tr(Uprime2Mean))/(1/2*tr(R + Uprime2Mean)).

Quote:
Since looking into this, it has raised further questions regarding the run time output of the turbulence kinetic energy, k. Is this the total, resolved or modelled turbulence kinetic energy?
k gives only the subgrid part. You can have a look at the source documentation, search for "k()":

https://www.openfoam.com/documentati...E.html#details

And to dig more into detail into the WALE files itself:
https://www.openfoam.com/documentati...8H_source.html
https://www.openfoam.com/documentati...8C_source.html
ano is offline   Reply With Quote

Old   December 17, 2018, 06:09
Default
  #3
New Member
 
Emily
Join Date: Nov 2017
Posts: 24
Rep Power: 8
em17 is on a distinguished road
Thank you for your detailed reply - you've really helped to clarify this!
em17 is offline   Reply With Quote

Old   September 25, 2019, 06:06
Default
  #4
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
I know this thread is from a few months ago but recently I have modified pimpleFoam to calculate the resolved turbulent kinetic energy and dissipation rate at run-time.

The solver is also calculating the ratio of k_res/(k_res+k_sgs) at run-time.

You can download it from this repository.

I have tested it in a channel flow at Re_t=395 and is working fine, but any feedback is welcome.
Andrea1984 is offline   Reply With Quote

Old   October 5, 2019, 01:01
Default
  #5
Member
 
godfatherBond's Avatar
 
Maximus Arelius
Join Date: Jan 2017
Location: Morocco
Posts: 34
Rep Power: 9
godfatherBond is on a distinguished road
Quote:
Originally Posted by Andrea1984 View Post
I know this thread is from a few months ago but recently I have modified pimpleFoam to calculate the resolved turbulent kinetic energy and dissipation rate at run-time.

The solver is also calculating the ratio of k_res/(k_res+k_sgs) at run-time.

You can download it from this repository.

I have tested it in a channel flow at Re_t=395 and is working fine, but any feedback is welcome.
Hi Andrea,
Could you tell for what version of OF was this orignally created? I am having some issues compiling it. I am using OF5.x.


EDIT: Got it to work in OF5.x. I think it was written using OpenFOAM-dev. Did your setup of Channel ReTau=395 was having the LESResIndex~0.8?
__________________
--
🃏Maximus🃏
godfatherBond is offline   Reply With Quote

Old   October 5, 2019, 05:58
Default
  #6
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
I have actually written in for OF-6, but it's good to know that is working now!

I have created a new mesh from scratch for my channel flow simulation at Re_t=395 so you cannot directly compare your Resolution Index with mine.

Andrea
Andrea1984 is offline   Reply With Quote

Old   November 29, 2019, 00:06
Default
  #7
Member
 
godfatherBond's Avatar
 
Maximus Arelius
Join Date: Jan 2017
Location: Morocco
Posts: 34
Rep Power: 9
godfatherBond is on a distinguished road
Quote:
Originally Posted by Andrea1984 View Post
I have actually written in for OF-6, but it's good to know that is working now!

I have created a new mesh from scratch for my channel flow simulation at Re_t=395 so you cannot directly compare your Resolution Index with mine.

Andrea
Hi Andrea,
If you see Pope's Ten questions concerning LES, to calculate the LES index shouldn't the quantities Ksgs and Kres be averaged in time and them the ratio of them (averaged Ksgs and Kres) be used to calculate LESResIndex. Your code is calculating the instantaneous value, shouldn't it be doing that using averaged values?
Please correct me if I am wrong!
__________________
--
🃏Maximus🃏
godfatherBond is offline   Reply With Quote

Old   November 29, 2019, 05:22
Default
  #8
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
Hi, please see my answer on this other thread

Andrea
Andrea1984 is offline   Reply With Quote

Old   April 16, 2020, 12:01
Default
  #9
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Quote:
Originally Posted by em17 View Post
Hello,

I am running an LES simulations with the WALE subgrid-scale model and am looking for some clarification on turbulence properties. To help validate my mesh, I would like to know how much of the turbulence kinetic energy is directly resolved and how much is modelled with the subgrid-scale model. Could anyone tell me how this can be done directly in OpenFOAM? I.e. what calculations I need to perform?

Reading through the forums, some people have said that R gives the modelled Reynolds stress tensor and that Uprime2Mean gives the resolved Reynolds stress tensor. Is this correct? If that's the case, does that mean the total Reynolds stress tensor is simply given by R + Uprime2Mean? Then I can simply find the percentage of resolved k as Uprime2Mean/(R + Uprime2Mean)? Please correct me if I am wrong.

Since looking into this, it has raised further questions regarding the run time output of the turbulence kinetic energy, k. Is this the total, resolved or modelled turbulence kinetic energy?

Thank you,
Em
Hi bro, I am also stuck at the same state of finding the R from the channel flow (pimpleFoam case). Can you please help me how you actually found the R from?
ari003 is offline   Reply With Quote

Old   April 16, 2020, 12:21
Default
  #10
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Quote:
Originally Posted by Andrea1984 View Post
I know this thread is from a few months ago but recently I have modified pimpleFoam to calculate the resolved turbulent kinetic energy and dissipation rate at run-time.

The solver is also calculating the ratio of k_res/(k_res+k_sgs) at run-time.

You can download it from this repository.

I have tested it in a channel flow at Re_t=395 and is working fine, but any feedback is welcome.
Hi Andreas, can you help me how can I compile this into the pimpleFoam solver?
ari003 is offline   Reply With Quote

Old   April 16, 2020, 13:03
Default
  #11
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
Hi Arijit, this is a self-contained solver. You can compile and then use it instead of pimpleFoam. It is essentially as pimpleFoam but it also calculate some useful statistics for LES.

Simply clone the repository and execute wmake to compile the solver. I have developed this in OpenFOAM 6.0 so it should work without any issues on that version, not 100% sure about other versions.
Andrea1984 is offline   Reply With Quote

Old   April 16, 2020, 13:33
Default
  #12
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Quote:
Originally Posted by Andrea1984 View Post
Hi Arijit, this is a self-contained solver. You can compile and then use it instead of pimpleFoam. It is essentially as pimpleFoam but it also calculate some useful statistics for LES.

Simply clone the repository and execute wmake to compile the solver. I have developed this in OpenFOAM 6.0 so it should work without any issues on that version, not 100% sure about other versions.
Yes Andreas, I am new to this openfoam and I am exactly in the intention to find the resolved Kinetic energy part . If you could please tell the steps how to compile,it will be really helpful. I ve tried to go through some youtube videos but those were not much helpful.
ari003 is offline   Reply With Quote

Old   April 16, 2020, 14:09
Default
  #13
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
Copy the files from the repository in a suitable folder in your machine. Usually this is $WM_PROJECT_USER_DIR/applications/solvers but it can be any folder you can write into

Within the folder where you copied the source code execute wmake

If this is successful you should now have a pimpleTKEBudgetFoam executable that you can run as you would run the standard pimpleFoam solver
Andrea1984 is offline   Reply With Quote

Old   April 16, 2020, 14:51
Default
  #14
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
I ve been trying is method as following:-
1. I made a seperate folder consisting of solvers and channel365(as I m trying to simulate that LES flow).
2. In the solvers folder I had taken the pimpleFoam and the pimpleTKEBudgetFoam(the one which is your modified one).
3. Then I started the terminal and initiated with sudo bash.
4. Then I typed wmake but there are some some errors which is popping up.
And with this post I m also attaching the pics which will help you to better understand my problem.
ari003 is offline   Reply With Quote

Old   April 16, 2020, 15:43
Default
  #15
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
I don't see any obvious issue with what you did. Maybe this is related to the fact that I have developed the solver for OpenFOAM 6.0 and you are using 7.0?
Andrea1984 is offline   Reply With Quote

Old   April 16, 2020, 19:31
Default
  #16
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Yes it is OpenFoam7 and what is the solution to that?
ari003 is offline   Reply With Quote

Old   April 16, 2020, 21:20
Default
  #17
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Yaa after lot of trial it is finally done. I have kept the folders similar to pimpleFoam solver where it was showing error. But I didnt found any PimpleTKEBudgetFoam executable file. Even I have modified the solver from pimpleFoam to PimpleTKEBudgetFoam in controlDict but when I m writing the PimpleTKEBudgetFoam in terminal it is showing command not found and it is running properly( as usual) with pimpleFoam.
ari003 is offline   Reply With Quote

Old   April 17, 2020, 07:23
Default
  #18
New Member
 
Emily
Join Date: Nov 2017
Posts: 24
Rep Power: 8
em17 is on a distinguished road
Quote:
Originally Posted by ari003 View Post
Hi bro, I am also stuck at the same state of finding the R from the channel flow (pimpleFoam case). Can you please help me how you actually found the R from?
Hi Arijit,

You can write out the modelled (subgrid) Reynolds stress tensor during run time by including the following in your controlDict

functions
{
#includeFunc R
{

You will also need to copy the file 'R' to your system directory, which can be copied from $FOAM_ETC/caseDicts/postProcessing/fields/R (the location may be slightly different depending on which version of OpenFOAM you use). This will write out the modelled Reynolds stress tensor in your time directories, just like U and p.

Once you have this and the resolved Reynolds stresses (UPrime2Mean) you can follow what Ano replied earlier in the thread to calculate how much of the field is modelled/resolved.
em17 is offline   Reply With Quote

Old   April 17, 2020, 11:27
Default
  #19
Senior Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 132
Rep Power: 7
ari003 is on a distinguished road
Thanks Emi for the reply. I have figured out the way to find R and Uprime2mean and then I can do the calculation in excel spreadsheet right?
In this formula 1/2tr(Uprime2Mean))/(1/2tr(R + Uprime2Mean) what does this tr denotes?
ari003 is offline   Reply With Quote

Old   April 17, 2020, 12:37
Default
  #20
New Member
 
Emily
Join Date: Nov 2017
Posts: 24
Rep Power: 8
em17 is on a distinguished road
I'd recommend opening the simulation in paraview and then you can use the calculator function - which is very straightforward.

tr(...) means the trace of the tensor. Both R and UPrime2Mean are 3x3 tensors, so you can calculate the trace by summing the three diagonal elements.
em17 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Dissipation calculation in LES - Isotropic turbulence MaryBau Main CFD Forum 3 March 25, 2014 15:33
Eddy viscosity ratio and LES Lance CFX 13 April 29, 2013 19:02


All times are GMT -4. The time now is 18:51.