X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2Fmodels%2Fpropulsion%2FFGPropeller.h;h=ea7953e1eabc8eba4c422104b02b3b63e7d3b932;hb=0917a5e062b531963f9f3d16bb0f95f769d34f61;hp=c0ddcde123822dde3c7bc282483b4832b8d2717b;hpb=932b38a87e2870d23f9be9461b551f1e1fe556ba;p=flightgear.git diff --git a/src/FDM/JSBSim/models/propulsion/FGPropeller.h b/src/FDM/JSBSim/models/propulsion/FGPropeller.h index c0ddcde12..ea7953e1e 100644 --- a/src/FDM/JSBSim/models/propulsion/FGPropeller.h +++ b/src/FDM/JSBSim/models/propulsion/FGPropeller.h @@ -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 +#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.
+/** FGPropeller models a propeller given the tabular data for Ct and Cp, + indexed by the advance ratio "J". + +

Configuration File Format:

+@code + + {number} + {number} + {number} + {number} + {number} + {number} + {number} + {number} + {number} + {number} + {1 | -1} + {number} + {number} + {number} + + + + {numbers} + +
+ + + + {numbers} + +
+ + + + {numbers} + +
+ + + + {numbers} + +
+ + +
+@endcode + +

Configuration Parameters:

+
+    \           - Propeller rotational inertia.
+    \      - Propeller disk diameter.
+    \     - Number of blades.
+    \     - Ratio of (engine rpm) / (prop rpm).
+    \      - Minimum blade pitch angle.
+    \      - Maximum blade pitch angle.
+    \        - Minimum rpm target for constant speed propeller.
+    \        - Maximum rpm target for constant speed propeller.
+    \    - 1 = constant speed mode, 0 = manual pitch mode. 
+    \  - Blade pitch angle for reverse.
+    \         - Direction of rotation (1=clockwise as viewed from cockpit,
+                        -1=anti-clockwise as viewed from cockpit).
+    \      - P factor.
+    \     - A multiplier for the coefficients of thrust.
+    \     - A multiplier for the coefficients of power.
+
+ + 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. +
+ Several references were helpful, here: @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 };