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

Calculate mass flow rate during run time in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 4 Post By jherb
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 21, 2019, 17:27
Default Calculate mass flow rate during run time in OpenFOAM
  #1
New Member
 
Aishwarya Krishnan
Join Date: Apr 2019
Posts: 6
Rep Power: 7
aishk is on a distinguished road
Hi all!

I am using the icoUncoupledKinematicParcel solver for a simple hopper-particle simulation. I have used "manual injection" and I need the mass flow rate through a specific plane in the hopper during its emptying. But when I try to do it through ParaView, I get U(0,0,0) (if I use slice -> integrate variables -> calculator). Does anyone know how to calculate the value of U or MFR through a plane or rectify this error?

Thanks for any help!
aishk is offline   Reply With Quote

Old   May 22, 2019, 10:00
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
You could add a function to system/controlDict which outputs the massflow in the directory postProcessing:
Code:
functions 

{
   outletMassFlowYourPatch
   {
        type            surfaceFieldValue;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl    timeStep;
        writeInterval   100;
        log             true;
        writeFields     false;
        regionType      patch;
        name            yourPatch;
        operation       sum;
        fields
        (
            phi
        );
   }
    

}

If you want do this on a plane inside the fluid domain, you could try an internal baffle.
jherb is offline   Reply With Quote

Old   May 23, 2019, 19:41
Default
  #3
New Member
 
Aishwarya Krishnan
Join Date: Apr 2019
Posts: 6
Rep Power: 7
aishk is on a distinguished road
Hi @jherb,

I tried both these options. I still get phi=0 at each time step in the outlet file.

Any other way to solve this?

Thank you!
aishk is offline   Reply With Quote

Old   May 24, 2019, 05:11
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Which version of OpenFOAM are you using? Have a look at the source code of your solver (icoUncoupledKinematicParcel?) and check which field is used the flux. Then use that field in the functions object. Also did you get a postProcessing folder at all? The example I gave you outputs the values only every 100th time step. Change the value of writeInterval to 1.
jherb is offline   Reply With Quote

Old   May 24, 2019, 13:45
Default
  #5
New Member
 
Aishwarya Krishnan
Join Date: Apr 2019
Posts: 6
Rep Power: 7
aishk is on a distinguished road
I am using OpenFOAM-dev for ubuntu. It looks like phi is velocity,U in icoUncoupledKinematicParcel.
I did get a postProcessing folder but all values of phi were zero at each 100 timesteps. Even when I reduce the timesteps to 1 it is zero.
I am not sure what is wrong. The magnitude of U in paraView is not zero though. The particles have velocity.
aishk is offline   Reply With Quote

Old   May 27, 2019, 08:03
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
Hello aishk,

In the example given by jherb, the function object computes the fluid flowrate, since phi refers to the fluid flux. The flux might be 0 in your case if you have a static fluid and if particles are just transported thanks to gravity and/or injection velocity. (this is what happens in the original hopper tutorial)

Since you want data related to particles, you need to use cloudFunctions, which are defined in your kinematicCloudProperties file. Among other cloud functions, facePostProcessing might do what you want :

Code:
Class
    Foam::FacePostProcessing
Description
    Records particle face quantities on used-specified face zone
    Currently supports:
        accummulated mass
        average mass flux
To use it, you need to define your plane as a faceZone (ie using topoSet) and then define the facePostProcessing function in your kinematicCloudProperties:

Code:
cloudFunctions
{
    myPostProcessing1
    {
        type            facePostProcessing;
        surfaceFormat    none;
        resetOnWrite    no;
        log                yes;
    
        faceZones
        (
            myPlaneFaceZone
        );
    }
}
You can switch off the "resetOnWrite" depending on whether you want the accumulated mass since start or since last write.


Have fun,

Yann
Antus likes this.

Last edited by Yann; May 27, 2019 at 11:19. Reason: typo
Yann is offline   Reply With Quote

Reply

Tags
mass flow rate, openfoam 1.5-dev, postprocessing mass flow


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
Match Pressure Inlet/Outlet Boundary Condition Mass Flow Rate MSchneid Fluent UDF and Scheme Programming 3 February 23, 2019 07:00
mass flow inlet and pressure outlet with target mass flow rate Zigainer FLUENT 13 October 26, 2018 06:58
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
Exit Corrected Mass Flow Rate Mesh Sensitivity Study s__s__s CFX 4 July 20, 2016 12:46
Periodic channel flow with time dependent mass flow rate QBeast FLUENT 3 May 10, 2013 14:14


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