bladeModel.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::bladeModel
26 
27 Description
28  Blade model class calculates:
29  Linear interpolated blade twist and chord based on radial position
30  Interpolation factor (for interpolating profile performance)
31 
32  Input in list format:
33 
34  data
35  (
36  (profile1 (radius1 twist1 chord1))
37  (profile1 (radius2 twist2 chord2))
38  );
39 
40  where:
41  radius [m]
42  twist [deg], converted to [rad] internally
43  chord [m]
44 
45 SourceFiles
46  bladeModel.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef bladeModel_H
51 #define bladeModel_H
52 
53 #include "List.H"
54 #include "dictionary.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class bladeModel Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class bladeModel
66 {
67 
68 protected:
69 
70  // Protected data
71 
72  //- Corresponding profile name per section
74 
75  //- Corresponding profile ID per section
77 
78  //- Radius [m]
80 
81  //- Twist [deg] on input, converted to [rad]
83 
84  //- Chord [m]
86 
87  //- File name (optional)
89 
90 
91  // Protected Member Functions
92 
93  //- Return true if file name is set
94  bool readFromFile() const;
95 
96  //- Return the interpolation indices and gradient
98  (
99  const scalar& xIn,
100  const List<scalar>& values,
101  label& i1,
102  label& i2,
103  scalar& ddx
104  ) const;
105 
106 
107 public:
108 
109  //- Constructor
110  bladeModel(const dictionary& dict);
111 
112 
113  //- Destructor
114  virtual ~bladeModel();
115 
116 
117  // Member Functions
118 
119  // Access
120 
121  //- Return const access to the profile name list
122  const List<word>& profileName() const;
123 
124  //- Return const access to the profile ID list
125  const List<label>& profileID() const;
126 
127  //- Return const access to the radius list
128  const List<scalar>& radius() const;
129 
130  //- Return const access to the twist list
131  const List<scalar>& twist() const;
132 
133  //- Return const access to the chord list
134  const List<scalar>& chord() const;
135 
136 
137  // Edit
138 
139  //- Return non-const access to the profile ID list
141 
142 
143  // Evaluation
144 
145  //- Return the twist and chord for a given radius
146  virtual void interpolate
147  (
148  const scalar radius,
149  scalar& twist,
150  scalar& chord,
151  label& i1,
152  label& i2,
153  scalar& invDr
154  ) const;
155 };
156 
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
Blade model class calculates: Linear interpolated blade twist and chord based on radial position Inte...
Definition: bladeModel.H:64
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 class for handling file names.
Definition: fileName.H:79
List< scalar > radius_
Radius [m].
Definition: bladeModel.H:78
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const List< scalar > & radius() const
Return const access to the radius list.
Definition: bladeModel.C:153
List< scalar > chord_
Chord [m].
Definition: bladeModel.H:84
List< scalar > twist_
Twist [deg] on input, converted to [rad].
Definition: bladeModel.H:81
virtual void interpolate(const scalar radius, scalar &twist, scalar &chord, label &i1, label &i2, scalar &invDr) const
Return the twist and chord for a given radius.
Definition: bladeModel.C:178
virtual ~bladeModel()
Destructor.
Definition: bladeModel.C:135
bladeModel(const dictionary &dict)
Constructor.
Definition: bladeModel.C:89
const List< scalar > & twist() const
Return const access to the twist list.
Definition: bladeModel.C:159
List< word > profileName_
Corresponding profile name per section.
Definition: bladeModel.H:72
const List< label > & profileID() const
Return const access to the profile ID list.
Definition: bladeModel.C:147
bool readFromFile() const
Return true if file name is set.
Definition: bladeModel.C:34
const List< scalar > & chord() const
Return const access to the chord list.
Definition: bladeModel.C:165
List< label > profileID_
Corresponding profile ID per section.
Definition: bladeModel.H:75
void interpolateWeights(const scalar &xIn, const List< scalar > &values, label &i1, label &i2, scalar &ddx) const
Return the interpolation indices and gradient.
Definition: bladeModel.C:41
fileName fName_
File name (optional)
Definition: bladeModel.H:87
Namespace for OpenFOAM.
const List< word > & profileName() const
Return const access to the profile name list.
Definition: bladeModel.C:141