]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGRocket.h
Curt Olson:
[flightgear.git] / src / FDM / JSBSim / FGRocket.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGRocket.h
4  Author:       Jon S. Berndt
5  Date started: 09/12/2000
6
7  ------------- Copyright (C) 2000  Jon S. Berndt (jsb@hal-pc.org) --------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU 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 General Public License for more
17  details.
18
19  You should have received a copy of the GNU 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 General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 09/12/2000  JSB  Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGROCKET_H
35 #define FGROCKET_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #include "FGEngine.h"
42 #include "FGConfigFile.h"
43
44 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 DEFINITIONS
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
47
48 #define ID_ROCKET "$Id$"
49
50 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 FORWARD DECLARATIONS
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
53
54 namespace JSBSim {
55
56 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 CLASS DOCUMENTATION
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
59
60 /** Models a generic rocket engine.
61     The rocket engine is modeled given the following parameters:
62     <ul>
63         <li>Chamber pressure (in psf)</li>
64         <li>Specific heat ratio (usually about 1.2 for hydrocarbon fuel and LOX)</li>
65         <li>Propulsive efficiency (in percent, from 0 to 1.0)</li>
66         <li>Variance (in percent, from 0 to 1.0, nominally 0.05)</li>
67     </ul>
68     Additionally, the following control inputs, operating characteristics, and
69     location are required, as with all other engine types:
70     <ul>
71         <li>Throttle setting (in percent, from 0 to 1.0)</li>
72         <li>Maximum allowable throttle setting</li>
73         <li>Minimum working throttle setting</li>
74         <li>Sea level fuel flow at maximum thrust</li>
75         <li>Sea level oxidizer flow at maximum thrust</li>
76         <li>X, Y, Z location in structural coordinate frame</li>
77         <li>Pitch and Yaw</li>
78     </ul>
79     The nozzle exit pressure (p2) is returned via a
80     call to FGNozzle::GetPowerRequired(). This exit pressure is used,
81     along with chamber pressure and specific heat ratio, to get the
82     thrust coefficient for the throttle setting. This thrust
83     coefficient is multiplied by the chamber pressure and then passed
84     to the nozzle Calculate() routine, where the thrust force is
85     determined.
86
87     @author Jon S. Berndt
88     $Id$
89     @see FGNozzle,
90     FGThruster,
91     FGForce,
92     FGEngine,
93     FGPropulsion,
94     FGTank
95 */
96
97 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98 CLASS DECLARATION
99 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
100
101 class FGRocket : public FGEngine
102 {
103 public:
104   /** Constructor.
105       @param exec pointer to JSBSim parent object, the FDM Executive.
106       @param Eng_cfg pointer to the config file object. */
107   FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg);
108
109   /** Destructor */
110   ~FGRocket(void);
111
112   /** Determines the thrust coefficient.
113       This routine takes the nozzle exit pressure and calculates the thrust
114       coefficient times the chamber pressure.
115       @param pe nozzle exit pressure
116       @return thrust coefficient times chamber pressure */
117   double Calculate(double pe);
118   
119   /** Gets the chamber pressure.
120       @return chamber pressure in psf. */
121   double GetChamberPressure(void) {return PC;}
122
123   /** Gets the flame-out status.
124       The engine will "flame out" if the throttle is set below the minimum 
125       sustainable setting.
126       @return true if engine has flamed out. */
127   bool GetFlameout(void) {return Flameout;}
128
129 private:
130   double SHR;
131   double maxPC;
132   double propEff;
133   double kFactor;
134   double Variance;
135   double PC;
136   bool Flameout;
137
138   void Debug(int from);
139 };
140 }
141 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
142 #endif
143