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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2015-2020 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::wallShearStress
29 
30 Group
31  grpForcesFunctionObjects
32 
33 Description
34  Computes the wall-shear stress at selected wall patches.
35 
36  \f[
37  \vec \tau = \vec R \cdot \vec n
38  \f]
39 
40  where
41  \vartable
42  \vec \tau | Wall shear stress vector [m^2/s^2]
43  \vec R | Shear-stress symmetric tensor (retrieved from turbulence model)
44  \vec n | Patch normal vector (into the domain)
45  \endvartable
46 
47  Operands:
48  \table
49  Operand | Type | Location
50  input | - | -
51  output file | dat | $FOAM_CASE/postProcessing/<FO>/<time>/<field>
52  output field | volVectorField (only boundaryField) <!--
53  --> | $FOAM_CASE/<time>/<outField>
54  \endtable
55 
56 Usage
57  Minimal example by using \c system/controlDict.functions:
58  \verbatim
59  wallShearStress1
60  {
61  // Mandatory entries (unmodifiable)
62  type wallShearStress;
63  libs (fieldFunctionObjects);
64 
65  // Optional entries (runtime modifiable)
66  patches (<patch1> ... <patchN>); // (wall1 "(wall2|wall3)");
67 
68  // Optional (inherited) entries
69  ...
70  }
71  \endverbatim
72 
73  where the entries mean:
74  \table
75  Property | Description | Type | Req'd | Dflt
76  type | Type name: wallShearStress | word | yes | -
77  libs | Library name: fieldFunctionObjects | word | yes | -
78  patches | Names of operand patches | wordList | no | all wall patches
79  \endtable
80 
81  The inherited entries are elaborated in:
82  - \link functionObject.H \endlink
83  - \link writeFile.H \endlink
84 
85  Minimal example by using the \c postProcess utility:
86  \verbatim
87  <solver> -postProcess -func wallShearStress
88  \endverbatim
89 
90 See also
91  - Foam::functionObject
92  - Foam::functionObjects::fvMeshFunctionObject
93  - Foam::functionObjects::writeFile
94  - ExtendedCodeGuide::functionObjects::field::wallShearStress
95 
96 SourceFiles
97  wallShearStress.C
98 
99 \*---------------------------------------------------------------------------*/
100 
101 #ifndef functionObjects_wallShearStress_H
102 #define functionObjects_wallShearStress_H
103 
104 #include "fvMeshFunctionObject.H"
105 #include "writeFile.H"
106 #include "volFieldsFwd.H"
107 #include "HashSet.H"
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 namespace Foam
112 {
113 namespace functionObjects
114 {
115 
116 /*---------------------------------------------------------------------------*\
117  Class wallShearStress Declaration
118 \*---------------------------------------------------------------------------*/
119 
120 class wallShearStress
121 :
122  public fvMeshFunctionObject,
123  public writeFile
124 {
125 protected:
126 
127  // Protected Data
128 
129  //- Optional list of patches to process
131 
132 
133  // Protected Member Functions
134 
135  //- File header information
136  virtual void writeFileHeader(Ostream& os) const;
137 
138  //- Calculate the shear-stress
139  void calcShearStress
140  (
141  const volSymmTensorField& Reff,
142  volVectorField& shearStress
143  );
144 
145 
146 public:
147 
148  //- Runtime type information
149  TypeName("wallShearStress");
150 
151 
152  // Constructors
153 
154  //- Construct from Time and dictionary
156  (
157  const word& name,
158  const Time& runTime,
159  const dictionary&
160  );
161 
162  //- No copy construct
163  wallShearStress(const wallShearStress&) = delete;
164 
165  //- No copy assignment
166  void operator=(const wallShearStress&) = delete;
167 
168 
169  //- Destructor
170  virtual ~wallShearStress() = default;
171 
172 
173  // Member Functions
174 
175  //- Read the wallShearStress data
176  virtual bool read(const dictionary&);
177 
178  //- Calculate the wall shear-stress
179  virtual bool execute();
180 
181  //- Write the wall shear-stress
182  virtual bool write();
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace functionObjects
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
writeFile.H
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::functionObjects::wallShearStress::read
virtual bool read(const dictionary &)
Read the wallShearStress data.
Definition: wallShearStress.C:122
Foam::functionObjects::wallShearStress::~wallShearStress
virtual ~wallShearStress()=default
Destructor.
fvMeshFunctionObject.H
Foam::functionObjects::wallShearStress::TypeName
TypeName("wallShearStress")
Runtime type information.
Foam::HashSet< label, Hash< label > >
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::wallShearStress::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: wallShearStress.C:51
Foam::functionObjects::wallShearStress::execute
virtual bool execute()
Calculate the wall shear-stress.
Definition: wallShearStress.C:177
Foam::functionObjects::wallShearStress::operator=
void operator=(const wallShearStress &)=delete
No copy assignment.
Foam::volSymmTensorField
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Definition: volFieldsFwd.H:65
Foam::functionObjects::wallShearStress
Computes the wall-shear stress at selected wall patches.
Definition: wallShearStress.H:173
Foam::functionObjects::wallShearStress::patchSet_
labelHashSet patchSet_
Optional list of patches to process.
Definition: wallShearStress.H:183
HashSet.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::wallShearStress::write
virtual bool write()
Write the wall shear-stress.
Definition: wallShearStress.C:218
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
Foam::functionObjects::wallShearStress::wallShearStress
wallShearStress(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Definition: wallShearStress.C:85
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
Foam::GeometricField< symmTensor, fvPatchField, volMesh >
Foam::functionObjects::wallShearStress::calcShearStress
void calcShearStress(const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear-stress.
Definition: wallShearStress.C:63