CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Spatial averaging (http://www.cfd-online.com/Forums/openfoam-post-processing/74538-spatial-averaging.html)

 deji April 2, 2010 16:10

Spatial averaging

Good afternoon everyone. I am hoping to do a turbulence simulation over the weekend and would like to spatially average the flow field in the homogeneous flow direction. This will done after I have time-averaged the solution. So does anyone know if I can use a tool in OpenFOAM to do spatial averaging? Thanks.

Deji

 owayz October 12, 2012 16:43

Hallo Deji,
Did you find the answer to you question?
regards,
Awais

 deji October 13, 2012 00:22

I do have a code that helps me average in a given direction. Why do you ask?

 owayz October 13, 2012 10:12

Do you right the average as a field?
I am doing an LES of flow over a circular cylinder and I need to average UMean and pMean over span-wise direction. That's is why I am asking this question.
Regards,
Awais

 deji October 13, 2012 22:34

I am not sure if I comprehend your question, but the spatial averaging is performed by prescribing which field will be averaged. The code basically takes the field and the direction to average in and collapses the domain into one plane. I am not certain if it will work for a circular cylinder; my geometry is a flat plate. What kind of mesh are you utilizing for your simulation?

Cheers,
Deji

 owayz October 13, 2012 22:54

Well you perfectly understood what I want to do. :)
My simulation is of flow over a circular cylinder. I want to average in spanwise direction of time averaged quantities.
If you have the code and you can share, that would be of great help.
Regards,
Awais

 deji October 13, 2012 22:56

Okay. I can post the code and some notes to help as well.

 deji October 16, 2012 21:10

My apologies for not posting the code in a timely manner, it has been a rough week. I hope to post the code tomorrow.

 owayz October 19, 2012 20:40

I will wait for your code. As I need it.
Regards,
Awais

 deji October 24, 2012 20:58

1 Attachment(s)
The code is attached. My apologies for just getting the code to you; I have being fairly busy.:o

 owayz October 24, 2012 21:22

Late is not a problem. :)
Thanks for sharing the code.
Regards,
Awais

 Soder January 29, 2013 09:18

Which version

Hi,
Which version of openFoam does it work for?
I tried installing it with 2.0

And got following error:

lnInclude/cuttingPlane.H:122:14: note: candidate is: void Foam::cuttingPlane::reCut(const Foam::primitiveMesh&, bool, const Foam::labelUList&)
sampledSurface/sampledAveragePlane/sampledAveragePlane.C:212:49: error: no matching function for call to 'Foam::sampledAveragePlane::reCut(const Foam::polyMesh&, const Foam::cellZone&)'
lnInclude/cuttingPlane.H:122:14: note: candidate is: void Foam::cuttingPlane::reCut(const Foam::primitiveMesh&, bool, const Foam::labelUList&)
make: *** [Make/linux64Gcc45DPOpt/sampledAveragePlane.o] Error 1

Best regards
Martin

 mmmn036 May 7, 2014 21:15

I could not unzip the file. It gives me some error, says file is empty. Any one can help

 roopesh99 January 25, 2016 01:23