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

Finding time averaged flow field from LES?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By amanbearpig
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2014, 07:04
Default Finding time averaged flow field from LES?
  #1
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
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
odellar is offline   Reply With Quote

Old   August 28, 2014, 10:06
Default
  #2
Member
 
Join Date: Apr 2011
Posts: 57
Rep Power: 15
amanbearpig is on a distinguished road
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;
          }
      );
  }
}
With this you can choose what terms you average (here U and p) as well as when you start averaging and how often you write out the averaged values. Hope this helps!
mp717 and hhu_lulu like this.
amanbearpig is offline   Reply With Quote

Old   August 29, 2014, 05:08
Default Thank you Amanbearpig
  #3
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
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
odellar is offline   Reply With Quote

Old   August 29, 2014, 14:19
Default
  #4
Member
 
Join Date: Apr 2011
Posts: 57
Rep Power: 15
amanbearpig is on a distinguished road
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?
amanbearpig is offline   Reply With Quote

Old   August 29, 2014, 14:36
Default
  #5
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
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
odellar is offline   Reply With Quote

Old   August 29, 2014, 14:51
Default
  #6
Member
 
Join Date: Apr 2011
Posts: 57
Rep Power: 15
amanbearpig is on a distinguished road
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!
amanbearpig is offline   Reply With Quote

Old   April 8, 2015, 15:16
Default
  #7
Member
 
Howar
Join Date: Mar 2015
Posts: 53
Rep Power: 11
Howard is on a distinguished road
Quote:
Originally Posted by amanbearpig View Post
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!
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!
Howard is offline   Reply With Quote

Old   July 6, 2021, 09:03
Default
  #8
Senior Member
 
Lukas Fischer
Join Date: May 2018
Location: Germany, Munich
Posts: 117
Rep Power: 8
lukasf is on a distinguished road
Quote:
Originally Posted by amanbearpig View Post
Code:
      fields
      (
          U
          {
              mean        on;
              prime2Mean  on;
              base        time;
          }

}

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





lukasf is offline   Reply With Quote

Old   July 8, 2021, 10:53
Default
  #9
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by lukasf View Post
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.
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.
lukasf likes this.
Tobermory is offline   Reply With Quote

Old   July 8, 2021, 11:00
Default
  #10
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 748
Rep Power: 14
Tobermory will become famous soon enough
... boy, I hate having to try and write this in Latex, but here goes:
\overline{\phi'^2} = \overline{(\phi - \overline{\Phi})^2} = \overline{\phi^2}  - 2\overline{\phi \overline{\Phi}} +  \overline{\Phi}^2 = \overline{\phi^2} - \overline{\Phi}^2
Tobermory is offline   Reply With Quote

Reply

Tags
mean flow field


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
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


All times are GMT -4. The time now is 19:13.