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)
24 lines
937 B
C++
24 lines
937 B
C++
/*--------------------------------*- 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"
|
|
|
|
// ************************************************************************* //
|