1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
3 Header: FGPropeller.h
\r
4 Author: Jon S. Berndt
\r
5 Date started: 08/24/00
\r
7 ------------- Copyright (C) 2000 Jon S. Berndt (jsb@hal-pc.org) -------------
\r
9 This program is free software; you can redistribute it and/or modify it under
\r
10 the terms of the GNU General Public License as published by the Free Software
\r
11 Foundation; either version 2 of the License, or (at your option) any later
\r
14 This program is distributed in the hope that it will be useful, but WITHOUT
\r
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
16 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
\r
19 You should have received a copy of the GNU General Public License along with
\r
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
\r
21 Place - Suite 330, Boston, MA 02111-1307, USA.
\r
23 Further information about the GNU General Public License can also be found on
\r
24 the world wide web at http://www.gnu.org.
\r
27 --------------------------------------------------------------------------------
\r
28 08/24/00 JSB Created
\r
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
34 #ifndef FGPROPELLER_H
\r
35 #define FGPROPELLER_H
\r
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
41 #include "FGThruster.h"
\r
42 #include "FGTable.h"
\r
43 #include "FGTranslation.h"
\r
44 #include "FGRotation.h"
\r
46 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
50 #define ID_PROPELLER "$Id$"
\r
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
53 FORWARD DECLARATIONS
\r
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
56 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
57 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
\r
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
60 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
64 /** Propeller modeling class.
\r
65 FGPropeller models a propeller given the tabular data for Ct and Cp
\r
66 indexed by advance ratio "J". The data for the propeller is
\r
67 stored in a config file named "prop_name.xml". The propeller config file
\r
68 is referenced from the main aircraft config file in the "Propulsion" section.
\r
69 See the constructor for FGPropeller to see what is read in and what should
\r
70 be stored in the config file.<br>
\r
71 Several references were helpful, here:<ul>
\r
72 <li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
\r
73 Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
\r
74 <li>Edwin Hartman, David Biermann, "The Aerodynamic Characteristics of
\r
75 Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6
\r
76 Airfoil Sections", NACA Report TN-640, 1938 (?)</li>
\r
77 <li>Various NACA Technical Notes and Reports</li>
\r
79 @author Jon S. Berndt
\r
86 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
88 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
90 class FGPropeller : public FGThruster {
\r
93 /** Constructor for FGPropeller.
\r
94 @param exec a pointer to the main executive object
\r
95 @param AC_cfg a pointer to the main aircraft config file object */
\r
96 FGPropeller(FGFDMExec* exec, FGConfigFile* AC_cfg);
\r
98 /// Destructor for FGPropeller - deletes the FGTable objects
\r
101 /** Sets the Revolutions Per Minute for the propeller. Normally the propeller
\r
102 instance will calculate its own rotational velocity, given the Torque
\r
103 produced by the engine and integrating over time using the standard
\r
104 equation for rotational acceleration "a": a = Q/I , where Q is Torque and
\r
105 I is moment of inertia for the propeller.
\r
106 @param rpm the rotational velocity of the propeller */
\r
107 void SetRPM(double rpm) {RPM = rpm;}
\r
109 /** This commands the pitch of the blade to change to the value supplied.
\r
110 This call is meant to be issued either from the cockpit or by the flight
\r
111 control system (perhaps to maintain constant RPM for a constant-speed
\r
112 propeller). This value will be limited to be within whatever is specified
\r
113 in the config file for Max and Min pitch. It is also one of the lookup
\r
114 indices to the power and thrust tables for variable-pitch propellers.
\r
115 @param pitch the pitch of the blade in degrees. */
\r
116 void SetPitch(double pitch) {Pitch = pitch;}
\r
118 void SetPFactor(double pf) {P_Factor = pf;}
\r
120 void SetSense(double s) { Sense = s;}
\r
122 /// Retrieves the pitch of the propeller in degrees.
\r
123 double GetPitch(void) { return Pitch; }
\r
125 /// Retrieves the RPMs of the propeller
\r
126 double GetRPM(void) { return RPM; }
\r
128 /// Retrieves the propeller moment of inertia
\r
129 double GetIxx(void) { return Ixx; }
\r
131 /// Retrieves the Torque in foot-pounds (Don't you love the English system?)
\r
132 double GetTorque(void) { return vTorque(eX); }
\r
134 /** Retrieves the power required (or "absorbed") by the propeller -
\r
135 i.e. the power required to keep spinning the propeller at the current
\r
136 velocity, air density, and rotational rate. */
\r
137 double GetPowerRequired(void);
\r
139 /** Calculates and returns the thrust produced by this propeller.
\r
140 Given the excess power available from the engine (in foot-pounds), the thrust is
\r
141 calculated, as well as the current RPM. The RPM is calculated by integrating
\r
142 the torque provided by the engine over what the propeller "absorbs"
\r
143 (essentially the "drag" of the propeller).
\r
144 @param PowerAvailable this is the excess power provided by the engine to
\r
145 accelerate the prop. It could be negative, dictating that the propeller
\r
147 @return the thrust in pounds */
\r
148 double Calculate(double PowerAvailable);
\r
162 double ExcessTorque;
\r
163 FGColumnVector3 vTorque;
\r
169 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r