1
0
Fork 0

Add support for a turbo prop condition lever.

Add support in the aircraft config file for a low idle and high idle n2.
This commit is contained in:
curt 2004-07-27 20:39:56 +00:00
parent e5f0163ce0
commit 85fe50dcc5
3 changed files with 16 additions and 7 deletions

View file

@ -634,8 +634,9 @@ void FGFDM::parseTurbineEngine(XMLAttributes* a)
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"))

View file

@ -7,18 +7,19 @@ namespace yasim {
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;
@ -56,6 +57,7 @@ void TurbineEngine::calc(float pressure, float temp, float omega)
_running = true;
}
_n2Min = _n2LowIdle + (_n2HighIdle - _n2LowIdle) * _cond_lever;
_omega = omega;
_rho = Atmosphere::calcStdDensity(pressure, temp);

View file

@ -10,7 +10,11 @@ public:
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);
@ -33,9 +37,11 @@ private:
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;