]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGPiston.h
Merge branch 'next' into durk-atc
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGPiston.h
index a71e2933b5431e1578f7377646c731b501fdabaa..a8019e5aa6a79d9f169a4b7f7655081d192fbe99 100644 (file)
@@ -4,7 +4,7 @@
  Author:       Jon S. Berndt
  Date started: 09/12/2000
 
- ------------- Copyright (C) 2000  Jon S. Berndt (jsb@hal-pc.org) --------------
+ ------------- Copyright (C) 2000  Jon S. Berndt (jon@jsbsim.org) --------------
 
  This program is free software; you can redistribute it and/or modify it under
  the terms of the GNU Lesser General Public License as published by the Free Software
@@ -40,14 +40,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGEngine.h"
-#include <math/FGTable.h>
-#include <input_output/FGXMLElement.h>
+#include "math/FGTable.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_PISTON "$Id$";
+#define ID_PISTON "$Id: FGPiston.h,v 1.26 2011/03/10 01:35:25 dpculp Exp $";
 #define FG_MAX_BOOST_SPEEDS 3
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -66,12 +65,13 @@ CLASS DOCUMENTATION
 
 @code
 <piston_engine name="{string}">
-  <minmp unit="{INHG | PA | ATM}"> {number} </minmp> <!-- Depricated -->
+  <minmp unit="{INHG | PA | ATM}"> {number} </minmp>
   <maxmp unit="{INHG | PA | ATM}"> {number} </maxmp>
   <displacement unit="{IN3 | LTR | CC}"> {number} </displacement>
   <bore unit="{IN | M}"> {number} </bore>
   <stroke unit="{IN | M}"> {number} </stroke>
   <cylinders> {number} </cylinders>
+  <cylinder-head-mass unit="{KG | LBS}"> {number} </cylinder-head-mass>
   <compression-ratio> {number} </compression-ratio>
   <sparkfaildrop> {number} </sparkfaildrop>
   <maxhp unit="{HP | WATTS}"> {number} </maxhp>
@@ -80,10 +80,13 @@ CLASS DOCUMENTATION
   <maxrpm> {number} </maxrpm>
   <maxthrottle> {number} </maxthrottle>
   <minthrottle> {number} </minthrottle>
-  <bsfc unit="{LBS/HP*HR | "KG/KW*HR"}"> {number} </bsft>
-  <volumetric_efficiency> {number} </volumetric_efficiency>
+  <bsfc unit="{LBS/HP*HR | "KG/KW*HR"}"> {number} </bsfc>
+  <volumetric-efficiency> {number} </volumetric-efficiency>
+  <dynamic-fmep unit="{INHG | PA | ATM}"> {number} </dynamic-fmep>
+  <static-fmep unit="{INHG | PA | ATM}"> {number} </static-fmep>
   <numboostspeeds> {number} </numboostspeeds>
   <boostoverride> {0 | 1} </boostoverride>
+  <boostmanual> {0 | 1} </boostmanual>
   <ratedboost1 unit="{INHG | PA | ATM}"> {number} </ratedboost1>
   <ratedpower1 unit="{HP | WATTS}"> {number} </ratedpower1>
   <ratedrpm1> {number} </ratedrpm1>
@@ -97,6 +100,9 @@ CLASS DOCUMENTATION
   <ratedrpm3> {number} </ratedrpm3>
   <ratedaltitude3 unit="{FT | M}"> {number} </ratedaltitude3>
   <takeoffboost unit="{INHG | PA | ATM}"> {number} </takeoffboost>
+  <air-intake-impedance-factor> {number} </air-intake-impedance-factor>
+  <ram-air-factor> {number} </ram-air-factor>
+  <cooling-factor> {number} </cooling-factor>
 </piston_engine>
 @endcode
 
@@ -120,6 +126,10 @@ CLASS DOCUMENTATION
       some way of getting the boost control cutout lever position (on or off)
       from FlightGear first.
 
+    - BOOSTMANUAL - whether a multispeed supercharger will manually or
+      automatically shift boost speeds.  On manual shifting the boost speeds
+      is accomplished by controling propulsion/engine/boostspeed
+
     - The next items are all appended with either 1, 2 or 3 depending on which
       boost speed they refer to, eg RATEDBOOST1.  The rated values seems to have
       been a common convention at the time to express the maximum continuously
@@ -152,8 +162,7 @@ CLASS DOCUMENTATION
       config file (and is above RATEDBOOST1), then the throttle position is
       interpreted as:
 
-    - 0 to 0.95 : idle manifold pressure to rated boost (where attainable)
-    - 0.96, 0.97, 0.98 : rated boost (where attainable).
+    - 0 to 0.98 : idle manifold pressure to rated boost (where attainable)
     - 0.99, 1.0 : takeoff boost (where attainable).
 
     A typical takeoff boost for an earlyish Merlin was about 12psi, compared
