derivedFields.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  Copyright : (C) 2011 Symscape
3  Website : www.symscape.com
4 -------------------------------------------------------------------------------
5 License
6  This file is part of OpenFOAM.
7 
8  OpenFOAM is free software: you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
14  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16  for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
20 
21 Class
22  Foam::derivedFields
23 
24 Description
25  Provide derived fields such as wallShearStress and yPlus
26 
27  Optionally provides statistics: min, max & average
28 
29  Member function derivedFields::write() writes
30  derivedFields into the directory <timeDir>, e.g.
31 
32  @verbatim
33  functions
34  (
35  derivedFields1
36  {
37  // Type of functionObject
38  type derivedFields;
39 
40  // Where to load it from (if not already in solver)
41  functionObjectLibs ("derivedFields");
42 
43  // Flow region
44  // Optional default = defaultRegion
45  // region someWhere;
46 
47  // Dedicated dictionary
48  // Optional defualt = ""
49  dictionary "";
50 
51  // Write interval
52  outputControl timeStep;
53  outputInterval 1;
54 
55  // functionObject will be called.
56  // Optional default = on
57  enabled on;
58 
59  // Write fields on first start up (e.g., time zero)
60  // Optional default = off
61  writeOnStart on;
62 
63  wallShearStress
64  {
65  // min, max & average to Info (optional default = off)
66  statistics on;
67 
68  // Incompressible density reference (optional default = 1.)
69  rhoInf 1.;
70  }
71 
72  yPlus
73  {
74  statistics on;
75  }
76  }
77  );
78  @endverbatim
79 
80 SourceFiles
81  derivedFields.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef derivedFields_H
86 #define derivedFields_H
87 
88 #include "pointFieldFwd.H"
89 
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 
96  // Forward declaration of classes
97  template<class T> class PtrList;
98  class objectRegistry;
99  class dictionary;
100  class derivedFieldWriter;
101  class mapPolyMesh;
102  class polyMesh;
103 
104  /*---------------------------------------------------------------------------*\
105  Class derivedFields Declaration
106  \*---------------------------------------------------------------------------*/
107 
108  class derivedFields
109  {
110  // Private data
111 
112  //- Active writers, if any.
114 
115  //- Name of this set of derivedFields,
116  word name_;
117 
118  const objectRegistry& obr_;
119 
120  // Private Member Functions
121 
122  //- Add writer to active list.
124 
125  //- Disallow default bitwise copy construct
127 
128  //- Disallow default bitwise assignment
129  void operator=(const derivedFields&);
130 
131  public:
132 
133  //- Runtime type information
134  TypeName("derivedFields");
135 
136  // Constructors
137 
138  //- Construct for given objectRegistry and dictionary.
139  // Allow the possibility to load fields from files
141  (
142  const word& name,
143  const objectRegistry&,
144  const dictionary&,
145  const bool loadFromFiles = false
146  );
147 
148  // Destructor
149  virtual ~derivedFields();
150 
151  // Member Functions
152 
153  //- Return name of the set of derivedFields
154  const word& name() const
155  {
156  return name_;
157  }
158 
159  //- Read the derivedFields data
160  void read(const dictionary& dict);
161 
162  //- Calculate the derivedFields and write
163  void write();
164 
165  //- Satisfy OutputFilterFunctionObject
166  void execute()
167  {}
168 
169  //- Satisfy OutputFilterFunctionObject
170  void end()
171  {}
172 
173  //- Called when time was set at the end of the Time::operator++
174  bool timeSet()
175  { return true; }
176 
177  //- Update for changes of mesh
178  void updateMesh(const mapPolyMesh&)
179  {}
180 
181  //- Update for changes of mesh
182  void movePoints(const polyMesh&)
183  {}
184  };
185 
186 
187  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
Foam::derivedFields::TypeName
TypeName("derivedFields")
Runtime type information.
Foam::derivedFields
Provide derived fields such as wallShearStress and yPlus.
Definition: derivedFields.H:107
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::derivedFields::operator=
void operator=(const derivedFields &)
Disallow default bitwise assignment.
Foam::derivedFields::execute
void execute()
Satisfy OutputFilterFunctionObject.
Definition: derivedFields.H:165
Foam::derivedFields::writers_
PtrList< derivedFieldWriter > *const writers_
Active writers, if any.
Definition: derivedFields.H:112
Foam::derivedFields::name
const word & name() const
Return name of the set of derivedFields.
Definition: derivedFields.H:153
Foam::derivedFields::derivedFields
derivedFields(const derivedFields &)
Disallow default bitwise copy construct.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::derivedFields::end
void end()
Satisfy OutputFilterFunctionObject.
Definition: derivedFields.H:169
Foam::derivedFields::updateMesh
void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: derivedFields.H:177
Foam::derivedFields::timeSet
bool timeSet()
Called when time was set at the end of the Time::operator++.
Definition: derivedFields.H:173
Foam::derivedFieldWriter
Basis for writers used in derivedFields e.g., wallShearStressWriter.
Definition: derivedFieldWriter.H:49
pointFieldFwd.H
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::derivedFields::movePoints
void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: derivedFields.H:181
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::writer
Base class for graphics format writing. Entry points are.
Definition: writer.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::derivedFields::addWriter
void addWriter(derivedFieldWriter *writer)
Add writer to active list.
Definition: derivedFields.C:46
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::derivedFields::name_
word name_
Name of this set of derivedFields,.
Definition: derivedFields.H:115
Foam::derivedFields::read
void read(const dictionary &dict)
Read the derivedFields data.
Definition: derivedFields.C:79
Foam::derivedFields::write
void write()
Calculate the derivedFields and write.
Definition: derivedFields.C:110
Foam::derivedFields::obr_
const objectRegistry & obr_
Definition: derivedFields.H:117
Foam::derivedFields::~derivedFields
virtual ~derivedFields()
Definition: derivedFields.C:71