default: Thrust = Off();
}
- return Thruster->Calculate(Thrust);
+ // The thruster can modify the thrust, eg. thrust reverser
+ return Thrust = Thruster->Calculate(Thrust);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OilTemp_degK = Seek(&OilTemp_degK, 366.0, 1.2, 0.1);
if (!Augmentation) {
- double correctedTSFC = TSFC + TSFC - (N2norm * TSFC);
+ double correctedTSFC = TSFC * (0.84 + (1-N2norm)*(1-N2norm));
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * correctedTSFC, 1000.0, 100000);
if (FuelFlow_pph < IdleFF) FuelFlow_pph = IdleFF;
NozzlePosition = Seek(&NozzlePosition, 1.0 - N2norm, 0.8, 0.8);
}
}
- if ((Injected == 1) && Injection)
- thrust = thrust * ThrustTables[3]->TotalValue();
+ if ((Injected == 1) && Injection) {
+ thrust = thrust * ThrustTables[3]->TotalValue();
+ }
ConsumeFuel();
if (Cutoff) phase = tpOff;
EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
OilPressure_psi = N2 * 0.62;
+ ConsumeFuel();
}
else {
phase = tpRun;
FuelFlow_pph = IdleFF;
N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
+ ConsumeFuel();
if (ThrottlePos < 0.01) phase = tpRun; // clear the stall with throttle
return 0.0;
N2 = 0.0;
N1 = Seek(&N1, qbar/20.0, 0, N1/15.0);
FuelFlow_pph = IdleFF;
+ ConsumeFuel();
OilPressure_psi = 0.0;
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0, 0.2);
Running = false;
double FGTurbine::Trim(void)
{
double idlethrust, milthrust, thrust, tdiff;
- idlethrust = MilThrust * ThrustTables[0]->TotalValue();
+ idlethrust = MilThrust * ThrustTables[0]->TotalValue();;
milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
- thrust = (idlethrust + (milthrust * ThrottlePos * ThrottlePos)) * (1.0 - BleedDemand);
+ thrust = (idlethrust + (milthrust * ThrottlePos * ThrottlePos))
+ * (1.0 - BleedDemand);
if (AugmentCmd > 0.0) {
tdiff = (MaxThrust * ThrustTables[2]->TotalValue()) - thrust;
thrust += (tdiff * AugmentCmd);
- }
+ }
+
return thrust;
}
ThrustTables.back()->Load(Eng_cfg);
}
else cerr << "Unhandled token in Engine config file: " << token << endl;
+ if (token == "EOF") return false;
}
// Pre-calculations and initializations
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-string FGTurbine::GetEngineLabels(void)
+string FGTurbine::GetEngineLabels(string delimeter)
{
std::ostringstream buf;
- buf << Name << "_N1[" << EngineNumber << "], "
- << Name << "_N2[" << EngineNumber << "], "
- << Thruster->GetThrusterLabels(EngineNumber);
+ buf << Name << "_N1[" << EngineNumber << "]" << delimeter
+ << Name << "_N2[" << EngineNumber << "]" << delimeter
+ << Thruster->GetThrusterLabels(EngineNumber, delimeter);
return buf.str();
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-string FGTurbine::GetEngineValues(void)
+string FGTurbine::GetEngineValues(string delimeter)
{
std::ostringstream buf;
- buf << N1 << ", "
- << N2 << ", "
- << Thruster->GetThrusterValues(EngineNumber);
+ buf << N1 << delimeter
+ << N2 << delimeter
+ << Thruster->GetThrusterValues(EngineNumber, delimeter);
return buf.str();
}
{
char property_name[80];
- snprintf(property_name, 80, "propulsion/n1[%u]", EngineNumber);
+ snprintf(property_name, 80, "propulsion/engine[%u]/n1", EngineNumber);
PropertyManager->Tie( property_name, &N1);
- snprintf(property_name, 80, "propulsion/n2[%u]", EngineNumber);
+ snprintf(property_name, 80, "propulsion/engine[%u]/n2", EngineNumber);
PropertyManager->Tie( property_name, &N2);
+ snprintf(property_name, 80, "propulsion/engine[%u]/fuel-flow", EngineNumber);
+ PropertyManager->Tie( property_name, &FuelFlow_pph);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
char property_name[80];
- snprintf(property_name, 80, "propulsion/n1[%u]", EngineNumber);
+ snprintf(property_name, 80, "propulsion/engine[%u]/n1", EngineNumber);
PropertyManager->Untie(property_name);
- snprintf(property_name, 80, "propulsion/n2[%u]", EngineNumber);
+ snprintf(property_name, 80, "propulsion/engine[%u]/n2", EngineNumber);
PropertyManager->Untie(property_name);
+ snprintf(property_name, 80, "propulsion/engine[%u]/fuel-flow", EngineNumber);
+ PropertyManager->Untie( property_name);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%