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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::lookupProfile
28 
29 Description
30  Look-up based profile data - drag and lift coefficients are lineraly
31  interpolated based on the supplied angle of attack
32 
33  Input in list format:
34 
35  data
36  (
37  (AOA1 Cd1 Cl2)
38  (AOA2 Cd2 Cl2)
39  ...
40  (AOAN CdN CdN)
41  );
42 
43  where:
44  AOA = angle of attack [deg] converted to [rad] internally
45  Cd = drag coefficient
46  Cl = lift coefficient
47 
48 SourceFiles
49  lookupProfile.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef lookupProfile_H
54 #define lookupProfile_H
55 
56 #include "profileModel.H"
57 #include "List.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class lookupProfile Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class lookupProfile
69 :
70  public profileModel
71 {
72 protected:
73 
74  // Protected data
75 
76  //- List of angle-of-attack values [deg] on input, converted to [rad]
78 
79  //- List of drag coefficient values
81 
82  //- List of lift coefficient values
84 
85 
86  // Protected Member Functions
87 
88  //- Return the interpolation indices and gradient
90  (
91  const scalar& xIn,
92  const List<scalar>& values,
93  label& i1,
94  label& i2,
95  scalar& ddx
96  ) const;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("lookup");
103 
104  //- Constructor
105  lookupProfile(const dictionary& dict, const word& modelName);
106 
107  //- Destructor
108  ~lookupProfile() = default;
109 
110 
111  // Member Functions
112 
113  //- Return the Cd and Cl for a given angle-of-attack
114  virtual void Cdl(const scalar alpha, scalar& Cd, scalar& Cl) const;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::lookupProfile::interpolateWeights
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:46
List.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::lookupProfile::lookupProfile
lookupProfile(const dictionary &dict, const word &modelName)
Constructor.
Definition: lookupProfile.C:95
Foam::HashTableOps::values
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
Definition: HashOps.H:149
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::lookupProfile::Cd_
List< scalar > Cd_
List of drag coefficient values.
Definition: lookupProfile.H:79
Foam::label
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:62
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::lookupProfile::AOA_
List< scalar > AOA_
List of angle-of-attack values [deg] on input, converted to [rad].
Definition: lookupProfile.H:76
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< scalar >
Foam::lookupProfile::Cdl
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const
Return the Cd and Cl for a given angle-of-attack.
Definition: lookupProfile.C:139
Foam::lookupProfile
Look-up based profile data - drag and lift coefficients are lineraly interpolated based on the suppli...
Definition: lookupProfile.H:67
Foam::lookupProfile::TypeName
TypeName("lookup")
Runtime type information.
Foam::lookupProfile::~lookupProfile
~lookupProfile()=default
Destructor.
Foam::profileModel
Base class for profile models.
Definition: profileModel.H:52
profileModel.H
Foam::lookupProfile::Cl_
List< scalar > Cl_
List of lift coefficient values.
Definition: lookupProfile.H:82