Add support in the aircraft config file for a low idle and high idle n2.
float flatRating = attrf(a, "flat-rating") * HP2W;
TurbineEngine* eng = new TurbineEngine(power, omega, alt, flatRating);
- if(a->hasAttribute("min-n2"))
- eng->setN2Range(attrf(a, "min-n2"), attrf(a, "max-n2"));
+ if(a->hasAttribute("n2-low-idle"))
+ eng->setN2Range(attrf(a, "n2-low-idle"), attrf(a, "n2-high-idle"),
+ attrf(a, "n2-max"));
// Nasty units conversion: lbs/hr per hp -> kg/s per watt
if(a->hasAttribute("bsfc"))
TurbineEngine::TurbineEngine(float power, float omega, float alt,
float flatRating)
{
- // _cond_lever = 1.0;
+ _cond_lever = 1.0;
_rho0 = Atmosphere::getStdDensity(0);
_maxTorque = (power/omega) * _rho0 / Atmosphere::getStdDensity(alt);
_flatRating = flatRating;
_bsfc = 0.047; // == 0.5 lb/hr per hp
- _n2Min = 65;
+ _n2LowIdle = 50;
+ _n2HighIdle = 70;
_n2Max = 100;
_rho = _rho0;
_omega = 0;
- _n2 = _n2Target = _n2Min;
+ _n2 = _n2Target = _n2Min = _n2LowIdle;
_torque = 0;
_fuelFlow = 0;
_running = true;
}
+ _n2Min = _n2LowIdle + (_n2HighIdle - _n2LowIdle) * _cond_lever;
_omega = omega;
_rho = Atmosphere::calcStdDensity(pressure, temp);
virtual TurbineEngine* isTurbineEngine() { return this; }
TurbineEngine(float power, float omega, float alt, float flatRating);
- void setN2Range(float min, float max) { _n2Min = min; _n2Max = max; }
+ void setN2Range(float low_idle, float high_idle, float max) {
+ _n2LowIdle = low_idle;
+ _n2HighIdle = high_idle;
+ _n2Max = max;
+ }
void setFuelConsumption(float bsfc) { _bsfc = bsfc; }
virtual void calc(float pressure, float temp, float speed);
float _flatRating;
float _rho0;
float _bsfc; // SI units! kg/s per watt
- float _n2Min;
+ float _n2LowIdle;
+ float _n2HighIdle;
float _n2Max;
+ float _n2Min;
float _n2Target;
float _torqueTarget;
float _fuelFlowTarget;