Hi,
I want to calculate mass
Hi,
I want to calculate mass flow across a BC, which should be a general problem for most people who work with CFD. But I cannot find any standard utility in the 1.4.1 release that can help me. Is it just me ... ? I have found a utility "calcmassflow" on the openfoam wiki. But that was apperantly created for version 1.2 and after som fiddling with correcting library paths to get wmake to work, I gave up. Can anyone help? Regards Jens |
Hi Jens
OpenFOAM calculates t
Hi Jens
OpenFOAM calculates the massflow at every surface in every timeStep. To create a file which contains the flux-data (filename = phi) for every writeInterval you have to tell it OF. Therefore look at the fvSchemes dictionary in <root>/<case>/system For more Infomation on fvSchemes read the UserGuide page: U-104 + U-109 (chapter 4.4.7) 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 |
Hello Jens,
A Good day to y
Hello Jens,
A Good day to you! I have been using a modified version of the calcMassFlow utility that you found on the OpenFOAMWiki. This version of the utility has the following features: 1. Ability to process a decomposed case (detected by the presence of multiple "processor<x>" folders) 2. A dictionary based selection of the patches across which to calculate the Massflow. 3. If a Density value in the dictionary greater than unity is found, it is used to directly calculate the flow in [kg/s], if the density line is commented out in the dictionary, the output is printed in [m^3/s] and [l/min]. 4. Works on OpenFOAM 1.4, 1.4.1, 1.4.1-dev, etc..etc... If you are only going to be working with single processor simulations, I can give you a slightly different version of the code, which is significantly faster (since the code overhead for multiprocessor supoort is not there). http://www.cfd-online.com/OpenFOAM_D...s/mime_zip.gif calcMassFlow.zip Have a nice day! Philippose |
Hello!
As Jens I need to ca
Hello!
As Jens I need to calculate the massFlow through a BC. I've found phi files and the patchIntegrate tool, but I'm not able to modify it :S Then, I am really interested in the calcMassFlow utility. But I am new in C++ and OpenFoam wmake. So, it would be great if you could explain me how to use the calcMassFlow utility developed by Philippose. In which folder should I download it?? (applications/bin/linuxGcc4DPOpt ??) Or what tutorial should I read to compile it?? Any help will be appreciated. Have a nice day !! Gaby |
Hello Gabriela,
Good evenin
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 |
Hello Philippose !
Good Eve
Hello Philippose !
Good Evening!! I've followed all your steps and finally it worked very good !!! Thank you so much! and I hope this would be useful to other Foamers !!! :-) Gabriela |
Hello Philippose,
Does this utility work with OF-1.5.x? I have a compressible case so I cannot give a rho value. Do you have suggestion? I would like to calculate mass flow rate at inlet in kg/s. I guess I will try it anyways. Thanks for your time, Rachel |
Mass flow in a plane into the field
Hi all,
Thanks for the posted utility in this thread. I am interested to calculated mass flow rate in a plane in the field, not patches as inlet/outlet, do you have any idea, what should i do? Thanks, Hamed |
Hello Philippose,
Thank you for your great utility! Do you know how I can run it in parallel? When I have a parallel case and run Code:
calcMassFlow -latestTime When I run Code:
mpirun --hostfile $hosts -np $cpus calcMassFlow -latestTime -parallel How can I solve this? |
steady BC, time dependent flux, density species
Hi All,
i have checked out calcMassFLow, nice tool! But i have encountered some difficutlies... First I dont understand this (perhaps someone could give me a hand) Code:
mass/Time = Volume/Time * density so I asume if rho =1 we come out with Volume/Time. If rho !=1 , we have to multiply with rho and end up with mass/time...ok byt why is the code then Code:
if(rho.value() > 1.0) Second question: I have two species coming out my inlet. C3H8 and "air", how can I specify the different densities for each? There is only one entry for density in the dict. Third question ( migth be slightly off-topic, i apologize for that) : If I dont specify the density, using an compressible solver, phi needs to be calculated with density. we have p=rho R T; My BC are: Code:
pressure: I am using reactingFOAM and my velocity Field shows eddys from resulting from unsteady BC... :confused: This goes along with the time depending flow I have: Code:
uild : 1.6 I have no clue why this is happening and it messes up everything... PLZ help! regards! |
Hello
I would like to compare the massflow produced by this utility to the one I get un fluent. In fluent, when you have a 2D case, it extrudes a third dimension of 1 meter to calculate the massflow. I would like to know how it works here with this code? What's the value of the third dimension? Where is it created? How to change it? Thanks for the help |
[QUOTE=philippose;185787]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> Hi philippose I tried to compile(wmake) the file that you had attached but it throws me the following error, can you help me with this SOURCE=calcMassFlow.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/research/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/home/research/OpenFOAM/OpenFOAM-1.6/src/meshTools/lnInclude -IlnInclude -I. -I/home/research/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/research/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPOpt/calcMassFlow.o In file included from calcMassFlow.C:198: /home/research/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/createPhi.H: In function ‘int main(int, char**)’: /home/research/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/createPhi.H:50: error: ‘U’ was not declared in this scope make: *** [Make/linuxGccDPOpt/calcMassFlow.o] Error 1 Thanks in advance. |
Hi,
I have OF 1.7.0 and Paraview 3.8.0. How can i calculate flow rate of patches? |
[QUOTE=subash;263350]
Quote:
HTML Code:
IOobject Uheader Now I have no compiler errors any more. |
mass flow calculation in OF 1.6
Hi Foamers,
I need your help in calculating the mass flow rate in OF 1.6 at the boundary patches. Plz help. with rgds, -Gopal. |
Hey Gopal,
have you tried the utility 'calcMassFlow' yet? |
I have tried the CalcMassFlow utility. It requires compilation of the utility. I am finding it difficult to compile as it is written for the older versions (1.2 or 1.3) I guess. I am using v1.6 for my calculations.
It will help me a lot if somebody can guide me thru. thanks. -Gopal. |
Try these instructions
Quote:
Be more specific about your problems, otherwise we cannot help you. |
1 Attachment(s)
Hi Anne,
Thanks for the reply. I have followed the steps. But still there are lot of errors. Plz see the attached log file. with rgds, -Gopal. |
Okay. Basically the first error is the most important.
The compiler does not find the file fvCFD.H Which version are you using exactly? Please check if there is the file fvCFD.H in OpenFOAM-1.6/src/finiteVolume/lnInclude. |
All times are GMT -4. The time now is 07:25. |