@@ -173,7 +182,7 @@ CLASS DOCUMENTATION
     @author Dave Luff (engine operational code)
     @author David Megginson (initial porting and additional code)
     @author Ron Jensen (additional engine code)
-    @version $Id$
+    @version $Id: FGPiston.h,v 1.26 2011/03/10 01:35:25 dpculp Exp $
   */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -188,28 +197,27 @@ public:
   /// Destructor
   ~FGPiston();
 
-  string GetEngineLabels(string delimeter);
-  string GetEngineValues(string delimeter);
+  std::string GetEngineLabels(const std::string& delimiter);
+  std::string GetEngineValues(const std::string& delimiter);
 
-  double Calculate(void);
-  double GetPowerAvailable(void) {return PowerAvailable;}
+  void Calculate(void);
+  double GetPowerAvailable(void) const {return (HP * hptoftlbssec);}
   double CalcFuelNeed(void);
 
   void ResetToIC(void);
   void SetMagnetos(int magnetos) {Magnetos = magnetos;}
 
-  double  GetEGT(void) { return EGT_degC; }
-  int     GetMagnetos(void) {return Magnetos;}
+  double  GetEGT(void) const { return EGT_degC; }
+  int     GetMagnetos(void) const {return Magnetos;}
 
-  double getExhaustGasTemp_degF(void) {return KelvinToFahrenheit(ExhaustGasTemp_degK);}
+  double getExhaustGasTemp_degF(void) const {return KelvinToFahrenheit(ExhaustGasTemp_degK);}
   double getManifoldPressure_inHg(void) const {return ManifoldPressure_inHg;}
-  double getCylinderHeadTemp_degF(void) {return KelvinToFahrenheit(CylinderHeadTemp_degK);}
+  double getCylinderHeadTemp_degF(void) const {return KelvinToFahrenheit(CylinderHeadTemp_degK);}
   double getOilPressure_psi(void) const {return OilPressure_psi;}
-  double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
-  double getRPM(void) {return RPM;}
+  double getOilTemp_degF (void) const {return KelvinToFahrenheit(OilTemp_degK);}
+  double getRPM(void) const {return RPM;}
 
 protected:
-  double ThrottleAngle;
 
 private:
   int crank_counter;
@@ -217,10 +225,8 @@ private:
   double IndicatedHorsePower;
   double PMEP;
   double FMEP;
-  double SpeedSlope;
-  double SpeedIntercept;
-  double AltitudeSlope;
-  double PowerAvailable;
+  double FMEPDynamic;
+  double FMEPStatic;
 
   // timestep
   double dt;
@@ -247,6 +253,8 @@ private:
   const double calorific_value_fuel;  // W/Kg (approximate)
   const double Cp_air;      // J/KgK
   const double Cp_fuel;     // J/KgK
+  const double standard_pressure; //Pa
+
 
   FGTable *Lookup_Combustion_Efficiency;
   FGTable *Mixture_Efficiency_Correlation;
@@ -267,12 +275,20 @@ private:
   double Bore;                     // inches
   double Stroke;                   // inches
   double Cylinders;                // number
-  double CompressionRatio;        // number
+  double CylinderHeadMass;         // kilograms
+  double CompressionRatio;         // number
+  double Z_airbox; // number representing intake impediance before the throttle
+  double Z_throttle; // number representing slope of throttle impediance
+  double PeakMeanPistonSpeed_fps; // ft/sec speed where intake valves begin to choke. Typically 33-50 fps
+  double RatedMeanPistonSpeed_fps; // ft/sec derived from MaxRPM and stroke.
+  double Ram_Air_Factor;           // number
 
   double StarterHP;                // initial horsepower of starter motor
   int BoostSpeeds;     // Number of super/turbocharger boost speeds - zero implies no turbo/supercharging.
   int BoostSpeed;      // The current boost-speed (zero-based).
   bool Boosted;                // Set true for boosted engine.
+  int BoostManual;     // The raw value read in from the config file - should be 1 or 0 - see description below.
+  bool bBoostManual;   // Set true if pilot must manually control the boost speed.
   int BoostOverride;   // The raw value read in from the config file - should be 1 or 0 - see description below.
   bool bBoostOverride; // Set true if pilot override of the boost regulator was fitted.
               // (Typically called 'war emergency power').
@@ -295,15 +311,18 @@ private:
   double minMAP;  // Pa
   double maxMAP;  // Pa
   double MAP;     // Pa
+  double TMAP;    // Pa - throttle manifold pressure e.g. before the supercharger boost
   double ISFC;    // Indicated specific fuel consumption [lbs/horsepower*hour
 
   //
   // Inputs (in addition to those in FGEngine).
   //
   double p_amb;              // Pascals
+  double p_ram;              // Pascals
   double T_amb;              // degrees Kelvin
   double RPM;                // revolutions per minute
   double IAS;                // knots
+  double Cooling_Factor;     // normal
   bool Magneto_Left;
   bool Magneto_Right;
   int Magnetos;