Skip to content

Commit

Permalink
caseDicts/postProcessing: Added triSurfaceAverage packaged function o…
Browse files Browse the repository at this point in the history
…bject

This is a packaged function object that conveniently computes averages
of fields on tri-surfaces. It can be executed on the command line as
follows:

    foamPostProcess -func "triSurfaceAverage(name=mid.obj, p)"

This will compute the average of the field "p" on a surface file in
"constant/geometry/mid.obj".

The calculation could also be done at run-time by adding the following
entry to the functions section of the system/controlDict

    #includeFunc triSurfaceAverage(name=mid.obj, p)
  • Loading branch information
Will Bainbridge committed Aug 17, 2022
1 parent d6c62a9 commit c5d70f0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions etc/caseDicts/postProcessing/surfaceFieldValue/triSurfaceAverage
@@ -0,0 +1,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
-------------------------------------------------------------------------------
Description
Calculates the average on a specified triangulated surface by interpolating
onto the triangles and integrating over the surface area. Triangles need to
be small (<= cell size) for an accurate result.
\*---------------------------------------------------------------------------*/

name <triSurfaceFileName>;

fields (<fieldNames>);

operation areaAverage;

#includeEtc "caseDicts/postProcessing/surfaceFieldValue/triSurfaceValue.cfg"

// ************************************************************************* //
2 changes: 2 additions & 0 deletions test/postProcessing/channel/system/controlDict
Expand Up @@ -398,6 +398,8 @@ surfaceFieldValueFunctions

#includeFunc faceZoneFlowRate(name=f0)

#includeFunc triSurfaceAverage(name=mid.obj, p)

#includeFunc triSurfaceVolumetricFlowRate(name=mid.obj)

#includeFunc triSurfaceDifference
Expand Down

0 comments on commit c5d70f0

Please sign in to comment.