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

Multiple instances of fieldAverage

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 30, 2020, 12:36
Default Multiple instances of fieldAverage
  #1
New Member
 
Andrew
Join Date: Mar 2018
Posts: 4
Rep Power: 8
andrewpomeroy is on a distinguished road
It is possible to use multiple instances of fieldAverage in controlDict but for the same variable?



What I am trying to achieve is a timeaverage for velocity U over two different periods (i.e., every 0.1 s and much longer over the whole LES simulation 40 s).


I seems that openFoam will allow two functions to be included but when I post-process the data in Paraview only one Umean variable is created. Is there some work-around or trick to specify two mean variables based on the same source variable?



This is what I'm trying to achieve:


Code:
functions
{
    fieldAverage1
    {
        type            fieldAverage;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl   runTime;
        writeInterval 0.1;

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            p
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        
        );
    }  

fieldAverage2
    {
        type            fieldAverage;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled            true;
        writeControl       runTime;
    writeInterval     100;
    timeStart    60;
    timeEnd        100;

        fields
        (
            U
            {
                mean        on;
                prime2Mean  off;
                base        time;
            }        
        );
     }
andrewpomeroy is offline   Reply With Quote

Old   August 4, 2020, 10:58
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

You might have some success by using windows as seen on the online documentation.

I just copied from there this part as an example to be filled in. Maybe test an a small case first:
Code:
        <field name 1>
        {
            mean        <yes|no>;
            prime2Mean  <yes|no>;
            base        <time|iteration>;
            windowType   exact;
            window       10.0;
            windowName   <name>;
            allowRestart true;
        }
Good luck,
Tom
tomf is offline   Reply With Quote

Old   August 11, 2020, 04:45
Default
  #3
New Member
 
Andrew
Join Date: Mar 2018
Posts: 4
Rep Power: 8
andrewpomeroy is on a distinguished road
Hi Tomf,
Yes that worked out for me. I found I had to specify a windowName but it does work.

Thanks.
andrewpomeroy is offline   Reply With Quote

Reply


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[OpenFOAM.org] Install openFOAM 3.0.1 in Ubuntu 16.04 LTS from Deb packs Pier84 OpenFOAM Installation 4 June 18, 2016 17:22
[snappyHexMesh] multiple instances of SnappyHexMesh mihaipruna OpenFOAM Meshing & Mesh Conversion 12 April 6, 2012 15:59
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21
[PyFoam] Running multiple instances of solver using MPI and PyFoam bfa OpenFOAM Community Contributions 3 January 25, 2011 18:57


All times are GMT -4. The time now is 00:55.