2001-12-01 06:22:24 +00:00
|
|
|
#ifndef _PROPELLER_HPP
|
|
|
|
#define _PROPELLER_HPP
|
|
|
|
|
|
|
|
namespace yasim {
|
|
|
|
|
|
|
|
// A generic propeller model. See the TeX documentation for
|
|
|
|
// implementation details, this is too hairy to explain in code
|
|
|
|
// comments.
|
|
|
|
class Propeller
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// Initializes a propeller with the specified "cruise" numbers
|
|
|
|
// for airspeed, RPM, power and air density, and two "takeoff"
|
|
|
|
// numbers for RPM and power (with air speed and density being
|
|
|
|
// zero and sea level). RPM values are in radians per second, of
|
|
|
|
// course.
|
2001-12-06 18:13:24 +00:00
|
|
|
Propeller(float radius, float v, float omega, float rho, float power);
|
|
|
|
|
2006-02-26 16:46:51 +00:00
|
|
|
void setStops (float fine_stop, float coarse_stop);
|
|
|
|
|
2001-12-06 18:13:24 +00:00
|
|
|
void setTakeoff(float omega0, float power0);
|
|
|
|
|
|
|
|
void modPitch(float mod);
|
2001-12-01 06:22:24 +00:00
|
|
|
|
2003-05-16 17:27:17 +00:00
|
|
|
void setPropPitch(float proppitch);
|
|
|
|
|
2004-07-20 22:17:58 +00:00
|
|
|
void setPropFeather(int state);
|
|
|
|
|
2003-05-16 17:27:17 +00:00
|
|
|
void setManualPitch();
|
|
|
|
|
2001-12-01 06:22:24 +00:00
|
|
|
void calc(float density, float v, float omega,
|
|
|
|
float* thrustOut, float* torqueOut);
|
|
|
|
|
|
|
|
private:
|
|
|
|
float _r; // characteristic radius
|
2001-12-07 20:00:59 +00:00
|
|
|
float _j0; // zero-thrust advance ratio
|
2001-12-06 18:13:24 +00:00
|
|
|
float _baseJ0; // ... uncorrected for prop advance
|
2001-12-07 20:00:59 +00:00
|
|
|
float _f0; // thrust coefficient
|
2001-12-01 06:22:24 +00:00
|
|
|
float _etaC; // Peak efficiency
|
|
|
|
float _lambdaPeak; // constant, ~0.759835;
|
|
|
|
float _beta; // constant, ~1.48058;
|
2001-12-06 18:13:24 +00:00
|
|
|
float _tc0; // thrust "coefficient" at takeoff
|
2006-02-26 16:46:51 +00:00
|
|
|
float _fine_stop; // ratio for minimum pitch (high RPM)
|
|
|
|
float _coarse_stop; // ratio for maximum pitch (low RPM)
|
2001-12-06 18:13:24 +00:00
|
|
|
bool _matchTakeoff; // Does _tc0 mean anything?
|
2004-07-20 22:17:58 +00:00
|
|
|
bool _manual; // manual pitch mode
|
|
|
|
float _proppitch; // prop pitch control setting (0 ~ 1.0)
|
|
|
|
float _propfeather; // prop feather control setting (0 = norm, 1 = feather)
|
2001-12-01 06:22:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace yasim
|
|
|
|
#endif // _PROPELLER_HPP
|