profileModel.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) 2011-2013 OpenFOAM Foundation
9  Copyright (C) 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::profileModel
29 
30 Description
31  Base class for profile models for handling
32  aerofoil lift and drag polar diagrams.
33 
34 Usage
35  Minimal example by using \c constant/fvOptions:
36  rotorDiskSource1
37  {
38  // Mandatory/Optional (inherited) entries
39  ...
40 
41  // Mandatory entries (runtime modifiable)
42  profiles
43  {
44  // Mandatory entries (runtime modifiable)
45  <profile1>
46  {
47  type <profileModel>;
48 
49  // Mandatory/Optional (inherited) entries
50  ...
51  }
52  ...
53  <profileN>
54  {
55  ...
56  }
57 
58  // Optional entries (runtime modifiable)
59  file <fileName>;
60  }
61  }
62 
63  where the entries mean:
64  \table
65  Property | Description | Type | Reqd | Dflt
66  type | Profile model - see below | word | yes | -
67  file | Name of file containing profile characteristics | word | no | -
68  \endtable
69 
70  Options for the \c type entry:
71  \verbatim
72  lookup | Polar data is linearly interpolated based on angle of attack
73  series | Polar data is computed as sum of cosine series
74  \endverbatim
75 
76 See also
77  - Foam::fv::rotorDiskSource
78  - Foam::lookupProfile
79  - Foam::seriesProfile
80 
81 SourceFiles
82  profileModel.C
83  profileModelList.C
84 
85 \*---------------------------------------------------------------------------*/
86 
87 #ifndef profileModel_H
88 #define profileModel_H
89 
90 #include "autoPtr.H"
91 #include "runTimeSelectionTables.H"
92 #include "dictionary.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 
99 /*---------------------------------------------------------------------------*\
100  Class profileModel Declaration
101 \*---------------------------------------------------------------------------*/
102 
103 class profileModel
104 {
105 protected:
106 
107  // Protected Data
108 
109  //- Coefficients dictionary
110  const dictionary dict_;
111 
112  //- Name of profile model
113  const word name_;
114 
115  //- File name (optional)
116  fileName fName_;
117 
118 
119  // Protected Member Functions
120 
121  //- Return true if file name is set
122  bool readFromFile() const;
123 
124 
125 public:
126 
127  //- Runtime type information
128  TypeName("profileModel");
129 
130 
131  // Declare run-time constructor selection table
132 
134  (
135  autoPtr,
136  profileModel,
137  dictionary,
138  (
139  const dictionary& dict,
140  const word& modelName
141  ),
142  (dict, modelName)
143  );
144 
145 
146  // Selectors
147 
148  //- Return a reference to the selected fvOption model
149  static autoPtr<profileModel> New(const dictionary& dict);
150 
151 
152  //- Constructor
153  profileModel(const dictionary& dict, const word& modelName);
154 
155 
156  //- Destructor
157  virtual ~profileModel() = default;
158 
159 
160  // Member Functions
161 
162  // Access
163 
164  //- Return const access to the source name
165  const word& name() const;
166 
167 
168  // Evaluation
169 
170  //- Return the Cd and Cl for a given angle-of-attack
171  virtual void Cdl
172  (
173  const scalar alpha,
174  scalar& Cd,
175  scalar& Cl
176  ) const = 0;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Foam::profileModel::readFromFile
bool readFromFile() const
Return true if file name is set.
Definition: profileModel.C:43
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::profileModel::name
const word & name() const
Return const access to the source name.
Definition: profileModel.C:61
Foam::profileModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, profileModel, dictionary,(const dictionary &dict, const word &modelName),(dict, modelName))
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::profileModel::~profileModel
virtual ~profileModel()=default
Destructor.
Foam::profileModel::Cdl
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const =0
Return the Cd and Cl for a given angle-of-attack.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::profileModel::TypeName
TypeName("profileModel")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::profileModel::profileModel
profileModel(const dictionary &dict, const word &modelName)
Constructor.
Definition: profileModel.C:51
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::profileModel::New
static autoPtr< profileModel > New(const dictionary &dict)
Return a reference to the selected fvOption model.
Definition: profileModel.C:68
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::profileModel::fName_
fileName fName_
File name (optional)
Definition: profileModel.H:133
Foam::profileModel::dict_
const dictionary dict_
Coefficients dictionary.
Definition: profileModel.H:127
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::profileModel::name_
const word name_
Name of profile model.
Definition: profileModel.H:130
Foam::profileModel
Base class for profile models for handling aerofoil lift and drag polar diagrams.
Definition: profileModel.H:120
autoPtr.H