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

How does the operation in surfaceFieldValue exactly work?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2023, 11:14
Default How does the operation in surfaceFieldValue exactly work?
  #1
New Member
 
Turhan
Join Date: Sep 2022
Posts: 16
Rep Power: 3
Turhan is on a distinguished road
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.
Turhan is offline   Reply With Quote

Old   January 19, 2023, 12:02
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,053
Rep Power: 26
Yann will become famous soon enough
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
Yann is offline   Reply With Quote

Old   February 21, 2023, 10:00
Default
  #3
New Member
 
Turhan
Join Date: Sep 2022
Posts: 16
Rep Power: 3
Turhan is on a distinguished road
Quote:
Originally Posted by Yann View Post
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?
Turhan is offline   Reply With Quote

Old   February 21, 2023, 10:17
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,053
Rep Power: 26
Yann will become famous soon enough
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
Yann is offline   Reply With Quote

Reply

Tags
post process, surfacefieldvalue

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
RuntimeControl with surfaceFieldValue (v2012) simrego OpenFOAM Post-Processing 3 April 23, 2021 15:11
OpenFoam "Permission denied" and "command not found" problems. iyidaniel@yahoo.co.uk OpenFOAM Running, Solving & CFD 11 January 2, 2018 06:47
Does CX_Interpret_String work in parallel? 86lolo Fluent UDF and Scheme Programming 2 June 30, 2014 04:36
Companies that lease software & hardware for cloud-based work? Catthan ANSYS 0 June 18, 2014 10:53
Do all CFD analysts have to do some hands-on work except PhDs? e13drd Main CFD Forum 2 March 17, 2014 14:56


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