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

Mass Flow rate through a plane

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2010, 17:08
Default Mass Flow rate through a plane
  #1
Senior Member
 
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 17
titio is on a distinguished road
Send a message via MSN to titio Send a message via Skype™ to titio
Hi foamers,

I am starting to feel desesperate guys. I am trying to calculate the mass flow through a plane that it is not a patch, as the massCalcFlow does. Is there any way of this the easy way, say using foamCalc or some other utility that I am not aware of. If not possible to do that easily, I will do it in the code, and I will contribute it to the community, if I manage to do it.

Can anyone help me out. Thanks in advance,

António Martins

PS: OpenFOAM really needs a good documentation, but it seems capitalism and common good do not mix very well... and the problems with the documentation site only helped the commercial software even more....
titio is offline   Reply With Quote

Old   July 22, 2010, 02:20
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by titio View Post
Hi foamers,

I am starting to feel desesperate guys. I am trying to calculate the mass flow through a plane that it is not a patch, as the massCalcFlow does. Is there any way of this the easy way, say using foamCalc or some other utility that I am not aware of. If not possible to do that easily, I will do it in the code, and I will contribute it to the community, if I manage to do it.

Can anyone help me out. Thanks in advance,
I'd guess that there just isn't a generic place for such a massflow sampling and that's why it hasn't made its way into the code.
Note that this is all much easier when sampling on a patch, since you can simply use the phi directly there.

Nonetheless, this code fragment should give you a few ideas (I hope).

Code:
// defined somewhere in the surrounding class:
PtrList<sampledPlane> gammaPlanes_;


void Foam::massFlowInfo::calculateAndWrite
(
    const volVectorField& U,
    const volScalarField& rho
) const
{
    forAll(gammaPlanes_, planeI)
    {
        const sampledPlane& pln = gammaPlanes_[planeI];

        label nFaces = pln.faces().size();
        reduce(nFaces, sumOp<label>());

        if (nFaces)
        {
            // the velocity normal to the plane
            scalarField Uproj = pln.project
            (
                pln.sample(U)
            );

            scalar U_mean = pln.average(Uproj);

            scalarField rhoU = pln.sample(rho) * Uproj;
            scalar massFlow = pln.integrate(rhoU);

            Info<< pln.name() << nl
                << "  area       = " << pln.area() << nl
                << "  massFlow   = " << massFlow << "  ("
                << (massFlow * 3600) << " kg/h)" << nl
                << "  U_mean     = " << U_mean
                << endl;
        }
        else
        {
            Info<< pln.name() << nl
                << "  area       = " << 0
                << endl;
        }
    }
}
olesen is offline   Reply With Quote

Old   July 22, 2010, 13:23
Default Thanks
  #3
Senior Member
 
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 17
titio is on a distinguished road
Send a message via MSN to titio Send a message via Skype™ to titio
Thanks olesen. I will try the code and I will let you know if its worked.

Thanks,

Titio
titio is offline   Reply With Quote

Old   October 26, 2010, 16:54
Default what happened with this?
  #4
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Was this resolved? if so, please share how you made this possible.
chegdan is offline   Reply With Quote

Old   October 26, 2010, 17:00
Default
  #5
Member
 
Robin Gilbert
Join Date: Jan 2010
Posts: 66
Rep Power: 16
robingilbert is on a distinguished road
try swak4Foam:

http://openfoamwiki.net/index.php/Contrib/swak4Foam

to calculate flow rate through internal faceZone this works. i have tried it. to calculate the flow through a patch u can use calcMassFlow:

http://openfoamwiki.net/index.php/Contrib_calcMassFlow
robingilbert is offline   Reply With Quote

Old   October 27, 2010, 16:59
Default
  #6
Senior Member
 
maysmech's Avatar
 
Join Date: Jan 2010
Posts: 347
Blog Entries: 2
Rep Power: 17
maysmech is on a distinguished road
hi,


How can i calculate mass flow rate of a patch by using paraView software?
maysmech is offline   Reply With Quote

Old   March 25, 2012, 19:08
Default how to construct sampledPlane?
  #7
New Member
 
Join Date: Nov 2009
Posts: 17
Rep Power: 16
misakagan is on a distinguished road
Quote:
Originally Posted by olesen View Post
I'd guess that there just isn't a generic place for such a massflow sampling and that's why it hasn't made its way into the code.
Note that this is all much easier when sampling on a patch, since you can simply use the phi directly there.

Nonetheless, this code fragment should give you a few ideas (I hope).

Code:
// defined somewhere in the surrounding class:
PtrList<sampledPlane> gammaPlanes_;


void Foam::massFlowInfo::calculateAndWrite
(
    const volVectorField& U,
    const volScalarField& rho
) const
{
    forAll(gammaPlanes_, planeI)
    {
        const sampledPlane& pln = gammaPlanes_[planeI];

        label nFaces = pln.faces().size();
        reduce(nFaces, sumOp<label>());

        if (nFaces)
        {
            // the velocity normal to the plane
            scalarField Uproj = pln.project
            (
                pln.sample(U)
            );

            scalar U_mean = pln.average(Uproj);

            scalarField rhoU = pln.sample(rho) * Uproj;
            scalar massFlow = pln.integrate(rhoU);

            Info<< pln.name() << nl
                << "  area       = " << pln.area() << nl
                << "  massFlow   = " << massFlow << "  ("
                << (massFlow * 3600) << " kg/h)" << nl
                << "  U_mean     = " << U_mean
                << endl;
        }
        else
        {
            Info<< pln.name() << nl
                << "  area       = " << 0
                << endl;
        }
    }
}
Dear Mr. Olesen,

The code is very helpful, but I wonder also how the parts related to construction of sampledPlane's is implemented. Normally sampledPlane's are constructed on runtime using the sampleDict with runtimeselectiontable. I don't know how to construct them in a regular way with the direction vectors and basepoints.

Any suggestion would be a lot of help.

Best,

Asim
misakagan is offline   Reply With Quote

Old   March 25, 2012, 19:41
Default
  #8
New Member
 
Join Date: Nov 2009
Posts: 17
Rep Power: 16
misakagan is on a distinguished road
Ok I found the answer. I have to create cuttingPlane's and construct sampledPlane's using those cuttingPlane's...
misakagan is offline   Reply With Quote

Old   August 22, 2017, 02:22
Default solution?
  #9
New Member
 
karundev
Join Date: Jun 2017
Location: India
Posts: 25
Rep Power: 8
krndv is on a distinguished road
Quote:
Originally Posted by maysmech View Post
hi,


How can i calculate mass flow rate of a patch by using paraView software?


hello,

have you got answer for this? Please share if you know/

Thank you
krndv is offline   Reply With Quote

Old   August 22, 2017, 03:46
Default
  #10
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 12
Flowkersma is on a distinguished road
Quote:
Originally Posted by krndv View Post
hello,

have you got answer for this? Please share if you know/

Thank you
1. Calculate rho * U_N with "Calculator".
2. Use "IntegrateVariables" filter to calculate the massflow.
Flowkersma 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
Mass Flow Rate Error jallison FLUENT 1 May 16, 2011 16:22
mass flow rate (CFX post) sanchezz CFX 2 January 14, 2010 06:54
Mass Flow Rate student87 CFX 4 January 2, 2010 04:45
Surface Integral - Mass Flow Rate Venkatesh V FLUENT 3 October 10, 2008 16:18
mass flow rate error Masood FLUENT 0 May 22, 2005 00:32


All times are GMT -4. The time now is 08:41.