From 2c3fa12eeaf5aeb5286b312d3a56b8ccf7948664 Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 8 Jun 2003 08:44:30 +0000 Subject: [PATCH] David Culp: 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FDM/JSBSim/FGSimTurbine.cpp b/src/FDM/JSBSim/FGSimTurbine.cpp index e47dc2256..69fca04a9 100644 --- a/src/FDM/JSBSim/FGSimTurbine.cpp +++ b/src/FDM/JSBSim/FGSimTurbine.cpp @@ -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);