surfaceFieldValue.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2015-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::fieldValues::surfaceFieldValue
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Provides a 'face regionType' variant of the fieldValues function object.
35 
36  Given a list of user-specified fields and a selection of mesh (or general
37  surface) faces, a number of operations can be performed, such as sums,
38  averages and integrations.
39 
40  For example, to calculate the volumetric or mass flux across a patch,
41  apply the 'sum' operator to the flux field (typically \c phi)
42 
43 Usage
44  Examples of function object specification:
45  \verbatim
46  movingWallPatch
47  {
48  type surfaceFieldValue;
49  libs ("libfieldFunctionObjects.so");
50 
51  log true;
52  writeControl writeTime;
53  writeFields false;
54 
55  regionType patch;
56  name movingWall;
57 
58  operation areaAverage;
59  fields (p phi U);
60  }
61 
62  surfaceFieldValue1
63  {
64  type surfaceFieldValue;
65  libs ("libfieldFunctionObjects.so");
66 
67  log true;
68  writeControl writeTime;
69  writeFields true;
70 
71  surfaceFormat none;
72  regionType faceZone;
73  name f0;
74 
75  operation sum;
76  weightField alpha1;
77  fields (p phi U);
78  }
79  \endverbatim
80 
81  Where the entries comprise:
82  \table
83  Property | Description | Required | Default
84  type | Type name: surfaceFieldValue | yes |
85  log | Write data to standard output | no | no
86  regionType | Face regionType: see below | yes |
87  name | Name for regionType | yes |
88  operation | Operation to perform | yes |
89  postOperation | Post-operation to perform | no | none
90  fields | List of fields to operate on | yes |
91  weightField | Name of field to apply weighting | no |
92  scaleFactor | Output value scaling factor | no | 1
93  writeArea | Write the surface area | no |
94  writeFields | Write the region field values | yes |
95  surfaceFormat | Output value format | no | none
96  \endtable
97 
98  Where \c regionType is defined by
99  \plaintable
100  faceZone | The \b name entry to specify the faceZone
101  patch | The \b name entry to specify the patch
102  functionObjectSurface | The \b name entry to specify a polySurface
103  sampledSurface | A \b sampledSurfaceDict sub-dictionary and \b name
104  \endplaintable
105 
106  The \c operation is one of:
107  \plaintable
108  none | no operation
109  min | minimum
110  max | maximum
111  sum | sum
112  sumMag | sum of component magnitudes
113  sumDirection | sum values that are positive in given direction
114  sumDirectionBalance | sum of balance of values in given direction
115  average | ensemble average
116  areaAverage | area-weighted average
117  areaIntegrate | area integral
118  CoV | coefficient of variation: standard deviation/mean
119  areaNormalAverage | area-weighted average in face normal direction
120  areaNormalIntegrate | area-weighted integral in face normal directon
121  uniformity | uniformity index
122  weightedSum | weighted sum
123  weightedAverage | weighted average
124  weightedAreaAverage | weighted area average
125  weightedAreaIntegrate | weighted area integral
126  weightedUniformity | weighted uniformity index
127  absWeightedSum | sum using absolute weighting
128  absWeightedAverage | average using absolute weighting
129  absWeightedAreaAverage | area average using absolute weighting
130  absWeightedAreaIntegrate | area integral using absolute weighting
131  absWeightedUniformity | uniformity index using absolute weighting
132  \endplaintable
133 
134 Note
135  - The values reported by the areaNormalAverage and areaNormalIntegrate
136  operations are written as the first component of a field with the same
137  rank as the input field.
138  - Faces on empty patches get ignored
139  - If the field is a volField the \c faceZone can only consist of boundary
140  faces
141  - Using \c functionObjectSurface:
142  - The keyword %subRegion should not be used to select surfaces.
143  Instead specify the regionType 'functionObjectSurface' and provide
144  the name.
145  - Using \c sampledSurface:
146  - not available for surface fields
147  - if interpolate=true they use \c interpolationCellPoint
148  otherwise they use cell values
149  - each triangle in \c sampledSurface is logically only in one cell
150  so interpolation will be wrong when triangles are larger than
151  cells. This can only happen for sampling on a \c triSurfaceMesh
152  - take care when using isoSurfaces - these might have duplicate
153  triangles and so integration might be wrong
154 
155  Uniformity
156  \f[
157  UI(\phi) = 1 - \frac{1}{2 \overline{\phi} A}
158  \int{\left| W \phi \cdot \hat{n} - \bar{W} \bar{\phi}\right| d\vec{A}}
159  \,,\;
160  \bar{\phi} = \frac{\int{W \phi \cdot d\vec{A}}}{\int{W \cdot d\vec{A}}}
161  \f]
162 
163  A velocity uniformity index is calculated with no weighting (W=1) and
164  \f$ \phi = \vec{U} \f$.
165 
166  A scalar concentration uniformity index is calculated with either
167  \f$ \rho \vec{U} \f$ or \f$ \vec{U} \f$ for weighting and
168  \f$ \phi = conc \f$.
169 
170 See also
171  Foam::fieldValues
172  Foam::functionObject
173 
174 SourceFiles
175  surfaceFieldValue.C
176  surfaceFieldValueTemplates.C
177 
178 \*---------------------------------------------------------------------------*/
179 
180 #ifndef functionObjects_surfaceFieldValue_H
181 #define functionObjects_surfaceFieldValue_H
182 
183 #include "fieldValue.H"
184 #include "Enum.H"
185 #include "surfaceMesh.H"
186 #include "polySurface.H"
187 #include "fvsPatchField.H"
188 #include "volFieldsFwd.H"
189 #include "polySurfaceFieldsFwd.H"
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 namespace Foam
194 {
195 
196 // Forward declarations
197 class sampledSurface;
198 class surfaceWriter;
199 
200 namespace functionObjects
201 {
202 namespace fieldValues
203 {
204 
205 /*---------------------------------------------------------------------------*\
206  Class surfaceFieldValue Declaration
207 \*---------------------------------------------------------------------------*/
208 
209 class surfaceFieldValue
210 :
211  public fieldValue
212 {
213 public:
214 
215  // Public Data Types
216 
217  //- Region type enumeration
218  enum regionTypes
219  {
220  stFaceZone = 0x01,
221  stPatch = 0x02,
222  stObject = 0x11,
223  stSampled = 0x12
224  };
225 
226  //- Region type names
227  static const Enum<regionTypes> regionTypeNames_;
228 
229  //- Bitmask values for operation variants
230  enum operationVariant
231  {
232  typeBase = 0,
233  typeScalar = 0x100,
234  typeWeighted = 0x200,
235  typeAbsolute = 0x400,
236  };
237 
238  //- Operation type enumeration
239  enum operationType
240  {
241  // Normal operations
242 
243  opNone = 0,
244  opMin,
245  opMax,
246  opSum,
247  opSumMag,
249 
252 
253  opAverage,
254  opAreaAverage,
256  opCoV,
257 
258  // Scalar return values
259 
262 
265 
267  opUniformity,
268 
269  // Weighted variants
270 
273 
276 
279 
282 
285 
286  // Variants using absolute weighting
287 
290 
293 
296 
300 
304  };
305 
306  //- Operation type names
307  static const Enum<operationType> operationTypeNames_;
308 
309 
310  //- Post-operation type enumeration
311  enum postOperationType
312  {
313  postOpNone,
314  postOpSqrt
315  };
316 
317  //- Operation type names
318  static const Enum<postOperationType> postOperationTypeNames_;
319 
320 
321 private:
322 
323  // Private Member Functions
324 
325  //- Set faces to evaluate based on a face zone
326  void setFaceZoneFaces();
327 
328  //- Set faces to evaluate based on a patch
329  void setPatchFaces();
330 
331  //- Combine mesh faces and points from multiple processors
332  void combineMeshGeometry
333  (
334  faceList& faces,
336  ) const;
337 
338  //- Combine surface faces and points from multiple processors
339  void combineSurfaceGeometry
340  (
341  faceList& faces,
343  ) const;
344 
345  //- Calculate and return total area of the surfaceFieldValue: sum(magSf)
346  scalar totalArea() const;
347 
348 
349 protected:
350 
351  // Protected Data
352 
353  //- Region type
355 
356  //- Operation to apply to values
358 
359  //- Optional post-evaluation operation
361 
362  //- Weight field name - optional
363  word weightFieldName_;
364 
365  //- Track if the surface needs an update
366  bool needsUpdate_;
367 
368  //- Optionally write the area of the surfaceFieldValue
369  bool writeArea_;
370 
371  //- Total area of the surfaceFieldValue
372  scalar totalArea_;
373 
374  //- Global number of faces
375  label nFaces_;
376 
377 
378  // If operating on mesh faces (faceZone, patch)
379 
380  //- Local list of face IDs
382 
383  //- Local list of patch ID per face
385 
386  //- List representing the face flip map
387  // (false: use as-is, true: negate)
389 
390  //- The sampledSurface (when operating on sampledSurface)
392 
393  //- Surface writer
395 
396 
397  // Protected Member Functions
398 
399  //- The volume mesh or surface registry being used
400  const objectRegistry& obr() const;
401 
402  //- Can the surface definition sample surface-fields?
403  inline bool withSurfaceFields() const;
404 
405  //- Can use mesh topological merge?
406  inline bool withTopologicalMerge() const;
407 
408  //- Return the local list of face IDs
409  inline const labelList& faceId() const;
410 
411  //- Return the local list of patch ID per face
412  inline const labelList& facePatch() const;
413 
414  //- Return the local true/false list representing the face flip map
415  inline const boolList& faceFlip() const;
416 
417  //- True if the operation needs a surface Sf
418  bool usesSf() const;
419 
420  //- True if the operation variant uses mag
421  inline bool usesMag() const;
422 
423  //- True if the operation variant uses a weight-field
424  inline bool usesWeight() const;
425 
426  //- True if operation variant uses a weight-field that is available.
427  // Checks for availability on any processor.
428  template<class WeightType>
429  inline bool canWeight(const Field<WeightType>& weightField) const;
430 
431  //- Update the surface and surface information as required.
432  // Do nothing (and return false) if no update was required
433  bool update();
434 
435  //- Return true if the field name is known and a valid type
436  template<class Type>
437  bool validField(const word& fieldName) const;
438 
439  //- Return field values by looking up field name
440  template<class Type>
442  (
443  const word& fieldName,
444  const bool mandatory = false
445  ) const;
446 
447  //- Apply the 'operation' to the values. Operation must preserve Type.
448  template<class Type, class WeightType>
450  (
452  const vectorField& Sf,
453  const Field<WeightType>& weightField
454  ) const;
455 
456  //- Apply the 'operation' to the values. Wrapper around
457  // processSameTypeValues. See also template specialisation below.
458  template<class Type, class WeightType>
459  Type processValues
460  (
461  const Field<Type>& values,
462  const vectorField& Sf,
463  const Field<WeightType>& weightField
464  ) const;
465 
466 
467  //- Filter a surface field according to faceIds
468  template<class Type>
470  (
472  ) const;
473 
474  //- Filter a volume field according to faceIds
475  template<class Type>
477  (
479  ) const;
480 
481 
482  //- Weighting factor.
483  // Possibly applies mag() depending on the operation type.
484  template<class WeightType>
486  (
487  const Field<WeightType>& weightField
488  ) const;
489 
490  //- Weighting factor, weight field with the area.
491  // Possibly applies mag() depending on the operation type.
492  // Reverts to mag(Sf) if the weight field is not available.
493  template<class WeightType>
495  (
496  const Field<WeightType>& weightField,
497  const vectorField& Sf
498  ) const;
499 
500 
501  //- Templated helper function to output field values
502  template<class WeightType>
504  (
505  const vectorField& Sf,
506  const Field<WeightType>& weightField,
507  const pointField& points,
508  const faceList& faces
509  );
510 
511  //- Templated helper function to output field values
512  template<class Type, class WeightType>
513  bool writeValues
514  (
515  const word& fieldName,
516  const vectorField& Sf,
517  const Field<WeightType>& weightField,
518  const pointField& points,
519  const faceList& faces
520  );
521 
522 
523  //- Output file header information
524  virtual void writeFileHeader(Ostream& os) const;
525 
526 
527 public:
528 
529  //- Run-time type information
530  TypeName("surfaceFieldValue");
531 
532 
533  // Constructors
534 
535  //- Construct from name, Time and dictionary
537  (
538  const word& name,
539  const Time& runTime,
540  const dictionary& dict
541  );
542 
543  //- Construct from name, objectRegistry and dictionary
545  (
546  const word& name,
547  const objectRegistry& obr,
549  );
550 
551 
552  //- Destructor
553  virtual ~surfaceFieldValue() = default;
554 
555 
556  // Public Member Functions
557 
558  //- Return the region type
559  inline regionTypes regionType() const;
560 
561  //- Return the output directory
562  inline fileName outputDir() const;
563 
564  //- Read from dictionary
565  virtual bool read(const dictionary& dict);
566 
567  //- Calculate and write
568  virtual bool write();
569 
570  //- Update for changes of mesh
571  virtual void updateMesh(const mapPolyMesh& mpm);
572 
573  //- Update for changes of mesh
574  virtual void movePoints(const polyMesh& mesh);
575 };
576 
577 
578 //- Specialisation for scalar fields
579 template<>
581 (
582  const Field<scalar>& values,
583  const vectorField& Sf,
584  const scalarField& weightField
585 ) const;
586 
587 
588 //- Specialisation for vector fields
589 template<>
591 (
592  const Field<vector>& values,
593  const vectorField& Sf,
594  const scalarField& weightField
595 ) const;
596 
597 
598 //- Specialisation for scalar - pass through
599 template<>
601 (
602  const Field<scalar>& weightField
603 ) const;
604 
605 
606 //- Specialisation for scalar - scalar * Area
607 template<>
609 (
610  const Field<scalar>& weightField,
611  const vectorField& Sf
612 ) const;
613 
614 
615 //- Specialisation for vector - vector (dot) Area
616 template<>
618 (
619  const Field<vector>& weightField,
620  const vectorField& Sf
621 ) const;
622 
623 
624 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
625 
626 } // End namespace fieldValues
627 } // End namespace functionObjects
628 } // End namespace Foam
629 
630 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
631 
632 #include "surfaceFieldValueI.H"
633 
634 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
635 
636 #ifdef NoRepository
638 #endif
639 
640 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
641 
642 #endif
643 
644 // ************************************************************************* //
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAreaIntegrate
Area integral using abs weighting.
Definition: surfaceFieldValue.H:474
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedUniformity
Weighted uniformity index.
Definition: surfaceFieldValue.H:460
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:74
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::functionObjects::fieldValues::surfaceFieldValue::operation_
operationType operation_
Operation to apply to values.
Definition: surfaceFieldValue.H:533
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
Foam::functionObjects::fieldValues::surfaceFieldValue::opMin
Minimum value.
Definition: surfaceFieldValue.H:420
Foam::Enum< regionTypes >
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumDirectionBalance
Sum of balance of values in given direction.
Definition: surfaceFieldValue.H:427
fvsPatchField.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
polySurface.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::functionObjects::fieldValues::surfaceFieldValue::operationType
operationType
Operation type enumeration.
Definition: surfaceFieldValue.H:415
Foam::functionObjects::fieldValues::surfaceFieldValue::read
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: surfaceFieldValue.C:866
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationType
postOperationType
Post-operation type enumeration.
Definition: surfaceFieldValue.H:487
Foam::functionObjects::fieldValues::surfaceFieldValue::typeScalar
Operation returns a scalar.
Definition: surfaceFieldValue.H:409
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaIntegrate
Area integral.
Definition: surfaceFieldValue.H:431
Foam::functionObjects::fieldValues::surfaceFieldValue::typeWeighted
Operation using weighting.
Definition: surfaceFieldValue.H:410
Foam::functionObjects::fieldValues::surfaceFieldValue::processSameTypeValues
Type processSameTypeValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Operation must preserve Type.
Definition: surfaceFieldValueTemplates.C:132
Foam::functionObjects::fieldValue::dict
const dictionary & dict() const
Return the reference to the construction dictionary.
Definition: fieldValueI.H:30
Foam::functionObjects::fieldValues::surfaceFieldValue::usesSf
bool usesSf() const
True if the operation needs a surface Sf.
Definition: surfaceFieldValue.C:460
Foam::functionObjects::fieldValues::surfaceFieldValue::faceFlip
const boolList & faceFlip() const
Return the local true/false list representing the face flip map.
Definition: surfaceFieldValueI.H:68
Foam::functionObjects::fieldValues::surfaceFieldValue::canWeight
bool canWeight(const Field< WeightType > &weightField) const
True if operation variant uses a weight-field that is available.
Definition: surfaceFieldValueTemplates.C:42
Foam::functionObjects::fieldValues::surfaceFieldValue::withTopologicalMerge
bool withTopologicalMerge() const
Can use mesh topological merge?
Definition: surfaceFieldValueI.H:47
Foam::functionObjects::fieldValues::surfaceFieldValue::postOpNone
No additional operation after calculation.
Definition: surfaceFieldValue.H:489
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperation_
postOperationType postOperation_
Optional post-evaluation operation.
Definition: surfaceFieldValue.H:536
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAreaAverage
Area average using abs weighting.
Definition: surfaceFieldValue.H:471
Foam::functionObjects::fieldValues::surfaceFieldValue::opUniformity
Uniformity index (output is always scalar)
Definition: surfaceFieldValue.H:443
Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
tmp< Field< Type > > filterField(const GeometricField< Type, fvsPatchField, surfaceMesh > &field) const
Filter a surface field according to faceIds.
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedUniformity
Uniformity index using abs weighting.
Definition: surfaceFieldValue.H:478
Foam::functionObjects::fieldValues::surfaceFieldValue::stSampled
Sample onto surface and calculate.
Definition: surfaceFieldValue.H:399
Foam::functionObjects::fieldValues::surfaceFieldValue::stFaceZone
Calculate on a faceZone.
Definition: surfaceFieldValue.H:396
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypeNames_
static const Enum< regionTypes > regionTypeNames_
Region type names.
Definition: surfaceFieldValue.H:403
Foam::functionObjects::fieldValues::surfaceFieldValue::writeAll
label writeAll(const vectorField &Sf, const Field< WeightType > &weightField, const pointField &points, const faceList &faces)
Templated helper function to output field values.
Foam::functionObjects::fieldValues::surfaceFieldValue::regionType_
regionTypes regionType_
Region type.
Definition: surfaceFieldValue.H:530
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
surfaceFieldValue(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition: surfaceFieldValue.C:798
Foam::functionObjects::fieldValues::surfaceFieldValue::stObject
Calculate with function object surface.
Definition: surfaceFieldValue.H:398
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::functionObjects::fieldValues::surfaceFieldValue::weightingFactor
tmp< scalarField > weightingFactor(const Field< WeightType > &weightField) const
Weighting factor.
Foam::functionObjects::fieldValues::surfaceFieldValue::withSurfaceFields
bool withSurfaceFields() const
Can the surface definition sample surface-fields?
Definition: surfaceFieldValueI.H:35
Foam::functionObjects::fieldValues::surfaceFieldValue::update
bool update()
Update the surface and surface information as required.
Definition: surfaceFieldValue.C:482
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::functionObjects::fieldValues::surfaceFieldValue::opMax
Maximum value.
Definition: surfaceFieldValue.H:421
Foam::functionObjects::fieldValues::surfaceFieldValue::typeAbsolute
Operation using mag (eg, for weighting)
Definition: surfaceFieldValue.H:411
Foam::Field< vector >
Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceWriterPtr_
autoPtr< surfaceWriter > surfaceWriterPtr_
Surface writer.
Definition: surfaceFieldValue.H:570
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAreaIntegrate
Weighted area integral.
Definition: surfaceFieldValue.H:457
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumDirection
Sum in a given direction.
Definition: surfaceFieldValue.H:424
Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues
tmp< Field< Type > > getFieldValues(const word &fieldName, const bool mandatory=false) const
Return field values by looking up field name.
Foam::functionObjects::fieldValues::surfaceFieldValue::updateMesh
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Definition: surfaceFieldValue.C:1096
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaNormalIntegrate
Area integral in normal direction (output is always scalar)
Definition: surfaceFieldValue.H:440
Foam::functionObjects::fieldValues::surfaceFieldValue::regionTypes
regionTypes
Region type enumeration.
Definition: surfaceFieldValue.H:394
Foam::functionObjects::fieldValues::surfaceFieldValue::opSum
Sum of values.
Definition: surfaceFieldValue.H:422
field
rDeltaTY field()
Foam::functionObjects::fieldValues::surfaceFieldValue::regionType
regionTypes regionType() const
Return the region type.
Definition: surfaceFieldValueI.H:93
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedSum
Weighted sum.
Definition: surfaceFieldValue.H:448
Foam::functionObjects::fieldValues::surfaceFieldValue::totalArea_
scalar totalArea_
Total area of the surfaceFieldValue.
Definition: surfaceFieldValue.H:548
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedAverage
Average using abs weighting.
Definition: surfaceFieldValue.H:468
Foam::functionObjects::fieldValues::surfaceFieldValue::TypeName
TypeName("surfaceFieldValue")
Run-time type information.
Foam::functionObjects::fieldValues::surfaceFieldValue::usesWeight
bool usesWeight() const
True if the operation variant uses a weight-field.
Definition: surfaceFieldValueI.H:85
polySurfaceFieldsFwd.H
Foam::functionObjects::fieldValues::surfaceFieldValue::nFaces_
label nFaces_
Global number of faces.
Definition: surfaceFieldValue.H:551
Foam::functionObjects::fieldValues::surfaceFieldValue::opCoV
Coefficient of variation.
Definition: surfaceFieldValue.H:432
Foam::functionObjects::fieldValues::surfaceFieldValue::faceId_
labelList faceId_
Local list of face IDs.
Definition: surfaceFieldValue.H:557
Foam::functionObjects::fieldValues::surfaceFieldValue::opSumMag
Sum of component magnitudes.
Definition: surfaceFieldValue.H:423
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
surfaceMesh.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAverage
Weighted average.
Definition: surfaceFieldValue.H:451
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::fieldValues::surfaceFieldValue::obr
const objectRegistry & obr() const
The volume mesh or surface registry being used.
Definition: surfaceFieldValue.C:119
Foam::functionObjects::fieldValues::surfaceFieldValue::facePatchId_
labelList facePatchId_
Local list of patch ID per face.
Definition: surfaceFieldValue.H:560
Foam::functionObjects::fieldValues::surfaceFieldValue::movePoints
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Definition: surfaceFieldValue.C:1105
Foam::functionObjects::fieldValues::surfaceFieldValue::~surfaceFieldValue
virtual ~surfaceFieldValue()=default
Destructor.
Foam::functionObjects::fieldValues::surfaceFieldValue::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
Output file header information.
Definition: surfaceFieldValue.C:543
Foam::functionObjects::fieldValues::surfaceFieldValue::validField
bool validField(const word &fieldName) const
Return true if the field name is known and a valid type.
Definition: surfaceFieldValueTemplates.C:56
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::functionObjects::fieldValues::surfaceFieldValue::writeArea_
bool writeArea_
Optionally write the area of the surfaceFieldValue.
Definition: surfaceFieldValue.H:545
Foam::functionObjects::fieldValues::surfaceFieldValue::opAverage
Ensemble average.
Definition: surfaceFieldValue.H:429
Foam::functionObjects::fieldValues::surfaceFieldValue::operationTypeNames_
static const Enum< operationType > operationTypeNames_
Operation type names.
Definition: surfaceFieldValue.H:483
Foam::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
fieldValue.H
Foam::faceList
List< face > faceList
A List of faces.
Definition: faceListFwd.H:47
Foam::functionObjects::fieldValues::surfaceFieldValue::weightFieldName_
word weightFieldName_
Weight field name - optional.
Definition: surfaceFieldValue.H:539
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
surfaceFieldValueI.H
Foam::functionObjects::fieldValues::surfaceFieldValue::opAbsWeightedSum
Sum using abs weighting.
Definition: surfaceFieldValue.H:465
Foam::functionObjects::fieldValues::surfaceFieldValue::needsUpdate_
bool needsUpdate_
Track if the surface needs an update.
Definition: surfaceFieldValue.H:542
Foam::List< face >
Foam::functionObjects::fieldValue
Base class for field value-based function objects.
Definition: fieldValue.H:65
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::functionObjects::fieldValues::surfaceFieldValue::opWeightedAreaAverage
Weighted area average.
Definition: surfaceFieldValue.H:454
Foam::functionObjects::fieldValues::surfaceFieldValue::postOpSqrt
Perform sqrt after normal operation.
Definition: surfaceFieldValue.H:490
Foam::functionObjects::fieldValues::surfaceFieldValue
Provides a 'face regionType' variant of the fieldValues function object.
Definition: surfaceFieldValue.H:385
Foam::functionObjects::fieldValues::surfaceFieldValue::sampledPtr_
autoPtr< sampledSurface > sampledPtr_
The sampledSurface (when operating on sampledSurface)
Definition: surfaceFieldValue.H:567
Foam::functionObjects::fieldValues::surfaceFieldValue::facePatch
const labelList & facePatch() const
Return the local list of patch ID per face.
Definition: surfaceFieldValueI.H:61
Foam::functionObjects::fieldValues::surfaceFieldValue::typeBase
Base operation.
Definition: surfaceFieldValue.H:408
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaNormalAverage
Area average in normal direction (output is always scalar)
Definition: surfaceFieldValue.H:437
Foam::functionObjects::fieldValues::surfaceFieldValue::stPatch
Calculate on a patch.
Definition: surfaceFieldValue.H:397
Foam::functionObjects::fieldValues::surfaceFieldValue::usesMag
bool usesMag() const
True if the operation variant uses mag.
Definition: surfaceFieldValueI.H:77
Foam::functionObjects::fieldValues::surfaceFieldValue::outputDir
fileName outputDir() const
Return the output directory.
Definition: surfaceFieldValueI.H:100
Foam::functionObjects::fieldValues::surfaceFieldValue::operationVariant
operationVariant
Bitmask values for operation variants.
Definition: surfaceFieldValue.H:406
Foam::functionObjects::fieldValues::surfaceFieldValue::write
virtual bool write()
Calculate and write.
Definition: surfaceFieldValue.C:984
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
bool writeValues(const word &fieldName, const vectorField &Sf, const Field< WeightType > &weightField, const pointField &points, const faceList &faces)
Templated helper function to output field values.
Definition: surfaceFieldValueTemplates.C:358
Foam::functionObjects::fieldValues::surfaceFieldValue::faceFlip_
boolList faceFlip_
List representing the face flip map.
Definition: surfaceFieldValue.H:564
Foam::functionObjects::fieldValues::surfaceFieldValue::processValues
Type processValues(const Field< Type > &values, const vectorField &Sf, const Field< WeightType > &weightField) const
Apply the 'operation' to the values. Wrapper around.
Definition: surfaceFieldValueTemplates.C:293
Foam::functionObjects::fieldValues::surfaceFieldValue::opNone
No operation.
Definition: surfaceFieldValue.H:419
Foam::functionObjects::fieldValues::surfaceFieldValue::opAreaAverage
Area average.
Definition: surfaceFieldValue.H:430
Foam::functionObjects::fieldValues::surfaceFieldValue::postOperationTypeNames_
static const Enum< postOperationType > postOperationTypeNames_
Operation type names.
Definition: surfaceFieldValue.H:494
Foam::functionObjects::fieldValues::surfaceFieldValue::faceId
const labelList & faceId() const
Return the local list of face IDs.
Definition: surfaceFieldValueI.H:54
surfaceFieldValueTemplates.C
Enum.H