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

Calculation of mass flow across a boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree12Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2012, 00:57
Default
  #21
New Member
 
Gopal Shinde
Join Date: Sep 2009
Location: Pune, India
Posts: 28
Rep Power: 17
shinde.gopal is on a distinguished road
Hi thr,

I am using version 1.6.
I have included the path in the program calcMassFlow.C.
But still I am getting this error. Plz help.

================================================== ====================
[shindg2@cd80si0017 calcMassFlow]$ wmake
SOURCE=calcMassFlow.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/cfdTools/lnInclude -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/cfdTools/general/lnInclude -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -I/home/edm/shindg2/OpenFOAM/shindg2-1.6/Libraries/cellFaceSetUtilities/lnInclude -IlnInclude -I. -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/calcMassFlow.o
calcMassFlow.C:36:30: error: FaceSetUtilities.H: No such file or directory
calcMassFlow.C:37: error: ‘FaceSetUtilities’ is not a namespace-name
calcMassFlow.C:37: error: expected namespace-name before ‘;’ token
calcMassFlow.C: In function ‘int main(int, char**)’:
calcMassFlow.C:105: error: ‘flipSet’ was not declared in this scope
calcMassFlow.C:105: error: template argument 1 is invalid
calcMassFlow.C:105: error: invalid type in declaration before ‘=’ token
calcMassFlow.C:105: error: ‘checkFaceSetSides’ was not declared in this scope
calcMassFlow.C:111: error: ‘flips’ cannot be used as a function
make: *** [Make/linux64GccDPOpt/calcMassFlow.o] Error 1
[shindg2@cd80si0017 calcMassFlow]$
================================================== =====================

with rgds,
-Gopal.
shinde.gopal is offline   Reply With Quote

Old   February 21, 2012, 00:58
Default
  #22
New Member
 
Gopal Shinde
Join Date: Sep 2009
Location: Pune, India
Posts: 28
Rep Power: 17
shinde.gopal is on a distinguished road
Hi thr,

I am using version 1.6.
I have included the path in the program calcMassFlow.C.
But still I am getting this error. Plz help.

================================================== ====================
[shindg2@cd80si0017 calcMassFlow]$ wmake
SOURCE=calcMassFlow.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/cfdTools/lnInclude -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/cfdTools/general/lnInclude -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -I/home/edm/shindg2/OpenFOAM/shindg2-1.6/Libraries/cellFaceSetUtilities/lnInclude -IlnInclude -I. -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/edm/shindg2/.PKG/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/calcMassFlow.o
calcMassFlow.C:36:30: error: FaceSetUtilities.H: No such file or directory
calcMassFlow.C:37: error: ‘FaceSetUtilities’ is not a namespace-name
calcMassFlow.C:37: error: expected namespace-name before ‘;’ token
calcMassFlow.C: In function ‘int main(int, char**)’:
calcMassFlow.C:105: error: ‘flipSet’ was not declared in this scope
calcMassFlow.C:105: error: template argument 1 is invalid
calcMassFlow.C:105: error: invalid type in declaration before ‘=’ token
calcMassFlow.C:105: error: ‘checkFaceSetSides’ was not declared in this scope
calcMassFlow.C:111: error: ‘flips’ cannot be used as a function
make: *** [Make/linux64GccDPOpt/calcMassFlow.o] Error 1
[shindg2@cd80si0017 calcMassFlow]$
================================================== =====================

with rgds,
-Gopal.
shinde.gopal is offline   Reply With Quote

Old   February 21, 2012, 09:52
Default
  #23
Senior Member
 
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 16
Anne Lincke is on a distinguished road
Hey Gopal,

you are missing a library which is needed for the utility.
Look at this post, they have the same problems:

http://www.cfd-online.com/Forums/ope...massflowc.html

Here you can download the libraries:
http://openfoamwiki.net/index.php/Contrib_calcMassFlow

