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

Compute mean vorticity field

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

Like Tree1Likes
  • 1 Post By ssss

Reply
 
LinkBack Thread Tools Display Modes
Old   August 11, 2015, 04:55
Default Compute mean vorticity field
  #1
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
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, 04:01
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Delft, Netherlands
Posts: 328
Rep Power: 12
tomf is on a distinguished road
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, 10:25
Default
  #3
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
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, 12:09
Default
  #4
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 198
Rep Power: 4
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, 05:26
Default Thanks
  #5
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
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, 06:07
Default
  #6
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 198
Rep Power: 4
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 likes this.

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

Old   August 14, 2015, 06:13
Default
  #7
Member
 
Olie
Join Date: Oct 2013
Posts: 50
Rep Power: 5
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 08:36. Reason: Added a N.B. regarding units of vorticity.
odellar is offline   Reply With Quote

Old   August 14, 2015, 09:12
Default
  #8
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 198
Rep Power: 4
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

Reply

Tags
fieldaverage, utilities

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 66 November 23, 2016 15:42
problems after decomposing for running alessio.nz OpenFOAM 6 December 23, 2015 15:27
creating an internal field? maybee OpenFOAM Programming & Development 0 February 17, 2014 17:10
To compute Average flowfield with oodles flying OpenFOAM Running, Solving & CFD 3 May 5, 2009 08:46
vorticity calculation at symmetryplane benconnell OpenFOAM 0 April 14, 2009 18:45


All times are GMT -4. The time now is 07:45.