From: andy Date: Wed, 12 Jun 2002 08:23:05 +0000 (+0000) Subject: Bugfix. The engine thrust is recalculated based on the current N1 value X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a682823adaf0fded092a7c6cfc5d099c27525ba8;p=flightgear.git Bugfix. The engine thrust is recalculated based on the current N1 value (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. --- diff --git a/src/FDM/YASim/Jet.cpp b/src/FDM/YASim/Jet.cpp index e3448a919..200a743db 100644 --- a/src/FDM/YASim/Jet.cpp +++ b/src/FDM/YASim/Jet.cpp @@ -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