CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Average values on Boundary Conditions (https://www.cfd-online.com/Forums/openfoam/97738-average-values-boundary-conditions.html)

helloworld11 February 23, 2012 11:21

Average values on Boundary Conditions
 
Hi everyone,
I am quite new to OpenFoam world and I need some help. I would like to calculate average values of velocity and pressure on my boundary patches. Any idea how can I do it? Any help will be appreciated :)

bigphil February 23, 2012 12:00

Hi,

You could use the patchAverage and/or the patchIntegrate post processing OpenFOAM utilities.

For example, to calculate the average pressure on a patch called myInlet:
Code:

patchAverage p myInlet
Philip

helloworld11 February 23, 2012 12:09

Hello Philip,
Thank your for your answer. I just tied patchAverage p inlet for my case works fine.
But for the velocity values if type patchAverage U inlet, I get the error :

Only possible to average volScalarFields

Is there any way to over come that error?

bigphil February 23, 2012 12:16

helloworld11,

patchIntegrate and patchAverage only operate on volScalarFields, so if you decompose your velocity field into its components first using foamCalc, i.e.
Code:

foamCalc components U
Then you can run patchAverage on each component:
Code:

patchAverage Ux myInlet
You can also use foamCalc to do other things like calculate the magnitude of a volVectorField:
Code:

foamCalc mag U
If you type something like "foamCalc banana" it will give you all the options.

Philip

helloworld11 February 23, 2012 12:24

Philip,

I followed the instructions you gave and now I am able to get values. Thank you very much.

Vishsel November 19, 2019 00:12

Hi all,

Again i am initiating this old thread to find the average field values of two or three patches ..

Any command to measure the field average values of totally three patches ??

like three patches namely - inlet1,inlet2,inlet3 .. I need average value for three patches ..

Thanks in advance,
Vishsel

lumasci March 22, 2023 11:13

how do you setup myInlet in 0/U or 0/p?
 
Quote:

Originally Posted by bigphil (Post 345979)
Hi,

You could use the patchAverage and/or the patchIntegrate post processing OpenFOAM utilities.

For example, to calculate the average pressure on a patch called myInlet:
Code:

patchAverage p myInlet
Philip


Hi, how do you setup myInlet in 0/U or 0/p?
In my case, I want to create an 'artificial' patch in order to get a mapping of the velocity for this specific area.

Usually, I use paraview/cross section to achieve that, but in this case, the geometry is much more complex. Therefore, I want the value of the velocity in this patch.


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