]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/models/propulsion/FGThruster.h
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / propulsion / FGThruster.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGThruster.h
4  Author:       Jon S. Berndt
5  Date started: 08/23/00
6
7  ------------- Copyright (C) 2000  Jon S. Berndt (jon@jsbsim.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
17  details.
18
19  You should have received a copy of the GNU Lesser General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 08/24/00  JSB  Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGTHRUSTER_H
35 #define FGTHRUSTER_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #include "FGForce.h"
42 #include "math/FGColumnVector3.h"
43 #include <string>
44
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 DEFINITIONS
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48
49 #define ID_THRUSTER "$Id: FGThruster.h,v 1.20 2012/03/18 15:48:36 jentron Exp $"
50
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 FORWARD DECLARATIONS
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54
55 namespace JSBSim {
56
57 class Element;
58 class FGPropertyManager;
59
60 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61 CLASS DOCUMENTATION
62 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
63
64 /** Base class for specific thrusting devices such as propellers, nozzles, etc.
65
66 <h3>reverser angle:</h3>
67
68     "Reverser angle" as used here is a way to manipulate the thrust vector,
69     along the thrust axis ONLY, during run time.  This should not be confused
70     with a thrust vectoring nozzle.  The angle is defined in radians, and is
71     used thus:  Final_thrust = cosine( reverser_angle ) * unmodified_thrust.  
72     Therefore a reverser angle of 0 results in no change, and a reverser angle
73     of 3.14 (pi) results in a completely reversed thrust vector.  An angle of
74     1.57 (pi/2) results in no thrust at all.
75  
76     @author Jon Berndt
77     @version $Id: FGThruster.h,v 1.20 2012/03/18 15:48:36 jentron Exp $
78     */
79
80 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 CLASS DECLARATION
82 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
83
84 class FGThruster : public FGForce {
85
86 public:
87   /// Constructor
88   FGThruster(FGFDMExec *FDMExec, Element *el, int num );
89   /// Destructor
90   virtual ~FGThruster();
91
92   enum eType {ttNozzle, ttRotor, ttPropeller, ttDirect};
93
94   virtual double Calculate(double tt) {
95        Thrust = cos(ReverserAngle)*tt;
96        vFn(1) = Thrust;
97        return Thrust;
98   }
99   void SetName(string name) {Name = name;}
100   virtual void SetRPM(double rpm) {};
101   virtual void SetEngineRPM(double rpm) {};
102   virtual double GetPowerRequired(void) {return 0.0;}
103   virtual void SetdeltaT(double dt) {deltaT = dt;}
104   double GetThrust(void) const {return Thrust;}
105   eType GetType(void) {return Type;}
106   string GetName(void) {return Name;}
107   void SetReverserAngle(double angle) {ReverserAngle = angle;}
108   double GetReverserAngle(void) const {return ReverserAngle;}
109   virtual double GetRPM(void) const { return 0.0; };
110   virtual double GetEngineRPM(void) const { return 0.0; };
111   double GetGearRatio(void) {return GearRatio; }
112   virtual string GetThrusterLabels(int id, const string& delimeter);
113   virtual string GetThrusterValues(int id, const string& delimeter);
114
115   struct Inputs {
116     double TotalDeltaT;
117     double H_agl;
118     FGColumnVector3 PQR;
119     FGColumnVector3 AeroPQR;
120     FGColumnVector3 AeroUVW;
121     double Density;
122     double Pressure;
123     double Soundspeed;
124     double Alpha;
125     double Beta;
126     double Vt;
127   } in;
128
129 protected:
130   eType Type;
131   string Name;
132   double Thrust;
133   double PowerRequired;
134   double deltaT;
135   double GearRatio;
136   double ThrustCoeff;
137   double ReverserAngle;
138   int EngineNum;
139   FGPropertyManager* PropertyManager;
140   virtual void Debug(int from);
141 };
142 }
143 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 #endif
145