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

how to calculate mass flow rate /simpleFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2012, 17:00
Default how to calculate mass flow rate /simpleFoam
  #1
Member
 
andres
Join Date: Jul 2011
Posts: 31
Rep Power: 15
greel is on a distinguished road
Hi Foamers,

How can I get the mass flow rate through patch??

I´m trying to obtain mass flow rate values to validate the result using the "flow in a 90° planar tee-junction" validation test case of Fluent ( Experiments by Hayes) http://oniken.free.fr/prg%20ecole/fl.../PDF/VAL_4.PDF

I was able to obtain similars contouts of static pressure, but I´m having severs problem to get the mass flow rate through exits.

I´m working with openfoam 2.0, simpleFoam solver and I can´t compile calcMassFlow utilityhttp://openfoamwiki.net/index.php/Contrib_calcMassFlow and I don´t understand how to use swak4foam.

Code:
usuarioubuntu@SAN1496UBU:~/swak4Foam/otros/calcMassFlow$ wmake
SOURCE=calcMassFlow.C ;  g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam200/src/cfdTools/lnInclude -I/opt/openfoam200/src/cfdTools/general/lnInclude 	 -I/opt/openfoam200/src/meshTools/lnInclude 	 -I/home/usuarioubuntu/OpenFOAM/usuarioubuntu-2.0.0/Libraries/cellFaceSetUtilities/lnInclude -IlnInclude -I. -I/opt/openfoam200/src/OpenFOAM/lnInclude -I/opt/openfoam200/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linuxGccDPOpt/calcMassFlow.o
calcMassFlow.C:33:19: fatal error: fvCFD.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPOpt/calcMassFlow.o] Error 1
usuarioubuntu@SAN1496UBU:~/swak4Foam/otros/calcMassFlow$ wmake
Making dependency list for source file calcMassFlow.C
SOURCE=calcMassFlow.C ;  g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam200/src/finiteVolume/lnInclude -I/opt/openfoam200/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam200/src/OpenFOAM/lnInclude -I/opt/openfoam200/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linuxGccDPOpt/calcMassFlow.o
calcMassFlow.C: In function ‘int main(int, char**)’:
calcMassFlow.C:63:9: error: expected ‘)’ before ‘IOobject’
calcMassFlow.C:71:30: error: ‘Uheader’ was not declared in this scope
calcMassFlow.C:73:5: error: expected primary-expression before ‘)’ token
calcMassFlow.C:73:5: error: expected ‘;’ before ‘)’ token
make: *** [Make/linuxGccDPOpt/calcMassFlow.o] Error 1
usuarioubuntu@SAN1496UBU:~/swak4Foam/otros/calcMassFlow$
Thanks for reading!
greel is offline   Reply With Quote

Old   January 18, 2012, 21:07
Default
  #2
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi

http://openfoamwiki.net/index.php/Co...unctionObjects
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   January 19, 2012, 09:30
Default
  #3
Member
 
andres
Join Date: Jul 2011
Posts: 31
Rep Power: 15
greel is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Thanks for the answer, but I think simpleFunctionObjects are not valid in OF 2.0. Now they are included in the swak4Foam but I dont understant how to use it.
greel is offline   Reply With Quote

Old   January 19, 2012, 09:55
Default
  #4
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Quote from the wiki.

Quote:
3.4 OpenFOAM 2.0
Starting with this version of OF is a part of swak4Foam.
If you can live without the other capabilities of swak4Foam then the library can still be downloaded independently
svn checkout https://openfoam-extend.svn.sourcefo...nctionObjects/
You just svn it go into the directory source the OF and run wmake libso and then add the massflow entry in the controlDict file.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   January 19, 2012, 10:08
Default
  #5
Member
 
andres
Join Date: Jul 2011
Posts: 31
Rep Power: 15
greel is on a distinguished road
Thanks for the answer.

I had compiled swak4foam without problems, but I think that the mass flow entry need some changes. If I use the the one in wiki I got this error;
Quote:
Starting time loop

--> FOAM Warning :
From function dlLibraryTableen(const fileName&)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libsimpleFunctionObjects.so"


--> FOAM FATAL ERROR:
Unknown function type patchMassFlow

Table of functionObjects is empty


From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.

FOAM exiting
So now I´m trying to replace "libsimpleFunctionObjects.so" and patchMassFlow


Thanks!
greel is offline   Reply With Quote

Old   January 19, 2012, 10:29
Default
  #6
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
I'll have a look at it tomorrow.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   January 19, 2012, 14:59
Default
  #7
Member
 
andres
Join Date: Jul 2011
Posts: 31
Rep Power: 15
greel is on a distinguished road
I keep trying with swak4foam but no results..

I have compiled calcMassFlow http://openfoamwiki.net/index.php/Contrib_calcMassFlow
An I was able to obtain some result, I will check the values now
greel is offline   Reply With Quote

Old   January 19, 2012, 22:25
Default
  #8
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi again

Just tried adding the entry from the wiki and this is the output.
So it works fine.