Follow the instructions which are neccessary for inserting the libraries. Then try it again

Anne
Anne Lincke is offline   Reply With Quote

Old   February 22, 2012, 00:54
Default
  #24
New Member
 
Gopal Shinde
Join Date: Sep 2009
Location: Pune, India
Posts: 28
Rep Power: 17
shinde.gopal is on a distinguished road
Hi Anne,

I have downloaded the required files /libraries. Thanks for the info.
I will give it a try and come back on this forum for some more help.

with rgds,
-Gopal.
shinde.gopal is offline   Reply With Quote

Old   April 11, 2012, 15:48
Smile Thanx philippose...
  #25
New Member
 
Deshaka Kottage
Join Date: Mar 2012
Posts: 2
Rep Power: 0
Deshaka_Kottage is on a distinguished road
Thanx philippose....It works..really nice work....
Deshaka_Kottage is offline   Reply With Quote

Old   November 21, 2012, 10:28
Default
  #26
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14
curiosity is on a distinguished road
Quote:
Originally Posted by philippose View Post
Hello Gabriela,

Good evening to you!

Sooo.... here are the steps you need to follow to compile and use calcMassFlow...

I am assuming that you have a working OpenFOAM installation, and that you are able to compile things using wmake....

1. Unzip the file "calcMassFlow.zip" to the folder: [home]/OpenFOAM/[username]-[OFVersion]/applications

2. Go into the created folder "calcMassFlow"

3. type "wmake"

4. The utility compiles, and installs the executable file in the folder:
[home]/OpenFOAM/[username]-[OFVersion]/applications/bin/linuxGCC4DOpt

The above four steps basically complete the compilation / installation of the utility.

To use it... you need to do the following:

1. In the folder "calcMassFlow" mentioned earlier, there is a sample "calcMassFlowDict" file.... copy this file into the "system" folder of your case.

2. Modify the entries under "patchNames" to the names of the patches through which you want to calculate the massflow.

3. Optionally, you can uncomment the "rho" line, and specify the density of the medium you simulated, in case you want the massflow in units "kg/s" instead of "m^3/s"

4. Go to the root folder of your case, and as usual, type:
calcMassFlow <root> <case> [-time t]

or

calcMassFlow <root> <case> [-latestTime]

or

calcMassFlow <root> <case>


That should be it....

Hope everything works as expected :-)!

Enjoy!

Philippose

Hi all,

I´ve made what Philippose told and I´ve been able to compile it, but when I execute de command calcMassFlowDic I´ve got a message error related with the variable phi:

Error... Patch: Name_of_my_Boundary not found
No phi for Time=4000 -> Skipping

Can anyone help me, please?
curiosity is offline   Reply With Quote

Old   November 21, 2012, 11:29
Default
  #27
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14
curiosity is on a distinguished road
Quote:
Originally Posted by graser View Post
Hi Jens

Now you have the flux and need to postprzess it. Therefore you need to integrate phi at your boundary. There is a OF-utility named patchIntegrate.
The Problem is that phi is defined as "surfaceScalarField" and patchIntegrate only integrates "volScalarField". To integrate phi you have to modify the patchIntegrate Tool to read and integrate surfaceScalarFields.

Hf
Max
I understand, but... how??
curiosity is offline   Reply With Quote

Old   November 21, 2012, 15:14
Default
  #28
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by curiosity View Post
Hi all,

I´ve made what Philippose told and I´ve been able to compile it, but when I execute de command calcMassFlowDic I´ve got a message error related with the variable phi:

Error... Patch: Name_of_my_Boundary not found
No phi for Time=4000 -> Skipping

