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

Monitoring flow rate on patch in OpenFOAM v2012

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By Tobermory
  • 1 Post By olher3

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 28, 2021, 06:29
Default Monitoring flow rate on patch in OpenFOAM v2012
  #1
New Member
 
Oliver Herz
Join Date: Jun 2021
Posts: 3
Rep Power: 4
olher3 is on a distinguished road
Hello,

after a 6 year break, I currently have an OpenFOAM project again. For this I use the latest version v2012.
Unfortunately, the keywords have changed over time. I have a model with 4 outlets (out1, out2, out3, out4) I would like to monitor the volume flow [m³/s] or mass flow [kg/s] on these during the simulation.


Solver: simpleFoam


Can someone give me an example of the function in the controlDict?
My old spelling no longer works.



Best wishes

O.Herz
olher3 is offline   Reply With Quote

Old   June 28, 2021, 11:27
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
The fieldFunction that you are after is surfaceFieldValue, I think (https://www.openfoam.com/documentati...ieldValue.html). Here's an example of its use for a case where I wanted the massflow-weighted average values of two scalars on a patch called outlet:

Code:
functions
{
    surfaceFieldValue1
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");
        enabled         yes;
        writeControl    writeTime;
        log             yes;
        writeFields     no;
        regionType      patch;
        name            outlet;
        operation       weightedAverage;
        weightField     phi;
        fields
        (
            H2O
            T
        );
    }
}
For your application, change out weightedAverage for sum, change the field to phi, and adjust the patch name. You get the idea, hopefully. Good luck.
hogsonik and Zane like this.
Tobermory is offline   Reply With Quote

Old   June 29, 2021, 03:29
Default
  #3
New Member
 
Oliver Herz
Join Date: Jun 2021
Posts: 3
Rep Power: 4
olher3 is on a distinguished road
Hello,


thanky you very much.
It works!


Best Regards


O.Herz
Tobermory likes this.
olher3 is offline   Reply With Quote

Old   September 7, 2023, 13:04
Default How do I write this to a file?
  #4
New Member
 
Avi
Join Date: Jul 2023
Posts: 2
Rep Power: 0
popopo is on a distinguished road
How do I write this to a file, say flowrate.txt?


Thanks!
popopo 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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 14:24
Pressure Outlet Targeted Mass Flow Rate LuckyTran FLUENT 1 November 23, 2016 10:40
[GAMBIT] periodic faces not matching Aadhavan ANSYS Meshing & Geometry 6 August 31, 2013 11:25
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


All times are GMT -4. The time now is 03:36.