]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/propulsion/FGPropeller.h
Bugfix: no automatic runway selection with --parkpos=
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGPropeller.h
index c0ddcde123822dde3c7bc282483b4832b8d2717b..ea7953e1eabc8eba4c422104b02b3b63e7d3b932 100644 (file)
@@ -4,23 +4,23 @@
  Author:       Jon S. Berndt
  Date started: 08/24/00
 
- ------------- 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 General Public License as published by the Free Software
+ the terms of the GNU Lesser General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later
  version.
 
  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
  details.
 
- You should have received a copy of the GNU General Public License along with
+ You should have received a copy of the GNU Lesser General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  Place - Suite 330, Boston, MA  02111-1307, USA.
 
- Further information about the GNU General Public License can also be found on
+ Further information about the GNU Lesser General Public License can also be found on
  the world wide web at http://www.gnu.org.
 
 HISTORY
@@ -39,13 +39,13 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGThruster.h"
-#include <math/FGTable.h>
+#include "math/FGTable.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_PROPELLER "$Id$"
+#define ID_PROPELLER "$Id: FGPropeller.h,v 1.16 2010/04/09 12:44:06 jberndt Exp $"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -57,13 +57,81 @@ namespace JSBSim {
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/** Propeller modeling class.
-    FGPropeller models a propeller given the tabular data for Ct and Cp
-    indexed by advance ratio "J". The data for the propeller is
-    stored in a config file named "prop_name.xml". The propeller config file
-    is referenced from the main aircraft config file in the "Propulsion" section.
-    See the constructor for FGPropeller to see what is read in and what should
-    be stored in the config file.<br>
+/** FGPropeller models a propeller given the tabular data for Ct and Cp,
+    indexed by the advance ratio "J". 
+
+<h3>Configuration File Format:</h3>
+@code
+<propeller name="{string}">
+  <ixx> {number} </ixx>
+  <diameter unit="IN"> {number} </diameter>
+  <numblades> {number} </numblades>
+  <gearratio> {number} </gearratio>
+  <minpitch> {number} </minpitch>
+  <maxpitch> {number} </maxpitch>
+  <minrpm> {number} </minrpm>
+  <maxrpm> {number} </maxrpm>
+  <constspeed> {number} </constspeed>
+  <reversepitch> {number} </reversepitch>
+  <sense> {1 | -1} </sense>
+  <p_factor> {number} </p_factor>
+  <ct_factor> {number} </ct_factor>
+  <cp_factor> {number} </cp_factor>
+
+  <table name="C_THRUST" type="internal">
+    <tableData>
+      {numbers}
+    </tableData>
+  </table>
+
+  <table name="C_POWER" type="internal">
+    <tableData>
+      {numbers}
+    </tableData>
+  </table>
+
+  <table name="CT_MACH" type="internal">
+    <tableData>
+      {numbers}
+    </tableData>
+  </table>
+
+  <table name="CP_MACH" type="internal">
+    <tableData>
+      {numbers}
+    </tableData>
+  </table>
+
+
+</propeller>
+@endcode
+
+<h3>Configuration Parameters:</h3>
+<pre>
+    \<ixx>           - Propeller rotational inertia.
+    \<diameter>      - Propeller disk diameter.
+    \<numblades>     - Number of blades.
+    \<gearratio>     - Ratio of (engine rpm) / (prop rpm).
+    \<minpitch>      - Minimum blade pitch angle.
+    \<maxpitch>      - Maximum blade pitch angle.
+    \<minrpm>        - Minimum rpm target for constant speed propeller.
+    \<maxrpm>        - Maximum rpm target for constant speed propeller.
+    \<constspeed>    - 1 = constant speed mode, 0 = manual pitch mode. 
+    \<reversepitch>  - Blade pitch angle for reverse.
+    \<sense>         - Direction of rotation (1=clockwise as viewed from cockpit,
+                        -1=anti-clockwise as viewed from cockpit).
+    \<p_factor>      - P factor.
+    \<ct_factor>     - A multiplier for the coefficients of thrust.
+    \<cp_factor>     - A multiplier for the coefficients of power.
+</pre>
+
+    Two tables are needed. One for coefficient of thrust (Ct) and one for
+    coefficient of power (Cp).
+
+    Two tables are optional. They apply a factor to Ct and Cp based on the
+    helical tip Mach.  
+    <br>
+
     Several references were helpful, here:<ul>
     <li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
      Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
@@ -73,7 +141,7 @@ CLASS DOCUMENTATION
     <li>Various NACA Technical Notes and Reports</li>
     </ul>
     @author Jon S. Berndt
-    @version $Id$
+    @version $Id: FGPropeller.h,v 1.16 2010/04/09 12:44:06 jberndt Exp $
     @see FGEngine
     @see FGThruster
 */
