| 1 | #ifndef _PROPELLER_HPP |
| 2 | #define _PROPELLER_HPP |
| 3 | |
| 4 | namespace yasim { |
| 5 | |
| 6 | // A generic propeller model. See the TeX documentation for |
| 7 | // implementation details, this is too hairy to explain in code |
| 8 | // comments. |
| 9 | class Propeller |
| 10 | { |
| 11 | public: |
| 12 | // Initializes a propeller with the specified "cruise" numbers |
| 13 | // for airspeed, RPM, power and air density, and two "takeoff" |
| 14 | // numbers for RPM and power (with air speed and density being |
| 15 | // zero and sea level). RPM values are in radians per second, of |
| 16 | // course. |
| 17 | Propeller(float radius, float v, float omega, float rho, float power); |
| 18 | |
| 19 | void setStops (float fine_stop, float coarse_stop); |
| 20 | |
| 21 | void setTakeoff(float omega0, float power0); |
| 22 | |
| 23 | void modPitch(float mod); |
| 24 | |
| 25 | void setPropPitch(float proppitch); |
| 26 | |
| 27 | void setPropFeather(int state); |
| 28 | |
| 29 | void setManualPitch(); |
| 30 | |
| 31 | void calc(float density, float v, float omega, |
| 32 | float* thrustOut, float* torqueOut); |
| 33 | |
| 34 | private: |
| 35 | float _r; // characteristic radius |
| 36 | float _j0; // zero-thrust advance ratio |
| 37 | float _baseJ0; // ... uncorrected for prop advance |
| 38 | float _f0; // thrust coefficient |
| 39 | float _etaC; // Peak efficiency |
| 40 | float _lambdaPeak; // constant, ~0.759835; |
| 41 | float _beta; // constant, ~1.48058; |
| 42 | float _tc0; // thrust "coefficient" at takeoff |
| 43 | float _fine_stop; // ratio for minimum pitch (high RPM) |
| 44 | float _coarse_stop; // ratio for maximum pitch (low RPM) |
| 45 | bool _matchTakeoff; // Does _tc0 mean anything? |
| 46 | bool _manual; // manual pitch mode |
| 47 | float _proppitch; // prop pitch control setting (0 ~ 1.0) |
| 48 | float _propfeather; // prop feather control setting (0 = norm, 1 = feather) |
| 49 | }; |
| 50 | |
| 51 | }; // namespace yasim |
| 52 | #endif // _PROPELLER_HPP |