CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   fieldAverage missing function! (https://www.cfd-online.com/Forums/openfoam-pre-processing/199401-fieldaverage-missing-function.html)

syavash March 5, 2018 14:18

fieldAverage missing function!
 
Hi everyone!

Is it possible to add an 'interval' option to fieldAverage? In this way the Mean quantities would be only calculated, for instance, every n seconds which n is the interval specified by the user, rather than at every and each time-step.

I think this option would be very useful in case of LES simulations. To justify my suggestion, I mention "phase-locked averaging" which is necessary in many LES cases. As an example, consider a flow configuration which demonstrates a natural frequency. A simple case is the flow around a cylinder with nominal vortex shedding with a certain frequency. In this case, it would be very convenient if the user could record identical phase-locked snapshots of the flow and average them altogether to have a phase-averaged field (e.g. in 45phi, 90phi, 180phi, ...where phi is phase angle). Is it possible to implement such an option in the present functionObjects? If not, I believe it is viable to add this functionality to OpenFOAM and many users could benefit from it.

Best Regards,
Syavash

LuckyTran March 5, 2018 15:15

I'm also curious of some crude implementation of a phase-locked average at runtime.

I haven't tried it yet but check out this post by wyldckat.
You use timeStart to set the phase, but I'm not sure if the next part with setting adjustableTime for outputControl actually does the correct phase-average.

Improving the windowing features of fieldAverage to support weights could fix this issue neatly. I.e. by using a window of 5 and defining the weights as [1 0 0 0 0] would give you the average of the 1st bin. But you need to be able to continue this average for many periods. This is quite doable for 1 period/frequency but you have to think of a clever naming scheme to generalize it for multiple frequencies.

Btw currently there is a window and windowName as options to fieldAverage. I don't have a clue yet what the inputs in windowName do. I wonder if hacking the windowName can get us somewhere...

syavash March 5, 2018 15:47

Quote:

Originally Posted by LuckyTran (Post 683889)
I'm also curious of some crude implementation of a phase-locked average at runtime.

I haven't tried it yet but check out this post by wyldckat.
You use timeStart to set the phase, but I'm not sure if the next part with setting adjustableTime for outputControl actually does the correct phase-average.

Improving the windowing features of fieldAverage to support weights could fix this issue neatly. I.e. by using a window of 5 and defining the weights as [1 0 0 0 0] would give you the average of the 1st bin. But you need to be able to continue this average for many periods. This is quite doable for 1 period/frequency but you have to think of a clever naming scheme to generalize it for multiple frequencies.

Btw currently there is a window and windowName as options to fieldAverage. I don't have a clue yet what the inputs in windowName do. I wonder if hacking the windowName can get us somewhere...

Thanks Lucky for your response. Yes, I am not sure either that adjustableTime could manipulate the fieldAverage behavior.

Your idea to use windowing and weights also sounds good. Is it already available in function objects or it was merely your approach to tackle the problem?!
Actually, I am not sure what is the functionality of window option which is currently available! Have an idea what purpose it serves?
I hope somebody from dev team will pass by!:D

Regards,
Syavash


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