when active does not touch the way the YASim jet calculates fuel flow, but separates out the afterburning component of thrust, calculates the TSFC of that component and uses the same method of fuel flow calculation for the afterburning component then adds it to the existing fuel flow
When inactive (atsfc doesn't exist or is zero) it just behaves exactly as before
I finally got around to testing this small patch thoroughly, and I'm satisfied that it doesn't affect anything else & works across many different versions (i've been testing it with current as it has changed over the last 7 months)
j->setRPMs(n1min, n1max, n2min, n2max);
j->setTSFC(attrf(a, "tsfc", 0.8));
+ j->setATSFC(attrf(a, "atsfc", 0.0));
if(a->hasAttribute("egt")) j->setEGT(attrf(a, "egt"));
if(a->hasAttribute("epr")) j->setEPR(attrf(a, "epr"));
if(a->hasAttribute("exhaust-speed"))
Jet::Jet()
{
_maxThrust = 0;
+ _abThrust = 0;
_abFactor = 1;
_reheat = 0;
_rotControl = 0;
_vMax = 800;
_epr0 = 3.0;
_tsfc = 0.8f;
+ _atsfc = 0.0f;
+ _abFuelFactor = 3.5f; //previously was constant in code below
_egt0 = 1050;
_n1Min = 55;
_n1Max = 102;
{
_maxThrust = thrust;
if(afterburner == 0) _abFactor = 1;
- else _abFactor = afterburner/thrust;
+ else { _abFactor = afterburner/thrust;
+ _abThrust = afterburner - thrust;
+ }
}
void Jet::setVMax(float spd)
_tsfc = tsfc;
}
+void Jet::setATSFC(float atsfc)
+{
+ _atsfc = atsfc;
+}
+
void Jet::setRPMs(float idleN1, float maxN1, float idleN2, float maxN2)
{
_n1Min = idleN1;
_epr = beta + 1;
float ff0 = _maxThrust*_tsfc*(1/(3600.0f*9.8f)); // takeoff fuel flow, kg/s
_fuelFlow = ff0 * beta*ibeta0;
- _fuelFlow *= 1 + (3.5f * _reheat * _abFactor); // Afterburners take
+ //Calc afterburner only tsfc if atsfc is set
+ if(_atsfc > 0) _abFuelFactor = ((_maxThrust*_abFactor*_atsfc)-(_maxThrust*_tsfc))/_abThrust;
+ if(_atsfc == 0 ) _fuelFlow *= 1 + (_abFuelFactor * _reheat * _abFactor); // Afterburners take
// 3.5 times as much
// fuel per thrust unit
+ else _fuelFlow += _abThrust*_abFuelFactor*(1/(3600.0f*9.8f))*beta*ibeta0*_reheat;
+ // add afterburning only component of fuel flow
+
_egt = T0 + beta*ibeta0 * (_egt0 - T0);
// Thrust reverse handling:
void setMaxThrust(float thrust, float afterburner=0);
void setVMax(float spd);
void setTSFC(float tsfc);
+ void setATSFC(float atsfc);
void setRPMs(float idleN1, float maxN1, float idleN2, float maxN2);
void setEGT(float takeoffEGT);
void setEPR(float takeoffEPR);
bool _reverseThrust;
float _maxThrust; // Max dry thrust at sea level
+ float _abThrust; // Max ab component of thrust at sea level
float _abFactor; // Afterburner thrust multiplier
float _maxRot;
float _vMax; // speed at which thrust is zero
float _epr0; // EPR at takeoff thrust
float _tsfc; // TSFC ((lb/hr)/lb) at takeoff thrust and zero airspeed
+ float _atsfc; // Afterburning TSFC ((lb/hr)/lb) at takeoff thrust and zero airspeed (total TSFC)
+ float _abFuelFactor; // Afterburner Only Fuel Factor at takeoff thrust and zero airspeed
float _egt0; // EGT at takeoff thrust
float _n1Min; // N1 at ground idle
float _n1Max; // N1 at takeoff thrust