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

Compute mean vorticity field

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By ssss

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 11, 2015, 05:55
Default Compute mean vorticity field
  #1
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
I'd like to compute the time averaged vorticity and stream function fields for a case I'm running. If I just wanted the time averaged velocity field, for example, I could put something like:

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

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

        );
    }
in the controlDict and it would compute during runtime (solving). However vorticity and stream function fields aren't computed during runtime, they must be (to the best of my knowledge) computed using the utilities vorticity and streamFunction, respectively, after solving. How can I then compute the time average of these fields?

Either a way of forcing openFoam to compute the vorticity and stream function fields during solving and calculating the mean at the same time, or waiting till the end to use the utilities to compute those fields and then computing the time average would be fine.

Thanks!
odellar is offline   Reply With Quote

Old   August 12, 2015, 05:01
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,

Both these utilities can be included as function objects. So they can at least be created during the run. Something like this should be added to the "functions" part of the controlDict, probably a bit more information is needed:

Code:
vorticity
{
    type            vorticity;
    outputControl   timeStep;
    outputInterval  1;
}
I am not sure if they can be averaged. You can try be adding "vorticity" to the fieldAverage part. If it works, the fieldAveraging should be placed after the vorticity. I would assume similar behavior for the streamfunction. However I have not tested this myself.

Regards,
Tom
tomf is offline   Reply With Quote

Old   August 12, 2015, 11:25
Default
  #3
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
Thanks Tom, I'm trying this at the moment, but I'm not convinced it's going to work, as streamFunction doesn't appear to be a function you can use in controlDict.. It looks to only work as a post-processing utility.

So still looking for a way of time-averaging fields AFTER I've finished solving if anyone has any ideas...

Thanks
odellar is offline   Reply With Quote

Old   August 12, 2015, 13:09
Default
  #4
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Maybe you can use swak4foam to generate the vorticity field and then use the field average function object to average vorticity.

I might have some code that does what you are searching for, if you are not able of average the vorticity let me know and I will search for the code
ssss is offline   Reply With Quote

Old   August 14, 2015, 06:26
Default Thanks
  #5
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
Quote:
Originally Posted by ssss View Post
Maybe you can use swak4foam to generate the vorticity field and then use the field average function object to average vorticity.

I might have some code that does what you are searching for, if you are not able of average the vorticity let me know and I will search for the code
Thanks SSSS, that would be handy to have a look at please..
odellar is offline   Reply With Quote

Old   August 14, 2015, 07:07
Default
  #6
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
So you create a vorticty field with swak4foam, and the average it with a fieldAverage functionObject

Code:
functions
{
vorticity
{
type expressionField;
autowrite true;
dimension [0 0 -1 0 0 0 0];
fieldName "vorticity";
expression "curl(U)";
verbose true;
autowrite true;
outputControl timeStep; 
}
        fieldAverage1
       {
                type            fieldAverage;
                functionObjectLibs ( "libfieldFunctionObjects.so" );
                enabled         true;
                outputControl   outputTime;

                fields
                (
                     vorticity
                     {
                     mean on;
                     prime2Mean on;
                     base time;
                     }
               );
         }

}
arvindpj and azan like this.

Last edited by ssss; August 14, 2015 at 10:12.
ssss is offline   Reply With Quote

Old   August 14, 2015, 07:13
Default
  #7
Member
 
Olie
Join Date: Oct 2013
Posts: 51
Rep Power: 13
odellar is on a distinguished road
Excellent this looks most helpful, thanks a lot.

N.B. I think the dimension should read [0 0 -1 0 0 0 0], no? Vorticity's units are s^{-1}?

Last edited by odellar; August 14, 2015 at 09:36. Reason: Added a N.B. regarding units of vorticity.
odellar is offline   Reply With Quote

Old   August 14, 2015, 10:12
Default
  #8
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Quote:
Originally Posted by odellar View Post
Excellent this looks most helpful, thanks a lot.

N.B. I think the dimension should read [0 0 -1 0 0 0 0], no? Vorticity's units are s^{-1}?
Yes you are right I will change original post. Thank you
ssss is offline   Reply With Quote

Old   January 9, 2017, 10:03
Default
  #9
Member
 
Anirudh Kulkarni
Join Date: May 2016
Posts: 62
Rep Power: 10
Tempest is on a distinguished road
Quote:
Originally Posted by odellar View Post
I'd like to compute the time averaged vorticity and stream function fields for a case I'm running. If I just wanted the time averaged velocity field, for example, I could put something like:

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

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

        );
    }
in the controlDict and it would compute during runtime (solving). However vorticity and stream function fields aren't computed during runtime, they must be (to the best of my knowledge) computed using the utilities vorticity and streamFunction, respectively, after solving. How can I then compute the time average of these fields?

Either a way of forcing openFoam to compute the vorticity and stream function fields during solving and calculating the mean at the same time, or waiting till the end to use the utilities to compute those fields and then computing the time average would be fine.

Thanks!
Hey sorry for reviving an old thread, but did you solve your problem. Since, I am currently going through the same conundrum, please tell me if you have figured out how to plot streamFunction after time averaging phi field.
Tempest is offline   Reply With Quote

Reply

Tags
fieldaverage, utilities


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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
creating an internal field? maybee OpenFOAM Programming & Development 2 February 4, 2021 18:15
To compute Average flowfield with oodles flying OpenFOAM Running, Solving & CFD 3 May 5, 2009 09:46
vorticity calculation at symmetryplane benconnell OpenFOAM 0 April 14, 2009 19:45


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