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-------------------------------------------------------------------------------
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::profileModel
29
30Description
31 Base class for profile models for handling
32 aerofoil lift and drag polar diagrams.
33
34Usage
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
76See also
77 - Foam::fv::rotorDiskSource
78 - Foam::lookupProfile
79 - Foam::seriesProfile
80
81SourceFiles
82 profileModel.C
83 profileModelList.C
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef profileModel_H
88#define profileModel_H
89
90#include "autoPtr.H"
92#include "dictionary.H"
93
94// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95
96namespace Foam
97{
98
99/*---------------------------------------------------------------------------*\
100 Class profileModel Declaration
101\*---------------------------------------------------------------------------*/
102
103class profileModel
104{
105protected:
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
121 //- Return true if file name is set
122 bool readFromFile() const;
123
124
125public:
126
127 //- Runtime type information
128 TypeName("profileModel");
129
131 // Declare run-time constructor selection table
132
134 (
135 autoPtr,
138 (
139 const dictionary& dict,
140 const word& modelName
141 ),
142 (dict, modelName)
143 );
144
146 // Selectors
147
148 //- Return a reference to the selected fvOption model
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// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Base class for profile models for handling aerofoil lift and drag polar diagrams.
Definition: profileModel.H:121
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const =0
Return the Cd and Cl for a given angle-of-attack.
bool readFromFile() const
Return true if file name is set.
Definition: profileModel.C:43
const dictionary dict_
Coefficients dictionary.
Definition: profileModel.H:127
fileName fName_
File name (optional)
Definition: profileModel.H:133
virtual ~profileModel()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, profileModel, dictionary,(const dictionary &dict, const word &modelName),(dict, modelName))
const word & name() const
Return const access to the source name.
Definition: profileModel.C:61
static autoPtr< profileModel > New(const dictionary &dict)
Return a reference to the selected fvOption model.
Definition: profileModel.C:68
TypeName("profileModel")
Runtime type information.
const word name_
Name of profile model.
Definition: profileModel.H:130
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
volScalarField & alpha
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73