![]() |
JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++
|
Turboprop engine model. More...
#include <FGTurboProp.h>
Inheritance diagram for FGTurboProp:
Collaboration diagram for FGTurboProp:Public Types | |
| enum | phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpStall, tpSeize, tpTrim } |
Public Member Functions | |
| FGTurboProp (FGFDMExec *Executive, Element *el, int engine_number, struct Inputs &input) | |
| Constructor. | |
| ~FGTurboProp () | |
| Destructor. | |
| double | CalcFuelNeed (void) |
| The fuel need is calculated based on power levels and flow rate for that power level. | |
| void | Calculate (void) |
| Calculates the thrust of the engine, and other engine functions. | |
| double | ExpSeek (double *var, double target, double accel, double decel) |
| int | GetCondition (void) const |
| bool | GetCutoff (void) const |
| std::string | GetEngineLabels (const std::string &delimiter) |
| std::string | GetEngineValues (const std::string &delimiter) |
| double | GetEngStarting (void) const |
| double | GetEPR (void) const |
| bool | GetFire (void) const |
| bool | GetGeneratorPower (void) const |
| bool | GetIeluIntervent (void) const |
| double | GetIeluThrottle (void) const |
| int | GetIgnition (void) const |
| double | GetInlet (void) const |
| double | GetITT (void) const |
| double | GetN1 (void) const |
| double | GetN2 (void) const |
| double | GetNozzle (void) const |
| double | getOilPressure_psi () const |
| double | getOilTemp_degF (void) |
| bool | GetOvertemp (void) const |
| phaseType | GetPhase (void) const |
| double | GetPowerAvailable (void) const |
| bool | GetReversed (void) const |
| double | GetRPM (void) const |
| int | InitRunning (void) |
| double | Seek (double *var, double target, double accel, double decel) |
| void | SetCondition (bool c) |
| void | SetCutoff (bool cutoff) |
| void | SetEPR (double epr) |
| void | SetGeneratorPower (bool gp) |
| void | SetIgnition (int ignition) |
| void | SetPhase (phaseType p) |
| void | SetReverse (bool reversed) |
For an example of this model in use see the file: engine/engtm601.xml
milthrust [LBS]
idlen1 [%]
maxn1 [%]
betarangeend[%]
if ThrottleCmd < betarangeend/100.0 then engine power=idle, propeller pitch
is controled by ThrottleCmd (between MINPITCH and REVERSEPITCH).
if ThrottleCmd > betarangeend/100.0 then engine power increases up to max reverse power
reversemaxpower [%]
max engine power in reverse mode
maxpower [HP]
psfc power specific fuel consumption [pph/HP] for N1=100%
n1idle_max_delay [-] time constant for N1 change
maxstartenginetime [sec]
after this time the automatic starting cycle is interrupted when the engine
doesn't start (0=automatic starting not present)
startern1 [%]
when starting starter spin up engine to this spin
ielumaxtorque [lb.ft]
if torque>ielumaxtorque limiters decrease the throttle
(ielu = Integrated Electronic Limiter Unit)
itt_delay [-] time constant for ITT change
(ITT = Inter Turbine Temperature)
Definition at line 95 of file FGTurboProp.h.
| FGTurboProp | ( | FGFDMExec * | Executive, |
| Element * | el, | ||
| int | engine_number, | ||
| struct Inputs & | input | ||
| ) |
| Executive | pointer to executive structure |
| el | pointer to the XML element representing the turbine engine |
| engine_number | engine number |
Definition at line 63 of file FGTurboProp.cpp.
: FGEngine(exec, el, engine_number, input),
ITT_N1(NULL), EnginePowerRPM_N1(NULL), EnginePowerVC(NULL)
{
SetDefaults();
thrusterType = Thruster->GetType();
Load(exec, el);
bindmodel();
Debug(0);
}
| double CalcFuelNeed | ( | void | ) | [virtual] |
It is also turned from a rate into an actual amount (pounds) by multiplying it by the delta T and the rate.
Reimplemented from FGEngine.
Definition at line 409 of file FGTurboProp.cpp.
{
FuelFlowRate = FuelFlow_pph / 3600.0;
FuelExpended = FuelFlowRate * in.TotalDeltaT;
if (!Starved) FuelUsedLbs += FuelExpended;
return FuelExpended;
}
| void Calculate | ( | void | ) | [virtual] |
Implements FGEngine.
Definition at line 165 of file FGTurboProp.cpp.
{
RunPreFunctions();
TAT = in.TAT_c;
ThrottlePos = in.ThrottlePos[EngineNumber];
/* The thruster controls the engine RPM because it encapsulates the gear ratio and other transmission variables */
RPM = Thruster->GetEngineRPM();
if (thrusterType == FGThruster::ttPropeller) {
((FGPropeller*)Thruster)->SetAdvance(in.PropAdvance[EngineNumber]);
((FGPropeller*)Thruster)->SetFeather(in.PropFeather[EngineNumber]);
((FGPropeller*)Thruster)->SetReverse(Reversed);
if (Reversed) {
((FGPropeller*)Thruster)->SetReverseCoef(ThrottlePos);
} else {
((FGPropeller*)Thruster)->SetReverseCoef(0.0);
}
if (Reversed) {
if (ThrottlePos < BetaRangeThrottleEnd) {
ThrottlePos = 0.0; // idle when in Beta-range
} else {
// when reversed:
ThrottlePos = (ThrottlePos-BetaRangeThrottleEnd)/(1-BetaRangeThrottleEnd) * ReverseMaxPower;
}
}
}
// When trimming is finished check if user wants engine OFF or RUNNING
if ((phase == tpTrim) && (in.TotalDeltaT > 0)) {
if (Running && !Starved) {
phase = tpRun;
N2 = IdleN2;
N1 = IdleN1;
OilTemp_degK = 366.0;
Cutoff = false;
} else {
phase = tpOff;
Cutoff = true;
Eng_ITT_degC = TAT;
Eng_Temperature = TAT;
OilTemp_degK = TAT+273.15;
}
}
if (!Running && Starter) {
if (phase == tpOff) {
phase = tpSpinUp;
if (StartTime < 0) StartTime=0;
}
}
if (!Running && !Cutoff && (N1 > 15.0)) {
phase = tpStart;
StartTime = -1;
}
if (Cutoff && (phase != tpSpinUp)) phase = tpOff;
if (in.TotalDeltaT == 0) phase = tpTrim;
if (Starved) phase = tpOff;
if (Condition >= 10) {
phase = tpOff;
StartTime=-1;
}
// limiter intervention wanted?
if (Ielu_max_torque > 0.0) {
double torque = 0.0;
if (thrusterType == FGThruster::ttPropeller) {
torque = ((FGPropeller*)(Thruster))->GetTorque();
} else if (thrusterType == FGThruster::ttRotor) {
torque = ((FGRotor*)(Thruster))->GetTorque();
}
if (Condition < 1) {
if ( abs(torque) > Ielu_max_torque && ThrottlePos >= OldThrottle ) {
ThrottlePos = OldThrottle - 0.1 * in.TotalDeltaT; //IELU down
Ielu_intervent = true;
} else if ( Ielu_intervent && ThrottlePos >= OldThrottle) {
ThrottlePos = OldThrottle + 0.05 * in.TotalDeltaT; //IELU up
Ielu_intervent = true;
} else {
Ielu_intervent = false;
}
} else {
Ielu_intervent = false;
}
OldThrottle = ThrottlePos;
}
switch (phase) {
case tpOff: HP = Off(); break;
case tpRun: HP = Run(); break;
case tpSpinUp: HP = SpinUp(); break;
case tpStart: HP = Start(); break;
default: HP = 0;
}
LoadThrusterInputs();
Thruster->Calculate(HP * hptoftlbssec);
RunPostFunctions();
}