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

Calculate Mass Flowrate at a faceZone with OpenFOAM4

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By donQi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2016, 04:25
Default Calculate Mass Flowrate at a faceZone with OpenFOAM4
  #1
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 13
donQi is on a distinguished road
Hello,

in OpenFOAM2.4 to compute that mass flowrate at an arbitrary faceZone inside the fluid domain I used the METHOD reported below. Unfortunately if I use it in OpenFOAM4 I get error:

Code:
[11] Unknown function type faceSource

Valid functions are : 

6
(
patchProbes
probes
psiReactionThermoMoleFractions
rhoReactionThermoMoleFractions
sets
surfaces
)
I would like to know what syntax do you use in newer OF versions. Thanks

METHOD used in OF2.4
1) use topoSet to extract the faceZone where you want to compute the massflow. The topoSetDict will as follows:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * ** * * * * * * * * * * * * * //

actions
(
    {
        // Name of set to operate on
        name    extractedFaces;  // to create the faceZone required by the effectiveness module in fvOptions
        type    faceSet;
        // One of clear/new/invert/add/delete|subset/list
        action  new;
        source  boxToFace;
        sourceInfo
        {  
            // thin box to extract the faceZone where you want to investigate the massflow
            box (0.148 -0.265 -0.265) (0.151 0.265 0.265);  
        }
    }
   
   
    // creation of the faceZone (from the above faceSet)
    {
        name    massFlowSurface;
        type    faceZoneSet;
        action  new;
        source  setAndNormalToFaceZone;
        sourceInfo
        {
            faceSet extractedFaces;
            normal (1    0    0);
        }
    }
 );
2) add in controlDict
Code:
functions
{
    #include        "ProbeData"
  
// massFlow computation 
    massFlow
    {
        type            faceSource;

        enabled         true;
        outputControl   timeStep;
        outputInterval  1;

        // Output to log&file (true) or to file only
        log             true;

        // Output field values as well
        valueOutput     false;

        // Type of source: patch/faceZone/sampledSurface
        source          faceZone;

        // if patch or faceZone: name of patch or faceZone
        sourceName      massFlowSurface;

        // Operation: areaAverage/sum/weightedAverage ...
        operation       sum;

        surfaceFormat   vtk;

        fields
        (
            phi
        );
    }  
  
}
3) launch the solver
donQi is offline   Reply With Quote

Old   August 31, 2016, 21:13
Default
  #2
Member
 
Al
Join Date: Jul 2013
Location: Japan
Posts: 47
Blog Entries: 3
Rep Power: 13
donQi is on a distinguished road
I have found the solution to my error here
http://www.openfoam.com/documentatio...2.html#details

I was forgetting the line
Code:
functionObjectLibs ("libfieldFunctionObjects.so");
inside the massFlow block. By setting:

Code:
functions
{
    //#include        "ProbeData"
  
// massFlow computation 
    massFlow
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl   timeStep;
        outputInterval  1;

        // Output to log&file (true) or to file only
        log             true;

        // Output field values as well
        valueOutput     false;

        // Type of source: patch/faceZone/sampledSurface
        source          faceZone;

        // if patch or faceZone: name of patch or faceZone
        sourceName      massFlowSurface;

        // Operation: areaAverage/sum/weightedAverage ...
        operation       sum;

        surfaceFormat   vtk;

        fields
        (
            phi
        );
    }  
  
}
I get correctly the massflow at the faceZone:

Code:
faceSource massFlow output:
    sum(massFlowSurface) of phi = 0.6364095
granzer likes this.
donQi 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
Orientation of faceZone, mass flow sign convention Awak OpenFOAM Pre-Processing 2 August 1, 2016 21:28
calculate mass flow rate from velocity contour hosein72 FLUENT 0 June 10, 2016 10:37
To calculate area averaged species mass fraction from PDF Bharadwaj B S Fluent UDF and Scheme Programming 3 March 8, 2016 02:22
How to calculate particle mass flow rate in domain with respect to injection flowrate Jeeloong Fluent Multiphase 0 January 27, 2016 19:40
How does FLUENT calculate turbulent mass diffusivity (m2/s) for the granular phase zhouwu FLUENT 0 August 6, 2011 04:51


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