1
0
Fork 0
flightgear/src/FDM/YASim/PistonEngine.hpp

48 lines
1.3 KiB
C++
Raw Normal View History

#ifndef _PISTONENGINE_HPP
#define _PISTONENGINE_HPP
#include "Engine.hpp"
namespace yasim {
class PistonEngine : public Engine {
public:
virtual PistonEngine* isPistonEngine() { return this; }
// Initializes an engine from known "takeoff" parameters.
PistonEngine(float power, float spd);
2001-12-06 18:13:24 +00:00
void setTurboParams(float mul, float maxMP);
2001-12-24 13:54:03 +00:00
void setDisplacement(float d);
void setCompression(float c);
bool isCranking();
2001-12-24 13:54:03 +00:00
float getMP();
float getEGT();
float getMaxPower(); // max sea-level power
virtual void calc(float pressure, float temp, float speed);
virtual float getTorque();
virtual float getFuelFlow();
private:
2001-12-24 13:54:03 +00:00
// Static configuration:
2001-12-07 20:00:59 +00:00
float _power0; // reference power setting
float _omega0; // " engine speed
float _rho0; // " manifold air density
float _f0; // "ideal" fuel flow at P0/omega0
float _mixCoeff; // fuel flow per omega at full mixture
2001-12-24 13:54:03 +00:00
float _turbo; // (or super-)charger pressure multiplier
float _maxMP; // wastegate setting
float _displacement; // piston stroke volume
float _compression; // compression ratio (>1)
2001-12-24 13:54:03 +00:00
// Runtime state/output:
float _mp;
float _torque;
float _fuelFlow;
float _egt;
};
}; // namespace yasim
#endif // _PISTONENGINE_HPP