caseDicts/postProcessing: Added triSurfaceAverage packaged function object

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)
This commit is contained in:
Will Bainbridge
2022-08-17 15:37:28 +01:00
parent d6c62a9e7a
commit c5d70f03c4
2 changed files with 25 additions and 0 deletions

View File

@ -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"
// ************************************************************************* //

View File

@ -398,6 +398,8 @@ surfaceFieldValueFunctions
#includeFunc faceZoneFlowRate(name=f0) #includeFunc faceZoneFlowRate(name=f0)
#includeFunc triSurfaceAverage(name=mid.obj, p)
#includeFunc triSurfaceVolumetricFlowRate(name=mid.obj) #includeFunc triSurfaceVolumetricFlowRate(name=mid.obj)
#includeFunc triSurfaceDifference #includeFunc triSurfaceDifference