1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 Date started: 09/12/2000
7 ------------- Copyright (C) 2000 Jon S. Berndt (jsb@hal-pc.org) --------------
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
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
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.
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.
27 --------------------------------------------------------------------------------
28 09/12/2000 JSB Created
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
42 #include <math/FGTable.h>
43 #include <input_output/FGXMLElement.h>
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 #define ID_ROCKET "$Id$"
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
57 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61 /** Models a generic rocket engine.
62 The rocket engine is modeled given the following parameters:
64 <li>Chamber pressure (in psf)</li>
65 <li>Specific heat ratio (usually about 1.2 for hydrocarbon fuel and LOX)</li>
66 <li>Propulsive efficiency (in percent, from 0 to 1.0)</li>
67 <li>Variance (in percent, from 0 to 1.0, nominally 0.05)</li>
69 Additionally, the following control inputs, operating characteristics, and
70 location are required, as with all other engine types:
72 <li>Throttle setting (in percent, from 0 to 1.0)</li>
73 <li>Maximum allowable throttle setting</li>
74 <li>Minimum working throttle setting</li>
75 <li>Sea level fuel flow at maximum thrust</li>
76 <li>Sea level oxidizer flow at maximum thrust</li>
77 <li>X, Y, Z location in structural coordinate frame</li>
78 <li>Pitch and Yaw</li>
80 The nozzle exit pressure (p2) is returned via a
81 call to FGNozzle::GetPowerRequired(). This exit pressure is used,
82 along with chamber pressure and specific heat ratio, to get the
83 thrust coefficient for the throttle setting. This thrust
84 coefficient is multiplied by the chamber pressure and then passed
85 to the nozzle Calculate() routine, where the thrust force is
88 One can model the thrust of a solid rocket by providing a normalized thrust table
89 as a function of time. For instance, the space shuttle solid rocket booster
90 normalized thrust value looks roughly like this:
93 \<thrust_table name="propulsion/thrust_time" type="internal">
121 The left column is time, the right column is normalized thrust. Inside the
122 FGRocket class code, the maximum thrust is calculated, and multiplied by this
123 table. The Rocket class also tracks burn time. All that needs to be done is
124 for the rocket engine to be throttle up to 1. At that time, the solid rocket
125 fuel begins burning and thrust is provided.
127 @author Jon S. Berndt
137 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
141 class FGRocket : public FGEngine
145 @param exec pointer to JSBSim parent object, the FDM Executive.
146 @param el a pointer to the XML Element instance representing the engine.
147 @param engine_number engine number */
148 FGRocket(FGFDMExec* exec, Element *el, int engine_number);
153 /** Determines the thrust coefficient.
154 @return thrust coefficient times chamber pressure */
155 double Calculate(void);
157 /** Gets the chamber pressure.
158 @return chamber pressure in psf. */
159 double GetChamberPressure(void) {return PC;}
161 /** Gets the flame-out status.
162 The engine will "flame out" if the throttle is set below the minimum
164 @return true if engine has flamed out. */
165 bool GetFlameout(void) {return Flameout;}
166 string GetEngineLabels(string delimeter);
167 string GetEngineValues(string delimeter);
178 FGTable* ThrustTable;
180 void Debug(int from);
183 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%