]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGTurboProp.h
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGTurboProp.h
old mode 100755 (executable)
new mode 100644 (file)
index 6ee0805..330a726
@@ -27,6 +27,7 @@
 HISTORY
 --------------------------------------------------------------------------------
 05/14/2004  Created
+02/08/2011  T. Kreitler, added rotor support
 
 //JVK (mark)
 
@@ -43,10 +44,10 @@ INCLUDES
 
 #include <vector>
 #include "FGEngine.h"
-#include <input_output/FGXMLElement.h>
-#include <math/FGTable.h>
+#include "input_output/FGXMLElement.h"
+#include "math/FGTable.h"
 
-#define ID_TURBOPROP "$Id$"
+#define ID_TURBOPROP "$Id: FGTurboProp.h,v 1.16 2011/08/04 13:45:42 jberndt Exp $"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -58,8 +59,33 @@ namespace JSBSim {
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/** Turboprop engine model.
-
+/** Turboprop engine model.  For an example of this model in use see the file:
+    engine/engtm601.xml
+ <h3>Configuration parameters:</h3>
+<pre>
+milthrust   [LBS]
+idlen1      [%]
+maxn1       [%]
+betarangeend[%]
+    if ThrottleCmd < betarangeend/100.0 then engine power=idle, propeller pitch
+    is controled by ThrottleCmd (between MINPITCH and  REVERSEPITCH).
+    if ThrottleCmd > betarangeend/100.0 then engine power increases up to max reverse power
+reversemaxpower [%]
+    max engine power in reverse mode
+maxpower    [HP]
+psfc power specific fuel consumption [pph/HP] for N1=100%
+n1idle_max_delay [-] time constant for N1 change
+maxstartenginetime [sec]
+    after this time the automatic starting cycle is interrupted when the engine
+    doesn't start (0=automatic starting not present)
+startern1   [%]
+    when starting starter spin up engine to this spin
+ielumaxtorque [lb.ft]
+    if torque>ielumaxtorque limiters decrease the throttle
+    (ielu = Integrated Electronic Limiter Unit)
+itt_delay [-] time constant for ITT change
+    (ITT = Inter Turbine Temperature)
+</pre>
 */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -73,20 +99,19 @@ public:
       @param Executive pointer to executive structure
       @param el pointer to the XML element representing the turbine engine
       @param engine_number engine number*/
-  FGTurboProp(FGFDMExec* Executive, Element *el, int engine_number);
+  FGTurboProp(FGFDMExec* Executive, Element *el, int engine_number, struct Inputs& input);
   /// Destructor
   ~FGTurboProp();
 
   enum phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpStall, tpSeize, tpTrim };
 
-  double Calculate(void);
+  void Calculate(void);
   double CalcFuelNeed(void);
 
-  inline double GetPowerAvailable(void) const {return (Eng_HP * hptoftlbssec);}
-  inline double GetPowerAvailable_HP(void) const {return (Eng_HP);}
-  inline double GetPropRPM(void) const {return (Prop_RPM);}
-  inline double GetThrottleCmd(void) const {return (ThrottleCmd);}
-  inline bool GetIeluIntervent(void) const { return Ielu_intervent; }
+  double GetPowerAvailable(void) const { return (HP * hptoftlbssec); }
+  double GetRPM(void) const { return (RPM); }
+  double GetIeluThrottle(void) const { return (ThrottlePos); }
+  bool GetIeluIntervent(void) const { return Ielu_intervent; }
 
   double Seek(double* var, double target, double accel, double decel);
   double ExpSeek(double* var, double target, double accel, double decel);
@@ -121,9 +146,9 @@ public:
 
   inline void SetGeneratorPower(bool gp) { GeneratorPower=gp; }
   inline void SetCondition(bool c) { Condition=c; }
-
-  string GetEngineLabels(string delimeter);  // added from Turbine 0.9.6
-  string GetEngineValues(string delimeter);  // added from Turbine 0.9.6
+  int InitRunning(void);
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
 
 private:
 
@@ -137,10 +162,9 @@ private:
   double MaxN2;            ///< N2 at 100% throttle
   double IdleFF;           ///< Idle Fuel Flow (lbm/hr)
   double delay;            ///< Inverse spool-up time from idle to 100% (seconds)
-  double dt;               ///< Simulator time slice
   double N1_factor;        ///< factor to tie N1 and throttle
   double N2_factor;        ///< factor to tie N2 and throttle
-  double ThrottleCmd;      ///< FCS-supplied throttle position
+  double ThrottlePos;      ///< FCS-supplied throttle position, modified locally
   double TAT;              ///< total air temperature (deg C)
   bool Stalled;            ///< true if engine is compressor-stalled
   bool Seized;             ///< true if inner spool is seized
@@ -163,26 +187,27 @@ private:
   double BetaRangeThrottleEnd; // coef (0-1) where is end of beta-range
   double ReverseMaxPower;      // coef (0-1) multiplies max throttle on reverse
 
-  double Idle_Max_Delay;       // time delay for exponencial
+  double Idle_Max_Delay;       // time delay for exponential
   double MaxPower;             // max engine power [HP]
-  double StarterN1;               // rotates of generator maked by starter [%]
-  double MaxStartingTime;           // maximal time for start [s] (-1 means not used)
-  double Prop_RPM;             // propeller RPM
+  double StarterN1;            // rotates of generator maked by starter [%]
+  double MaxStartingTime;      // maximal time for start [s] (-1 means not used)
+  double RPM;                  // shaft RPM
   double Velocity;
   double rho;
   double PSFC;                 // Power specific fuel comsumption [lb/(HP*hr)] at best efficiency
 
-  double Eng_HP;               // current engine power
+  double HP;                   // engine power output
 
-  double StartTime;               // engine strating time [s] (0 when start button pushed)
+  double StartTime;            // engine starting time [s] (0 when start button pushed)
 
-  double  ITT_Delay;            // time delay for exponencial grow of ITT
+  double  ITT_Delay;           // time delay for exponential growth of ITT
   double  Eng_ITT_degC;
   double  Eng_Temperature;     // temperature inside engine
 
   bool EngStarting;            // logicaly output - TRUE if engine is starting
   bool GeneratorPower;
   int Condition;
+  int thrusterType;            // the attached thruster
 
   double Off(void);
   double Run(void);
@@ -192,10 +217,9 @@ private:
   void SetDefaults(void);
   bool Load(FGFDMExec *exec, Element *el);
   void bindmodel(void);
-  void unbind(void);
   void Debug(int from);
 
-  FGTable* ITT_N1; // ITT temperature depending on throttle command
+  FGTable* ITT_N1;             // ITT temperature depending on throttle command
   FGTable* EnginePowerRPM_N1;
   FGTable* EnginePowerVC;
 };