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

ensemble averaging for oscillating components in the domain

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Thangam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2015, 00:20
Default ensemble averaging for oscillating components in the domain
  #1
Member
 
Thangam Natarajan
Join Date: Dec 2010
Location: Perth
Posts: 70
Rep Power: 16
Thangam is on a distinguished road
I have a domain inside which a plate is vibrating as a sinusoidal function. I have managed to impart the mesh motion. The issue is now obtaining the time averaged fields with fieldAverage. Because, what I really need is an ensemble average with respect to different phase shift/positions of the plate. If I turn on the fieldAverage from the controlDict, this is going to average over all the time steps (in-turn all the phases of impingement plate motion) which is going to result in an erroneous time averaged flow field? So, to avoid this, I decided to keep the fieldAverage option off and just write the instantaneous fields at different phase locations of the impingement plate motion. At this point I have about 10 time directories at each phase location of the plate motion(ie 0, pi/2, pi, 3pi/2, 2pi. ).

Now I decided to use execFlowFunctionObjects to get the time average of the fields during post-processing. I am looking to average all the 10 time directories at a particular phase location(for example at pi/2). I am not sure if execFlowFunctionObjects does what I need. Is there a cleaner/correct way of doing this in runtime?If so, the fieldAverage function has to be modified I guess. Also now I am confused how Umean and the fluctuating components and in-turn the average over time is calculated. Is calculating the time averaged fields based on this mean velocity locked at a particular phase shift correct? I'd be really pleased to get some pointers!



Thanks a lot.


Thangam.
Thangam is offline   Reply With Quote

Old   May 2, 2015, 00:48
Default
  #2
Member
 
Thangam Natarajan
Join Date: Dec 2010
Location: Perth
Posts: 70
Rep Power: 16
Thangam is on a distinguished road
To put it short,

1) I have a plate moving as a sinusoidal function in a domain.
2) I want the time averaged statistics at 8 different phases of the sine curve. ie 0, pi/4, pi/2, 3pi/4, pi etc.
3) Now I want to average with respect to the individual phases.

To do this, the crudest way to do it would be to create these 8 directories first and write data (i dont know how!) into respective folders for the respective time step increments. When calculating the averages, read the fields from these directories for the previous time steps to average within the phase.

I believe there will be a change to the way writeControl works. Because data has to be written to different directories for fieldaveraging. Secondly, the fieldAveraging itself to use the previous time step in these 8 directories. I am not sure how to go about it.
Thangam is offline   Reply With Quote

Old   May 17, 2015, 16:06
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Thangam,

Without a test case, there isn't much more I can do than simply diagnose the problem, since this would require testing.
But as far as I can figure out from the source code, it's not possible to use the current fieldAverage function object to do averages with specific time snapshots.
In addition, if your simulation is transient, then you must be very certain that the time snapshots are exactly at the right phase positions.

The part that would need testing is that this function object can be modified to do what you need to be done. But aside from it taking some considerable time to study and develop the modified function object, it's also necessary to also test it.

Either way, the trick of using execFlowFunctionObjects with the "-time <ranges>" should pretty much solve your problem.


Although, now that I think of it... the modification to the file:
Code:
src/postProcessing/functionObjects/field/fieldAverage/fieldAverage/fieldAverage.C
should be fairly easy to do, because the trick seems to be to modified the execute method to only run at specific time instances, instead of running for all time snapshots...

... mmm... after inspecting the source code and remembering some details, the trick would be for you to use is when you configure these two lines in the function object (to be used with the solver) for a particular averaging of one specific phase:
Code:
        timeStart           0;
        timeEnd             10;
        outputControl       outputTime;
        outputInterval      1;
you should use a multiple of the time step "delta", in "outputInterval", along with removing any potential outlier sampling with the "timeStart" parameter.

For example, if your "deltaT" is 0.001 and each "pi/2" phase occurs at 0.5 seconds:
  • pi/2 -> 0.5 s
  • pi -> 1 s
  • 3/2 pi -> 1.5 s
  • 2pi -> 2 s
Then for the first phase you would use this:
Code:
        timeStart           0.5; //in seconds
        timeEnd             10; //in seconds
        outputControl       adjustableTime;
        outputInterval      2000;
For the second:
Code:
        timeStart           1.0; //in seconds
        timeEnd             10; //in seconds
        outputControl       adjustableTime;
        outputInterval      2000;
Third:
Code:
        timeStart           1.5; //in seconds
        timeEnd             10; //in seconds
        outputControl       adjustableTime;
        outputInterval      2000;
