CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How does the operation in surfaceFieldValue exactly work? (https://www.cfd-online.com/Forums/openfoam-post-processing/247197-how-does-operation-surfacefieldvalue-exactly-work.html)

Turhan January 19, 2023 11:14

How does the operation in surfaceFieldValue exactly work?
 
Dear all,

I'm running a code that shows a flow through a pipeline
In order to see what the mass flow is through the pipe I've written the following code:

MassFlow
{
type surfaceFieldValue;
libs (fieldFunctionObjects);
enabled true;
writeControl writeTime;
log true;
writeFields false;
regionType patch;
name inlet;
operation average;

fields
(
phi U p
);
}

Here I've written average at the operation. But what is it exactly taking the average of? Is it summing the phi, U and p on each point of the patch I've chosen? Or is it averaging the variables at each timestep?

To compare results, I had rerunned the simulation with "operation none;" instead, but that gave me a blank page.

Yann January 19, 2023 12:02

Hello,

Your current definition is computing the average value of all faces on your patch for Phi, U and p.
More details here: https://www.openfoam.com/documentati...ieldValue.html

If you want to compute the flowrate you should use operation sum on phi (which is the flux on each face of the patch).

Regards,
Yann

Turhan February 21, 2023 10:00

Quote:

Originally Posted by Yann (Post 843152)
Hello,

Your current definition is computing the average value of all faces on your patch for Phi, U and p.
More details here: https://www.openfoam.com/documentati...ieldValue.html

If you want to compute the flowrate you should use operation sum on phi (which is the flux on each face of the patch).

Regards,
Yann

I see, with faces I assume you mean the faces of the grid cells at the patch.
So for the total flow rate it makes sense to sum the flow rate through all faces.
But would that not mean that for data such as the pressure and velocity I should get the average value of all faces in order to know what velocity/pressure occurs at the patch?

Yann February 21, 2023 10:17

Yes exactly, if you want to know the average velocity or average pressure on your patch you can use average or areaAverage.

For the flowrate you can use sum(phi) since phi is the local flux at the face. If you are using an incompressible solver, you will get a volume flow rate. If you are using a compressible solver you will get a mass flow rate.

You can also compute areaNormalIntegrate(U) which will also give a volume flow rate.

I hope this helps.
Yann


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