Loading...
Searching...
No Matches
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-2023 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 | postProcessing/<FO>/<time>/field
52 output field | volVectorField (only boundaryField) | <time>/outputField
53 \endtable
54
55Usage
56 Minimal example by using \c system/controlDict.functions:
57 \verbatim
58 wallShearStressFO
59 {
60 // Mandatory entries
61 type wallShearStress;
62 libs (fieldFunctionObjects);
63
64 // Optional entries
65 patches (<patch1> ... <patchN>); // (wall1 "(wall2|wall3)");
66 writeFields <bool>;
67
68 // Inherited entries
69 ...
70 }
71 \endverbatim
72
73 where the entries mean:
74 \table
75 Property | Description | Type | Reqd | Deflt
76 type | Type name: wallShearStress | word | yes | -
77 libs | Library name: fieldFunctionObjects | word | yes | -
78 patches | Names of operand patches | wordRes | no | all wall patches
79 writeFields | Flag to write shear stress field | bool | no | true
80 \endtable
81
82 The inherited entries are elaborated in:
83 - \link functionObject.H \endlink
84 - \link writeFile.H \endlink
85
86Note
87 The \c writeFields flag currently defaults to \c true
88 (for consistency with previous versions that did not have that flag)
89 but this is subject to change in the near future for consistency
90 with other function objects.
91
92SourceFiles
93 wallShearStress.C
94
95\*---------------------------------------------------------------------------*/
96
97#ifndef Foam_functionObjects_wallShearStress_H
98#define Foam_functionObjects_wallShearStress_H
99
100#include "fvMeshFunctionObject.H"
101#include "writeFile.H"
102#include "volFieldsFwd.H"
103
104// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
106namespace Foam
107{
108namespace functionObjects
109{
110
111/*---------------------------------------------------------------------------*\
112 Class wallShearStress Declaration
113\*---------------------------------------------------------------------------*/
114
115class wallShearStress
116:
118 public writeFile
119{
120 // Private Data
121
122 //- Write the shear stress field ?
123 bool writeFields_;
124
125
126protected:
127
128 // Protected Data
129
130 //- Wall patches to process (optionally filtered by name)
132
133
134 // Protected Member Functions
135
136 //- File header information
137 virtual void writeFileHeader(Ostream& os) const;
138
139 //- Calculate the shear-stress
140 void calcShearStress
141 (
142 const volSymmTensorField& Reff,
143 volVectorField& shearStress
144 );
145
146
147public:
148
149 //- Runtime type information
150 TypeName("wallShearStress");
151
152
153 // Constructors
154
155 //- Construct from name, Time and dictionary
157 (
158 const word& name,
159 const Time& runTime,
160 const dictionary&
161 );
162
163 //- No copy construct
164 wallShearStress(const wallShearStress&) = delete;
165
166 //- No copy assignment
167 void operator=(const wallShearStress&) = delete;
169
170 //- Destructor
171 virtual ~wallShearStress() = default;
172
173
174 // Member Functions
175
176 //- Read the function-object dictionary
177 virtual bool read(const dictionary& dict);
178
179 //- Execute the function-object operations
180 virtual bool execute();
181
182 //- Write the function-object results
183 virtual bool write();
184};
185
186
187// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189} // End namespace functionObjects
190} // End namespace Foam
191
192// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193
194#endif
195
196// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
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...
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Computes the wall-shear stress at selected wall patches.
virtual ~wallShearStress()=default
Destructor.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
void operator=(const wallShearStress &)=delete
No copy assignment.
virtual void writeFileHeader(Ostream &os) const
File header information.
wallShearStress(const word &name, const Time &runTime, const dictionary &)
Construct from name, Time and dictionary.
virtual bool execute()
Execute the function-object operations.
void calcShearStress(const volSymmTensorField &Reff, volVectorField &shearStress)
Calculate the shear-stress.
virtual bool write()
Write the function-object results.
wallShearStress(const wallShearStress &)=delete
No copy construct.
TypeName("wallShearStress")
Runtime type information.
labelList patchIDs_
Wall patches to process (optionally filtered by name).
Base class for writing single files from the function objects.
Definition writeFile.H:113
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
Definition writeFile.C:200
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68
Forwards and collection of common volume field types.