]> git.mxchange.org Git - flightgear.git/commitdiff
Add support for a turbo prop condition lever.
authorcurt <curt>
Tue, 27 Jul 2004 20:39:56 +0000 (20:39 +0000)
committercurt <curt>
Tue, 27 Jul 2004 20:39:56 +0000 (20:39 +0000)
Add support in the aircraft config file for a low idle and high idle n2.

src/FDM/YASim/FGFDM.cpp
src/FDM/YASim/TurbineEngine.cpp
src/FDM/YASim/TurbineEngine.hpp

index 258a3424b097c483fc18101aa639c1470e2e056c..57d95c041571e5e58d2b296c7d922f31f80f655c 100644 (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"))
index ee79fcdb1a8f8c73d17fbefd6f7133b3353877bf..6e489bbb49324a0019fee8f9e99b2181d8c2a110 100644 (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);
 
index 3f14edb21674454bef02cbb6e9bdfe927bb5a3f8..ab496ebde0ed9e7f12d00dc404f5e89314af60a9 100644 (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;