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:
parent
e5f0163ce0
commit
85fe50dcc5
3 changed files with 16 additions and 7 deletions
|
@ -634,8 +634,9 @@ void FGFDM::parseTurbineEngine(XMLAttributes* a)
|
||||||
float flatRating = attrf(a, "flat-rating") * HP2W;
|
float flatRating = attrf(a, "flat-rating") * HP2W;
|
||||||
TurbineEngine* eng = new TurbineEngine(power, omega, alt, flatRating);
|
TurbineEngine* eng = new TurbineEngine(power, omega, alt, flatRating);
|
||||||
|
|
||||||
if(a->hasAttribute("min-n2"))
|
if(a->hasAttribute("n2-low-idle"))
|
||||||
eng->setN2Range(attrf(a, "min-n2"), attrf(a, "max-n2"));
|
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
|
// Nasty units conversion: lbs/hr per hp -> kg/s per watt
|
||||||
if(a->hasAttribute("bsfc"))
|
if(a->hasAttribute("bsfc"))
|
||||||
|
|
|
@ -7,18 +7,19 @@ namespace yasim {
|
||||||
TurbineEngine::TurbineEngine(float power, float omega, float alt,
|
TurbineEngine::TurbineEngine(float power, float omega, float alt,
|
||||||
float flatRating)
|
float flatRating)
|
||||||
{
|
{
|
||||||
// _cond_lever = 1.0;
|
_cond_lever = 1.0;
|
||||||
|
|
||||||
_rho0 = Atmosphere::getStdDensity(0);
|
_rho0 = Atmosphere::getStdDensity(0);
|
||||||
_maxTorque = (power/omega) * _rho0 / Atmosphere::getStdDensity(alt);
|
_maxTorque = (power/omega) * _rho0 / Atmosphere::getStdDensity(alt);
|
||||||
_flatRating = flatRating;
|
_flatRating = flatRating;
|
||||||
_bsfc = 0.047; // == 0.5 lb/hr per hp
|
_bsfc = 0.047; // == 0.5 lb/hr per hp
|
||||||
_n2Min = 65;
|
_n2LowIdle = 50;
|
||||||
|
_n2HighIdle = 70;
|
||||||
_n2Max = 100;
|
_n2Max = 100;
|
||||||
|
|
||||||
_rho = _rho0;
|
_rho = _rho0;
|
||||||
_omega = 0;
|
_omega = 0;
|
||||||
_n2 = _n2Target = _n2Min;
|
_n2 = _n2Target = _n2Min = _n2LowIdle;
|
||||||
_torque = 0;
|
_torque = 0;
|
||||||
_fuelFlow = 0;
|
_fuelFlow = 0;
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ void TurbineEngine::calc(float pressure, float temp, float omega)
|
||||||
_running = true;
|
_running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_n2Min = _n2LowIdle + (_n2HighIdle - _n2LowIdle) * _cond_lever;
|
||||||
_omega = omega;
|
_omega = omega;
|
||||||
_rho = Atmosphere::calcStdDensity(pressure, temp);
|
_rho = Atmosphere::calcStdDensity(pressure, temp);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,11 @@ public:
|
||||||
virtual TurbineEngine* isTurbineEngine() { return this; }
|
virtual TurbineEngine* isTurbineEngine() { return this; }
|
||||||
|
|
||||||
TurbineEngine(float power, float omega, float alt, float flatRating);
|
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; }
|
void setFuelConsumption(float bsfc) { _bsfc = bsfc; }
|
||||||
|
|
||||||
virtual void calc(float pressure, float temp, float speed);
|
virtual void calc(float pressure, float temp, float speed);
|
||||||
|
@ -33,9 +37,11 @@ private:
|
||||||
float _flatRating;
|
float _flatRating;
|
||||||
float _rho0;
|
float _rho0;
|
||||||
float _bsfc; // SI units! kg/s per watt
|
float _bsfc; // SI units! kg/s per watt
|
||||||
float _n2Min;
|
float _n2LowIdle;
|
||||||
|
float _n2HighIdle;
|
||||||
float _n2Max;
|
float _n2Max;
|
||||||
|
|
||||||
|
float _n2Min;
|
||||||
float _n2Target;
|
float _n2Target;
|
||||||
float _torqueTarget;
|
float _torqueTarget;
|
||||||
float _fuelFlowTarget;
|
float _fuelFlowTarget;
|
||||||
|
|
Loading…
Add table
Reference in a new issue