CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Mass flow through a patch (https://www.cfd-online.com/Forums/openfoam/80710-mass-flow-through-patch.html)

alf12 October 4, 2010 11:00

Mass flow through a patch
 
Hi,

I want to calculate mass flow through a patch, using incompressible RANS transient solver (2D case).

I have tried various methods, but I have some trouble with all of them

1 - Using post processing tool patchIngrate
Code:

patchIntegrate phi outlet
It works, but I have to format the file as an array to post process it and that's time consuming. I have done it for a few cases and I need a more efficient solution.

2 - Using libsimpleFunctionObjects library

2.1 - "patchMassFlow" function :
In this case I have a strange warning from OpenFoam :
Code:

--> FOAM Warning :
    From function SolverInfo::SolverInfo(const dictionary& dict,const objectRegistry &obr)
    in file SolverInfo/SolverInfo.C at line 88
    Neither LES nor RANS found. Assuming no turbulence

2.2 - "patchIntegrate" function with field U
It works but the output is a vector and once again I have to process the file before I can use it.

Actually the best solution should be using patchMassFlow but I struggle to understand this warning.

Thanks for help

nuovodna October 4, 2010 11:05

Take a look here:

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

I attached a file of calcMassFlow that works on OF 1.7+

alf12 October 4, 2010 11:44

Thanks for your answer. No problem to run your code but actually I have the same problem than with patchIntegrate, ie I have to format the file. I would like to get something that I could read more or less directly with gnuplot.

Code:

#Time Massflow
0.02 12.51
0.04 13.20
0.06 15.24

Anyway I will try to change the output format either in your code or either in the patchIntegrate tool.

nuovodna October 4, 2010 12:02

A precision: it's not my code. I only made some modification to get it working on OF 1.7.x

Original source code:

http://openfoamwiki.net/index.php/Contrib_calcMassFlow

I hope you can modify the code and obtain a "gnuplot ready" file :)

Regards

Emanuele

alf12 October 5, 2010 03:33

So, I have made change in the patchIntegrate tool to fit my need and basically it works.

Anyway, I would prefer to use the libsimpleFunctionObjects in order to control the output interval and I don't really understand if the warning I get is a bug or if I miss anything.

I get this warning only when I use the patchMassFlow type with this lib and not when using the patchIntegrate type from the same lib.

gschaider October 5, 2010 12:49

Quote:

Originally Posted by alf12 (Post 277715)
Hi,

2 - Using libsimpleFunctionObjects library

2.1 - "patchMassFlow" function :
In this case I have a strange warning from OpenFoam :
Code:

--> FOAM Warning :
    From function SolverInfo::SolverInfo(const dictionary& dict,const objectRegistry &obr)
    in file SolverInfo/SolverInfo.C at line 88
    Neither LES nor RANS found. Assuming no turbulence

2.2 - "patchIntegrate" function with field U
It works but the output is a vector and once again I have to process the file before I can use it.

Actually the best solution should be using patchMassFlow but I struggle to understand this warning.

Thanks for help

Don't mind the warning. The SolverInfo-class just tries to determine the properties of the solver you're working with and fails to understand new-school turbulence. But to calculate the massFlow you don't need turbulence so you'll be fine

Bernhard

PS: bug-Report at the mantis of the extend-project would be nice though

alf12 October 6, 2010 04:47

Bernhard, thanks for your answer.

I am still in the learning process with OpenFOAM and I have thought that SolverInfo was an OpenFOAM class.

I have run a calculation using patchMassFlow from libsimpleFunctionObjects and so far everything looks fine.


All times are GMT -4. The time now is 06:53.