diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict index f48237e9ed..156b7cf54f 100644 --- a/applications/utilities/postProcessing/sampling/sample/sampleDict +++ b/applications/utilities/postProcessing/sampling/sample/sampleDict @@ -27,6 +27,7 @@ setFormat raw; // Surface output format. Choice of // null : suppress output +// ensight : Ensight Gold format, one field per case file // foamFile : separate points, faces and values file // dx : DX scalar or vector format // vtk : VTK ascii format diff --git a/src/postProcessing/functionObjects/field/Make/files b/src/postProcessing/functionObjects/field/Make/files index 003ef04ef8..e869e24b1c 100644 --- a/src/postProcessing/functionObjects/field/Make/files +++ b/src/postProcessing/functionObjects/field/Make/files @@ -20,4 +20,7 @@ streamLine/streamLineParticle.C streamLine/streamLineParticleCloud.C streamLine/streamLineFunctionObject.C +surfaceInterpolateFields/surfaceInterpolateFields.C +surfaceInterpolateFields/surfaceInterpolateFieldsFunctionObject.C + LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index 1f6cc537e1..e3755efbb8 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -198,11 +198,10 @@ void Foam::fieldValues::cellSource::write() if (active_) { + scalar totalVolume = gSum(filterField(mesh().V())); if (Pstream::master()) { - outputFilePtr_() - << obr_.time().value() << tab - << sum(filterField(mesh().V())); + outputFilePtr_() << obr_.time().value() << tab << totalVolume; } forAll(fields_, i) diff --git a/src/postProcessing/functionObjects/field/fieldValues/controlDict b/src/postProcessing/functionObjects/field/fieldValues/controlDict index 7605d4afc1..c7619975f7 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/controlDict +++ b/src/postProcessing/functionObjects/field/fieldValues/controlDict @@ -61,11 +61,25 @@ functions // Output field values as well valueOutput true; - // Patch or faceZone to sample + // Type of source: patch/faceZone/sampledSurface source patch; + + // if patch or faceZone: name of patch or faceZone sourceName movingWall; -// source faceZone; -// sourceName f0; + + //// if sampledSurface: dictionary with a sampledSurface + //// Note: the sampledSurfaces will have cell-values, i.e. + //// non-interpolated. Also will not sample surface fields. + //sampledSurfaceDict + //{ + // type cuttingPlane; + // planeType pointAndNormal; + // pointAndNormalDict + // { + // basePoint (0 0.099 0); + // normalVector (0 1 0); + // } + //} // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; @@ -73,7 +87,7 @@ functions fields ( p - phi + phi // surface fields not supported for sampledSurface U ); } diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index f30d80f716..472f725dc4 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -28,21 +28,20 @@ License #include "cyclicPolyPatch.H" #include "emptyPolyPatch.H" #include "coupledPolyPatch.H" -#include "surfaceFields.H" -#include "volFields.H" +#include "sampledSurface.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(Foam::fieldValues::faceSource, 0); template<> -const char* Foam::NamedEnum:: +const char* Foam::NamedEnum:: names[] = { - "faceZone", "patch" + "faceZone", "patch", "sampledSurface" }; -const Foam::NamedEnum +const Foam::NamedEnum Foam::fieldValues::faceSource::sourceTypeNames_; @@ -188,6 +187,19 @@ void Foam::fieldValues::faceSource::setPatchFaces() } +void Foam::fieldValues::faceSource::sampledSurfaceFaces(const dictionary& dict) +{ + surfacePtr_ = sampledSurface::New + ( + name_, + mesh(), + dict.subDict("sampledSurfaceDict") + ); + surfacePtr_().update(); + nFaces_ = returnReduce(surfacePtr_().faces().size(), sumOp