lookupProfile.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::lookupProfile
29
30Description
31 Profile model where polar lift and drag coefficients are linearly
32 interpolated from a polar table by using an input angle of attack.
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 // Mandatory entries (runtime modifiable)
48 type lookup;
49 data
50 (
51 (AOA1 Cd1 Cl2)
52 (AOA2 Cd2 Cl2)
53 ([0] [1] [2])
54 ...
55 (AOAN CdN CdN)
56 );
57 }
58
59 // Mandatory/Optional (inherited) entries
60 ...
61 }
62 }
63
64 where the entries mean:
65 \table
66 Property | Description | Type | Reqd | Dflt
67 [0] AOA | Angle of attack | scalar | yes | -
68 [1] Cd | Drag coefficient corresponding to the angle attack <!--
69 --> | scalar | yes | -
70 [2] Cl | Lift coefficient corresponding to the angle attack <!--
71 --> | scalar | yes | -
72 \endtable
73
74Note
75 - Angle of attack is internally converted from [deg] to [rad].
76
77See also
78 - Foam::fv::rotorDiskSource
79 - Foam::profileModel
80 - Foam::seriesProfile
81
82SourceFiles
83 lookupProfile.C
84
85\*---------------------------------------------------------------------------*/
86
87#ifndef lookupProfile_H
88#define lookupProfile_H
89
90#include "profileModel.H"
91#include "List.H"
92
93// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94
95namespace Foam
96{
97
98/*---------------------------------------------------------------------------*\
99 Class lookupProfile Declaration
100\*---------------------------------------------------------------------------*/
101
102class lookupProfile
103:
104 public profileModel
105{
106protected:
107
108 // Protected Data
109
110 //- List of angle-of-attack values [deg] on input, converted to [rad]
111 List<scalar> AOA_;
112
113 //- List of drag coefficient values
114 List<scalar> Cd_;
115
116 //- List of lift coefficient values
117 List<scalar> Cl_;
118
119
120 // Protected Member Functions
121
122 //- Return the interpolation indices and gradient
124 (
125 const scalar& xIn,
126 const List<scalar>& values,
127 label& i1,
128 label& i2,
129 scalar& ddx
130 ) const;
131
132
133public:
134
135 //- Runtime type information
136 TypeName("lookup");
137
139 // Constructors
140
141 //- Constructor from dictionary and model name
142 lookupProfile(const dictionary& dict, const word& modelName);
143
144 //- No copy construct
145 lookupProfile(const lookupProfile&) = delete;
146
147 //- No copy assignment
148 void operator=(const lookupProfile&) = delete;
149
150
151 //- Destructor
152 ~lookupProfile() = default;
153
154
155 // Member Functions
156
157 //- Return the Cd and Cl for a given angle-of-attack
158 virtual void Cdl(const scalar alpha, scalar& Cd, scalar& Cl) const;
159};
160
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164} // End namespace Foam
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168#endif
169
170// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Profile model where polar lift and drag coefficients are linearly interpolated from a polar table by ...
List< scalar > Cl_
List of lift coefficient values.
~lookupProfile()=default
Destructor.
TypeName("lookup")
Runtime type information.
void interpolateWeights(const scalar &xIn, const List< scalar > &values, label &i1, label &i2, scalar &ddx) const
Return the interpolation indices and gradient.
Definition: lookupProfile.C:47
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const
Return the Cd and Cl for a given angle-of-attack.
lookupProfile(const lookupProfile &)=delete
No copy construct.
void operator=(const lookupProfile &)=delete
No copy assignment.
List< scalar > Cd_
List of drag coefficient values.
List< scalar > AOA_
List of angle-of-attack values [deg] on input, converted to [rad].
Base class for profile models for handling aerofoil lift and drag polar diagrams.
Definition: profileModel.H:121
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
volScalarField & alpha
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73