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

Calculate flowrate of a scalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2021, 13:19
Default Calculate flowrate of a scalarField
  #1
Member
 
Join Date: Mar 2019
Posts: 31
Rep Power: 7
Andrea23 is on a distinguished road
Hi,

with "flowRatePatch" postprocess function you can calculate the volumetric or mass flow rate through a patch, reading the phi scalarfield. I want to calculate the flowrate of a concentration (scalarfield T).

There is a postprocess function to calcolate the flowrate of phi*T?

or there is a way to multiply these 2 fields? the problem is that T has 1 value per cell, phi has 1 value per face so it has to be a openfoam function that associate cell T value with phi value of cell faces

Thanks
Andrea23 is offline   Reply With Quote

Old   February 15, 2021, 14:43
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Maybe helps?

- surfaceInterpolate function object to obtain (somewhat) equivalent surface field values from volumetric field values (using T).
- Multiply the two fields (surfaceInterpolated T and phi) by using `multiply` function object.
HPE is offline   Reply With Quote

Old   February 15, 2021, 16:24
Default
  #3
Member
 
Join Date: Mar 2019
Posts: 31
Rep Power: 7
Andrea23 is on a distinguished road
Quote:
Originally Posted by HPE View Post
Maybe helps?

- surfaceInterpolate function object to obtain (somewhat) equivalent surface field values from volumetric field values (using T).
- Multiply the two fields (surfaceInterpolated T and phi) by using `multiply` function object.
Thanks for the reply;

calcolate surfaceInterpolated and multiplying for phi is the same as multiply T cellcenter value for phi?
if yes, I have to write this in controlDict

Quote:
surfaceInterpolate1
{
// Mandatory entries (unmodifiable)
type surfaceInterpolate;
libs (fieldFunctionObjects);

// Mandatory entries (runtime modifiable)
fields (T phiT);

// Optional (inherited) entries
region region0;
enabled true;
log true;
timeStart 0;
timeEnd 1000;
executeControl timeStep;
executeInterval 100; //if i want the field every 100 time step
writeControl timeStep;
writeInterval 100;
}
but I haven't find documentation for "multiply", do you know how it works?

as last step after I have the new volScalarField I rename it as "phi" and use "flowRatePatch", right?
Andrea23 is offline   Reply With Quote

Old   February 15, 2021, 16:58
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
For the first question: dont know.

For the second question: Please see incompressible/pisoFoam/RAS/cavity tutorial's controlDict.
HPE is offline   Reply With Quote

Old   February 16, 2021, 04:47
Default
  #5
Member
 
Join Date: Mar 2019
Posts: 31
Rep Power: 7
Andrea23 is on a distinguished road
Quote:
Originally Posted by HPE View Post
For the first question: dont know.

For the second question: Please see incompressible/pisoFoam/RAS/cavity tutorial's controlDict.
I have checked incompressible/pisoFoam/RAS/cavity but there isn't multiply in controlDict, I even tried using -help and foamInfo but it didn't find anything. I am using openFoam 8

I tried this too

Quote:
functions
{
functionObjectLibs("libutilityFunctionObject.so")
type coded;
name phiT;
writeControl runTime;
writeInterval 100;

codeWrite
{

surfaceScalarField phiT
(
IOobject
(
"phiT"
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
),

mesh().lookupObject<surfaceScalarField>("phi") * mesh().lookupObject<volScalarField>("T")
);
phiT.write()
};
}
But I had an error "ill defined primitiveEntry startin at keyowrd surfaceScalarField

and probably I have to use

Quote:
mesh().lookupObject<volScalarField>("T")
mesh().lookupObject<surfaceScalarField>("phi")

phi*(fvc::interpolate(T) & mesh.Sf())
but I am not sure if it works, can I use fvc:: in controlDict?
Andrea23 is offline   Reply With Quote

Old   February 16, 2021, 09:40
Default
  #6
Member
 
Join Date: Mar 2019
Posts: 31
Rep Power: 7
Andrea23 is on a distinguished road
the answer is in this post:

how to calculate mass flow rate on patches and summation of that during the run?
Andrea23 is offline   Reply With Quote

Reply


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
Calculate Mass Flowrate at a faceZone with OpenFOAM4 donQi OpenFOAM Post-Processing 1 August 31, 2016 21:13
calculate velocity difference helly OpenFOAM Post-Processing 0 June 21, 2016 08:49
How to calculate T+gradT where T is volScalarField and gradT is scalarField ??? Zhiheng Wang OpenFOAM Programming & Development 4 May 28, 2016 13:51
calculate values for eps and k from Re or u????? sbar OpenFOAM Pre-Processing 5 August 16, 2010 04:10
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57


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