string FGPropeller::GetThrusterValues(int id, string delimeter) { std::ostringstream buf; FGColumnVector3 vPFactor = GetPFactor(); buf << vTorque(eX) << delimeter << vPFactor(ePitch) << delimeter << vPFactor(eYaw) << delimeter << Thrust << delimeter; if (IsVPitch()) buf << Pitch << delimeter; buf << RPM; return buf.str(); }
double FGPropeller::GetPowerRequired(void) { double cPReq, J; double rho = fdmex->GetAtmosphere()->GetDensity(); double RPS = RPM / 60.0; if (RPS != 0) J = fdmex->GetAuxiliary()->GetAeroUVW(eU) / (Diameter * RPS); else J = 1000.0; // Set J to a high number if (MaxPitch == MinPitch) { // Fixed pitch prop Pitch = MinPitch; cPReq = cPower->GetValue(J); } else { // Variable pitch prop if (MaxRPM != MinRPM) { // fixed-speed prop // do normal calculation when propeller is neither feathered nor reversed if (!Feathered) { if (!Reversed) { double rpmReq = MinRPM + (MaxRPM - MinRPM) * Advance; double dRPM = rpmReq - RPM; // The pitch of a variable propeller cannot be changed when the RPMs are // too low - the oil pump does not work. if (RPM > 200) Pitch -= dRPM * deltaT; if (Pitch < MinPitch) Pitch = MinPitch; else if (Pitch > MaxPitch) Pitch = MaxPitch; } else { // Reversed propeller // when reversed calculate propeller pitch depending on throttle lever position // (beta range for taxing full reverse for braking) double PitchReq = MinPitch - ( MinPitch - ReversePitch ) * Reverse_coef; // The pitch of a variable propeller cannot be changed when the RPMs are // too low - the oil pump does not work. if (RPM > 200) Pitch += (PitchReq - Pitch) / 200; if (RPM > MaxRPM) { Pitch += (MaxRPM - RPM) / 50; if (Pitch < ReversePitch) Pitch = ReversePitch; else if (Pitch > MaxPitch) Pitch = MaxPitch; } } } else { // Feathered propeller // ToDo: Make feathered and reverse settings done via FGKinemat Pitch += (MaxPitch - Pitch) / 300; // just a guess (about 5 sec to fully feathered) } } else { // Variable Speed Prop Pitch = MinPitch + (MaxPitch - MinPitch) * Advance; } cPReq = cPower->GetValue(J, Pitch); } cPReq *= CpFactor; if (RPS > 0) { PowerRequired = cPReq*RPS*RPS*RPS*D5*rho; vTorque(eX) = -Sense*PowerRequired / (RPS*2.0*M_PI); } else { PowerRequired = 0.0; vTorque(eX) = 0.0; } return PowerRequired; }
double FGPropeller::GetPowerRequired(void) { double cPReq, J; double rho = in.Density; double Vel = in.AeroUVW(eU); double RPS = RPM / 60.0; if (RPS != 0.0) J = Vel / (Diameter * RPS); else J = Vel / Diameter; if (MaxPitch == MinPitch) { // Fixed pitch prop cPReq = cPower->GetValue(J); } else { // Variable pitch prop if (ConstantSpeed != 0) { // Constant Speed Mode // do normal calculation when propeller is neither feathered nor reversed // Note: This method of feathering and reversing was added to support the // turboprop model. It's left here for backward compatablity, but // now feathering and reversing should be done in Manual Pitch Mode. if (!Feathered) { if (!Reversed) { double rpmReq = MinRPM + (MaxRPM - MinRPM) * Advance; double dRPM = rpmReq - RPM; // The pitch of a variable propeller cannot be changed when the RPMs are // too low - the oil pump does not work. if (RPM > 200) Pitch -= dRPM * deltaT; if (Pitch < MinPitch) Pitch = MinPitch; else if (Pitch > MaxPitch) Pitch = MaxPitch; } else { // Reversed propeller // when reversed calculate propeller pitch depending on throttle lever position // (beta range for taxing full reverse for braking) double PitchReq = MinPitch - ( MinPitch - ReversePitch ) * Reverse_coef; // The pitch of a variable propeller cannot be changed when the RPMs are // too low - the oil pump does not work. if (RPM > 200) Pitch += (PitchReq - Pitch) / 200; if (RPM > MaxRPM) { Pitch += (MaxRPM - RPM) / 50; if (Pitch < ReversePitch) Pitch = ReversePitch; else if (Pitch > MaxPitch) Pitch = MaxPitch; } } } else { // Feathered propeller // ToDo: Make feathered and reverse settings done via FGKinemat Pitch += (MaxPitch - Pitch) / 300; // just a guess (about 5 sec to fully feathered) } } else { // Manual Pitch Mode, pitch is controlled externally } cPReq = cPower->GetValue(J, Pitch); } // Apply optional scaling factor to Cp (default value = 1) cPReq *= CpFactor; // Apply optional Mach effects from CP_MACH table if (CpMach) cPReq *= CpMach->GetValue(HelicalTipMach); double local_RPS = RPS < 0.01 ? 0.01 : RPS; PowerRequired = cPReq*local_RPS*local_RPS*local_RPS*D5*rho; vTorque(eX) = -Sense*PowerRequired / (local_RPS*2.0*M_PI); return PowerRequired; }