bladeModel.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-2015 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::bladeModel
29 
30 Description
31  Blade model class calculates:
32  - Linear interpolated blade twist and chord based on radial position
33  - Interpolation factor (for interpolating profile performance)
34 
35 Usage
36  Minimal example by using \c constant/fvOptions:
37  rotorDiskSource1
38  {
39  // Mandatory/Optional (inherited) entries
40  ...
41 
42  // Mandatory entries (runtime modifiable)
43  blade
44  {
45  // Mandatory entries (runtime modifiable)
46  data
47  (
48  (profile1 (radius1 twist1 chord1))
49  (profile1 (radius2 twist2 chord2))
50  ...
51  ([0] ([1] [2] [3]))
52  );
53 
54  // Optional entries (runtime modifiable)
55  file <fileName>;
56  }
57  }
58 
59  where the entries mean:
60  \table
61  Property | Description | Type | Reqd | Dflt
62  blade | Dictionary name: blade | word | yes | -
63  data | Blade characteristics in list format | list | yes | -
64  [0] (profile) | Corresponding profile name per section | word | yes | -
65  [1] (radius) | Radial position of the blade section [m] | scalar | yes | -
66  [2] (twist) | Twist angle of the blade section [deg] | scalar | yes | -
67  [3] (chord) | Chord length of the blade section [m] | scalar | yes | -
68  file | Name of file containing blade characteristics | word | no | -
69  \endtable
70 
71 Note
72  - The entry \c twist is internally converted from [deg] to [rad].
73 
74 See also
75  - Foam::fv::rotorDiskSource
76 
77 SourceFiles
78  bladeModel.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef bladeModel_H
83 #define bladeModel_H
84 
85 #include "List.H"
86 #include "dictionary.H"
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 namespace Foam
91 {
92 
93 /*---------------------------------------------------------------------------*\
94  Class bladeModel Declaration
95 \*---------------------------------------------------------------------------*/
96 
97 class bladeModel
98 {
99 protected:
100 
101  // Protected Data
102 
103  //- Corresponding profile name per section
104  List<word> profileName_;
105 
106  //- Corresponding profile ID per section
107  List<label> profileID_;
108 
109  //- Radius [m]
110  List<scalar> radius_;
111 
112  //- Twist [deg] on input, converted to [rad]
113  List<scalar> twist_;
114 
115  //- Chord [m]
116  List<scalar> chord_;
117 
118  //- File name (optional)
119  fileName fName_;
120 
121 
122  // Protected Member Functions
123 
124  //- Return true if file name is set
125  bool readFromFile() const;
126 
127  //- Return the interpolation indices and gradient
128  void interpolateWeights
129  (
130  const scalar& xIn,
131  const List<scalar>& values,
132  label& i1,
133  label& i2,
134  scalar& ddx
135  ) const;
136 
137 
138 public:
139 
140  // Constructors
141 
142  //- Construct from dictionary
143  bladeModel(const dictionary& dict);
144 
145  //- No copy construct
146  bladeModel(const bladeModel&) = delete;
147 
148  //- No copy assignment
149  void operator=(const bladeModel&) = delete;
150 
151 
152  //- Destructor
153  virtual ~bladeModel() = default;
154 
155 
156  // Member Functions
157 
158  // Access
159 
160  //- Return const access to the profile name list
161  const List<word>& profileName() const;
162 
163  //- Return const access to the profile ID list
164  const List<label>& profileID() const;
165 
166  //- Return const access to the radius list
167  const List<scalar>& radius() const;
168 
169  //- Return const access to the twist list
170  const List<scalar>& twist() const;
171 
172  //- Return const access to the chord list
173  const List<scalar>& chord() const;
174 
175 
176  // Edit
177 
178  //- Return non-const access to the profile ID list
180 
181 
182  // Evaluation
183 
184  //- Return the twist and chord for a given radius
185  virtual void interpolate
186  (
187  const scalar radius,
188  scalar& twist,
189  scalar& chord,
190  label& i1,
191  label& i2,
192  scalar& invDr
193  ) const;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Foam::bladeModel::profileName
const List< word > & profileName() const
Return const access to the profile name list.
Definition: bladeModel.C:140
Foam::bladeModel::radius
const List< scalar > & radius() const
Return const access to the radius list.
Definition: bladeModel.C:152
List.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::bladeModel::chord
const List< scalar > & chord() const
Return const access to the chord list.
Definition: bladeModel.C:164
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::bladeModel::interpolateWeights
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:44
Foam::bladeModel::twist
const List< scalar > & twist() const
Return const access to the twist list.
Definition: bladeModel.C:158
Foam::bladeModel::profileID
const List< label > & profileID() const
Return const access to the profile ID list.
Definition: bladeModel.C:146
Foam::bladeModel
Blade model class calculates:
Definition: bladeModel.H:144
Foam::bladeModel::interpolate
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:177
Foam::bladeModel::fName_
fileName fName_
File name (optional)
Definition: bladeModel.H:166
Foam::bladeModel::operator=
void operator=(const bladeModel &)=delete
No copy assignment.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::bladeModel::profileName_
List< word > profileName_
Corresponding profile name per section.
Definition: bladeModel.H:151
Foam::bladeModel::radius_
List< scalar > radius_
Radius [m].
Definition: bladeModel.H:157
Foam::List< word >
dictionary.H
Foam::bladeModel::profileID_
List< label > profileID_
Corresponding profile ID per section.
Definition: bladeModel.H:154
Foam::bladeModel::twist_
List< scalar > twist_
Twist [deg] on input, converted to [rad].
Definition: bladeModel.H:160
Foam::bladeModel::~bladeModel
virtual ~bladeModel()=default
Destructor.
Foam::bladeModel::readFromFile
bool readFromFile() const
Return true if file name is set.
Definition: bladeModel.C:37
Foam::bladeModel::bladeModel
bladeModel(const dictionary &dict)
Construct from dictionary.
Definition: bladeModel.C:92
Foam::bladeModel::chord_
List< scalar > chord_
Chord [m].
Definition: bladeModel.H:163