1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
8 // Initializes an engine from known "takeoff" parameters.
9 PistonEngine(float power, float spd);
10 void setTurboParams(float mul, float maxMP);
12 void setThrottle(float throttle);
13 void setMixture(float mixture);
17 // Calculates power output and fuel flow, based on a given
18 // throttle setting (0-1 corresponding to the fraction of
19 // "available" manifold pressure), mixture (fuel flux per rpm,
20 // 0-1, where 1 is "max rich", or a little bit more than needed
21 // for rated power at sea level)
22 void calc(float pressure, float temp, float speed,
23 float* powerOut, float* fuelFlowOut);
26 float _power0; // reference power setting
27 float _omega0; // " engine speed
28 float _rho0; // " manifold air density
29 float _f0; // "ideal" fuel flow at P0/omega0
30 float _mixCoeff; // fuel flow per omega at full mixture
41 #endif // _PISTONENGINE_HPP