|
[Sponsors] |
August 26, 2014, 07:04 |
Finding time averaged flow field from LES?
|
#1 |
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13 |
Is there a way of computing the time averaged flow field from the data produced from a LES (pimpleFoam)?
Or even setting something up before running the LES simulation to instruct it to keep computing the mean flow field whilst solving? Thanks in advance, Olie |
|
August 28, 2014, 10:06 |
|
#2 |
Member
Join Date: Apr 2011
Posts: 57
Rep Power: 15 |
Hi Olie,
You can use a function in your controlDict to calculate time-averaged values. I've used this to calculate time-averaged values for LES using pimpleFoam myself. Below is the function I include at the bottom of my controlDict file in the LES run directory. Code:
functions { fieldAverage { type fieldAverage; functionObjectLibs ( "libfieldFunctionObjects.so" ); enabled true; timeStart 30.0 outputControl outputTime; outputInterval 100; fields ( U { mean on; prime2Mean on; base time; } p { mean on; prime2Mean on; base time; } ); } } |
|
August 29, 2014, 05:08 |
Thank you Amanbearpig
|
#3 |
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13 |
Thank you - I've just looked in my controlDict file to find that this code was actually already implemented, so now I know what the files UMean, pMean etc are in the time directories!
Two questions, firstly what are UPrime2Mean and pPrime2Mean? Secondly how do I view the UMean and pMean fields in paraView? It doesn't give me the option to view them.. Thanks again! Olie |
|
August 29, 2014, 14:19 |
|
#4 |
Member
Join Date: Apr 2011
Posts: 57
Rep Power: 15 |
Hi Olie,
UPrime2Mean is the time averaged components of the resolved Reynolds stress tensor - it is the fluctuating velocity components (u') squared (2) and averaged in time (Mean). pPrime2Mean is the corresponding time averaged fluctuating pressure - the fluctuating pressure squared and averaged. Regarding the viewing of the means in Paraview, I have not had an issue viewing them before, perhaps check and make sure that the time step you are loading into Paraview contains the means (if you don't write out the timeAverage values at every time step they won't be present to view). If you load Paraview, what variables are available to see? And are the means present in the time directory you have loaded into Paraview? |
|
August 29, 2014, 14:36 |
|
#5 |
Member
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13 |
Oh Reynolds stresses - of course, don't know why I didn't spot that!
Arr, I've looked again in paraView and it was because I only ever viewed the first time step (t=0), at which point UPrime and pPrime DON'T exist, but then skipped to the next time step where they DO exist, and can view it fine. Silly me! Perfect. Thanks a lot! Olie |
|
August 29, 2014, 14:51 |
|
#6 |
Member
Join Date: Apr 2011
Posts: 57
Rep Power: 15 |
Hi Olie,
Glad I could be of help! I've learned alot in OpenFOAM from reading these forums and have been helped by others a great deal, so I'm glad to be able to do the same when I can! |
|
April 8, 2015, 15:16 |
|
#7 |
Member
Howar
Join Date: Mar 2015
Posts: 53
Rep Power: 11 |
Hi, friend. I would like to ask if I want to calculate the average value of the outlet surface, how to conduct it? or are there resources for these information. Thank you!
|
|
July 6, 2021, 09:03 |
|
#8 |
Senior Member
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 8 |
Hi, in my opinion this usage is not correct. One would first need to calculate a well averaged mean velocity UMean. After that one should active the calculation of prime2Mean. I tried to do this with OpenFoam v1912 by choosing this setting: Code:
fields ( U { mean on; prime2Mean off; base time; } } However, if I later set prime2Mean to on OpenFOAM does not read the existing UMean field (which contains a better, well averaged UMean) but instead overwrites the existing UMean field and starts to calculate UMean again. Has anyone an idea on how to improve this? My idea was to first determine UMean and then use a second function fieldaverage2 to start using prime2Mean after timestart = 0.005. Code:
fieldAverage1 { type fieldAverage; libs (fieldFunctionObjects); writeControl writeTime; timeStart 0; //start from the time at which the flow field is properly initialized e.g. 3-5 through flows through the domain. Here I chose timeStart 0 for testing purposes only. fields ( U { mean on; prime2Mean on; base time; } ); } fieldAverage2 { type fieldAverage; libs (fieldFunctionObjects); writeControl writeTime; timeStart 0.005; //start determining UPrime2Mean after UMean is properly converged, here e.g. after 0.005s. fields ( U { mean off; prime2Mean on; base time; } ); } However this error occurs: --> FOAM FATAL ERROR: To calculate the prime-squared average, the mean average must also be selected for field U |
|
July 8, 2021, 10:53 |
|
#9 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14 |
No - that's not required thankfully. OF employs a trick that has long been used for LES/DNS solvers, and simply keeps track of the mean and the mean square. From this you can calculate the variance (mean square minus the square of the mean) and the accuracy improves of course as the sample size increases. Why wait for the mean to converge before calculating the mean square? That would just be a waste of computing time.
|
|
July 8, 2021, 11:00 |
|
#10 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14 |
||
Tags |
mean flow field |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
Help for the small implementation in turbulence model | shipman | OpenFOAM Programming & Development | 25 | March 19, 2014 11:08 |
Flow around cube and cube natural convection | Mirage12 | OpenFOAM Running, Solving & CFD | 5 | June 15, 2013 12:20 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |