48#include "FGPropeller.h"
49#include "input_output/FGXMLElement.h"
62 calorific_value_fuel(47.3e6),
65 standard_pressure(101320.73)
85 MinManifoldPressure_inHg = 6.5;
86 MaxManifoldPressure_inHg = 28.5;
87 ManifoldPressureLag=1.0;
89 volumetric_efficiency = 0.85;
94 CompressionRatio = 8.5;
97 PeakMeanPistonSpeed_fps = 100;
100 Cooling_Factor = 0.5144444;
101 StaticFriction_HP = 1.5;
108 Lookup_Combustion_Efficiency = 0;
109 Mixture_Efficiency_Correlation = 0;
123 bBoostOverride =
false;
124 bTakeoffBoost =
false;
126 BoostLossFactor = 0.0;
129 for (i=0; i<FG_MAX_BOOST_SPEEDS; i++) {
132 RatedAltitude[i] = 0.0;
134 RatedMAP[i] = 100000;
136 TakeoffMAP[i] = 100000;
138 for (i=0; i<FG_MAX_BOOST_SPEEDS-1; i++) {
139 BoostSwitchAltitude[i] = 0.0;
140 BoostSwitchPressure[i] = 0.0;
183 if (el->
FindElement(
"air-intake-impedance-factor"))
235 Design_Oil_Temp = 358;
236 Oil_Viscosity_Index = 0.25;
237 Oil_Press_Relief_Valve = 60;
238 Oil_Press_RPM_Max = MaxRPM*0.75;
239 if (el->
FindElement(
"oil-pressure-relief-valve-psi"))
251 if (name ==
"COMBUSTION") {
252 Lookup_Combustion_Efficiency =
new FGTable(PropertyManager, table_element);
253 }
else if (name ==
"MIXTURE") {
254 Mixture_Efficiency_Correlation =
new FGTable(PropertyManager, table_element);
257 log <<
"Unknown table type: " << name <<
" in piston engine definition.\n";
259 }
catch (std::string& str) {
263 delete Lookup_Combustion_Efficiency;
264 delete Mixture_Efficiency_Correlation;
265 err <<
"Error loading piston engine table:" + name +
". " + str <<
"\n";
271 volumetric_efficiency_reduced = volumetric_efficiency;
273 if(StarterRPM < 0.) StarterRPM = 2*IdleRPM;
274 if(StarterTorque < 0)
275 StarterTorque = (MaxHP)*0.4;
277 displacement_SI = Displacement * in3tom3;
278 RatedMeanPistonSpeed_fps = ( MaxRPM * Stroke) / (360);
282 double pmep = 29.92 - MaxManifoldPressure_inHg;
283 pmep *= inhgtopa * volumetric_efficiency;
284 double fmep = (FMEPDynamic * RatedMeanPistonSpeed_fps * fttom + FMEPStatic);
285 double hp_loss = ((pmep + fmep) * displacement_SI * MaxRPM)/(Cycles*22371);
286 ISFC = ( 1.1*Displacement * MaxRPM * volumetric_efficiency *(MaxManifoldPressure_inHg / 29.92) ) / (9411 * (MaxHP+hp_loss-StaticFriction_HP));
290 if ( MaxManifoldPressure_inHg > 29.9 ) {
291 MaxManifoldPressure_inHg = 29.9;
293 minMAP = MinManifoldPressure_inHg * inhgtopa;
294 maxMAP = MaxManifoldPressure_inHg * inhgtopa;
312 double Ze=PeakMeanPistonSpeed_fps/RatedMeanPistonSpeed_fps;
313 Z_airbox = (standard_pressure *Ze / maxMAP) - Ze;
316 Z_throttle=(PeakMeanPistonSpeed_fps/((IdleRPM * Stroke) / 360))*(standard_pressure/minMAP - 1) - Z_airbox;
320 if(Lookup_Combustion_Efficiency == 0) {
322 Lookup_Combustion_Efficiency =
new FGTable(12);
323 *Lookup_Combustion_Efficiency << 0.00 << 0.980;
324 *Lookup_Combustion_Efficiency << 0.90 << 0.980;
325 *Lookup_Combustion_Efficiency << 1.00 << 0.970;
326 *Lookup_Combustion_Efficiency << 1.05 << 0.950;
327 *Lookup_Combustion_Efficiency << 1.10 << 0.900;
328 *Lookup_Combustion_Efficiency << 1.15 << 0.850;
329 *Lookup_Combustion_Efficiency << 1.20 << 0.790;
330 *Lookup_Combustion_Efficiency << 1.30 << 0.700;
331 *Lookup_Combustion_Efficiency << 1.40 << 0.630;
332 *Lookup_Combustion_Efficiency << 1.50 << 0.570;
333 *Lookup_Combustion_Efficiency << 1.60 << 0.525;
334 *Lookup_Combustion_Efficiency << 2.00 << 0.345;
338 if( Mixture_Efficiency_Correlation == 0) {
339 Mixture_Efficiency_Correlation =
new FGTable(15);
340 *Mixture_Efficiency_Correlation << 0.05000 << 0.00000;
341 *Mixture_Efficiency_Correlation << 0.05137 << 0.00862;
342 *Mixture_Efficiency_Correlation << 0.05179 << 0.21552;
343 *Mixture_Efficiency_Correlation << 0.05430 << 0.48276;
344 *Mixture_Efficiency_Correlation << 0.05842 << 0.70690;
345 *Mixture_Efficiency_Correlation << 0.06312 << 0.83621;
346 *Mixture_Efficiency_Correlation << 0.06942 << 0.93103;
347 *Mixture_Efficiency_Correlation << 0.07786 << 1.00000;
348 *Mixture_Efficiency_Correlation << 0.08845 << 1.00000;
349 *Mixture_Efficiency_Correlation << 0.09270 << 0.98276;
350 *Mixture_Efficiency_Correlation << 0.10120 << 0.93103;
351 *Mixture_Efficiency_Correlation << 0.11455 << 0.72414;
352 *Mixture_Efficiency_Correlation << 0.12158 << 0.45690;
353 *Mixture_Efficiency_Correlation << 0.12435 << 0.23276;
354 *Mixture_Efficiency_Correlation << 0.12500 << 0.00000;
357 string property_name, base_property_name;
358 base_property_name = CreateIndexedPropertyName(
"propulsion/engine", EngineNumber);
359 property_name = base_property_name +
"/power-hp";
360 PropertyManager->Tie(property_name, &HP);
361 property_name = base_property_name +
"/friction-hp";
362 PropertyManager->Tie(property_name, &StaticFriction_HP);
363 property_name = base_property_name +
"/bsfc-lbs_hphr";
364 PropertyManager->Tie(property_name, &ISFC);
365 property_name = base_property_name +
"/starter-norm";
366 PropertyManager->Tie(property_name, &StarterGain);
367 property_name = base_property_name +
"/volumetric-efficiency";
368 PropertyManager->Tie(property_name, &volumetric_efficiency);
369 property_name = base_property_name +
"/map-pa";
370 PropertyManager->Tie(property_name, &MAP);
371 property_name = base_property_name +
"/map-inhg";
372 PropertyManager->Tie(property_name, &ManifoldPressure_inHg);
373 property_name = base_property_name +
"/air-intake-impedance-factor";
374 PropertyManager->Tie(property_name, &Z_airbox);
375 property_name = base_property_name +
"/ram-air-factor";
376 PropertyManager->Tie(property_name, &Ram_Air_Factor);
377 property_name = base_property_name +
"/cooling-factor";
378 PropertyManager->Tie(property_name, &Cooling_Factor);
379 property_name = base_property_name +
"/boost-speed";
380 PropertyManager->Tie(property_name, &BoostSpeed);
381 property_name = base_property_name +
"/cht-degF";
382 PropertyManager->Tie(property_name,
this, &FGPiston::getCylinderHeadTemp_degF);
383 property_name = base_property_name +
"/oil-temperature-degF";
384 PropertyManager->Tie(property_name,
this, &FGPiston::getOilTemp_degF);
385 property_name = base_property_name +
"/oil-pressure-psi";
386 PropertyManager->Tie(property_name,
this, &FGPiston::getOilPressure_psi);
387 property_name = base_property_name +
"/egt-degF";
388 PropertyManager->Tie(property_name,
this, &FGPiston::getExhaustGasTemp_degF);
389 if(BoostLossFactor > 0.0) {
390 property_name = base_property_name +
"/boostloss-factor";
391 PropertyManager->Tie(property_name, &BoostLossFactor);
392 property_name = base_property_name +
"/boostloss-hp";
393 PropertyManager->Tie(property_name, &BoostLossHP);
395 property_name = base_property_name +
"/AFR";
396 PropertyManager->Tie(property_name,
this, &FGPiston::getAFR);
399 if (TakeoffBoost > RatedBoost[0]) bTakeoffBoost =
true;
400 for (i=0; i<BoostSpeeds; ++i) {
402 if (RatedBoost[i] <= 0.0) bad =
true;
403 if (RatedPower[i] <= 0.0) bad =
true;
404 if (RatedAltitude[i] < 0.0) bad =
true;
405 if (i > 0 && RatedAltitude[i] < RatedAltitude[i - 1]) bad =
true;
413 if (i < BoostSpeeds - 1) {
414 if (BoostSwitchAltitude[i] < RatedAltitude[i]) {
417 BoostSwitchAltitude[i] = RatedAltitude[i] + 1000;
419 BoostSwitchPressure[i] = GetStdPressure100K(BoostSwitchAltitude[i]) * psftopa;
423 BoostSwitchHysteresis = 1000;
426 RatedMAP[i] = standard_pressure + RatedBoost[i] * 6895;
428 if (TakeoffBoost > RatedBoost[0]) {
430 TakeoffMAP[i] = RatedMAP[i] + ((TakeoffBoost - RatedBoost[0]) * 6895);
431 bTakeoffBoost =
true;
433 TakeoffMAP[i] = RatedMAP[i];
434 bTakeoffBoost =
false;
436 BoostMul[i] = RatedMAP[i] / (GetStdPressure100K(RatedAltitude[i]) * psftopa);
440 if (BoostSpeeds > 0) {
444 bBoostOverride = (BoostOverride == 1 ? true :
false);
445 bBoostManual = (BoostManual == 1 ? true :
false);
453 delete Lookup_Combustion_Efficiency;
454 delete Mixture_Efficiency_Correlation;
464 ManifoldPressure_inHg = in.Pressure * psftoinhg;
465 MAP = in.Pressure * psftopa;
468 OilTemp_degK = airTemperature_degK;
469 CylinderHeadTemp_degK = airTemperature_degK;
470 ExhaustGasTemp_degK = airTemperature_degK;
471 EGT_degC = ExhaustGasTemp_degK - 273;
472 Thruster->SetRPM(0.0);
474 OilPressure_psi = 0.0;
484 p_amb = in.Pressure * psftopa;
485 double p = in.TotalPressure * psftopa;
486 p_ram = (p - p_amb) * Ram_Air_Factor + p_amb;
492 RPM = Thruster->GetEngineRPM();
494 MeanPistonSpeed_fps = ( RPM * Stroke) / (360);
499 if (Boosted) doBoostControl();
513 if (IndicatedHorsePower < 0.1250) Running =
false;
520 if (Thruster->GetType() == FGThruster::ttPropeller) {
521 ((
FGPropeller*)Thruster)->SetAdvance(in.PropAdvance[EngineNumber]);
522 ((
FGPropeller*)Thruster)->SetFeather(in.PropFeather[EngineNumber]);
525 LoadThrusterInputs();
527 double power = HP * hptoftlbssec;
528 if (RPM <= 0.1) power = max(power, 0.0);
529 Thruster->Calculate(power);
538 FuelExpended = FuelFlowRate * in.TotalDeltaT;
539 if (!Starved) FuelUsedLbs += FuelExpended;
545int FGPiston::InitRunning(
void)
548 in.MixtureCmd[EngineNumber] = in.PressureRatio*1.3;
549 in.MixturePos[EngineNumber] = in.PressureRatio*1.3;
550 Thruster->SetRPM( 2.0*IdleRPM/Thruster->GetGearRatio() );
560void FGPiston::doEngineStartup(
void)
567 Magneto_Left =
false;
568 Magneto_Right =
false;
580 if ((Magnetos == 1) || (Magnetos > 2)) Magneto_Left =
true;
581 if (Magnetos > 1) Magneto_Right =
true;
584 fuel = FuelFlowRate > 0.0 ? 1 : 0;
587 if (Cranking != Starter) {
598 if (!spark || !fuel) Running =
false;
599 if (RPM < IdleRPM*0.8 ) Running =
false;
601 if ( spark && fuel) {
602 if (RPM > IdleRPM*0.8)
622void FGPiston::doBoostControl(
void)
625 if(BoostSpeed > BoostSpeeds-1) BoostSpeed = BoostSpeeds-1;
626 if(BoostSpeed < 0) BoostSpeed = 0;
628 if(BoostSpeed < BoostSpeeds - 1) {
630 if(p_amb < BoostSwitchPressure[BoostSpeed] - BoostSwitchHysteresis) {
633 }
if(BoostSpeed > 0) {
635 if(p_amb > BoostSwitchPressure[BoostSpeed - 1] + BoostSwitchHysteresis) {
657void FGPiston::doMAP(
void)
659 double Zt = (1 - in.ThrottlePos[EngineNumber])*(1 - in.ThrottlePos[EngineNumber])*Z_throttle;
660 double Ze= MeanPistonSpeed_fps > 0 ? PeakMeanPistonSpeed_fps/MeanPistonSpeed_fps : 999999;
662 double map_coefficient = Ze/(Ze+Z_airbox+Zt);
665 double dMAP=(TMAP - p_ram * map_coefficient);
666 if (ManifoldPressureLag > in.TotalDeltaT) dMAP *= in.TotalDeltaT/ManifoldPressureLag;
673 PMEP = (TMAP - p_amb) * volumetric_efficiency;
682 bool bTakeoffPos =
false;
684 if (in.ThrottlePos[EngineNumber] > 0.98) {
689 double boost_factor = (( BoostMul[BoostSpeed] - 1 ) / RatedRPM[BoostSpeed] ) * RPM + 1;
690 MAP = TMAP * boost_factor;
692 if(!bBoostOverride) {
694 if (MAP > TakeoffMAP[BoostSpeed]) MAP = TakeoffMAP[BoostSpeed];
696 if (MAP > RatedMAP[BoostSpeed]) MAP = RatedMAP[BoostSpeed];
703 if( BoostLossFactor > 0.0 )
705 double gamma = 1.414;
707 BoostLossHP = ((Nstage * TMAP * v_dot_air * gamma) / (gamma - 1)) * (pow((MAP/TMAP),((gamma-1)/(Nstage * gamma))) - 1) * BoostLossFactor / 745.7 ;
713 ManifoldPressure_inHg = MAP / inhgtopa;
730void FGPiston::doAirFlow(
void)
735 double mratio = MAP < 1. ? CompressionRatio : p_amb/MAP;
736 if (mratio > CompressionRatio) mratio = CompressionRatio;
737 double ve =((gamma-1)/gamma) +( CompressionRatio -(mratio))/(gamma*( CompressionRatio - 1));
739 rho_air = p_amb / (R_air * T_amb);
740 double swept_volume = (displacement_SI * (RPM/60)) / 2;
741 volumetric_efficiency_reduced = volumetric_efficiency *ve;
742 v_dot_air = swept_volume * volumetric_efficiency_reduced;
744 double rho_air_manifold = MAP / (R_air * T_amb);
745 m_dot_air = v_dot_air * rho_air_manifold;
758void FGPiston::doFuelFlow(
void)
760 double thi_sea_level = 1.3 * in.MixturePos[EngineNumber];
761 equivalence_ratio = thi_sea_level * 101325.0 / p_amb;
762 m_dot_fuel = (m_dot_air * equivalence_ratio) / 14.7;
763 FuelFlowRate = m_dot_fuel * 2.2046;
766 equivalence_ratio = 0.0;
770 FuelFlow_pph = FuelFlowRate * 3600;
771 FuelFlow_gph = FuelFlow_pph / FuelDensity;
785void FGPiston::doEnginePower(
void)
787 IndicatedHorsePower = -StaticFriction_HP;
791 ME = Mixture_Efficiency_Correlation->
GetValue(m_dot_fuel/m_dot_air);
794 FMEP = (-FMEPDynamic * MeanPistonSpeed_fps * fttom - FMEPStatic);
798 if ( Magnetos != 3 ) power *= SparkFailDrop;
801 IndicatedHorsePower = (FuelFlow_pph / ISFC )* ME * power - StaticFriction_HP;
805 double torque, k_torque, rpm;
807 rpm = RPM < 1.0 ? 1.0 : RPM;
809 if(RPM<StarterRPM) k_torque = 1.0-RPM/(StarterRPM);
811 torque = StarterTorque*k_torque*StarterGain;
812 IndicatedHorsePower = torque * rpm / 5252;
818 double pumping_hp = ((PMEP + FMEP) * displacement_SI * RPM)/(Cycles*22371);
820 HP = IndicatedHorsePower + pumping_hp - BoostLossHP;
823 PctPower = HP / MaxHP ;
837void FGPiston::doEGT(
void)
839 double delta_T_exhaust;
840 double enthalpy_exhaust;
841 double heat_capacity_exhaust;
844 if ((Running) && (m_dot_air > 0.0)) {
845 combustion_efficiency = Lookup_Combustion_Efficiency->
GetValue(equivalence_ratio);
846 enthalpy_exhaust = m_dot_fuel * calorific_value_fuel *
847 combustion_efficiency * 0.30;
848 heat_capacity_exhaust = (Cp_air * m_dot_air) + (Cp_fuel * m_dot_fuel);
849 delta_T_exhaust = enthalpy_exhaust / heat_capacity_exhaust;
850 ExhaustGasTemp_degK = T_amb + delta_T_exhaust;
852 combustion_efficiency = 0;
853 dEGTdt = (
RankineToKelvin(in.Temperature) - ExhaustGasTemp_degK) / 100.0;
854 delta_T_exhaust = dEGTdt * in.TotalDeltaT;
856 ExhaustGasTemp_degK += delta_T_exhaust;
870void FGPiston::doCHT(
void)
876 double arbitary_area = Displacement/360.0;
877 double CpCylinderHead = 800.0;
878 double MassCylinderHead = CylinderHeadMass * Cylinders;
880 double temperature_difference = CylinderHeadTemp_degK - T_amb;
881 double v_apparent = IAS * Cooling_Factor;
882 double v_dot_cooling_air = arbitary_area * v_apparent;
883 double m_dot_cooling_air = v_dot_cooling_air * rho_air;
884 double dqdt_from_combustion =
885 m_dot_fuel * calorific_value_fuel * combustion_efficiency * 0.33;
886 double dqdt_forced = (h2 * m_dot_cooling_air * temperature_difference) +
887 (h3 * RPM * temperature_difference / MaxRPM);
888 double dqdt_free = h1 * temperature_difference * arbitary_area;
889 double dqdt_cylinder_head = dqdt_from_combustion + dqdt_forced + dqdt_free;
891 double HeatCapacityCylinderHead = CpCylinderHead * MassCylinderHead;
893 CylinderHeadTemp_degK +=
894 (dqdt_cylinder_head / HeatCapacityCylinderHead) * in.TotalDeltaT;
907void FGPiston::doOilTemperature(
void)
909 double target_oil_temp;
910 double time_constant;
911 double efficiency = 0.667;
915 target_oil_temp = CylinderHeadTemp_degK + efficiency * (T_amb - CylinderHeadTemp_degK) ;
917 if (OilPressure_psi > 5.0 ) {
918 time_constant = 5000 / OilPressure_psi;
923 time_constant = 1000;
927 double dOilTempdt = (target_oil_temp - OilTemp_degK) / time_constant;
929 OilTemp_degK += (dOilTempdt * in.TotalDeltaT);
941void FGPiston::doOilPressure(
void)
943 OilPressure_psi = (Oil_Press_Relief_Valve / Oil_Press_RPM_Max) * RPM;
945 if (OilPressure_psi >= Oil_Press_Relief_Valve) {
946 OilPressure_psi = Oil_Press_Relief_Valve;
949 OilPressure_psi += (Design_Oil_Temp - OilTemp_degK) * Oil_Viscosity_Index * OilPressure_psi / Oil_Press_Relief_Valve;
956double FGPiston::GetStdPressure100K(
double altitude)
const
959 if (altitude > 100000.0) altitude = 100000.0;
962 const double coef[5] = { 2116.217,
969 for (
int pwr=1; pwr<=4; pwr++) alt[pwr] = alt[pwr-1]*altitude;
972 for (
int ctr=0; ctr<=4; ctr++) press += coef[ctr]*alt[ctr];
978string FGPiston::GetEngineLabels(
const string& delimiter)
980 std::ostringstream buf;
982 buf << Name <<
" Power Available (engine " << EngineNumber <<
" in ft-lbs/sec)" << delimiter
983 << Name <<
" HP (engine " << EngineNumber <<
")" << delimiter
984 << Name <<
" equivalent ratio (engine " << EngineNumber <<
")" << delimiter
985 << Name <<
" MAP (engine " << EngineNumber <<
" in inHg)" << delimiter
986 << Thruster->GetThrusterLabels(EngineNumber, delimiter);
993string FGPiston::GetEngineValues(
const string& delimiter)
995 std::ostringstream buf;
997 buf << (HP * hptoftlbssec) << delimiter << HP << delimiter
998 << equivalence_ratio << delimiter << ManifoldPressure_inHg << delimiter
999 << Thruster->GetThrusterValues(EngineNumber, delimiter);
1024void FGPiston::Debug(
int from)
1026 if (debug_lvl <= 0)
return;
1028 if (debug_lvl & 1) {
1030 FGLogging log(LogLevel::DEBUG);
1031 log <<
"\n Engine Name: " << Name <<
"\n";
1032 log <<
" MinManifoldPressure: " << MinManifoldPressure_inHg <<
"\n";
1033 log <<
" MaxManifoldPressure: " << MaxManifoldPressure_inHg <<
"\n";
1034 log <<
" MinMaP (Pa): " << minMAP <<
"\n";
1035 log <<
" MaxMaP (Pa): " << maxMAP <<
"\n";
1036 log <<
" Displacement: " << Displacement <<
"\n";
1037 log <<
" Bore: " << Bore <<
"\n";
1038 log <<
" Stroke: " << Stroke <<
"\n";
1039 log <<
" Cylinders: " << Cylinders <<
"\n";
1040 log <<
" Cylinders Head Mass: " << CylinderHeadMass <<
"\n";
1041 log <<
" Compression Ratio: " << CompressionRatio <<
"\n";
1042 log <<
" MaxHP: " << MaxHP <<
"\n";
1043 log <<
" Cycles: " << Cycles <<
"\n";
1044 log <<
" IdleRPM: " << IdleRPM <<
"\n";
1045 log <<
" MaxRPM: " << MaxRPM <<
"\n";
1046 log <<
" Throttle Constant: " << Z_throttle <<
"\n";
1047 log <<
" ISFC: " << ISFC <<
"\n";
1048 log <<
" Volumetric Efficiency: " << volumetric_efficiency <<
"\n";
1049 log <<
" PeakMeanPistonSpeed_fps: " << PeakMeanPistonSpeed_fps <<
"\n";
1050 log <<
" Intake Impedance Factor: " << Z_airbox <<
"\n";
1051 log <<
" Dynamic FMEP Factor: " << FMEPDynamic <<
"\n";
1052 log <<
" Static FMEP Factor: " << FMEPStatic <<
"\n";
1054 log <<
" Starter Motor Torque: " << StarterTorque <<
"\n";
1055 log <<
" Starter Motor RPM: " << StarterRPM <<
"\n";
1058 log <<
" Combustion Efficiency table:\n";
1059 Lookup_Combustion_Efficiency->Print();
1063 log <<
" Mixture Efficiency Correlation table:\n";
1064 Mixture_Efficiency_Correlation->Print();
1068 if (debug_lvl & 2 ) {
1069 FGLogging log(LogLevel::DEBUG);
1070 if (from == 0) log <<
"Instantiated: FGPiston\n";
1071 if (from == 1) log <<
"Destroyed: FGPiston\n";
1073 if (debug_lvl & 4 ) {
1075 if (debug_lvl & 8 ) {
1077 if (debug_lvl & 16) {
1079 if (debug_lvl & 64) {
Element * FindElement(const std::string &el="")
Searches for a specified element.
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.
double FindElementValueAsNumberConvertTo(const std::string &el, const std::string &target_units)
Searches for the named element and converts and returns the data belonging to it.
Element * FindNextElement(const std::string &el="")
Searches for the next element as specified.
double FindElementValueAsNumber(const std::string &el="")
Searches for the named element and returns the data belonging to it as a number.
Base class for all engines.
virtual void ResetToIC(void)
Resets the Engine parameters to the initial conditions.
Encapsulates the JSBSim simulation executive.
std::shared_ptr< FGPropertyManager > GetPropertyManager(void) const
Returns a pointer to the property manager object.
static constexpr double Constrain(double min, double value, double max)
Constrain a value between a minimum and a maximum value.
static constexpr double RankineToKelvin(double rankine)
Converts from degrees Rankine to degrees Kelvin.
void Calculate(void)
Calculates the thrust of the engine, and other engine functions.
void ResetToIC(void)
Resets the Engine parameters to the initial conditions.
FGPiston(FGFDMExec *exec, Element *el, int engine_number, struct Inputs &input)
Constructor.
double CalcFuelNeed(void)
The fuel need is calculated based on power levels and flow rate for that power level.
FGPropeller models a propeller given the tabular data for Ct (thrust) and Cp (power),...
double GetValue(void) const
Get the current table value.
Main namespace for the JSBSim Flight Dynamics Model.