lookupProfile.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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::lookupProfile
26 
27 Description
28  Look-up based profile data - drag and lift coefficients are linearly
29  interpolated based on the supplied angle of attack
30 
31  Input in list format:
32 
33  data
34  (
35  (AOA1 Cd1 Cl2)
36  (AOA2 Cd2 Cl2)
37  ...
38  (AOAN CdN CdN)
39  );
40 
41  where:
42  AOA = angle of attack [deg] converted to [rad] internally
43  Cd = drag coefficient
44  Cl = lift coefficient
45 
46 SourceFiles
47  lookupProfile.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef lookupProfile_H
52 #define lookupProfile_H
53 
54 #include "profileModel.H"
55 #include "List.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class lookupProfile Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class lookupProfile
67 :
68  public profileModel
69 {
70 
71 protected:
72 
73  // Protected data
74 
75  //- List of angle-of-attack values [deg] on input, converted to [rad]
77 
78  //- List of drag coefficient values
80 
81  //- List of lift coefficient values
83 
84 
85  // Protected Member Functions
86 
87  //- Return the interpolation indices and gradient
89  (
90  const scalar& xIn,
91  const List<scalar>& values,
92  label& i1,
93  label& i2,
94  scalar& ddx
95  ) const;
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("lookup");
102 
103  //- Constructor
104  lookupProfile(const dictionary& dict, const word& modelName);
105 
106 
107  // Member Functions
108 
109  // Evaluation
110 
111  //- Return the Cd and Cl for a given angle-of-attack
112  virtual void Cdl(const scalar alpha, scalar& Cd, scalar& Cl) const;
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
dictionary dict
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
List< scalar > AOA_
List of angle-of-attack values [deg] on input, converted to [rad].
Definition: lookupProfile.H:75
TypeName("lookup")
Runtime type information.
List< scalar > Cd_
List of drag coefficient values.
Definition: lookupProfile.H:78
lookupProfile(const dictionary &dict, const word &modelName)
Constructor.
Definition: lookupProfile.C:93
A class for handling words, derived from string.
Definition: word.H:59
Base class for profile models.
Definition: profileModel.H:50
virtual void Cdl(const scalar alpha, scalar &Cd, scalar &Cl) const
Return the Cd and Cl for a given angle-of-attack.
Look-up based profile data - drag and lift coefficients are linearly interpolated based on the suppli...
Definition: lookupProfile.H:65
List< scalar > Cl_
List of lift coefficient values.
Definition: lookupProfile.H:81
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:44
Namespace for OpenFOAM.