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

Utilities: post average turbulence fields and create turbulence fields for LES

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

Like Tree35Likes
  • 35 Post By Hanzo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2013, 09:39
Default Utilities: post average turbulence fields and create turbulence fields for LES
  #1
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 16
Hanzo is on a distinguished road
Hi everybody,

I found the following issues in OpenFOAM concerning some turbulence analysis:

- the utility createTurbulenceFields only works for RAS computations
- there is no standard utility to average fields after computation has been done (to get U-mean, U-rms, R-Mean, Reff-Mean ...)

So I worked on these utilities and after mentioning it in some posts I got replies and private messages asking me if I could publish them. So here they are:

createTurbulenceFieldsLES

Is a tools which writes out the fields k,epsilon, R, Reff after a RAS or LES simulation has been performed.

postAverageTurbulenceFields


Inspired by eelcovv, who wrote the tool postAverage, I extended his tools to be also able to post average the fields R and Reff. Again RAS and LES are supported.
The post can be found here http://www.cfd-online.com/Forums/ope...rocessing.html

How to use these utilities

Please find attached the modified tutorials

- pitz_daily_les
- cavity_ras

Including Allrun scripts which show how to use these tools.

How to install

- copy the contents from the archives "postAverageTurbulenceFields.zip" and "createTurbulenceFieldsLES.zip" into the folder username-2.1.1/application/utilities

- go into each of the folders postAverageTurbulenceFields and createTurbulenceFieldsLES and type wmake

It also worked under OpenFOAM 1.6.

Known issues


- for some reason, which I did not figure out, averaging the Reynolds stress tensor for RAS computations does not work (but works for Reff)

- if the output setting for the averaging is set to certain values, nothing is written. However, it works for output intervals 1 and 2 (just delete the unnecessary files after averaging)

I am happy about any comments how to improve these tools or if there is a better way to post own code.

Best,
Hanzo
Attached Files
File Type: zip createTurbulenceFieldsLES.zip (2.8 KB, 699 views)
File Type: zip postAverageTurbulenceFields.zip (3.7 KB, 721 views)
File Type: zip cavity_ras.zip (15.5 KB, 308 views)
File Type: zip pitz_daily_les.zip (15.7 KB, 381 views)
Hanzo is offline   Reply With Quote

Old   February 9, 2013, 16:37
Default
  #2
Senior Member
 
atmcfd's Avatar
 
ATM
Join Date: May 2009
Location: United States
Posts: 104
Rep Power: 17
atmcfd is on a distinguished road
Hanzo,

Great work and thanks for all the efforts you have put in. I will give these tools a try and let you know.


Best,

A.T.M
atmcfd is offline   Reply With Quote

Old   November 6, 2013, 04:36
Default Energy spectrum - LES simulation
  #3
New Member
 
Gustavo
Join Date: Feb 2010
Location: Curitiba - PR - Brasil
Posts: 16
Rep Power: 16
ghindi is on a distinguished road
Hi there!

I'm relatively new to LES simulation and I'm struggling now to post-process energy spectrum to verify the -5/3 law for my model.

Does anyone know how to extract/create that field in OF?

Best regards,
Gustavo.
ghindi is offline   Reply With Quote

Old   November 26, 2014, 17:14
Default Want to calculate UPrime2Mean
  #4
New Member
 
rakendd's Avatar
 
Rakend D K
Join Date: Jul 2014
Posts: 3
Rep Power: 12
rakendd is on a distinguished road
Hi all
Sorry for opening up this old thread.
I want to calculate UPrime2Mean in LES post-processing.
createTurbulenceFieldsLES is calculating R and Reff but these values are different from UPrime2Mean
postAverageTurbulenceFields giving
Quote:
Create time

Create mesh for time = 0

Adding fields for time 0
Reading field p

Reading field k

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type LESModel
Selecting LES turbulence model oneEqEddy
--> FOAM Warning :
From function cubeRootVolDelta::calcDelta()
in file cubeRootVolDelta/cubeRootVolDelta.C at line 52
Case is 2D, LES is not strictly applicable

