CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   how to calculate mass flow rate /simpleFoam (http://www.cfd-online.com/Forums/openfoam-post-processing/96300-how-calculate-mass-flow-rate-simplefoam.html)

greel January 18, 2012 17:00

how to calculate mass flow rate /simpleFoam
 
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!

linnemann January 18, 2012 21:07

Hi

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

greel January 19, 2012 09:30

Quote:

Originally Posted by linnemann (Post 340013)

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.

linnemann January 19, 2012 09:55

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.

greel January 19, 2012 10:08

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 dlLibraryTable:pen(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!

linnemann January 19, 2012 10:29

I'll have a look at it tomorrow.

greel January 19, 2012 14:59

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

linnemann January 19, 2012 22:25

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;
  }
);


gschaider January 21, 2012 10:29

Quote:

Originally Posted by greel (Post 340105)
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 dlLibraryTable:pen(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

greel January 24, 2012 16:01

Quote:

Originally Posted by gschaider (Post 340427)
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)

https://www.sharcnet.ca/Software/Flu...gvmfl010-1.jpg

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


jmcneill June 8, 2012 11:00

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.

gschaider June 9, 2012 12:22

Quote:

Originally Posted by jmcneill (Post 365472)
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

aerogt3 October 31, 2012 11:58

What is the factor 19.7363 there for? Is it a unit conversion, and if so, from what to what?

gschaider November 14, 2012 18:44

Quote:

Originally Posted by aerogt3 (Post 389500)
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

aerogt3 November 15, 2012 14:27

Quote:

Originally Posted by gschaider (Post 392160)
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.

linnemann November 16, 2012 01:16

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.


All times are GMT -4. The time now is 20:48.