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