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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::bladeModel
29
30Description
31 Blade model class calculates:
32 - Linear interpolated blade twist and chord based on radial position
33 - Interpolation factor (for interpolating profile performance)
34
35Usage
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
71Note
72 - The entry \c twist is internally converted from [deg] to [rad].
73
74See also
75 - Foam::fv::rotorDiskSource
76
77SourceFiles
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
90namespace Foam
91{
92
93/*---------------------------------------------------------------------------*\
94 Class bladeModel Declaration
95\*---------------------------------------------------------------------------*/
96
97class bladeModel
98{
99protected:
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
129 (
130 const scalar& xIn,
131 const List<scalar>& values,
132 label& i1,
133 label& i2,
134 scalar& ddx
135 ) const;
136
137
138public:
139
140 // Constructors
141
142 //- Construct from dictionary
143 bladeModel(const dictionary& dict);
145 //- No copy construct
146 bladeModel(const bladeModel&) = delete;
147
148 //- No copy assignment
149 void operator=(const bladeModel&) = delete;
150
152 //- Destructor
153 virtual ~bladeModel() = default;
155
156 // Member Functions
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
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199} // End namespace Foam
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#endif
204
205// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
Blade model class calculates:
Definition: bladeModel.H:145
const List< scalar > & chord() const
Return const access to the chord list.
Definition: bladeModel.C:164
const List< label > & profileID() const
Return const access to the profile ID list.
Definition: bladeModel.C:146
List< word > profileName_
Corresponding profile name per section.
Definition: bladeModel.H:151
bladeModel(const bladeModel &)=delete
No copy construct.
const List< scalar > & radius() const
Return const access to the radius list.
Definition: bladeModel.C:152
List< label > profileID_
Corresponding profile ID per section.
Definition: bladeModel.H:154
const List< word > & profileName() const
Return const access to the profile name list.
Definition: bladeModel.C:140
List< scalar > radius_
Radius [m].
Definition: bladeModel.H:157
void operator=(const bladeModel &)=delete
No copy assignment.
List< scalar > chord_
Chord [m].
Definition: bladeModel.H:163
const List< scalar > & twist() const
Return const access to the twist list.
Definition: bladeModel.C:158
bool readFromFile() const
Return true if file name is set.
Definition: bladeModel.C:37
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
fileName fName_
File name (optional)
Definition: bladeModel.H:166
virtual ~bladeModel()=default
Destructor.
List< scalar > twist_
Twist [deg] on input, converted to [rad].
Definition: bladeModel.H:160
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
bladeModel(const dictionary &dict)
Construct from dictionary.
Definition: bladeModel.C:92
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Namespace for OpenFOAM.
dictionary dict