forceCoeffs.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) 2011-2019 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::forceCoeffs
26 
27 Description
28  Extends the forces functionObject by providing lift, drag and moment
29  coefficients. The data can optionally be output into bins, defined in a
30  given direction.
31 
32  Example of function object specification:
33  \verbatim
34  forceCoeffs1
35  {
36  type forceCoeffs;
37  libs ("libforces.so");
38  ...
39  log yes;
40  patches (walls);
41  liftDir (0 1 0);
42  dragDir (-1 0 0);
43  pitchAxis (0 0 1);
44  magUInf 100;
45  lRef 3.5;
46  Aref 2.2;
47 
48  binData
49  {
50  nBin 20;
51  direction (1 0 0);
52  cumulative yes;
53  }
54  }
55  \endverbatim
56 
57 Usage
58  \table
59  Property | Description | Required | Default value
60  type | type name: forceCoeffs | yes |
61  log | write force data to standard output | no | no
62  patches | patches included in the forces calculation | yes |
63  liftDir | lift direction | yes |
64  dragDir | drag direction | yes |
65  pitchAxis | pitch axis | yes |
66  magUInf | free stream velocity magnitude | yes |
67  lRef | reference length scale for moment calculations | yes |
68  Aref | reference area | yes |
69  \endtable
70 
71  Bin data is optional, but if the dictionary is present, the entries must
72  be defined according o
73  \table
74  nBin | number of data bins | yes |
75  direction | direction along which bins are defined | yes |
76  cumulative | bin data accumulated with increasing distance | yes |
77  \endtable
78 
79 See also
80  Foam::functionObject
81  Foam::functionObjects::timeControl
82  Foam::functionObjects::forces
83 
84 SourceFiles
85  forceCoeffs.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef functionObjects_forceCoeffs_H
90 #define functionObjects_forceCoeffs_H
91 
92 #include "forces.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 namespace functionObjects
99 {
100 
101 /*---------------------------------------------------------------------------*\
102  Class forceCoeffs Declaration
103 \*---------------------------------------------------------------------------*/
104 
105 class forceCoeffs
106 :
107  public forces
108 {
109  // Private Data
110 
111  // Force coefficient geometry
112 
113  //- Lift
114  vector liftDir_;
115 
116  //- Drag
117  vector dragDir_;
118 
119  //- Pitch
120  vector pitchAxis_;
121 
122 
123  // Free-stream conditions
124 
125  //- Velocity magnitude
126  scalar magUInf_;
127 
128 
129  // Reference scales
130 
131  //- Length
132  scalar lRef_;
133 
134  //- Area
135  scalar Aref_;
136 
137 
138 protected:
139 
140  //- Output file header information
141  virtual void writeFileHeader(const label i);
142 
143 
144 public:
145 
146  //- Runtime type information
147  TypeName("forceCoeffs");
148 
149 
150  // Constructors
151 
152  //- Construct from Time and dictionary
154  (
155  const word& name,
156  const Time& runTime,
157  const dictionary&
158  );
159 
160  //- Disallow default bitwise copy construction
161  forceCoeffs(const forceCoeffs&) = delete;
162 
163 
164  //- Destructor
165  virtual ~forceCoeffs();
166 
167 
168  // Member Functions
170  //- Read the forces data
171  virtual bool read(const dictionary&);
172 
173  //- Execute, currently does nothing
174  virtual bool execute();
175 
176  //- Write the forces
177  virtual bool write();
178 
179 
180  // Member Operators
181 
182  //- Disallow default bitwise assignment
183  void operator=(const forceCoeffs&) = delete;
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace functionObjects
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
TypeName("forceCoeffs")
Runtime type information.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual bool write()
Write the forces.
Definition: forceCoeffs.C:190
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
virtual bool read(const dictionary &)
Read the forces data.
Definition: forceCoeffs.C:154
forceCoeffs(const word &name, const Time &runTime, const dictionary &)
Construct from Time and dictionary.
Definition: forceCoeffs.C:128
void operator=(const forceCoeffs &)=delete
Disallow default bitwise assignment.
virtual void writeFileHeader(const label i)
Output file header information.
Definition: forceCoeffs.C:43
Extends the forces functionObject by providing lift, drag and moment coefficients. The data can optionally be output into bins, defined in a given direction.
Definition: forceCoeffs.H:169
virtual ~forceCoeffs()
Destructor.
Definition: forceCoeffs.C:148
virtual bool execute()
Execute, currently does nothing.
Definition: forceCoeffs.C:184
Namespace for OpenFOAM.