@@ -87,7 +155,8 @@ class FGPropeller : public FGThruster {
 public:
   /** Constructor for FGPropeller.
       @param exec a pointer to the main executive object
-      @param el a pointer to the thruster config file XML element*/
+      @param el a pointer to the thruster config file XML element
+      @param num the number of this propeller */
   FGPropeller(FGFDMExec* exec, Element* el, int num = 0);
 
   /// Destructor for FGPropeller - deletes the FGTable objects
@@ -118,6 +187,15 @@ public:
   /// Sets the P-Factor constant
   void SetPFactor(double pf) {P_Factor = pf;}
 
+  /// Sets propeller into constant speed mode, or manual pitch mode
+  void SetConstantSpeed(int mode) {ConstantSpeed = mode;} 
+
+  /// Sets coefficient of thrust multiplier
+  void SetCtFactor(double ctf) {CtFactor = ctf;}
+
+  /// Sets coefficient of power multiplier
+  void SetCpFactor(double cpf) {CpFactor = cpf;}
+
   /** Sets the rotation sense of the propeller.
       @param s this value should be +/- 1 ONLY. +1 indicates clockwise rotation as
                viewed by someone standing behind the engine looking forward into
@@ -128,11 +206,30 @@ public:
   double GetPitch(void)         { return Pitch;         }
 
   /// Retrieves the RPMs of the propeller
-  double GetRPM(void)           { return RPM;           }
+  double GetRPM(void)     const { return RPM;           } 
 
   /// Retrieves the propeller moment of inertia
   double GetIxx(void)           { return Ixx;           }
 
+  /// Retrieves the coefficient of thrust multiplier
+  double GetCtFactor(void)      { return CtFactor;      }
+
+  /// Retrieves the coefficient of power multiplier
+  double GetCpFactor(void)      { return CpFactor;      }
+
+  /// Retrieves the propeller diameter
+  double GetDiameter(void)      { return Diameter;      }
+
+  /// Retrieves propeller thrust table
+  FGTable* GetCThrustTable(void) const { return cThrust;}
+  /// Retrieves propeller power table
+  FGTable* GetCPowerTable(void)  const { return cPower; }
+
+  /// Retrieves propeller thrust Mach effects factor
+  FGTable* GetCtMachTable(void) const { return CtMach; }
+  /// Retrieves propeller power Mach effects factor
+  FGTable* GetCpMachTable(void) const { return CpMach; }
+
   /// Retrieves the Torque in foot-pounds (Don't you love the English system?)
   double GetTorque(void)        { return vTorque(eX);    }
 
@@ -161,6 +258,11 @@ public:
   bool   GetReverse (void) { return Reversed; }
   void   SetFeather (bool f) { Feathered = f; }
   bool   GetFeather (void) { return Feathered; }
+  double GetThrustCoefficient(void) const {return ThrustCoeff;}
+  double GetHelicalTipMach(void) const {return HelicalTipMach;}
+  int    GetConstantSpeed(void) const {return ConstantSpeed;}
+  void   SetInducedVelocity(double Vi) {Vinduced = Vi;}
+  double GetInducedVelocity(void) const {return Vinduced;}
 
 private:
   int   numBlades;
@@ -179,12 +281,19 @@ private:
   double ExcessTorque;
   double D4;
   double D5;
+  double HelicalTipMach;
+  double Vinduced;
   FGColumnVector3 vTorque;
   FGTable *cThrust;
   FGTable *cPower;
+  FGTable *CtMach;
+  FGTable *CpMach;
+  double CtFactor;
+  double CpFactor;
+  int    ConstantSpeed;
   void Debug(int from);
   double ReversePitch; // Pitch, when fully reversed
-  bool   Reversed;              // true, when propeller is reversed
+  bool   Reversed;     // true, when propeller is reversed
   double Reverse_coef; // 0 - 1 defines AdvancePitch (0=MIN_PITCH 1=REVERSE_PITCH)
   bool   Feathered;    // true, if feather command
 };