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

Time averaging of new variable using fieldAverage

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

Like Tree1Likes
  • 1 Post By agustinvo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 5, 2017, 16:59
Default Time averaging of new variable using fieldAverage
  #1
Member
 
Mirage
Join Date: Jul 2012
Posts: 43
Rep Power: 9
Mirage is on a distinguished road
Dear Foamers,

I m writing the heat flux as output only for the last time step and I would like to average this latter parameter over the time using the fieldAverage function.
It works fine for standard variable like p or U. I am getting UMean and pMean as an output and the values are physical after averaging over a long time.

However I am not able to average any new variable, that I m calculating in my customized solver.
Here is the function, that I writing in controlDict:

Code:
 fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl   outputTime;

        fields
        (

            TurbFlux 
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
}
Is it possible to average non-standard variable?
I am wondering, what i am doing wrong.

I appreciate any help !

Cheers !

Last edited by Mirage; February 6, 2017 at 23:34.
Mirage is offline   Reply With Quote

Old   February 6, 2017, 23:37
Default
  #2
Member
 
Mirage
Join Date: Jul 2012
Posts: 43
Rep Power: 9
Mirage is on a distinguished road
Should I define the new variable in the OpenFoam libraries ?

Any help or answer is appreciated
Mirage is offline   Reply With Quote

Old   February 8, 2017, 06:35
Default
  #3
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Brussels
Posts: 228
Rep Power: 10
agustinvo is on a distinguished road
Hello

I passed through this two weeks ago. First of all, if you can include that variable in your code, that's is the easiest, but if you define Turbflux for example as a Swak4Foam field in yout controlDict, please take a look to this:

https://www.cfd-online.com/Forums/openfoam-programming-development/142749-using-fieldaverage-together-swak4foam-expressionfield.html#post622399


BTW, are you trying to get the turbulent heat flux from your simulations?
Mirage likes this.
agustinvo is offline   Reply With Quote

Old   February 11, 2017, 18:54
Default
  #4
Member
 
Mirage
Join Date: Jul 2012
Posts: 43
Rep Power: 9
Mirage is on a distinguished road
Thanks !!

I managed to calculate the turb flux using the expressionfield of swak4foam tool.


However I am really interested on calculating the average variable in the code.

I could define the flux as variable in the solver. Nevertheless I was not able to average it.
fieldaverage function is not allowing the averaging of non-standard OF variables.

Do you know, if I could define the time averaging on the solver?
Mirage is offline   Reply With Quote

Old   February 12, 2017, 07:37
Default
  #5
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Brussels
Posts: 228
Rep Power: 10
agustinvo is on a distinguished road
Hi,

you may take a look into the code of fieldAverage. Me, I've never tried to do so.

What I do is, in my solver, define some auxiliar variables, that I use later to create my turbulent heat flux.

The THF is defined as <u'T'>, but it can be decomposed, follogind the ensemble averaging, as <u'T'>=<UT> - <U> <T>, so you need to create a variable UT, you get the mean of UT, U and T, and then with expressionField you get u'T'.

This is what I do, but fi you find any other easier way to get it, make us know!
agustinvo is offline   Reply With Quote

Old   March 29, 2017, 23:43
Default
  #6
New Member
 
Harshal Akolekar
Join Date: Aug 2016
Location: Melbourne
Posts: 25
Rep Power: 5
hakolekar is on a distinguished road
Hi,

Is it possible to find the field average (over a certain time interval) of volScalarFields in the defined in the member functions of OpenFoam - without using the swak4foam?

For example - the production term in the k equation.

I have already defined this as an IO object and have a data set for this term in my time directories, but it does not produce field averages and instead states:
Field Pkt not found in database for averaging

If anyone has any ideas, it would be appreciated.

Regards,
Harshal
hakolekar is offline   Reply With Quote

Old   November 9, 2019, 22:30
Default
  #7
Senior Member
 
Join Date: Jan 2013
Posts: 132
Rep Power: 9
kkpal is on a distinguished road
Hi Harshal,
Have you found a solution to this?

Quote:
Originally Posted by hakolekar View Post
Hi,

Is it possible to find the field average (over a certain time interval) of volScalarFields in the defined in the member functions of OpenFoam - without using the swak4foam?

For example - the production term in the k equation.

I have already defined this as an IO object and have a data set for this term in my time directories, but it does not produce field averages and instead states:
Field Pkt not found in database for averaging

If anyone has any ideas, it would be appreciated.

Regards,
Harshal
kkpal 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
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 03:34
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 04:23.