]> git.mxchange.org Git - flightgear.git/commitdiff
David Culp:
authorehofman <ehofman>
Sun, 8 Jun 2003 08:44:30 +0000 (08:44 +0000)
committerehofman <ehofman>
Sun, 8 Jun 2003 08:44:30 +0000 (08:44 +0000)
This version handles a zero fuel load better.  I found that if you try to consume fuel from an empty tank, with zero fuel flow, the FGEngine::Starved flag alternates

src/FDM/JSBSim/FGSimTurbine.cpp

index e47dc2256d91f2d9d2334c78fd695b1895e5eede..69fca04a9b8a709c079bbbdb307bcbef5f980fff 100644 (file)
@@ -77,6 +77,7 @@ double FGSimTurbine::Calculate(double dummy)
   // calculate virtual throttle position (actual +/- lag) based on
   // FCS Throttle value (except when trimming)
   if (dt > 0.0) {
+    Running = !Starved;
     ThrottleCmd = FCS->GetThrottleCmd(EngineNumber);
     if ( ThrottleCmd > throttle ) {
       throttle += (dt * delay);
@@ -88,13 +89,14 @@ double FGSimTurbine::Calculate(double dummy)
       }
     }
   else {
+    Starved = false;
     throttle = ThrottleCmd = FCS->GetThrottleCmd(EngineNumber);
     }
     
   idlethrust = MaxMilThrust * ThrustTables[0]->TotalValue();
   milthrust = MaxMilThrust * ThrustTables[1]->TotalValue();
 
-  if (!Starved) {
+  if (Running) {
     thrust = milthrust * throttle * throttle;
     if (thrust < idlethrust) thrust = idlethrust;
     FuelFlow_pph = thrust * TSFC;
@@ -113,7 +115,7 @@ double FGSimTurbine::Calculate(double dummy)
     }
   else {
     thrust = 0.0;
-    FuelFlow_pph = 0.0;
+    FuelFlow_pph = 0.000001;
     N1 -= (dt * 3.0);
     if (N1 < (Translation->Getqbar()/10.0)) N1 = Translation->Getqbar()/10.0;
     N2 -= (dt * 3.5);