convert["LBS/FT/SEC"]["N/M/SEC"] = 14.5939;
convert["N/M/SEC"]["LBS/FT/SEC"] = 1.0/convert["LBS/FT/SEC"]["N/M/SEC"];
// Damping force (Square Law)
- convert["LBS/FT/SEC2"]["N/M/SEC2"] = 14.5939;
- convert["N/M/SEC2"]["LBS/FT/SEC2"] = 1.0/convert["LBS/FT/SEC2"]["N/M/SEC2"];
+ convert["LBS/FT2/SEC2"]["N/M2/SEC2"] = 47.880259;
+ convert["N/M2/SEC2"]["LBS/FT2/SEC2"] = 1.0/convert["LBS/FT2/SEC2"]["N/M2/SEC2"];
// Power
convert["WATTS"]["HP"] = 0.001341022;
convert["HP"]["WATTS"] = 1.0/convert["WATTS"]["HP"];
convert["LBS/FT/SEC"]["LBS/FT/SEC"] = 1.00;
convert["N/M/SEC"]["N/M/SEC"] = 1.00;
// Damping force (Square law)
- convert["LBS/FT/SEC2"]["LBS/FT/SEC2"] = 1.00;
- convert["N/M/SEC2"]["N/M/SEC2"] = 1.00;
+ convert["LBS/FT2/SEC2"]["LBS/FT2/SEC2"] = 1.00;
+ convert["N/M2/SEC2"]["N/M2/SEC2"] = 1.00;
// Power
convert["HP"]["HP"] = 1.00;
convert["WATTS"]["WATTS"] = 1.00;
if (el->FindElement("damping_coeff")) {
dampCoeff = el->FindElement("damping_coeff");
if (dampCoeff->GetAttributeValue("type") == "SQUARE") {
- eDampType = dtSquare; // default is dtLinear
- bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC2");
+ eDampType = dtSquare;
+ bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT2/SEC2");
} else {
bDamp = el->FindElementValueAsNumberConvertTo("damping_coeff", "LBS/FT/SEC");
}
if (el->FindElement("damping_coeff_rebound")) {
dampCoeffRebound = el->FindElement("damping_coeff_rebound");
if (dampCoeffRebound->GetAttributeValue("type") == "SQUARE") {
- eDampTypeRebound = dtSquare; // default is dtLinear
- bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC2");
+ eDampTypeRebound = dtSquare;
+ bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT2/SEC2");
} else {
bDampRebound = el->FindElementValueAsNumberConvertTo("damping_coeff_rebound", "LBS/FT/SEC");
}
RatedAltitude[2] = el->FindElementValueAsNumberConvertTo("ratedaltitude3", "FT");
}
char property_name[80];
- snprintf(property_name, 80, "/engines/engine[%d]/power_hp", engine_number);
+ snprintf(property_name, 80, "propulsion/engine[%d]/power_hp", EngineNumber);
PropertyManager->Tie(property_name, &HP);
- snprintf(property_name, 80, "/engines/engine[%d]/bsfc", engine_number);
+ snprintf(property_name, 80, "propulsion/engine[%d]/bsfc", EngineNumber);
PropertyManager->Tie(property_name, &BSFC);
minMAP = MinManifoldPressure_inHg * inhgtopa; // inHg to Pa
FGPiston::~FGPiston()
{
char property_name[80];
- snprintf(property_name, 80, "/engines/engine[%d]/power_hp", EngineNumber);
- PropertyManager->Untie(property_name);
- snprintf(property_name, 80, "/engines/engine[%d]/bsfc", EngineNumber);
- PropertyManager->Untie(property_name);
delete Lookup_Combustion_Efficiency;
delete Power_Mixture_Correlation;
void FGPiston::doMAP(void)
{
- suction_loss = pow( ThrottlePos*0.98, RPM/MaxRPM );
+ suction_loss = RPM > 0.0 ? ThrottlePos * MaxRPM / RPM : 1.0;
+ if (suction_loss > 1.0) suction_loss = 1.0;
MAP = p_amb * suction_loss;
if(Boosted) {
}
}
// Boost the manifold pressure.
- MAP += MAP * BoostMul[BoostSpeed] * RPM/MaxRPM;
+ MAP += MAP * BoostMul[BoostSpeed] * suction_loss * RPM/RatedRPM[BoostSpeed];
// Now clip the manifold pressure to BCV or Wastegate setting.
if(bTakeoffPos) {
if(MAP > TakeoffMAP[BoostSpeed]) {
rho_air = p_amb / (R_air * T_amb);
double displacement_SI = Displacement * in3tom3;
double swept_volume = (displacement_SI * (RPM/60)) / 2;
- double v_dot_air = swept_volume * volumetric_efficiency;
+ double v_dot_air = swept_volume * volumetric_efficiency * suction_loss;
double rho_air_manifold = MAP / (R_air * T_amb);
m_dot_air = v_dot_air * rho_air_manifold;
double T_amb_sea_lev_degF = KelvinToFahrenheit(288);
// FIXME: this needs to be generalized
- double ME, Adjusted_BSFC; // Convienience term for use in the calculations
+ double ME, friction, percent_RPM; // Convienience term for use in the calculations
ME = Mixture_Efficiency_Correlation->GetValue(m_dot_fuel/m_dot_air);
- Adjusted_BSFC = (1/ThrottlePos) * BSFC;
- Percentage_Power = 1.000;
+
+ percent_RPM = RPM/MaxRPM;
+ friction = 1 - (percent_RPM * percent_RPM * percent_RPM * percent_RPM/10);
+ if (friction < 0 ) friction = 0;
+ Percentage_Power = friction;
if ( Magnetos != 3 ) Percentage_Power *= SparkFailDrop;
- HP = (FuelFlow_gph * 6.0 / Adjusted_BSFC )* ME * suction_loss * Percentage_Power;
+
+ HP = (FuelFlow_gph * 6.0 / BSFC )* ME * suction_loss * Percentage_Power;
} else {