1

Previous: Evaluating pressure coefficient at Up: Test case: Backward-Facing-Step Next: Monitoring the convergence

This is an automatically generated documentation by LaTeX2HTML utility. In case of any issue, please, contact us at info@cfdsupport.com.

Evaluating mass flow at the domain boundaries

  • The aim of this section is calculation of flow through a specified patch.
  • We use postProcess utility and functionObject flowRatePatch for summing the flux on patch faces.
  • For solvers where the flux is volumetric (i.e. for incompressible solvers)), the flow rate is volumetric; where flux is mass flux (i.e. for compressible solvers), the flow rate is mass flow rate.

  • Print help for this utility:
    # postProcess -help
    Usage: postProcess [OPTIONS]
    options:
      -case
    specify alternate case directory, default is the cwd -constant include the ‘constant/’ dir in the times list -dict read control dictionary from specified location -field Specify the name of the field to be processed, e.g. U -fields Specify a list of fields to be processed, e.g. ‘(U T p)’ – regular expressions not currently supported -func Specify the name of the functionObject to execute, e.g. Q -funcs Specify the names of the functionObjects to execute, e.g. ‘(Q div(U))’ -latestTime select the latest time -list List the available configured functionObjects -newTimes select the new times -noFunctionObjects do not execute functionObjects -noZero exclude the ‘0/’ dir from the times list -parallel run in parallel -region specify alternative mesh region -roots <(dir1 .. dirN)> slave root directories for distributed running -time comma-separated time ranges – eg, ‘:10,20,40:70,1000:’ -srcDoc display source code in browser -doc display application documentation in browser -help print the usage
  • The available functionObjects by utility postProcess can be listed by typing # postProcess -list
  • In case of steady-state solution we evaluate last time layer only
  • Use switch -latestTime

  • patchName are inlet and outlet
  • Run utility for inlet:
    # postProcess -func 'flowRatePatch(name=inlet)' -latestTime
  • Screen output:
    /*---------------------------------------------------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  dev                                   |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    Build  : dev-e2ccbbbb
    Exec   : postProcess -func flowRatePatch(name=inlet) -latestTime
    Date   : Jun 16 2017
    Time   : 12:01:00
    Host   : $HOSTNAME
    PID    : $
    Case   : $FOAM_RUN/pitzDaily
    nProcs : 1
    sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
    fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
    allowSystemOperations : Allowing user-supplied system call operations
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    Create time
    
    Create mesh for time = 287
    
    surfaceFieldValue flowRatePatch(name=inlet):
        total faces  = 30
        total area   = 2.54e-05
    
    
    Time = 287
    
    Reading fields:
        surfaceScalarFields: phi
    
    Executing functionObjects
    surfaceFieldValue flowRatePatch(name=inlet) write:
        sum(inlet) of phi = -0.000254
    
    
    End
    
  • Same for outlet:
    # postProcess -func 'flowRatePatch(name=outlet)' -latestTime
  • Screen output:
    /*---------------------------------------------------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  dev                                   |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    Build  : dev-e2ccbbbb
    Exec   : postProcess -func flowRatePatch(name=outlet) -latestTime
    Date   : Jun 16 2017
    Time   : 12:01:00
    Host   : $HOSTNAME
    PID    : $
    Case   : $FOAM_RUN/pitzDaily
    nProcs : 1
    sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
    fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
    allowSystemOperations : Allowing user-supplied system call operations
    
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    Create time
    
    Create mesh for time = 287
    
    surfaceFieldValue flowRatePatch(name=outlet):
        total faces  = 57
        total area   = 3.32e-05
    
    
    Time = 287
    
    Reading fields:
        surfaceScalarFields: phi
    
    Executing functionObjects
    surfaceFieldValue flowRatePatch(name=outlet) write:
        sum(outlet) of phi = 0.00025399
    
    
    End
    
  • Resulting flux at the inlet $ \phi_{inlet} = -0.0002539999$
  • Resulting flux at the outlet $ \phi_{outlet} = 0.0002539904$
  • $ \vert\phi_{inlet} + \phi_{outlet}\vert \leq 1\cdot 10^{-8} $