1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
8 class PistonEngine : public Engine {
10 virtual PistonEngine* isPistonEngine() { return this; }
12 // Initializes an engine from known "takeoff" parameters.
13 PistonEngine(float power, float spd);
14 void setTurboParams(float mul, float maxMP);
15 void setDisplacement(float d);
16 void setCompression(float c);
21 float getMaxPower(); // max sea-level power
22 float getBoost() { return _boostPressure; }
24 virtual void calc(float pressure, float temp, float speed);
25 virtual float getTorque();
26 virtual float getFuelFlow();
29 // Static configuration:
30 float _power0; // reference power setting
31 float _omega0; // " engine speed
32 float _rho0; // " manifold air density
33 float _f0; // "ideal" fuel flow at P0/omega0
34 float _mixCoeff; // fuel flow per omega at full mixture
35 float _turbo; // (or super-)charger pressure multiplier
36 float _maxMP; // wastegate setting
37 float _displacement; // piston stroke volume
38 float _compression; // compression ratio (>1)
40 // Runtime state/output:
49 #endif // _PISTONENGINE_HPP