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