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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::wallShearStress
29
30Group
31 grpForcesFunctionObjects
32
33Description
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
56Usage
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
90See also
91 - Foam::functionObject
92 - Foam::functionObjects::fvMeshFunctionObject
93 - Foam::functionObjects::writeFile
94 - ExtendedCodeGuide::functionObjects::field::wallShearStress
95
96SourceFiles
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
111namespace Foam
112{
113namespace functionObjects
114{
115
116/*---------------------------------------------------------------------------*\
117 Class wallShearStress Declaration
118\*---------------------------------------------------------------------------*/
119
120class wallShearStress
121:
122 public fvMeshFunctionObject,
123 public writeFile
124{
125protected:
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
146public:
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();
184
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188} // End namespace functionObjects
189} // End namespace Foam
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193#endif
194
195// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Computes the wall-shear stress at selected wall patches.
virtual ~wallShearStress()=default
Destructor.
void operator=(const wallShearStress &)=delete
No copy assignment.
virtual void writeFileHeader(Ostream &os) const
File header information.
labelHashSet patchSet_
Optional list of patches to process.
wallShearStress(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
virtual bool execute()
Calculate the wall shear-stress.
void calcShearStress(const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear-stress.
virtual bool write()
Write the wall shear-stress.
wallShearStress(const wallShearStress &)=delete
No copy construct.
TypeName("wallShearStress")
Runtime type information.
virtual bool read(const dictionary &)
Read the wallShearStress data.
Base class for writing single files from the function objects.
Definition: writeFile.H:120
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:83
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Definition: volFieldsFwd.H:86
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73