CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Extract average values of faceZone (https://www.cfd-online.com/Forums/openfoam-solving/203704-extract-average-values-facezone.html)

Aurelius July 4, 2018 12:50

Extract average values of faceZone
 
Dear all,

I usually monitor area average quantities (p, U) from patches with function objects in “controlDict” like for example:

Code:

functions
{
outletSFV
{
type surfaceFieldValue;
libs ("libfieldFunctionObjects.so");
enabled yes;
log yes;
writeFields no;
regionType patch;
name outlet;
operation areaAverage;
// operation weightedAverage;
// weightField phi;
fields
(
U
p
);
}
}

My problem is that I need the same for a “faceZone” (which stands for an internal surface in the domain). The original model is a msh file that it has been converted to openFoam . It does not work using the same function object by changing the “regionType” from “patch” to “faceZone”.

The Foam Error I get:

[5] --> FOAM FATAL ERROR:
[5] surfaceFieldValue rs1SFVs: faceZone(interior_rotorstator_1):
Unable to process internal faces for volume field U

How can I get te internal volume field U automatically interpolated on the faceZone or if there is other way to extract on fly average values from an faceZone?

I am using OpenFoam v5.


Thanks for any help!
Aurelius

student666 July 4, 2018 14:52

Hi, don't know how to help, but if you set e.g.
Code:

regionType banana
Openfoam should gives you an error that it doesn't recognize banana and should print a list of available region types it can handle.
Eg:
If code has faceSet implemented, maybe you can use topoSet to define one...
Just a hint...
Cheers

student666 July 4, 2018 22:11

Just checked my personal notes...

https://www.cfd-online.com/Forums/bl...rocessing.html


As you may see, I largely use "banana method" and strangely if I put:

Code:

regionType banana
I get faceZones too.


Code:

--> FOAM FATAL IO ERROR:
banana is not in enumeration:
3
(
faceZone
patch
sampledSurface
)

Regards.

Aurelius July 5, 2018 04:18

Thanks for your answer.

If I put "surfaceInterpolate" instead of "surfaceFieldValue" in "type" field OF does not crash (remember I've got foam fatal error "Unable to process internal faces for volume field p"), but now OF reports:


...

surfaceInterpolate rs1SFVs write:
surface field p already exists

surfaceInterpolate rs1SFVs write:
Writing interpolated surface fields to 410
...



or in other words I cannot monitor "p" on fly as I do when "regionType" is a patch.


Regards.

student666 July 5, 2018 12:45

Well, it's hard to understand what you're doing, but I remember I performed a study case with a fan where the goal was to measure how much the rotational speed affected the rate of change of p at the suction side, using the "notes" I wrote on my personal blog, I managed to overcome the issue.
If I were you I would define an stl, as I did.

Regards.

Aurelius July 5, 2018 14:25

I aim the same as in your case. It is a fan that is built up in a domain in which I cannot with patches catch control surfaces on the over/under-pressure sides to follow "p" during the calculation. The only surface definition in the model for that are faceZones, that's why I tried with my function object changing "patch" (with it works fine) with "faceZone". I have little experience with OF, I will look how to define a stl for these faceZones. Thanks again for your help!

Regards.

Iose October 11, 2018 06:46

Hi Aurelius,
do you solve your issue? I use OpenFOAM dev - totalPressureDifference works perfectly for patches, but if I wanted to online monitoring the faceZone it doesn't work.
Thanks

Aurelius October 11, 2018 09:53

Hi Iose,

no, i didn't. My model comes from a fluent .msh file and i do not know how to define the faceZone as it would be in a stl in order i can address it via sample function in controlDict.
Regards.

Iose October 15, 2018 03:30

Hi Aurelius,
I found solution with help from wyldckat, see this
HTML Code:

https://www.cfd-online.com/Forums/openfoam/75393-internal-faces-monitoring.html#post710030
Create baffle from facezone enables monitoring pressure on these faces.

artymk4 April 18, 2019 09:18

Quote:

Originally Posted by Iose (Post 710034)
Hi Aurelius,
I found solution with help from wyldckat, see this
HTML Code:

https://www.cfd-online.com/Forums/openfoam/75393-internal-faces-monitoring.html#post710030
Create baffle from facezone enables monitoring pressure on these faces.

This link didn't work for me. Looks like it changed to
Code:

https://www.cfd-online.com/Forums/openfoam/75393-internal-faces-monitoring.html#post710029

enthusiast May 16, 2022 09:32

This solves the issue
 
p, U are volume fields, if you are using surfaceFieldValue, you need surface fields.

Hence you need to interpolate the volume fields to get surface fields.

Go through this, this solution will definitely solve this issue.

HTML Code:

https://www.cfd-online.com/Forums/openfoam-post-processing/238974-facezoneaverage-function-object-does-not-work-field-u-p-etc.html
Regards
Akshay


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