#include "FGEngine.h"
#include "math/FGTable.h"
-#include "input_output/FGXMLElement.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_PISTON "$Id$";
+#define ID_PISTON "$Id: FGPiston.h,v 1.26 2011/03/10 01:35:25 dpculp Exp $";
#define FG_MAX_BOOST_SPEEDS 3
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@code
<piston_engine name="{string}">
- <minmp unit="{INHG | PA | ATM}"> {number} </minmp> <!-- Depricated -->
+ <minmp unit="{INHG | PA | ATM}"> {number} </minmp>
<maxmp unit="{INHG | PA | ATM}"> {number} </maxmp>
<displacement unit="{IN3 | LTR | CC}"> {number} </displacement>
<bore unit="{IN | M}"> {number} </bore>
<stroke unit="{IN | M}"> {number} </stroke>
<cylinders> {number} </cylinders>
+ <cylinder-head-mass unit="{KG | LBS}"> {number} </cylinder-head-mass>
<compression-ratio> {number} </compression-ratio>
<sparkfaildrop> {number} </sparkfaildrop>
<maxhp unit="{HP | WATTS}"> {number} </maxhp>
<minthrottle> {number} </minthrottle>
<bsfc unit="{LBS/HP*HR | "KG/KW*HR"}"> {number} </bsfc>
<volumetric-efficiency> {number} </volumetric-efficiency>
+ <dynamic-fmep unit="{INHG | PA | ATM}"> {number} </dynamic-fmep>
+ <static-fmep unit="{INHG | PA | ATM}"> {number} </static-fmep>
<numboostspeeds> {number} </numboostspeeds>
<boostoverride> {0 | 1} </boostoverride>
<boostmanual> {0 | 1} </boostmanual>
<takeoffboost unit="{INHG | PA | ATM}"> {number} </takeoffboost>
<air-intake-impedance-factor> {number} </air-intake-impedance-factor>
<ram-air-factor> {number} </ram-air-factor>
+ <cooling-factor> {number} </cooling-factor>
</piston_engine>
@endcode
config file (and is above RATEDBOOST1), then the throttle position is
interpreted as:
- - 0 to 0.95 : idle manifold pressure to rated boost (where attainable)
- - 0.96, 0.97, 0.98 : rated boost (where attainable).
+ - 0 to 0.98 : idle manifold pressure to rated boost (where attainable)
- 0.99, 1.0 : takeoff boost (where attainable).
A typical takeoff boost for an earlyish Merlin was about 12psi, compared
@author Dave Luff (engine operational code)
@author David Megginson (initial porting and additional code)
@author Ron Jensen (additional engine code)
- @version $Id$
+ @version $Id: FGPiston.h,v 1.26 2011/03/10 01:35:25 dpculp Exp $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/// Destructor
~FGPiston();
- string GetEngineLabels(string delimeter);
- string GetEngineValues(string delimeter);
+ std::string GetEngineLabels(const std::string& delimiter);
+ std::string GetEngineValues(const std::string& delimiter);
- double Calculate(void);
- double GetPowerAvailable(void) {return PowerAvailable;}
+ void Calculate(void);
+ double GetPowerAvailable(void) const {return (HP * hptoftlbssec);}
double CalcFuelNeed(void);
void ResetToIC(void);
void SetMagnetos(int magnetos) {Magnetos = magnetos;}
- double GetEGT(void) { return EGT_degC; }
- int GetMagnetos(void) {return Magnetos;}
+ double GetEGT(void) const { return EGT_degC; }
+ int GetMagnetos(void) const {return Magnetos;}
- double getExhaustGasTemp_degF(void) {return KelvinToFahrenheit(ExhaustGasTemp_degK);}
+ double getExhaustGasTemp_degF(void) const {return KelvinToFahrenheit(ExhaustGasTemp_degK);}
double getManifoldPressure_inHg(void) const {return ManifoldPressure_inHg;}
- double getCylinderHeadTemp_degF(void) {return KelvinToFahrenheit(CylinderHeadTemp_degK);}
+ double getCylinderHeadTemp_degF(void) const {return KelvinToFahrenheit(CylinderHeadTemp_degK);}
double getOilPressure_psi(void) const {return OilPressure_psi;}
- double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
- double getRPM(void) {return RPM;}
+ double getOilTemp_degF (void) const {return KelvinToFahrenheit(OilTemp_degK);}
+ double getRPM(void) const {return RPM;}
protected:
- double ThrottleAngle;
private:
int crank_counter;
double IndicatedHorsePower;
double PMEP;
double FMEP;
- double SpeedSlope;
- double SpeedIntercept;
- double AltitudeSlope;
- double PowerAvailable;
+ double FMEPDynamic;
+ double FMEPStatic;
// timestep
double dt;
double Bore; // inches
double Stroke; // inches
double Cylinders; // number
+ double CylinderHeadMass; // kilograms
double CompressionRatio; // number
double Z_airbox; // number representing intake impediance before the throttle
double Z_throttle; // number representing slope of throttle impediance
double T_amb; // degrees Kelvin
double RPM; // revolutions per minute
double IAS; // knots
+ double Cooling_Factor; // normal
bool Magneto_Left;
bool Magneto_Right;
int Magnetos;