wallShearStress.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 | Copyright (C) 2013-2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::wallShearStress
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This function object evaluates and outputs the shear stress at wall
32  patches. The result is written as a volVectorField to time directories as
33  field 'wallShearStress'
34 
35  \f[
36  Stress = R \dot n
37  \f]
38 
39  where
40  \vartable
41  R | stress tensor
42  n | patch normal vector (into the domain)
43  \endvartable
44 
45  The shear stress (symmetrical) tensor field is retrieved from the
46  turbulence model. All wall patches are included by default; to restrict
47  the calculation to certain patches, use the optional 'patches' entry.
48 
49  Example of function object specification:
50  \verbatim
51  wallShearStress1
52  {
53  type wallShearStress;
54  functionObjectLibs ("libutilityFunctionObjects.so");
55  ...
56  patches (".*Wall");
57  }
58  \endverbatim
59 
60  \heading Function object usage
61  \table
62  Property | Description | Required | Default value
63  type | type name: wallShearStress | yes |
64  resultName | Name of wall shear stress field | no | <function name>
65  patches | list of patches to process | no | all wall patches
66  log | Log to standard output | no | yes
67  \endtable
68 
69 SourceFiles
70  wallShearStress.C
71  IOwallShearStress.H
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef wallShearStress_H
76 #define wallShearStress_H
77 
78 #include "functionObjectFile.H"
79 #include "volFieldsFwd.H"
80 #include "Switch.H"
81 #include "OFstream.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 // Forward declaration of classes
89 class objectRegistry;
90 class dictionary;
91 class polyMesh;
92 class mapPolyMesh;
93 class fvMesh;
94 
95 /*---------------------------------------------------------------------------*\
96  Class wallShearStress Declaration
97 \*---------------------------------------------------------------------------*/
98 
99 class wallShearStress
100 :
101  public functionObjectFile
102 {
103 protected:
104 
105  // Protected data
106 
107  //- Name of this set of wallShearStress object
108  word name_;
109 
110  //- Refefence to the database
111  const objectRegistry& obr_;
112 
113  //- on/off switch
114  bool active_;
115 
116  //- Result name
117  word resultName_;
118 
119  //- Switch to send output to Info as well as to file
120  Switch log_;
121 
122  //- Optional list of patches to process
124 
125 
126  // Protected Member Functions
127 
128  //- File header information
129  virtual void writeFileHeader(Ostream& os) const;
130 
131  //- Calculate the shear stress
132  void calcShearStress
133  (
134  const fvMesh& mesh,
135  const volSymmTensorField& Reff,
136  volVectorField& shearStress
137  );
138 
139  //- Disallow default bitwise copy construct
141 
142  //- Disallow default bitwise assignment
144 
145 
146 public:
147 
148  //- Runtime type information
149  TypeName("wallShearStress");
150 
151 
152  // Constructors
153 
154  //- Construct for given objectRegistry and dictionary.
155  // Allow the possibility to load fields from files
157  (
158  const word& name,
159  const objectRegistry&,
160  const dictionary&,
161  const bool loadFromFiles = false
162  );
163 
164 
165  //- Destructor
166  virtual ~wallShearStress();
167 
168 
169  // Member Functions
170 
171  //- Return name of the set of wallShearStress
172  virtual const word& name() const
173  {
174  return name_;
175  }
176 
177  //- Read the wallShearStress data
178  virtual void read(const dictionary&);
179 
180  //- Execute, currently does nothing
181  virtual void execute();
182 
183  //- Execute at the final time-loop, currently does nothing
184  virtual void end();
185 
186  //- Called when time was set at the end of the Time::operator++
187  virtual void timeSet();
188 
189  //- Calculate the wallShearStress and write
190  virtual void write();
191 
192  //- Update for changes of mesh
193  virtual void updateMesh(const mapPolyMesh&)
194  {}
195 
196  //- Update for changes of mesh
197  virtual void movePoints(const polyMesh&)
198  {}
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
volFieldsFwd.H
Foam::wallShearStress::name
virtual const word & name() const
Return name of the set of wallShearStress.
Definition: wallShearStress.H:204
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::wallShearStress::resultName_
word resultName_
Result name.
Definition: wallShearStress.H:149
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::wallShearStress::active_
bool active_
on/off switch
Definition: wallShearStress.H:146
Foam::wallShearStress::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: wallShearStress.H:225
Foam::wallShearStress::write
virtual void write()
Calculate the wallShearStress and write.
Definition: wallShearStress.C:279
Foam::wallShearStress::~wallShearStress
virtual ~wallShearStress()
Destructor.
Definition: wallShearStress.C:154
Foam::wallShearStress::TypeName
TypeName("wallShearStress")
Runtime type information.
Foam::wallShearStress::obr_
const objectRegistry & obr_
Refefence to the database.
Definition: wallShearStress.H:143
Foam::HashSet< label, Hash< label > >
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
OFstream.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::wallShearStress::calcShearStress
void calcShearStress(const fvMesh &mesh, const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear stress.
Definition: wallShearStress.C:56
Foam::wallShearStress::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: wallShearStress.C:43
Foam::wallShearStress::wallShearStress
wallShearStress(const wallShearStress &)
Disallow default bitwise copy construct.
Switch.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::wallShearStress::patchSet_
labelHashSet patchSet_
Optional list of patches to process.
Definition: wallShearStress.H:155
Foam::wallShearStress::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: wallShearStress.H:229
functionObjectFile.H
Foam::functionObjectFile
Base class for output file data handling.
Definition: functionObjectFile.H:57
Foam::wallShearStress::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: wallShearStress.C:267
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::wallShearStress::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: wallShearStress.C:273
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::wallShearStress::read
virtual void read(const dictionary &)
Read the wallShearStress data.
Definition: wallShearStress.C:160
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:210
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::wallShearStress::execute
virtual void execute()
Execute, currently does nothing.
Definition: wallShearStress.C:220
Foam::wallShearStress::operator=
void operator=(const wallShearStress &)
Disallow default bitwise assignment.
Foam::wallShearStress::name_
word name_
Name of this set of wallShearStress object.
Definition: wallShearStress.H:140
Foam::wallShearStress::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: wallShearStress.H:152
Foam::wallShearStress
This function object evaluates and outputs the shear stress at wall patches. The result is written as...
Definition: wallShearStress.H:131