oneEqEddyCoeffs
{
ce 1.048;
ck 0.094;
}

Reading/calculating field UMean

Reading/calculating field pMean

Reading/calculating field UPrime2Mean

Reading/calculating field pPrime2Mean

fieldAverage: starting averaging at time 0

Calculating averages
but nothing is being calculated.
Can someone help me in this...
Thank you.
rakendd is offline   Reply With Quote

Old   June 16, 2016, 18:12
Default Report a bug
  #5
New Member
 
Jie (Jay) Zhang
Join Date: Sep 2010
Location: Phoenix, AZ, U.S.
Posts: 28
Rep Power: 16
jiez is on a distinguished road
Nice job but there seems to be a bug:
For some reason, if do not specify time range, the createTurbulenceFieldsLES utility calculates only based on the velocity solution in the first read, resulting in identical k, epsilon, R, Reff for all times.
jiez is offline   Reply With Quote

Old   June 16, 2016, 21:22
Default Bug fixed
  #6
New Member
 
Jie (Jay) Zhang
Join Date: Sep 2010
Location: Phoenix, AZ, U.S.
Posts: 28
Rep Power: 16
jiez is on a distinguished road
The bug I reported above can be easily fixed by a minor revision on the origin code. Attached please find an updated version.
Attached Files
File Type: zip createTurbulenceFieldsLES2.zip (2.8 KB, 186 views)
jiez is offline   Reply With Quote

Old   June 20, 2016, 06:22
Default Comment to Epsilon
  #7
New Member
 
Join Date: Apr 2016
Posts: 1
Rep Power: 0
Bohus is on a distinguished road
It is very good work guys, tahnks
But:
1. It is necessary to read mesh in each timestep for me, because I use the dynamic mesh.
2. I am not sure, but I think that Epsilon is calculated only as subgrid one, and the reading of nuSgs is also necessary. Then it works for me someway.

Best regards,
Bohus.
Attached Files
File Type: h createFields.H (756 Bytes, 72 views)
File Type: c createTurbulenceFieldsLES.C (3.4 KB, 110 views)
Bohus is offline   Reply With Quote

Old   October 24, 2016, 10:17
Default
  #8
Member
 
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 12
Z.Q. Niu is on a distinguished road
Hi ghindi,
Have you found the method of calculating the energy spectrum?
Z.Q. Niu is offline   Reply With Quote

Old   November 30, 2016, 15:13
Default
  #9
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
Usually you don't need the spectrum of the whole domain. You can have spectrum in time or a homogeneous direction, the easiest way to do it is to probe a location in time or sample a line in that direction then take FFT of it in Matlab or Python.

Remember, for time spectrum all of the times need to be loaded in memory which for big cases is not practical. For a directional spectrum always sampling is needed as the grid is unstructured and doing this for the whole domain introduces a huge computational cost.
anishtain4 is offline   Reply With Quote

Old   August 18, 2017, 13:14
Default
  #10
New Member
 
Pedro
Join Date: Feb 2016
Location: United States
Posts: 23
Rep Power: 10
pedramtx is on a distinguished road
Hello,
I've been trying to calculate rms of Lambda2. I added this quantity in controlDict/fieldAverage1, but got this warning:
--> FOAM Warning :
From function void Foam::fieldAverage::initialize()
in file fieldAverage/fieldAverage/fieldAverage.C at line 92
Field Lambda2 not found in database for averaging

Any suggestion on resolving the issue is appreciated.

Pedram
pedramtx is offline   Reply With Quote

Old   August 18, 2017, 19:33
Default
  #11
New Member
 
Pedro
Join Date: Feb 2016
Location: United States
Posts: 23
Rep Power: 10
pedramtx is on a distinguished road
I resolved the issue! I modulated the solver that I use.
Thanks.
pedramtx 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



All times are GMT -4. The time now is 12:46.