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

Calculating average velocity Umean on a line

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By joshwilliams

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2022, 14:31
Question Calculating average velocity Umean on a line
  #1
Member
 
Emre
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 97
Rep Power: 10
ordinary is on a distinguished road
Hello dear foamers,

I observe Ux (x component of velocity U) over a line during my 2d, transient analysis by this script within my controldict.

Code:
functions{

myLinefunction{
   type sets;
   libs ("libsampling.so");
   interpolationScheme 	cellPoint;
   setFormat raw;
   writeControl   timeStep;
   writeInterval  1;
   sets
   (
	data
	{
		type uniform;
		axis xyz;
		start (0.349493 -0.357075 0.0);
		end (0.349493 0.357075 0.0);
		nPoints 200;
	}
   );
   fields 	(U);
}

}
However, I don't want this. I want OpenFOAM to calculate automatically the Umean if it is possible. The sketch below demonstrates the thing I want.
umean.png

Regards
ordinary is offline   Reply With Quote

Old   February 16, 2022, 03:22
Default
  #2
Senior Member
 
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 112
Rep Power: 5
joshwilliams is on a distinguished road
Without modifying the code, you could average the entire U field using fieldAverage, to get a field `UMean'. Then as a post-processing step you can calculate UMeanx over this line by changing "U" in fields to "UMean".
ordinary likes this.
joshwilliams is offline   Reply With Quote

Old   February 20, 2022, 12:42
Default
  #3
Member
 
Emre
Join Date: Nov 2015
Location: Izmir, Turkey
Posts: 97
Rep Power: 10
ordinary is on a distinguished road
Quote:
Originally Posted by joshwilliams View Post
Without modifying the code, you could average the entire U field using fieldAverage, to get a field `UMean'. Then as a post-processing step you can calculate UMeanx over this line by changing "U" in fields to "UMean".
Thank you. It worked flawlessly.
ordinary is offline   Reply With Quote

Reply

Tags
average velocity, umean


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
Import .csv - velocity profile - error eSKa CFX 9 April 3, 2021 13:38
kindly help me .. i have and error at line number 147.. m zubair Fluent UDF and Scheme Programming 0 February 10, 2019 11:25
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 15:16


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