]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Jet.cpp
Add support for a turbo prop condition lever.
[flightgear.git] / src / FDM / YASim / Jet.cpp
index 200a743dbc2ae7a1b8d5475a54c20261bb122589..afbb669cde95956af65c2865aa9757791abaad16 100644 (file)
@@ -10,6 +10,7 @@ Jet::Jet()
     _reheat = 0;
     _rotControl = 0;
     _maxRot = 0;
+    _reverseThrust = false;
 
     // Initialize parameters for an early-ish subsonic turbojet.  More
     // recent turbofans will typically have a lower vMax, epr0, and
@@ -31,6 +32,7 @@ Jet::Jet()
     // And sanify the remaining junk, just in case.
     _running = true;
     _cranking = false;
+    _fuel = true;
     _epr = 1;
     _fuelFlow = 0;
     _egt = 273;
@@ -148,6 +150,12 @@ void Jet::integrate(float dt)
     _pressureCorrect = statP/P0;
     _tempCorrect = Math::sqrt(statT/T0);
 
+    // Handle running out of fuel.  This is a hack.  What should
+    // really happen is a simulation of ram air torque on the
+    // turbine.  This just forces the engine into ground idle.
+    if(_fuel == false)
+        _throttle = 0;
+
     // Linearly taper maxThrust to zero at vMax
     float vCorr = 1 - (speed/_vMax);
 
@@ -186,6 +194,9 @@ void Jet::integrate(float dt)
                                                  // 3.5 times as much
                                                  // fuel per thrust unit
     _egt = T0 + beta*ibeta0 * (_egt0 - T0);
+
+    // Thrust reverse handling:
+    if(_reverseThrust) _thrust *= -_reverseEff;
 }
 
 bool Jet::isRunning()