# Spatial averaging

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

 April 2, 2010, 16:10 Spatial averaging #1 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 8 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

 October 12, 2012, 16:43 #2 Senior Member   Awais Ali Join Date: Feb 2010 Location: Germany Posts: 128 Rep Power: 8 Hallo Deji, Did you find the answer to you question? regards, Awais

 October 13, 2012, 00:22 #3 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 8 I do have a code that helps me average in a given direction. Why do you ask?

 October 13, 2012, 10:12 #4 Senior Member   Awais Ali Join Date: Feb 2010 Location: Germany Posts: 128 Rep Power: 8 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

 October 13, 2012, 22:34 #5 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 8 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

 October 13, 2012, 22:54 #6 Senior Member   Awais Ali Join Date: Feb 2010 Location: Germany Posts: 128 Rep Power: 8 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

 October 13, 2012, 22:56 #7 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 8 Okay. I can post the code and some notes to help as well.

 October 16, 2012, 21:10 #8 Senior Member   n/a Join Date: Sep 2009 Posts: 198 Rep Power: 8 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 and gregjunqua like this.

 October 19, 2012, 20:40 #9 Senior Member   Awais Ali Join Date: Feb 2010 Location: Germany Posts: 128 Rep Power: 8 Thanks in Advance Deji. I will wait for your code. As I need it. Regards, Awais

October 24, 2012, 20:58
#10
Senior Member

n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8
The code is attached. My apologies for just getting the code to you; I have being fairly busy.
Attached Files
 spatial.zip (9.9 KB, 195 views)

 October 24, 2012, 21:22 #11 Senior Member   Awais Ali Join Date: Feb 2010 Location: Germany Posts: 128 Rep Power: 8 Late is not a problem. Thanks for sharing the code. Regards, Awais

 January 29, 2013, 09:18 Which version #12 New Member   Martin Söder Join Date: Jun 2011 Posts: 8 Rep Power: 6 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:rimitiveMesh&, bool, const Foam::labelUList&) sampledSurface/sampledAveragePlane/sampledAveragePlane.C:212:49: error: no matching function for call to 'Foam::sampledAveragePlane::reCut(const Foam:olyMesh&, const Foam::cellZone&)' lnInclude/cuttingPlane.H:122:14: note: candidate is: void Foam::cuttingPlane::reCut(const Foam:rimitiveMesh&, bool, const Foam::labelUList&) make: *** [Make/linux64Gcc45DPOpt/sampledAveragePlane.o] Error 1 Best regards Martin

 May 7, 2014, 21:15 #13 Member   Manjura Maula Md. Nayamatullah Join Date: May 2013 Location: San Antonio, Texas, USA Posts: 42 Rep Power: 4 I could not unzip the file. It gives me some error, says file is empty. Any one can help

January 25, 2016, 01:23
#14
New Member

Rupesh Verma
Join Date: Jun 2013
Posts: 22
Rep Power: 4
Quote:
 Originally Posted by mmmn036 I could not unzip the file. It gives me some error, says file is empty. Any one can help