]> git.mxchange.org Git - flightgear.git/commitdiff
Bugfix. The engine thrust is recalculated based on the current N1 value
authorandy <andy>
Wed, 12 Jun 2002 08:23:05 +0000 (08:23 +0000)
committerandy <andy>
Wed, 12 Jun 2002 08:23:05 +0000 (08:23 +0000)
(and not the throttle setting), but the recalculation left in a degeneracy
when the target/throttle setting was exactly zero.  Zero times a big number
is still zero.  Fixed to use real math, not theoretical math.

src/FDM/YASim/Jet.cpp

index e3448a91966a63915558b9e0707a6f0a3e2b71fd..200a743dbc2ae7a1b8d5475a54c20261bb122589 100644 (file)
@@ -152,12 +152,12 @@ void Jet::integrate(float dt)
     float vCorr = 1 - (speed/_vMax);
 
     float maxThrust = _maxThrust * vCorr * (statD/D0);
-    _thrust = maxThrust * _throttle;
+    float setThrust = maxThrust * _throttle;
 
     // Now get a "beta" (i.e. EPR - 1) value.  The output values are
     // expressed as functions of beta.
     float ibeta0 = 1/(_epr0 - 1);
-    float betaTarget = (_epr0 - 1) * (_thrust/_maxThrust) * (P0/_pressure)
+    float betaTarget = (_epr0 - 1) * (setThrust/_maxThrust) * (P0/_pressure)
        * (_temp/statT);
     float n2Target = _n2Min + (betaTarget*ibeta0) * (_n2Max - _n2Min);
 
@@ -173,7 +173,7 @@ void Jet::integrate(float dt)
     // The actual thrust produced is keyed to the N1 speed.  Add the
     // afterburners in at the end.
     float betaN1 =  (_epr0-1) * (_n1 - _n1Min) / (_n1Max - _n1Min);
-    _thrust *= betaN1/(betaTarget+0.00001f); // blowup protection
+    _thrust = _maxThrust * betaN1/((_epr0-1)*(P0/_pressure)*(_temp/statT));
     _thrust *= 1 + _reheat*(_abFactor-1);
 
     // Finally, calculate the output variables.   Use a 80/20 mix of