Code:
smoothSolver:  Solving for Ux, Initial residual = 1.74784e-06, Final residual = 5.48515e-08, No Iterations 3
smoothSolver:  Solving for Uy, Initial residual = 1.765421e-06, Final residual = 5.508338e-08, No Iterations 3
smoothSolver:  Solving for Uz, Initial residual = 2.072079e-06, Final residual = 7.16652e-08, No Iterations 3
GAMG:  Solving for p, Initial residual = 0.004637279, Final residual = 5.125009e-06, No Iterations 3
time step continuity errors : sum local = 5.154984e-07, global = 5.606926e-10, cumulative = 5.606926e-10
smoothSolver:  Solving for omega, Initial residual = 1.853332e-06, Final residual = 9.561004e-08, No Iterations 2
smoothSolver:  Solving for k, Initial residual = 2.060505e-05, Final residual = 3.168589e-07, No Iterations 3
ExecutionTime = 65.84 s  ClockTime = 66 s

 MassFlows:   inlet = -16.77585  outlet = 16.77589
Have you tried inputting the full path to the libsimpleFunctionObjects.so? Since it complains that it cant load it.
I've also compiled the full swak4foam for OF21.
Try to do this instead.

Code:
functions 
(
   massFlow
   {
      type patchMassFlow;
     functionObjectLibs
       (
         "/home/user/OpenFOAM/somefolder/libsimpleFunctionObjects.so"
       );
     verbose true;
     patches
       (
         inlet
         outlet
       );
     factor 19.7363;
   }
);
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   January 21, 2012, 10:29
Default
  #9
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 greel View Post
Thanks for the answer.

I had compiled swak4foam without problems, but I think that the mass flow entry need some changes. If I use the the one in wiki I got this error;
Quote:
Starting time loop

--> FOAM Warning :
From function dlLibraryTableen(const fileName&)
in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
could not load "libsimpleFunctionObjects.so"
Check whether libsimpleFunctionObjects.so is really in the folder $FOAM_USER_LIBBIN (where a 'normal' compilation would put it) and whether that folder is in your $LD_LIBRARY_PATH
gschaider is offline   Reply With Quote

Old   January 24, 2012, 16:01
Default
  #10
Member
 
andres
Join Date: Jul 2011
Posts: 31
Rep Power: 15
greel is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Check whether libsimpleFunctionObjects.so is really in the folder $FOAM_USER_LIBBIN (where a 'normal' compilation would put it) and whether that folder is in your $LD_LIBRARY_PATH
Thanks Bernhard,
The libsimpleFunctionObjects.so wasn´t there so I went to swak4foam folder and "Allwmake" it. Now the libsimple... is in the folder $FOAM_USER_LIBBIN .

Many thanks!

I have studied the case http://www.sciencedirect.com/science...45793089900273 ( I dont have the paper so if anyone have it pls pm me)



My results under simpleFoam are really similars for % of flow split


Code:
Reynolds	        10       	100        	200       	300   	   400
Experimental *	0.5256	0.7256	0.8415	0.8854	0.9098
OpenFoam	0.5264	0.7196	0.8277	0.8812	0.9111
greel is offline   Reply With Quote

Old   June 8, 2012, 12:00
Default
  #11
New Member
 
James McNeill
Join Date: Feb 2012
Posts: 4
Rep Power: 14
jmcneill is on a distinguished road
This is a bit tangential to the original question, but still falls unde the scope of the title. I'm struggling with understanding how mass flow rate is determined in the simpleFoam models (I'm using buoyantBoussinesqSimpleFoam) when there is no specification of the density in the transportProperties file. Does anyone have an idea of where the density may be entered, before I dig into the source code? Thanks in advance.
jmcneill is offline   Reply With Quote

Old   June 9, 2012, 13:22
Default
  #12
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 jmcneill View Post
This is a bit tangential to the original question, but still falls unde the scope of the title. I'm struggling with understanding how mass flow rate is determined in the simpleFoam models (I'm using buoyantBoussinesqSimpleFoam) when there is no specification of the density in the transportProperties file. Does anyone have an idea of where the density may be entered, before I dig into the source code? Thanks in advance.
The there is a rho field. And yes: this is very tangential
gschaider is offline   Reply With Quote

Old   October 31, 2012, 11:58
Default
  #13
Member
 
Join Date: Mar 2009
Posts: 90
Rep Power: 17
aerogt3 is on a distinguished road
What is the factor 19.7363 there for? Is it a unit conversion, and if so, from what to what?
aerogt3 is offline   Reply With Quote

Old   November 14, 2012, 18:44
Default
  #14
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 aerogt3 View Post
What is the factor 19.7363 there for? Is it a unit conversion, and if so, from what to what?
It is completely unclear to me what you mean with "there". If you're referring to something in the thread pleas quote otherwise specify a minimum of context
__________________
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 15, 2012, 14:27
Default
  #15
Member
 
Join Date: Mar 2009
Posts: 90
Rep Power: 17
aerogt3 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
It is completely unclear to me what you mean with "there". If you're referring to something in the thread pleas quote otherwise specify a minimum of context
In post #8.
aerogt3 is offline   Reply With Quote

Old   November 16, 2012, 01:16
Default
  #16
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi

Its just a factor, if you want it in m3/s you just set it to 1.

I have no idea what the factor 19.7363 converts it into, it was taken directly copy/paste from the Wiki.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann 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 rate on face OpenFoam ronaldo OpenFOAM 7 November 8, 2019 01:10
Mass flow rate: calculation v/s computation beguxa FLUENT 5 December 2, 2018 22:02
Mass Flow Rate Error jallison FLUENT 1 May 16, 2011 17:22
2D axisymmetric mass flow rate for the plain orifice atomizer jwillie2000 FLUENT 2 September 17, 2010 06:43
particle, parcel and mass flow rate balance flybird FLUENT 0 May 24, 2007 11:44


All times are GMT -4. The time now is 19:16.