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);
11 void setDisplacement(float d);
12 void setCompression(float c);
14 void setThrottle(float throttle);
15 void setMixture(float mixture);
16 void setBoost(float boost); // fraction of turbo-mul used
18 float getMaxPower(); // max sea-level power
20 void calc(float pressure, float temp, float speed);
27 // Static configuration:
28 float _power0; // reference power setting
29 float _omega0; // " engine speed
30 float _rho0; // " manifold air density
31 float _f0; // "ideal" fuel flow at P0/omega0
32 float _mixCoeff; // fuel flow per omega at full mixture
33 float _turbo; // (or super-)charger pressure multiplier
34 float _maxMP; // wastegate setting
35 float _displacement; // piston stroke volume
36 float _compression; // compression ratio (>1)
43 // Runtime state/output:
51 #endif // _PISTONENGINE_HPP