JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
An Open Source Flight Dynamics and Control Software Library in C++
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 (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 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 "math/FGTable.h"
43 #include "math/FGFunction.h"
44 
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 FORWARD DECLARATIONS
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48 
49 namespace JSBSim {
50 
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 CLASS DOCUMENTATION
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54 
121 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
122 CLASS DECLARATION
123 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
124 
125 class FGRocket : public FGEngine
126 {
127 public:
132  FGRocket(FGFDMExec* exec, Element *el, int engine_number, struct FGEngine::Inputs& input);
133 
135  ~FGRocket(void);
136 
138  void Calculate(void);
139 
144  double CalcFuelNeed(void);
145 
150  double CalcOxidizerNeed(void);
151 
154  double GetTotalImpulse(void) const {return It;}
155 
158  double GetVacTotalImpulse(void) const {return ItVac;}
159 
164  bool GetFlameout(void) {return Flameout;}
165 
166  double GetOxiFlowRate(void) const {return OxidizerFlowRate;}
167 
168  double GetMixtureRatio(void) const {return MxR;}
169 
170  double GetIsp(void) const {return Isp;}
171 
172  void SetMixtureRatio(double mix) {MxR = mix;}
173 
174  void SetIsp(double isp) {Isp = isp;}
175 
176  std::string GetEngineLabels(const std::string& delimiter);
177  std::string GetEngineValues(const std::string& delimiter);
178 
188  void SetThrustVariation(double var) {ThrustVariation = var;}
189 
197  void SetTotalIspVariation(double var) {TotalIspVariation = var;}
198 
200  double GetThrustVariation(void) const {return ThrustVariation;}
201 
203  double GetTotalIspVariation(void) const {return TotalIspVariation;}
204 
205 private:
208  double GetVacThrust(void) const {return VacThrust;}
209 
210  void bindmodel(FGPropertyManager* pm);
211 
212  double Isp; // Vacuum Isp
213  double It; // Total actual Isp
214  double ItVac; // Total Vacuum Isp
215  double MxR; // Mixture Ratio
216  double BurnTime;
217  double ThrustVariation;
218  double TotalIspVariation;
219  double VacThrust;
220  double previousFuelNeedPerTank;
221  double previousOxiNeedPerTank;
222  double OxidizerExpended;
223  double TotalPropellantExpended;
224  double SLOxiFlowMax;
225  double PropFlowMax;
226  double OxidizerFlowRate;
227  double PropellantFlowRate;
228  bool Flameout;
229  double BuildupTime;
230  FGTable* ThrustTable;
231  FGFunction* isp_function;
232  FGFDMExec* FDMExec;
233 
234  void Debug(int from);
235 };
236 }
237 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238 #endif
JSBSim::FGRocket::GetTotalImpulse
double GetTotalImpulse(void) const
Gets the total impulse of the rocket.
Definition: FGRocket.h:154
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGRocket::SetTotalIspVariation
void SetTotalIspVariation(double var)
Sets the variation in total motor energy.
Definition: FGRocket.h:197
JSBSim::FGRocket::GetThrustVariation
double GetThrustVariation(void) const
Returns the thrust variation, if any.
Definition: FGRocket.h:200
JSBSim::FGRocket::GetTotalIspVariation
double GetTotalIspVariation(void) const
Returns the Total Isp variation, if any.
Definition: FGRocket.h:203
JSBSim::FGRocket::Calculate
void Calculate(void)
Determines the thrust.
Definition: FGRocket.cpp:156
JSBSim::FGRocket::~FGRocket
~FGRocket(void)
Destructor.
Definition: FGRocket.cpp:148
JSBSim::FGRocket
Models a generic rocket engine.
Definition: FGRocket.h:125
JSBSim::FGRocket::GetVacTotalImpulse
double GetVacTotalImpulse(void) const
Gets the total impulse of the rocket.
Definition: FGRocket.h:158
JSBSim::FGRocket::SetThrustVariation
void SetThrustVariation(double var)
Sets the thrust variation for a solid rocket engine.
Definition: FGRocket.h:188
JSBSim::FGEngine::Inputs
Definition: FGEngine.h:106
JSBSim::FGRocket::CalcOxidizerNeed
double CalcOxidizerNeed(void)
The oxidizer need is calculated based on power levels and flow rate for that power level.
Definition: FGRocket.cpp:238
JSBSim::FGRocket::CalcFuelNeed
double CalcFuelNeed(void)
The fuel need is calculated based on power levels and flow rate for that power level.
Definition: FGRocket.cpp:222
JSBSim::FGEngine
Base class for all engines.
Definition: FGEngine.h:103
JSBSim::FGRocket::FGRocket
FGRocket(FGFDMExec *exec, Element *el, int engine_number, struct FGEngine::Inputs &input)
Constructor.
Definition: FGRocket.cpp:54
JSBSim::FGRocket::GetFlameout
bool GetFlameout(void)
Gets the flame-out status.
Definition: FGRocket.h:164
JSBSim::Element
Definition: FGXMLElement.h:143