]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/PistonEngine.hpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / YASim / PistonEngine.hpp
1 #ifndef _PISTONENGINE_HPP
2 #define _PISTONENGINE_HPP
3
4 #include "Engine.hpp"
5
6 namespace yasim {
7
8 class PistonEngine : public Engine {
9 public:
10     virtual PistonEngine* isPistonEngine() { return this; }
11
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);
17
18     bool isCranking();
19     float getMP();
20     float getEGT();
21     float getMaxPower(); // max sea-level power
22     float getBoost() { return _boostPressure; }
23     float getOilTemp() { return _oilTemp; }
24
25     virtual void calc(float pressure, float temp, float speed);
26     virtual void stabilize();
27     virtual void integrate(float dt);
28     virtual float getTorque();
29     virtual float getFuelFlow();
30
31 private:
32     // Static configuration:
33     float _power0;   // reference power setting
34     float _omega0;   //   "       engine speed
35     float _rho0;     //   "       manifold air density
36     float _f0;       // "ideal" fuel flow at P0/omega0
37     float _mixCoeff; // fuel flow per omega at full mixture
38     float _turbo;    // (or super-)charger pressure multiplier
39     float _maxMP;    // wastegate setting
40     float _displacement; // piston stroke volume
41     float _compression;  // compression ratio (>1)
42
43     // Runtime state/output:
44     float _mp;
45     float _torque;
46     float _fuelFlow;
47     float _egt;
48     float _boostPressure;
49     float _oilTemp;
50     float _oilTempTarget;
51     float _dOilTempdt;
52 };
53
54 }; // namespace yasim
55 #endif // _PISTONENGINE_HPP