Can anyone help me, please?
Well. Is there a patch named Name_of_my_Boundary in your geometry? If yes: check the case (that is a favourite). The missing phi is more of a showstopper. Without it no mass flow will be calculated ... for that timestep (assuming this calcMassFlow is the utility I wrote and published http://openfoamwiki.net/index.php/Contrib_calcMassFlow year ago and haven't maintained for a long time. But maybe there is another utility of the same name floating around)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 21, 2012, 15:18
Default
  #29
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by curiosity View Post
I understand, but... how??
By copying and adapting the sources of the utility.

Personally I'd do that with swak4Foam. Either by using a patchExpression-function-Object during the simulation or the funkyDoCalc-utility afterwards (swak4Foam is one of the reasons why I don't maintain calcMassFlow anymore)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 26, 2012, 07:40
Default
  #30
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14
curiosity is on a distinguished road
I´ll try

Thanks!
curiosity is offline   Reply With Quote

Old   December 8, 2012, 06:45
Default
  #31
New Member
 
Mulualem
Join Date: May 2010
Posts: 11
Rep Power: 16
mulfal is on a distinguished road
Dear Foamers,
I am trying to calculate the mass flow and/or the pressure force at any field or any section of the domain, which is not pre-defined patch like the inlet/outlet patch. This question has been asked back in 2009 by haghajani in this thread though it seems no one has tried to answer it or may be I couldn’t come across any other posts related to this issue

Would be great help if some one has done or modified the patchNames in order to calculate the mass flow at any section of the domain and lend me a hand on it.

Have a nice day!
mulfal is offline   Reply With Quote

Old   December 8, 2012, 07:26
Default
  #32
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14
curiosity is on a distinguished road
Hi Mulualem,

I´m not so sure if I´m the adecuate person to help you. Anyway, I´ll try ^^

In ParaView, click Filters-->Slice and enter the coordenates of the plane you want to calculate the mass flow into the tab Properties.

Then, Filters--->Calculator and in Scalars choose U_X or U_Y depending on the direction of the mass flow you want to calculate.

Continue with: Filters--->Integrate Variables... You´ll see a chart in wich the U_X is, in fact, the mass flow in the x-direction. This is because when you apply the filter Integrate Variables, ParaView is multiplying each area of cell of the slice you´ve chosen for the variable U_X in this cell.

That´s all, hope it´s useful for you
Elham, Pravin Kadu and mizzou like this.
curiosity is offline   Reply With Quote

Old   December 8, 2012, 07:34
Default
  #33
New Member
 
Mulualem
Join Date: May 2010
Posts: 11
Rep Power: 16
mulfal is on a distinguished road
Hi Paula,
Thank you very much for your quick reply. I will definately try your method and hope it works. I am still at my desk so will come back to you if I have encountered any problem.

This means I can even calculate the pressure forces at the same faces using using the p_rgh, am I right?

Thanks a lot!
mulfal is offline   Reply With Quote

Old   December 8, 2012, 08:28
Default
  #34
New Member
 
Mulualem
Join Date: May 2010
Posts: 11
Rep Power: 16
mulfal is on a distinguished road
Quote:
Originally Posted by curiosity View Post
Hi Mulualem,

I´m not so sure if I´m the adecuate person to help you. Anyway, I´ll try ^^

In ParaView, click Filters-->Slice and enter the coordenates of the plane you want to calculate the mass flow into the tab Properties.

Then, Filters--->Calculator and in Scalars choose U_X or U_Y depending on the direction of the mass flow you want to calculate.

Continue with: Filters--->Integrate Variables... You´ll see a chart in wich the U_X is, in fact, the mass flow in the x-direction. This is because when you apply the filter Integrate Variables, ParaView is multiplying each area of cell of the slice you´ve chosen for the variable U_X in this cell.

That´s all, hope it´s useful for you
Hi Paula,
I have been trying the steps you gave me to calculate the mass flow rate and it works fine. At least I can now work out to calculate the integral of the pressure at a chosen cross-section to obtain the pressure forces at that section.

Just I have one question though, If I want to calculate the flow rate at a small section of the face area (say a sum of cells in the domain face area), is paraView capable of choosing such kind of certain cells from the total face area of the domain?

