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

Calculation of mass flow across a boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree12Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2017, 17:52
Default
  #61
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Adlak View Post
Hi,

Phi is local equivalence ratio. Yes, cross sections are aligned with cell faces. I dont have any other things.
OK. A function object like
Code:
mixingEff1 {
  type swakExpression;
  verbose true;
  valueType faceZone;
  zoneName control1;
  expression "alpha*YH2*phi*flip()/inflowH2";
  accumulations (
    sum
  );
  variables (
     "inflowH2{inlet}=sum(phi*YH2);"
     "alpha=equivRatio<1 ? 1 : 1/equivRatio;"
  );
}
That is only a sketch. Some parameters are missing (about interpolating volume-fields to the faces) and with the phi I use I assume that this is a compressible solver. Also that the faceZone has a properly set flip-map (that is to compensate for faces that might be orientated "wrong")
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   April 28, 2017, 05:39
Default
  #62
Member
 
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10
Adlak is on a distinguished road
Quote:
Originally Posted by gschaider View Post
OK. A function object like
Code:
mixingEff1 {
  type swakExpression;
  verbose true;
  valueType faceZone;
  zoneName control1;
  expression "alpha*YH2*phi*flip()/inflowH2";
  accumulations (
    sum
  );
  variables (
     "inflowH2{inlet}=sum(phi*YH2);"
     "alpha=equivRatio<1 ? 1 : 1/equivRatio;"
  );
}
That is only a sketch. Some parameters are missing (about interpolating volume-fields to the faces) and with the phi I use I assume that this is a compressible solver. Also that the faceZone has a properly set flip-map (that is to compensate for faces that might be orientated "wrong")



Thanks gschaider,
Should I put this expression in controldict file and will it work in openfoam-3.0.x ??? I will study this and try to implement it.

Thanks again for ur quick reply.
Adlak is offline   Reply With Quote

Old   May 1, 2017, 16:58
Default
  #63
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Adlak View Post
Thanks gschaider,
Should I put this expression in controldict file and will it work in openfoam-3.0.x ??? I will study this and try to implement it.

Thanks again for ur quick reply.
The solution would require swak4foam (you'll have to install that). The last release of that should work with OF 3.0. Yes. It goes into the functions-dictionary in the controlDict
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   May 12, 2017, 06:54
Default
  #64
Member
 
Mukesh Adlak
Join Date: Jun 2016
Posts: 32
Rep Power: 10
Adlak is on a distinguished road
Quote:
Originally Posted by gschaider View Post
OK. A function object like
Code:
mixingEff1 {
  type swakExpression;
  verbose true;
  valueType faceZone;
  zoneName control1;
  expression "alpha*YH2*phi*flip()/inflowH2";
  accumulations (
    sum
  );
  variables (
     "inflowH2{inlet}=sum(phi*YH2);"
     "alpha=equivRatio<1 ? 1 : 1/equivRatio;"
  );
}
That is only a sketch. Some parameters are missing (about interpolating volume-fields to the faces) and with the phi I use I assume that this is a compressible solver. Also that the faceZone has a properly set flip-map (that is to compensate for faces that might be orientated "wrong")

Hi gschaider,
I understood all but except following 3 things:
verbose true;
valueType faceZone;
zoneName control1;

Not sure but facezone might be related to cross section over I want to calc. efficiency.
I dont have any facezones or facesets.
If I will create facezones using toposet it will create patches for that but it may affect the flow field inside the domain. i dont know about the sampledsurfaces, will it be useful for my case ?
Adlak is offline   Reply With Quote

Old   January 9, 2020, 15:08
Default For MultiRegion
  #65
New Member
 
Pratyush Kumar
Join Date: Jun 2019
Location: Mumbai
Posts: 19
Rep Power: 7
PRATBHARAT is on a distinguished road
Hello Anne Gerdes,
How can I use this utility for Multi region case, running in parallel ?
PRATBHARAT is offline   Reply With Quote

Old   April 4, 2024, 11:47
Default
  #66
New Member
 
Join Date: Dec 2022
Posts: 4
Rep Power: 3
Ron71 is on a distinguished road
Hi there,
I improved a bit the provided code that was originally OF-2. It works pretty neat now for OF-10. Please, enjoy.



Use:
calcMassFlow -latestTime


(no other optional arguments accepted)



If someone can 'repair' the time loop that I plugged in, thank you in advance...
Attached Images
File Type: png Screenshot from 2024-04-04 17-40-26.png (131.2 KB, 2 views)
File Type: jpg Screenshot from 2024-04-04 17-38-15.jpg (95.3 KB, 3 views)
Attached Files
File Type: zip masscalc.zip (86.5 KB, 1 views)
Ron71 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
Calculate Mass Flow in a faceSet during calculation torvic OpenFOAM Running, Solving & CFD 1 August 11, 2008 19:05
mass flow rate calculation Ahmed CFX 7 June 20, 2008 05:55
Calculation of mass flow rate msrinath80 OpenFOAM Running, Solving & CFD 0 April 18, 2007 14:05
Calculation of added mass in viscous flow kharati Main CFD Forum 2 February 1, 2006 00:28
Mass Flow Rate Calculation Paul FLUENT 9 March 23, 2002 08:37


All times are GMT -4. The time now is 15:28.