53 label nElem = values.size();
63 while ((i2 < nElem) && (values[i2] < xIn))
84 ddx = (xIn -
values[i1])/(values[i2] - values[i1]);
101 List<Tuple2<word, vector>> data;
109 dict.readEntry(
"data", data);
114 profileName_.setSize(data.size());
115 profileID_.setSize(data.size());
116 radius_.setSize(data.size());
117 twist_.setSize(data.size());
118 chord_.setSize(data.size());
122 profileName_[i] = data[i].first();
124 radius_[i] = data[i].second()[0];
125 twist_[i] = degToRad(data[i].second()[1]);
126 chord_[i] = data[i].second()[2];
132 <<
"No blade data specified"
186 interpolateWeights(radius, radius_, i1, i2, invDr);
188 twist = invDr*(twist_[i2] - twist_[i1]) + twist_[i1];
189 chord = invDr*(chord_[i2] - chord_[i1]) + chord_[i1];
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label n)
Older name for setAddressableSize.
const List< scalar > & chord() const
Return const access to the chord list.
const List< label > & profileID() const
Return const access to the profile ID list.
List< word > profileName_
Corresponding profile name per section.
const List< scalar > & radius() const
Return const access to the radius list.
List< label > profileID_
Corresponding profile ID per section.
const List< word > & profileName() const
Return const access to the profile name list.
List< scalar > radius_
Radius [m].
List< scalar > chord_
Chord [m].
const List< scalar > & twist() const
Return const access to the twist list.
bool readFromFile() const
Return true if file name is set.
void interpolateWeights(const scalar &xIn, const List< scalar > &values, label &i1, label &i2, scalar &ddx) const
Return the interpolation indices and gradient.
fileName fName_
File name (optional).
List< scalar > twist_
Twist [deg] on input, converted to [rad].
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.
bladeModel(const dictionary &dict)
Construct from dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Unit conversion functions.