wallShearStress.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2025 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 Description
28  Calculates and write the shear-stress at wall patches as
29  the volVectorField field 'wallShearStress' or 'wallShearStress.<phase>'.
30 
31  \f[
32  Stress = R \dot n
33  \f]
34 
35  where
36  \vartable
37  R | stress tensor
38  n | patch normal vector (into the domain)
39  \endvartable
40 
41  The shear-stress symmetric tensor field is retrieved from the turbulence
42  model. All wall patches are included by default; to restrict the
43  calculation to certain patches, use the optional 'patches' entry.
44 
45  Example of function object specification:
46  \verbatim
47  wallShearStress1
48  {
49  type wallShearStress;
50  libs ("libfieldFunctionObjects.so");
51  ...
52  patches (".*Wall");
53  }
54  \endverbatim
55 
56 Usage
57  \table
58  Property | Description | Required | Default value
59  type | type name: wallShearStress | yes |
60  patch | patch to process | no |
61  patches | list of patches to process | no | all wall patches
62  phase | phase name | no |
63  \endtable
64 
65  Note:
66  Writing field 'wallShearStress' is done by default, but it can be
67  overridden by defining an empty \c objects list. For details see
68  writeLocalObjects.
69 
70 See also
71  Foam::functionObject
72  Foam::functionObjects::fvMeshFunctionObject
73  Foam::functionObjects::logFiles
74  Foam::functionObjects::writeLocalObjects
75  Foam::functionObjects::timeControl
76 
77 SourceFiles
78  wallShearStress.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef wallShearStress_functionObject_H
83 #define wallShearStress_functionObject_H
84 
85 #include "fvMeshFunctionObject.H"
86 #include "logFiles.H"
87 #include "writeLocalObjects.H"
88 #include "volFieldsFwd.H"
89 #include "surfaceFieldsFwd.H"
90 #include "HashSet.H"
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 namespace Foam
95 {
96 namespace functionObjects
97 {
98 
99 /*---------------------------------------------------------------------------*\
100  Class wallShearStress Declaration
101 \*---------------------------------------------------------------------------*/
102 
103 class wallShearStress
104 :
105  public fvMeshFunctionObject,
106  public logFiles,
107  public writeLocalObjects
108 {
109  // Private Data
110 
111  //- The name of the phase
112  word phaseName_;
113 
114  //- Optional list of patches to process
115  labelHashSet patchSet_;
116 
117 
118  // Private Member Functions
119 
120  //- File header information
121  virtual void writeFileHeader(const label i);
122 
123  //- Calculate the shear-stress
124  tmp<volVectorField> calcShearStress
125  (
126  const surfaceVectorField& tau
127  );
128 
129 
130 public:
131 
132  //- Runtime type information
133  TypeName("wallShearStress");
134 
135 
136  // Constructors
137 
138  //- Construct from Time and dictionary
140  (
141  const word& name,
142  const Time& runTime,
143  const dictionary&
144  );
145 
146  //- Disallow default bitwise copy construction
147  wallShearStress(const wallShearStress&) = delete;
148 
149 
150  //- Destructor
151  virtual ~wallShearStress();
152 
153 
154  // Member Functions
155 
156  //- Read the wallShearStress data
157  virtual bool read(const dictionary&);
158 
159  //- Return the list of fields required
160  virtual wordList fields() const
161  {
162  return wordList::null();
163  }
164 
165  //- Calculate the wall shear-stress
166  virtual bool execute();
167 
168  //- Write the wall shear-stress
169  virtual bool write();
170 
171 
172  // Member Operators
173 
174  //- Disallow default bitwise assignment
175  void operator=(const wallShearStress&) = delete;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace functionObjects
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Calculates and write the shear-stress at wall patches as the volVectorField field 'wallShearStress' o...
virtual wordList fields() const
Return the list of fields required.
void operator=(const wallShearStress &)=delete
Disallow default bitwise assignment.
wallShearStress(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool execute()
Calculate the wall shear-stress.
virtual bool write()
Write the wall shear-stress.
TypeName("wallShearStress")
Runtime type information.
virtual bool read(const dictionary &)
Read the wallShearStress data.
A class for handling words, derived from string.
Definition: word.H:62
const vector tau
Namespace for OpenFOAM.
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
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:213
SurfaceField< vector > surfaceVectorField