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-2016 OpenFOAM Foundation
6  \\/ M anipulation |
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::functionObjects::wallShearStress
26 
27 Group
28  grpForcesFunctionObjects
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  libs ("libfieldFunctionObjects.so");
55  ...
56  patches (".*Wall");
57  }
58  \endverbatim
59 
60 Usage
61  \table
62  Property | Description | Required | Default value
63  type | type name: wallShearStress | yes |
64  patches | list of patches to process | no | all wall patches
65  \endtable
66 
67 See also
68  Foam::functionObject
69  Foam::functionObjects::writeFiles
70  Foam::functionObjects::pressureTools
71  Foam::functionObjects::timeControl
72 
73 SourceFiles
74  wallShearStress.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef functionObjects_wallShearStress_H
79 #define functionObjects_wallShearStress_H
80 
81 #include "writeFiles.H"
82 #include "volFieldsFwd.H"
83 #include "HashSet.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 
90 // Forward declaration of classes
91 class fvMesh;
92 
93 namespace functionObjects
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class wallShearStress Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class wallShearStress
101 :
102  public writeFiles
103 {
104 protected:
105 
106  // Protected data
107 
108  //- Optional list of patches to process
110 
111 
112  // Protected Member Functions
113 
114  //- File header information
115  virtual void writeFileHeader(const label i);
116 
117  //- Calculate the shear stress
118  void calcShearStress
119  (
120  const fvMesh& mesh,
121  const volSymmTensorField& Reff,
122  volVectorField& shearStress
123  );
124 
125 
126 private:
127 
128  // Private member functions
129 
130  //- Disallow default bitwise copy construct
132 
133  //- Disallow default bitwise assignment
134  void operator=(const wallShearStress&);
135 
136 
137 public:
138 
139  //- Runtime type information
140  TypeName("wallShearStress");
141 
142 
143  // Constructors
144 
145  //- Construct from Time and dictionary
147  (
148  const word& name,
149  const Time& runTime,
150  const dictionary&
151  );
152 
153 
154  //- Destructor
155  virtual ~wallShearStress();
156 
157 
158  // Member Functions
159 
160  //- Read the wallShearStress data
161  virtual bool read(const dictionary&);
162 
163  //- Calculate the wall shear-stress
164  virtual bool execute();
165 
166  //- Write the wall shear-stress
167  virtual bool write();
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace functionObjects
174 } // End namespace Foam
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Definition: volFieldsFwd.H:58
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:59
virtual bool read(const dictionary &)
Read the wallShearStress data.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
void calcShearStress(const fvMesh &mesh, const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear stress.
labelHashSet patchSet_
Optional list of patches to process.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual bool execute()
Calculate the wall shear-stress.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:210
virtual void writeFileHeader(const label i)
File header information.
dynamicFvMesh & mesh
const word & name() const
Return the name of this functionObject.
A class for handling words, derived from string.
Definition: word.H:59
This function object evaluates and outputs the shear stress at wall patches. The result is written as...
virtual bool write()
Write the wall shear-stress.
TypeName("wallShearStress")
Runtime type information.
Namespace for OpenFOAM.