Augmented = AugMethod = Injected = 0;
BypassRatio = BleedDemand = 0.0;
IdleThrustLookup = MilThrustLookup = MaxThrustLookup = InjectionLookup = 0;
+ N1_spinup = 1.0; N2_spinup = 3.0;
ResetToIC();
double FGTurbine::Calculate(void)
{
+ double thrust;
+
TAT = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556;
dt = State->Getdt() * Propulsion->GetRate();
ThrottlePos = FCS->GetThrottlePos(EngineNumber);
if (Seized) phase = tpSeize;
switch (phase) {
- case tpOff: Thrust = Off(); break;
- case tpRun: Thrust = Run(); break;
- case tpSpinUp: Thrust = SpinUp(); break;
- case tpStart: Thrust = Start(); break;
- case tpStall: Thrust = Stall(); break;
- case tpSeize: Thrust = Seize(); break;
- case tpTrim: Thrust = Trim(); break;
- default: Thrust = Off();
+ case tpOff: thrust = Off(); break;
+ case tpRun: thrust = Run(); break;
+ case tpSpinUp: thrust = SpinUp(); break;
+ case tpStart: thrust = Start(); break;
+ case tpStall: thrust = Stall(); break;
+ case tpSeize: thrust = Seize(); break;
+ case tpTrim: thrust = Trim(); break;
+ default: thrust = Off();
}
- Thrust = Thruster->Calculate(Thrust); // allow thruster to modify thrust (i.e. reversing)
+ thrust = Thruster->Calculate(thrust); // allow thruster to modify thrust (i.e. reversing)
- return Thrust;
+ return thrust;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
Running = false;
FuelFlow_pph = 0.0;
- N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
- N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
+ N2 = Seek(&N2, 25.18, N2_spinup, N2/2.0);
+ N1 = Seek(&N1, 5.21, N1_spinup, N1/2.0);
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
OilPressure_psi = N2 * 0.62;
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
bool FGTurbine::Load(FGFDMExec* exec, Element *el)
{
- char property_prefix[80];
- snprintf(property_prefix, 80, "propulsion/engine[%u]/", EngineNumber);
+ string property_name, property_prefix;
+ property_prefix = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
if (el->FindElement("milthrust"))
MilThrust = el->FindElementValueAsNumberConvertTo("milthrust","LBS");
MaxN1 = el->FindElementValueAsNumber("maxn1");
if (el->FindElement("maxn2"))
MaxN2 = el->FindElementValueAsNumber("maxn2");
+ if (el->FindElement("n1spinup"))
+ N1_spinup = el->FindElementValueAsNumber("n1spinup");
+ if (el->FindElement("n2spinup"))
+ N2_spinup = el->FindElementValueAsNumber("n2spinup");
if (el->FindElement("augmented"))
Augmented = (int)el->FindElementValueAsNumber("augmented");
if (el->FindElement("augmethod"))
void FGTurbine::bindmodel()
{
- char property_name[80];
-
- snprintf(property_name, 80, "propulsion/engine[%u]/n1", EngineNumber);
- PropertyManager->Tie( property_name, &N1);
- snprintf(property_name, 80, "propulsion/engine[%u]/n2", EngineNumber);
- PropertyManager->Tie( property_name, &N2);
- snprintf(property_name, 80, "propulsion/engine[%u]/injection_cmd", EngineNumber);
- PropertyManager->Tie( property_name, (FGTurbine*)this,
+ string property_name, base_property_name;
+ base_property_name = CreateIndexedPropertyName("propulsion/engine", EngineNumber);
+ property_name = base_property_name + "/n1";
+ PropertyManager->Tie( property_name.c_str(), &N1);
+ property_name = base_property_name + "/n2";
+ PropertyManager->Tie( property_name.c_str(), &N2);
+ property_name = base_property_name + "/injection_cmd";
+ PropertyManager->Tie( property_name.c_str(), (FGTurbine*)this,
&FGTurbine::GetInjection, &FGTurbine::SetInjection);
}