2001-12-01 06:22:24 +00:00
|
|
|
#ifndef _JET_HPP
|
|
|
|
#define _JET_HPP
|
|
|
|
|
|
|
|
#include "Thruster.hpp"
|
|
|
|
|
|
|
|
namespace yasim {
|
|
|
|
|
|
|
|
class Jet : public Thruster {
|
|
|
|
public:
|
|
|
|
Jet();
|
|
|
|
|
2001-12-06 18:13:24 +00:00
|
|
|
virtual Jet* getJet() { return this; }
|
2001-12-24 13:54:03 +00:00
|
|
|
|
|
|
|
void setMaxThrust(float thrust, float afterburner=0);
|
|
|
|
void setVMax(float spd);
|
|
|
|
void setTSFC(float tsfc);
|
|
|
|
void setRPMs(float idleN1, float maxN1, float idleN2, float maxN2);
|
|
|
|
void setEGT(float takeoffEGT);
|
|
|
|
void setEPR(float takeoffEPR);
|
|
|
|
void setVectorAngle(float angle);
|
2001-12-01 06:22:24 +00:00
|
|
|
|
2001-12-24 13:54:03 +00:00
|
|
|
// The time it takes the engine to reach 90% thrust from idle
|
|
|
|
void setSpooling(float time);
|
|
|
|
|
|
|
|
// Sets the reheat control
|
2001-12-01 06:22:24 +00:00
|
|
|
void setReheat(float reheat);
|
|
|
|
|
2001-12-24 13:54:03 +00:00
|
|
|
// Sets the thrust vector control (0-1)
|
|
|
|
void setRotation(float rot);
|
|
|
|
|
2004-01-30 23:21:26 +00:00
|
|
|
// Thrust reverser control.
|
|
|
|
void setReverse(bool reverse) { _reverseThrust = reverse; }
|
|
|
|
|
|
|
|
// Thrust reverser effectiveness.
|
|
|
|
void setReverseThrust(float eff) { _reverseEff = eff; }
|
|
|
|
|
2001-12-24 13:54:03 +00:00
|
|
|
float getN1();
|
|
|
|
float getN2();
|
|
|
|
float getEPR();
|
|
|
|
float getEGT();
|
|
|
|
|
2004-11-23 21:35:30 +00:00
|
|
|
// Normalized "performance" number. Used for fuzzy numbers in FGFDM
|
|
|
|
float getPerfNorm() { return (_n1 - _n1Min) / (_n1Max - _n1Min); }
|
|
|
|
|
2001-12-24 13:54:03 +00:00
|
|
|
// From Thruster:
|
2002-02-20 04:27:22 +00:00
|
|
|
virtual bool isRunning();
|
|
|
|
virtual bool isCranking();
|
2001-12-01 06:22:24 +00:00
|
|
|
virtual void getThrust(float* out);
|
|
|
|
virtual void getTorque(float* out);
|
|
|
|
virtual void getGyro(float* out);
|
|
|
|
virtual float getFuelFlow();
|
|
|
|
virtual void integrate(float dt);
|
2001-12-06 18:13:24 +00:00
|
|
|
virtual void stabilize();
|
2001-12-01 06:22:24 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
float _reheat;
|
2004-01-30 23:21:26 +00:00
|
|
|
bool _reverseThrust;
|
2001-12-24 13:54:03 +00:00
|
|
|
|
|
|
|
float _maxThrust; // Max dry thrust at sea level
|
|
|
|
float _abFactor; // Afterburner thrust multiplier
|
|
|
|
|
|
|
|
float _maxRot;
|
|
|
|
float _rotControl;
|
|
|
|
|
|
|
|
float _decay; // time constant for the exponential integration
|
|
|
|
float _vMax; // speed at which thrust is zero
|
|
|
|
float _epr0; // EPR at takeoff thrust
|
|
|
|
float _tsfc; // TSFC ((lb/hr)/lb) at takeoff thrust and zero airspeed
|
|
|
|
float _egt0; // EGT at takeoff thrust
|
|
|
|
float _n1Min; // N1 at ground idle
|
|
|
|
float _n1Max; // N1 at takeoff thrust
|
|
|
|
float _n2Min; // N2 at ground idle
|
|
|
|
float _n2Max; // N2 at takeoff thrust
|
2004-01-30 23:21:26 +00:00
|
|
|
float _reverseEff; // Thrust reverser effectiveness (fraction)
|
2001-12-24 13:54:03 +00:00
|
|
|
|
2002-02-20 04:27:22 +00:00
|
|
|
bool _running; // Is the engine running?
|
|
|
|
bool _cranking; // Is the engine cranking?
|
2001-12-24 13:54:03 +00:00
|
|
|
float _thrust; // Current thrust
|
|
|
|
float _epr; // Current EPR
|
|
|
|
float _n1; // Current UNCORRECTED N1 (percent)
|
|
|
|
float _n2; // Current UNCORRECTED N2 (percent)
|
|
|
|
float _fuelFlow; // Current UNCORRECTED fuel flow (kg/s)
|
|
|
|
float _egt; // Current UNCORRECTED EGT (kelvin)
|
|
|
|
|
|
|
|
float _tempCorrect; // Intake temp / std temp (273 K)
|
|
|
|
float _pressureCorrect; // Intake pressure / std pressure
|
2001-12-01 06:22:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}; // namespace yasim
|
|
|
|
#endif // _JET_HPP
|