]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPropeller.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGPropeller.h
index f133d79f55e395126c5aede6dc2d9a688efbbedd..0434e694303038a9de25e49e1eec37412a8e5649 100644 (file)
@@ -40,7 +40,6 @@ INCLUDES
 
 #include "FGThruster.h"
 #include "FGTable.h"
-#include "FGTranslation.h"
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
@@ -52,17 +51,15 @@ DEFINITIONS
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+namespace JSBSim {
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DOCUMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 /** Propeller modeling class.
-    FGPropeller models a propeller given the tabular data for Ct, Cp, and
-    efficiency indexed by advance ratio "J". The data for the propeller is
+    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
@@ -74,7 +71,7 @@ CLASS DOCUMENTATION
     Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6
     Airfoil Sections", NACA Report TN-640, 1938 (?)</li>
     <li>Various NACA Technical Notes and Reports</li>
-    <ul>
+    </ul>
     @author Jon S. Berndt
     @version $Id$
     @see FGEngine
@@ -92,7 +89,7 @@ public:
   /** Constructor for FGPropeller.
       @param exec a pointer to the main executive object
       @param AC_cfg a pointer to the main aircraft config file object */
-  FGPropeller(FGFDMExec* exec, FGConfigFile* AC_cfg);
+  FGPropeller(FGFDMExec* exec, FGConfigFile* AC_cfg, int num = 0);
 
   /// Destructor for FGPropeller - deletes the FGTable objects
   ~FGPropeller();
@@ -103,35 +100,51 @@ public:
       equation for rotational acceleration "a": a = Q/I , where Q is Torque and
       I is moment of inertia for the propeller.
       @param rpm the rotational velocity of the propeller */
-  void SetRPM(float rpm) {RPM = rpm;}
+  void SetRPM(double rpm) {RPM = rpm;}
+
+  /// Returns true of this propeller is variable pitch
+  bool IsVPitch(void) {return MaxPitch != MinPitch;}
 
   /** This commands the pitch of the blade to change to the value supplied.
       This call is meant to be issued either from the cockpit or by the flight
       control system (perhaps to maintain constant RPM for a constant-speed
       propeller). This value will be limited to be within whatever is specified
       in the config file for Max and Min pitch. It is also one of the lookup
-      indices to the power, thrust, and efficiency tables for variable-pitch
-      propellers.
+      indices to the power and thrust tables for variable-pitch propellers.
       @param pitch the pitch of the blade in degrees. */
-  void SetPitch(float pitch) {Pitch = pitch;}
+  void SetPitch(double pitch) {Pitch = pitch;}
+
+  void SetAdvance(double advance) {Advance = advance;}
+
+  /// Sets the P-Factor constant
+  void SetPFactor(double pf) {P_Factor = pf;}
+
+  /** 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
+               the direction of flight. */
+  void SetSense(double s) { Sense = s;}
+
+  double GetSense(void) {return Sense;}
+  double GetPFactorValue(void) {return P_Factor;}
 
   /// Retrieves the pitch of the propeller in degrees.
-  float GetPitch(void)         { return Pitch;         }
-  
+  double GetPitch(void)         { return Pitch;         }
+
   /// Retrieves the RPMs of the propeller
-  float GetRPM(void)           { return RPM;           }
-  
+  double GetRPM(void)           { return RPM;           }
+
   /// Retrieves the propeller moment of inertia
-  float GetIxx(void)           { return Ixx;           }
-  
+  double GetIxx(void)           { return Ixx;           }
+
   /// Retrieves the Torque in foot-pounds (Don't you love the English system?)
-  float GetTorque(void)        { return Torque;        }
-  
+  double GetTorque(void)        { return vTorque(eX);    }
+
   /** Retrieves the power required (or "absorbed") by the propeller -
       i.e. the power required to keep spinning the propeller at the current
       velocity, air density,  and rotational rate. */
-  float GetPowerRequired(void);
-  
+  double GetPowerRequired(void);
+
   /** Calculates and returns the thrust produced by this propeller.
       Given the excess power available from the engine (in foot-pounds), the thrust is
       calculated, as well as the current RPM. The RPM is calculated by integrating
@@ -140,26 +153,32 @@ public:
       @param PowerAvailable this is the excess power provided by the engine to
       accelerate the prop. It could be negative, dictating that the propeller
       would be slowed.
-                 @return the thrust in pounds */
-  float Calculate(float PowerAvailable);
+      @return the thrust in pounds */
+  double Calculate(double PowerAvailable);
+  FGColumnVector3 GetPFactor(void);
+  string GetThrusterLabels(int id, string delimeter);
+  string GetThrusterValues(int id, string delimeter);
 
 private:
   int   numBlades;
-  float RPM;
-  float Ixx;
-  float Diameter;
-  float MaxPitch;
-  float MinPitch;
-  float P_Factor;
-  float Sense;
-  float Pitch;
-  float Torque;
-  FGTable *Efficiency;
+  double RPM;
+  double Ixx;
+  double Diameter;
+  double MaxPitch;
+  double MinPitch;
+  double MinRPM;
+  double MaxRPM;
+  double P_Factor;
+  double Sense;
+  double Pitch;
+  double Advance;
+  double ExcessTorque;
+  FGColumnVector3 vTorque;
   FGTable *cThrust;
   FGTable *cPower;
-  void Debug(void);
+  void Debug(int from);
 };
-
+}
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 #endif