Forth:
Code:
        timeStart           2.0; //in seconds
        timeEnd             10; //in seconds
        outputControl       adjustableTime;
        outputInterval      2000;
Since I can't easily test this, I'm not 100% certain this will work as intended.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 1, 2015, 01:39
Default
  #4
Member
 
Thangam Natarajan
Join Date: Dec 2010
Location: Perth
Posts: 70
Rep Power: 16
Thangam is on a distinguished road
Thanks a lot for your time. I managed to solve the issue with postAverage utility found elsewhere in the forum. I tested it and does what I require for the moment. Will post a test case soon.


Thangam.
Thangam is offline   Reply With Quote

Old   July 16, 2015, 10:00
Default
  #5
Member
 
SM
Join Date: Dec 2010
Posts: 97
Rep Power: 15
canopus is on a distinguished road
Hi Thangam
Can you elaborate how you fixed the issue and the link to postAverage utility?

Also a test case will be very helpful.

Thanks & regards
canopus is offline   Reply With Quote

Old   July 17, 2015, 08:12
Default
  #6
Member
 
Thangam Natarajan
Join Date: Dec 2010
Location: Perth
Posts: 70
Rep Power: 16
Thangam is on a distinguished road
Hi SM,

Well, there was no straight forward method to this and I had to do a work around to achieve this.

Typically you may need to do the following:

1) Choose the writeInterval such that you have data at required time scales of investigation and do not use the fieldAverage in the controlDict(turn it to false). If you use fieldAverage, you loose all the phase information and you only get a long time average (you may do so if you don't want the phase information!)

2) For example, if you have 8 time directories in a sinusoid or time period, ie, pi/2, pi and so on, and you have these set of 8 time directories for as many cycles as you want (to have a smooth mean curve), you need to sort all the time directories of similar phases together i.e all pi/2 directories into one directory, all pi into another etc. A small bash script based on modulo arithmetic on the directory names should do the job of sorting the time directories.

3) I used the postAverageTurbulenceFields from the link here:

4) You can run the utility into the final 8 directories which are sorted phase wise. And then you have the last time step with the ensemble average of as many time directories you provided!

Cheers.
Thangam.
wyldckat likes this.
Thangam is offline   Reply With Quote

Old   July 19, 2015, 11:43
Default
  #7
Member
 
SM
Join Date: Dec 2010
Posts: 97
Rep Power: 15
canopus is on a distinguished road
Thanks for outlining the steps.
Looks bit round about but I am really beginner.

Just to point out that the postAverage utility needs a correction I guess
as from this post ?
canopus is offline   Reply With Quote

Old   November 5, 2015, 03:02
Default
  #8
Senior Member
 
Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 14
huangxianbei is on a distinguished road
Quote:
Originally Posted by Thangam View Post
Hi SM,

Well, there was no straight forward method to this and I had to do a work around to achieve this.

Typically you may need to do the following:

1) Choose the writeInterval such that you have data at required time scales of investigation and do not use the fieldAverage in the controlDict(turn it to false). If you use fieldAverage, you loose all the phase information and you only get a long time average (you may do so if you don't want the phase information!)

2) For example, if you have 8 time directories in a sinusoid or time period, ie, pi/2, pi and so on, and you have these set of 8 time directories for as many cycles as you want (to have a smooth mean curve), you need to sort all the time directories of similar phases together i.e all pi/2 directories into one directory, all pi into another etc. A small bash script based on modulo arithmetic on the directory names should do the job of sorting the time directories.

3) I used the postAverageTurbulenceFields from the link here:

4) You can run the utility into the final 8 directories which are sorted phase wise. And then you have the last time step with the ensemble average of as many time directories you provided!

Cheers.
Thangam.
Hello:
Thanky you for you post. I read this method and found it to be not easy to realize as you have to save the required time directories. If the mesh size is large, then the disk space needed is large. Have you ever found a easier way?

Xianbei
huangxianbei is offline   Reply With Quote

Reply

Tags
ensemble, les, oscillating wall, time average


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
Setting rotating frame of referece. RPFigueiredo CFX 3 October 28, 2014 05:59
Appropriate Boundary conditions for jet flow in open domain shrutidhara.123 FLUENT 0 August 5, 2014 11:27
air bubble is disappear increasing time using vof xujjun CFX 9 June 9, 2009 08:59
CHT Problem - Domain Imbalance Parthipan CFX 5 September 11, 2007 11:13
rotating domain in rotating domain, different axis Robert Stringer CFX 3 December 4, 2006 08:04


All times are GMT -4. The time now is 16:52.