]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/PistonEngine.hpp
Latest YASim changes.
[flightgear.git] / src / FDM / YASim / PistonEngine.hpp
1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
3
4 namespace yasim {
5
6 class PistonEngine {
7 public:
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);
13
14     void setThrottle(float throttle);
15     void setMixture(float mixture);
16     void setBoost(float boost); // fraction of turbo-mul used
17
18     float getMaxPower(); // max sea-level power
19
20     void calc(float pressure, float temp, float speed);
21     float getTorque();
22     float getFuelFlow();
23     float getMP();
24     float getEGT();
25
26 private:
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)
37
38     // Runtime settables:
39     float _throttle;
40     float _mixture;
41     float _boost;
42
43     // Runtime state/output:
44     float _mp;
45     float _torque;
46     float _fuelFlow;
47     float _egt;
48 };
49
50 }; // namespace yasim
51 #endif // _PISTONENGINE_HPP