JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
FGTurboProp.h
1/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3 Header: FGTurboProp.h
4 Author: Jiri "Javky" Javurek
5 based on SimTurbine and Turbine engine from David Culp
6 Date started: 05/14/2004
7
8 ------------- Copyright (C) 2004 (javky@email.cz)----------
9
10 This program is free software; you can redistribute it and/or modify it under
11 the terms of the GNU Lesser General Public License as published by the Free Software
12 Foundation; either version 2 of the License, or (at your option) any later
13 version.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
18 details.
19
20 You should have received a copy of the GNU Lesser General Public License along with
21 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22 Place - Suite 330, Boston, MA 02111-1307, USA.
23
24 Further information about the GNU Lesser General Public License can also be found on
25 the world wide web at http://www.gnu.org.
26
27HISTORY
28--------------------------------------------------------------------------------
2905/14/2004 Created
3002/08/2011 T. Kreitler, added rotor support
31
32//JVK (mark)
33
34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35SENTRY
36%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
37
38#ifndef FGTURBOPROP_H
39#define FGTURBOPROP_H
40
41/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42INCLUDES
43%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
44
45#include <vector>
46#include "FGEngine.h"
47#include "math/FGTable.h"
48
49/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50FORWARD DECLARATIONS
51%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
52
53namespace JSBSim {
54
55/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56CLASS DOCUMENTATION
57%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
58
88/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
89CLASS DECLARATION
90%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
91
92class FGTurboProp : public FGEngine
93{
94public:
99 FGTurboProp(FGFDMExec* Executive, Element *el, int engine_number, struct Inputs& input);
100
101 enum phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpTrim };
102
103 void Calculate(void);
104 double CalcFuelNeed(void);
105
106 double GetPowerAvailable(void) const { return (HP * hptoftlbssec); }
107 double GetRPM(void) const { return RPM; }
108 double GetIeluThrottle(void) const { return (ThrottlePos); }
109 bool GetIeluIntervent(void) const { return Ielu_intervent; }
110
111 double Seek(double* var, double target, double accel, double decel);
112 double ExpSeek(double* var, double target, double accel, double decel);
113
114 phaseType GetPhase(void) const { return phase; }
115
116 bool GetReversed(void) const { return Reversed; }
117 bool GetCutoff(void) const { return Cutoff; }
118
119 double GetN1(void) const {return N1;}
120 double GetITT(void) const {return Eng_ITT_degC;}
121 double GetEngStarting(void) const { return EngStarting; }
122
123 double getOilPressure_psi () const {return OilPressure_psi;}
124 double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
125
126 inline bool GetGeneratorPower(void) const { return GeneratorPower; }
127 inline int GetCondition(void) const { return Condition; }
128
129 void SetPhase( phaseType p ) { phase = p; }
130 void SetReverse(bool reversed) { Reversed = reversed; }
131 void SetCutoff(bool cutoff) { Cutoff = cutoff; }
132
133 inline void SetGeneratorPower(bool gp) { GeneratorPower=gp; }
134 inline void SetCondition(bool c) { Condition=c; }
135 int InitRunning(void);
136 std::string GetEngineLabels(const std::string& delimiter);
137 std::string GetEngineValues(const std::string& delimiter);
138
139private:
140
141 phaseType phase;
142 double IdleN1;
143 double N1;
144 double MaxN1;
145 double delay;
146 double N1_factor;
147 double ThrottlePos;
148 bool Reversed;
149 bool Cutoff;
150
151 double OilPressure_psi;
152 double OilTemp_degK;
153
154 double Ielu_max_torque; // max propeller torque (before ielu intervent)
155 bool Ielu_intervent;
156 double OldThrottle;
157
158 double BetaRangeThrottleEnd; // coef (0-1) where is end of beta-range
159 double ReverseMaxPower; // coef (0-1) multiplies max throttle on reverse
160
161 double Idle_Max_Delay; // time delay for exponential
162 double MaxPower; // max engine power [HP]
163 double StarterN1; // rotates of generator maked by starter [%]
164 double MaxStartingTime; // maximal time for start [s] (-1 means not used)
165 double RPM; // shaft RPM
166 double PSFC; // Power specific fuel comsumption [lb/(HP*hr)] at best efficiency
167 double CombustionEfficiency;
168
169 double HP; // engine power output
170
171 double StartTime; // engine starting time [s] (0 when start button pushed)
172
173 double ITT_Delay; // time delay for exponential growth of ITT
174 double Eng_ITT_degC;
175 double Eng_Temperature; // temperature inside engine
176
177 bool EngStarting; // logicaly output - TRUE if engine is starting
178 bool GeneratorPower;
179 int Condition;
180 int thrusterType; // the attached thruster
181
182 double Off(void);
183 double Run(void);
184 double SpinUp(void);
185 double Start(void);
186
187 void SetDefaults(void);
188 bool Load(FGFDMExec *exec, Element *el);
189 void bindmodel(FGPropertyManager* pm);
190 void Debug(int from);
191
192 std::unique_ptr<FGTable> ITT_N1; // ITT temperature depending on throttle command
193 std::unique_ptr<FGTable> EnginePowerRPM_N1;
194 std::shared_ptr<FGParameter> EnginePowerVC;
195 std::unique_ptr<FGTable> CombustionEfficiency_N1;
196};
197}
198//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
199#endif
Base class for all engines.
Definition FGEngine.h:104
Encapsulates the JSBSim simulation executive.
Definition FGFDMExec.h:185
static constexpr double KelvinToFahrenheit(double kelvin)
Converts from degrees Kelvin to degrees Fahrenheit.
Definition FGJSBBase.h:186
Turboprop engine model.
Definition FGTurboProp.h:93
void Calculate(void)
Calculates the thrust of the engine, and other engine functions.
double CalcFuelNeed(void)
The fuel need is calculated based on power levels and flow rate for that power level.
Main namespace for the JSBSim Flight Dynamics Model.
Definition FGFDMExec.cpp:71