]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/TurbineEngine.hpp
Initial checkin of a TurbineEngine implementation. This hasn't been
[flightgear.git] / src / FDM / YASim / TurbineEngine.hpp
1 #ifndef _TURBINEENGINE_HPP
2 #define _TURBINEENGINE_HPP
3
4 #include "Engine.hpp"
5
6 namespace yasim {
7
8 class TurbineEngine : public Engine {
9 public:
10     virtual TurbineEngine* isTurbineEngine() { return this; }
11
12     TurbineEngine(float power, float omega, float alt, float flatRating);
13     void setN2Range(float min, float max) { _n2Min = min; _n2Max = max; }
14     void setFuelConsumption(float bsfc) { _bsfc = bsfc; }
15
16     virtual void calc(float pressure, float temp, float speed);
17     virtual void stabilize();
18     virtual void integrate(float dt);
19
20     virtual float getTorque() { return _torque; }
21     virtual float getFuelFlow() { return _fuelFlow; }
22     float getN2() { return _n2; }
23
24 private:
25     void setOutputFromN2();
26
27     float _maxTorque;
28     float _flatRating;
29     float _rho0;
30     float _bsfc; // SI units! kg/s per watt
31     float _n2Min;
32     float _n2Max;
33
34     float _n2Target;
35     float _torqueTarget;
36     float _fuelFlowTarget;
37
38     float _n2;
39     float _rho;
40     float _omega;
41     float _torque;
42     float _fuelFlow;
43 };
44
45 }; // namespace yasim
46 #endif // _TURBINEENGINE_HPP