CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Average weighted value calc at specific plane (https://www.cfd-online.com/Forums/openfoam/183551-average-weighted-value-calc-specific-plane.html)

Mark JIN February 7, 2017 01:47

Average weighted value calc at specific plane
 
2 Attachment(s)
Dear Friends,

I wonder if anyone has ever tried to calculate average weighted value (ie. velocity) at localized plane within your domain? I found there were ways to calculate average weighted value at defined patch, but what if I want to do that anywhere else?

Just as what I showed in the attached pics. If I want to calculate average wind velocity at the highlighted plane (in black), how can I achieve that? Should I define coordinates of the plane I want to calculate in Controldict?

Pls bear with me if I repeat my questions so many times.
Appreciate in advance for any help.

Regards,
MarkJIN

alexeym February 7, 2017 13:56

Hi,

Let's assume, you are using OpenFOAM 4.x. Did you try surfaceRegion function object? (See http://cpp.openfoam.org/v4/a02578.html#details).

There is an option to take field values from sampledSurface, you can average values.

Mark JIN February 7, 2017 20:56

Quote:

Originally Posted by alexeym (Post 636299)
Hi,

Let's assume, you are using OpenFOAM 4.x. Did you try surfaceRegion function object? (See http://cpp.openfoam.org/v4/a02578.html#details).

There is an option to take field values from sampledSurface, you can average values.


Dear Alexey,

Thanks for your guide. I'm using openfoam 4.1. I havent try surfaceRegion before. Is this function working when running xxFoam or working during postprocessing? Btw, where can I define the coordinates of my user defined face to be averaged? I'm quite new to openfoam and cannot understand the structure of dictionaries sometime.

Regards,
Mark

alexeym February 10, 2017 13:36

Hi,

If is still relevant,
- it can be run both ways, since it is function object.
- definition of sampledSurface can be learned from:
1. https://github.com/OpenFOAM/OpenFOAM...es/controlDict
2. If you need plane, then maybe cuttingPlane instead of sampledTriSurfaceMesh if better choice, definition can be found, for example, here: https://github.com/OpenFOAM/OpenFOAM...m/cuttingPlane

Mark JIN February 12, 2017 21:15

Quote:

Originally Posted by alexeym (Post 636698)
Hi,

If is still relevant,
- it can be run both ways, since it is function object.
- definition of sampledSurface can be learned from:
1. https://github.com/OpenFOAM/OpenFOAM...es/controlDict
2. If you need plane, then maybe cuttingPlane instead of sampledTriSurfaceMesh if better choice, definition can be found, for example, here: https://github.com/OpenFOAM/OpenFOAM...m/cuttingPlane


Dear Alexey,

Thanks for your links, seems relevant.

Best regards,
Mark

heru July 12, 2018 11:18

finally,



how did you selected an area an then did the average of a field u?

eb19 July 13, 2018 15:16

Quote:

Originally Posted by alexeym (Post 636299)
Hi,

Let's assume, you are using OpenFOAM 4.x. Did you try surfaceRegion function object? (See http://cpp.openfoam.org/v4/a02578.html#details).

There is an option to take field values from sampledSurface, you can average values.

Hi Alexeym,

How can we average a value using sampledSurface? I need to calculate force on an area inside my domain. The area is not a patch, so I can not use patchIntegrate or force. I also tried surface sampling, but I only got pressures at each point on the area, not with the cell area. Therefore, I can not quantify the force.

I also tried surfaceRegion, but I am not sure which operation should I use?
Do you know or have suggestions? I have been searching and trying for almost three days with this, but not yet seen a light. I would appreciate your suggestion. Thank you.

eb19


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