Thanks!

Mulualem
mulfal is offline   Reply With Quote

Old   December 8, 2012, 09:03
Default
  #35
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14
curiosity is on a distinguished road
Hi Mulualem,

Happy to know It worked

I don´t know the exact answer to your new question but I think there´s a filter called Select Extract Cells or something like that. Try it as the same way you used the other filter... and let me know if it works too

Regards,

Paula
curiosity is offline   Reply With Quote

Old   December 8, 2012, 09:57
Default
  #36
New Member
 
Mulualem
Join Date: May 2010
Posts: 11
Rep Power: 16
mulfal is on a distinguished road
Quote:
Originally Posted by curiosity View Post
Hi Mulualem,

Happy to know It worked

I don´t know the exact answer to your new question but I think there´s a filter called Select Extract Cells or something like that. Try it as the same way you used the other filter... and let me know if it works too

Regards,

Paula
Hi Paula,
It works great.
Steps: After slice...go to filters>ExtractCellsByRegion
In the properties tab under the intersect with list, you can choose plane if you want to cut only one side of the face and set the coordinate but if you want to cut more than one side, you can choose box and work out with the translate, rotate and scale data in order to extract the exact surface area you want.

It has been great to talk to you and you saved a lot of my time. I have been looking the codes developed for this kind of post processing jobs but now I will put them aside for the time being and post-process my data using the paraView.

Thank you and have a nice weekend!

Best Wishes,

Mulualem
mulfal is offline   Reply With Quote

Old   December 8, 2012, 12:13
Default
  #37
Member
 
Paula
Join Date: Aug 2012
Posts: 30
Rep Power: 14
curiosity is on a distinguished road
Great! It´s nice having been useful

Thanks for your reply !

Good luck!
curiosity is offline   Reply With Quote

Old   March 22, 2013, 09:07
Default
  #38
New Member
 
Join Date: Feb 2012
Posts: 1
Rep Power: 0
GeoKNL is on a distinguished road
Hi.
Have you finally found why was your flux oscillating?
Because i have the same problem (with steady boundary conditions).
Thanks
George
GeoKNL is offline   Reply With Quote

Old   July 1, 2013, 09:22
Default Mass flux output in a file
  #39
Member
 
Hale
Join Date: May 2013
Posts: 53
Rep Power: 13
Hale is on a distinguished road
Hi,

Is there any body who knows how to write the fluxes given by calcMassFlow in a text file and not on the terminal where it normally does?

I want to plot the values on a graph but I don't know how to write them in a file!

NB. calcMassFlow is a ultility that gives the mass flux through patches.

Thank a lot
Hale is offline   Reply With Quote

Old   July 1, 2013, 19:21
Default
  #40
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Hale View Post
Hi,

Is there any body who knows how to write the fluxes given by calcMassFlow in a text file and not on the terminal where it normally does?

I want to plot the values on a graph but I don't know how to write them in a file!

NB. calcMassFlow is a ultility that gives the mass flux through patches.

Thank a lot
You're talking about http://openfoamwiki.net/index.php/Contrib_calcMassFlow ? Either use a script to extract that information from the output (I use for some strange reasons PyFoam) or use swak4Foam http://openfoamwiki.net/index.php/Co...e_calcMassFlow (that does output into a file too)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider 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 Flow in a faceSet during calculation torvic OpenFOAM Running, Solving & CFD 1 August 11, 2008 20:05
mass flow rate calculation Ahmed CFX 7 June 20, 2008 06:55
Calculation of mass flow rate msrinath80 OpenFOAM Running, Solving & CFD 0 April 18, 2007 15:05
Calculation of added mass in viscous flow kharati Main CFD Forum 2 February 1, 2006 01:28
Mass Flow Rate Calculation Paul FLUENT 9 March 23, 2002 09:37


All times are GMT -4. The time now is 17:22.