1
0
Fork 0

Sync w/ JSBSim:

* Propeller required power now accounts for the engine tilt
* Fixed a division by zero in FGLGear::GetSteerNorm for non steerable gears
* Fixed a bug reported by Ron H. and Rebecca N. Palmer on the FG mailing list: the 'length' parameter passed to gethostbyaddr in FGFdmSocket was erroneous.
This commit is contained in:
Bertrand Coconnier 2017-03-11 13:24:51 +01:00
parent dab68505bb
commit 579f215005
11 changed files with 112 additions and 79 deletions

View file

@ -72,7 +72,7 @@ using namespace std;
namespace JSBSim {
IDENT(IdSrc,"$Id: FGFDMExec.cpp,v 1.193 2017/02/25 14:23:18 bcoconni Exp $");
IDENT(IdSrc,"$Id: FGFDMExec.cpp,v 1.194 2017/03/03 23:00:39 bcoconni Exp $");
IDENT(IdHdr,ID_FDMEXEC);
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -428,7 +428,7 @@ void FGFDMExec::LoadInputs(unsigned int idx)
Propulsion->in.PropAdvance = FCS->GetPropAdvance();
Propulsion->in.PropFeather = FCS->GetPropFeather();
Propulsion->in.H_agl = Propagate->GetDistanceAGL();
Propulsion->in.PQR = Propagate->GetPQR();
Propulsion->in.PQRi = Propagate->GetPQRi();
break;
case eAerodynamics:

View file

@ -57,7 +57,7 @@ using std::string;
namespace JSBSim {
IDENT(IdSrc,"$Id: FGfdmSocket.cpp,v 1.31 2015/03/22 12:19:31 bcoconni Exp $");
IDENT(IdSrc,"$Id: FGfdmSocket.cpp,v 1.32 2017/03/11 12:12:12 bcoconni Exp $");
IDENT(IdHdr,ID_FDMSOCKET);
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -93,9 +93,9 @@ FGfdmSocket::FGfdmSocket(const string& address, int port, int protocol)
cout << "Could not get host net address by name..." << endl;
}
} else {
unsigned int ip;
unsigned long ip;
ip = inet_addr(address.c_str());
if ((host = gethostbyaddr((char*)&ip, address.size(), PF_INET)) == NULL) {
if ((host = gethostbyaddr((char*)&ip, sizeof(ip), PF_INET)) == NULL) {
cout << "Could not get host net address by number..." << endl;
}
}

View file

@ -50,7 +50,7 @@ INCLUDES
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_FCS "$Id: FGFCS.h,v 1.54 2017/02/25 14:23:18 bcoconni Exp $"
#define ID_FCS "$Id: FGFCS.h,v 1.55 2017/03/03 23:03:20 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@ -168,7 +168,7 @@ CLASS DOCUMENTATION
@property gear/tailhook-pos-norm
@author Jon S. Berndt
@version $Revision: 1.54 $
@version $Revision: 1.55 $
@see FGActuator
@see FGDeadBand
@see FGFCSFunction
@ -430,7 +430,7 @@ public:
/** Sets the propeller pitch command for the specified engine
@param engine engine ID number
@param cmd mixture command in percent (0.0 - 1.0)*/
@param cmd pitch command in percent (0.0 - 1.0)*/
void SetPropAdvanceCmd(int engine, double cmd);
/** Sets the propeller feather command for the specified engine

View file

@ -49,7 +49,7 @@ INCLUDES
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_LGEAR "$Id: FGLGear.h,v 1.65 2016/05/16 18:19:57 bcoconni Exp $"
#define ID_LGEAR "$Id: FGLGear.h,v 1.66 2017/03/11 12:07:22 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@ -178,7 +178,7 @@ CLASS DOCUMENTATION
</contact>
@endcode
@author Jon S. Berndt
@version $Id: FGLGear.h,v 1.65 2016/05/16 18:19:57 bcoconni Exp $
@version $Id: FGLGear.h,v 1.66 2017/03/11 12:07:22 bcoconni Exp $
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
NASA-Ames", NASA CR-2497, January 1975
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
@ -273,7 +273,9 @@ public:
/** Get the console touchdown reporting feature
@return true if reporting is turned on */
bool GetReport(void) const { return ReportEnable; }
double GetSteerNorm(void) const { return radtodeg/maxSteerAngle*SteerAngle; }
double GetSteerNorm(void) const {
return maxSteerAngle == 0.0 ? 0.0 : radtodeg/maxSteerAngle*SteerAngle;
}
void SetSteerCmd(double cmd) { SetSteerAngleDeg(cmd * maxSteerAngle); }
double GetstaticFCoeff(void) const { return staticFCoeff; }

View file

@ -53,7 +53,7 @@ using namespace std;
namespace JSBSim {
IDENT(IdSrc,"$Id: FGEngine.cpp,v 1.67 2015/09/27 09:54:21 bcoconni Exp $");
IDENT(IdSrc,"$Id: FGEngine.cpp,v 1.68 2017/03/03 23:00:39 bcoconni Exp $");
IDENT(IdHdr,ID_ENGINE);
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -158,7 +158,7 @@ void FGEngine::LoadThrusterInputs()
{
Thruster->in.TotalDeltaT = in.TotalDeltaT;
Thruster->in.H_agl = in.H_agl;
Thruster->in.PQR = in.PQR;
Thruster->in.PQRi = in.PQRi;
Thruster->in.AeroPQR = in.AeroPQR;
Thruster->in.AeroUVW = in.AeroUVW;
Thruster->in.Density = in.Density;

View file

@ -53,7 +53,7 @@ INCLUDES
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_ENGINE "$Id: FGEngine.h,v 1.47 2015/09/27 10:16:57 bcoconni Exp $"
#define ID_ENGINE "$Id: FGEngine.h,v 1.48 2017/03/03 23:00:39 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@ -111,7 +111,7 @@ CLASS DOCUMENTATION
documentation for engine and thruster classes.
</pre>
@author Jon S. Berndt
@version $Id: FGEngine.h,v 1.47 2015/09/27 10:16:57 bcoconni Exp $
@version $Id: FGEngine.h,v 1.48 2017/03/03 23:00:39 bcoconni Exp $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -138,7 +138,7 @@ public:
double H_agl;
FGColumnVector3 AeroUVW;
FGColumnVector3 AeroPQR;
FGColumnVector3 PQR;
FGColumnVector3 PQRi;
std::vector <double> ThrottleCmd;
std::vector <double> MixtureCmd;
std::vector <double> ThrottlePos;

View file

@ -45,7 +45,7 @@ using namespace std;
namespace JSBSim {
IDENT(IdSrc,"$Id: FGPropeller.cpp,v 1.58 2016/06/04 11:06:51 bcoconni Exp $");
IDENT(IdSrc,"$Id: FGPropeller.cpp,v 1.60 2017/03/03 23:00:39 bcoconni Exp $");
IDENT(IdHdr,ID_PROPELLER);
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -80,8 +80,8 @@ FGPropeller::FGPropeller(FGFDMExec* exec, Element* prop_element, int num)
Ixx = max(prop_element->FindElementValueAsNumberConvertTo("ixx", "SLUG*FT2"), 0.001);
Sense_multiplier = 1.0;
if (prop_element->HasAttribute("version"))
if (prop_element->GetAttributeValueAsNumber("version") > 1.0)
if (prop_element->HasAttribute("version")
&& prop_element->GetAttributeValueAsNumber("version") > 1.0)
Sense_multiplier = -1.0;
if (prop_element->FindElement("diameter"))
@ -146,6 +146,7 @@ FGPropeller::FGPropeller(FGFDMExec* exec, Element* prop_element, int num)
Type = ttPropeller;
RPM = 0;
vTorque.InitMatrix();
vH.InitMatrix();
D4 = Diameter*Diameter*Diameter*Diameter;
D5 = D4*Diameter;
Pitch = MinPitch;
@ -186,6 +187,14 @@ FGPropeller::~FGPropeller()
Debug(1);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void FGPropeller::ResetToIC(void)
{
FGThruster::ResetToIC();
Vinduced = 0.0;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// We must be getting the aerodynamic velocity here, NOT the inertial velocity.
@ -211,11 +220,11 @@ double FGPropeller::Calculate(double EnginePower)
double Vtip = RPS * Diameter * M_PI;
HelicalTipMach = sqrt(Vtip*Vtip + Vel*Vel) / in.Soundspeed;
PowerAvailable = EnginePower - GetPowerRequired();
if (RPS > 0.0) J = Vel / (Diameter * RPS); // Calculate J normally
else J = Vel / Diameter;
PowerAvailable = EnginePower - GetPowerRequired();
if (MaxPitch == MinPitch) { // Fixed pitch prop
ThrustCoeff = cThrust->GetValue(J);
} else { // Variable pitch prop
@ -265,8 +274,6 @@ double FGPropeller::Calculate(double EnginePower)
// FGForce::GetBodyForces() function.
vH(eX) = Ixx*omega*Sense*Sense_multiplier;
vH(eY) = 0.0;
vH(eZ) = 0.0;
if (omega > 0.0) ExcessTorque = PowerAvailable / omega;
else ExcessTorque = PowerAvailable / 1.0;
@ -277,7 +284,7 @@ double FGPropeller::Calculate(double EnginePower)
// Transform Torque and momentum first, as PQR is used in this
// equation and cannot be transformed itself.
vMn = in.PQR*(Transform()*vH) + Transform()*vTorque;
vMn = in.PQRi*(Transform()*vH) + Transform()*vTorque;
return Thrust; // return thrust in pounds
}
@ -286,13 +293,7 @@ double FGPropeller::Calculate(double EnginePower)
double FGPropeller::GetPowerRequired(void)
{
double cPReq, J;
double rho = in.Density;
double Vel = in.AeroUVW(eU) + Vinduced;
double RPS = RPM / 60.0;
if (RPS != 0.0) J = Vel / (Diameter * RPS);
else J = Vel / Diameter;
double cPReq;
if (MaxPitch == MinPitch) { // Fixed pitch prop
cPReq = cPower->GetValue(J);
@ -303,7 +304,7 @@ double FGPropeller::GetPowerRequired(void)
// do normal calculation when propeller is neither feathered nor reversed
// Note: This method of feathering and reversing was added to support the
// turboprop model. It's left here for backward compatablity, but
// turboprop model. It's left here for backward compatiblity, but
// now feathering and reversing should be done in Manual Pitch Mode.
if (!Feathered) {
if (!Reversed) {
@ -349,9 +350,10 @@ double FGPropeller::GetPowerRequired(void)
// Apply optional Mach effects from CP_MACH table
if (CpMach) cPReq *= CpMach->GetValue(HelicalTipMach);
double RPS = RPM / 60.0;
double local_RPS = RPS < 0.01 ? 0.01 : RPS;
PowerRequired = cPReq*local_RPS*local_RPS*local_RPS*D5*rho;
PowerRequired = cPReq*local_RPS*local_RPS*local_RPS*D5*in.Density;
vTorque(eX) = -Sense*PowerRequired / (local_RPS*2.0*M_PI);
return PowerRequired;

View file

@ -45,7 +45,7 @@ INCLUDES
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_PROPELLER "$Id: FGPropeller.h,v 1.26 2016/01/02 17:42:53 bcoconni Exp $"
#define ID_PROPELLER "$Id: FGPropeller.h,v 1.28 2017/03/03 23:00:39 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@ -57,13 +57,14 @@ namespace JSBSim {
CLASS DOCUMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/** FGPropeller models a propeller given the tabular data for Ct and Cp,
indexed by the advance ratio "J".
/** FGPropeller models a propeller given the tabular data for Ct (thrust) and
Cp (power), indexed by the advance ratio "J".
<h3>Configuration File Format:</h3>
@code
### Configuration File Format
~~~{.xml}
<sense> {1 | -1} </sense>
<propeller name="{string}">
<propeller name="{string}" version="{string}">
<ixx> {number} </ixx>
<diameter unit="IN"> {number} </diameter>
<numblades> {number} </numblades>
@ -102,11 +103,11 @@ CLASS DOCUMENTATION
</tableData>
</table>
</propeller>
@endcode
~~~
### Configuration Parameters
<h3>Configuration Parameters:</h3>
<pre>
\<ixx> - Propeller rotational inertia.
\<diameter> - Propeller disk diameter.
@ -126,25 +127,40 @@ CLASS DOCUMENTATION
\<cp_factor> - A multiplier for the coefficients of power.
</pre>
Two tables are needed. One for coefficient of thrust (Ct) and one for
coefficient of power (Cp).
Two tables are needed. One for coefficient of thrust (Ct) and one for
coefficient of power (Cp).
Two tables are optional. They apply a factor to Ct and Cp based on the
helical tip Mach.
<br>
Two tables are optional. They apply a factor to Ct and Cp based on the
helical tip Mach.
Several references were helpful, here:<ul>
<li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
<li>Edwin Hartman, David Biermann, "The Aerodynamic Characteristics of
Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6
Airfoil Sections", NACA Report TN-640, 1938 (?)</li>
<li>Various NACA Technical Notes and Reports</li>
</ul>
@author Jon S. Berndt
@version $Id: FGPropeller.h,v 1.26 2016/01/02 17:42:53 bcoconni Exp $
@see FGEngine
@see FGThruster
In addition to thrust, the propeller applies two moments to the aircraft:
- The torque that tends to roll the aircraft in the direction opposite to the
propeller rotation,
- and the gyroscopic moment.
It should be noted that historically the gyroscopic moment had an incorrect
sign. The correct sign can be obtained by specifying a **version** attribute
higher than 1.0 to the propeller definition
~~~.xml
<propeller name="a_prop" version="1.1">
<!-- propeller definition -->
</propeller>
~~~
For backward compatibility, the absence of the **version** attribute will result
in the gyroscopic moment to be computed with the legacy incorrect sign.
Several references were helpful, here:
+ Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
Wiley & Sons, 1979 ISBN 0-471-03032-5
+ Edwin Hartman, David Biermann, "The Aerodynamic Characteristics of
Full Scale Propellers Having 2, 3, and 4 Blades of Clark Y and R.A.F. 6
Airfoil Sections", NACA Report TN-640, 1938 (?)
+ Various NACA Technical Notes and Reports
@author Jon S. Berndt
@version $Id: FGPropeller.h,v 1.28 2017/03/03 23:00:39 bcoconni Exp $
@see FGEngine
@see FGThruster
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -163,15 +179,19 @@ public:
/// Destructor for FGPropeller - deletes the FGTable objects
~FGPropeller();
/// Reset the initial conditions.
void ResetToIC(void);
/** Sets the Revolutions Per Minute for the propeller. Normally the propeller
instance will calculate its own rotational velocity, given the Torque
produced by the engine and integrating over time using the standard
equation for rotational acceleration "a": a = Q/I , where Q is Torque and
I is moment of inertia for the propeller.
equation for rotational acceleration \f$a\f$: \f$a = Q/I\f$ , where
\f$Q\f$ is Torque and \f$I\f$ is moment of inertia for the propeller.
@param rpm the rotational velocity of the propeller */
void SetRPM(double rpm) {RPM = rpm;}
/** Sets the Revolutions Per Minute for the propeller using the engine gear ratio **/
/** Sets the Revolutions Per Minute for the propeller using the engine gear
ratio */
void SetEngineRPM(double rpm) {RPM = rpm/GearRatio;}
/// Returns true of this propeller is variable pitch
@ -186,6 +206,9 @@ public:
@param pitch the pitch of the blade in degrees. */
void SetPitch(double pitch) {Pitch = pitch;}
/** Set the propeller pitch.
@param advance the pitch command in percent (0.0 - 1.0)
*/
void SetAdvance(double advance) {Advance = advance;}
/// Sets the P-Factor constant
@ -255,20 +278,35 @@ public:
would be slowed.
@return the thrust in pounds */
double Calculate(double EnginePower);
/// Retrieves the P-Factor constant
FGColumnVector3 GetPFactor(void) const;
/// Generate the labels for the thruster standard CSV output
std::string GetThrusterLabels(int id, const std::string& delimeter);
/// Generate the values for the thruster standard CSV output
std::string GetThrusterValues(int id, const std::string& delimeter);
/** Set the propeller reverse pitch.
@param c the reverse pitch command in percent (0.0 - 1.0)
*/
void SetReverseCoef (double c) { Reverse_coef = c; }
/// Retrieves the reverse pitch command.
double GetReverseCoef (void) const { return Reverse_coef; }
/// If true, sets the propeller in reversed position.
void SetReverse (bool r) { Reversed = r; }
/// Returns true if the propeller is in reverse position.
bool GetReverse (void) const { return Reversed; }
/// If true, sets the propeller in feathered position.
void SetFeather (bool f) { Feathered = f; }
/// Returns true if the propeller is in feathered position.
bool GetFeather (void) const { return Feathered; }
/// Retrieves the thrust coefficient
double GetThrustCoefficient(void) const {return ThrustCoeff;}
/// Retrieves the Mach number at the propeller tips.
double GetHelicalTipMach(void) const {return HelicalTipMach;}
/// Returns a non-zero value if the propeller is constant speed.
int GetConstantSpeed(void) const {return ConstantSpeed;}
/// Set the propeller induced velocity
void SetInducedVelocity(double Vi) {Vinduced = Vi;}
/// Get the propeller induced velocity.
double GetInducedVelocity(void) const {return Vinduced;}
private:

View file

@ -46,7 +46,7 @@ INCLUDES
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#define ID_THRUSTER "$Id: FGThruster.h,v 1.26 2015/09/27 10:03:53 bcoconni Exp $"
#define ID_THRUSTER "$Id: FGThruster.h,v 1.27 2017/03/03 23:00:39 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@ -74,7 +74,7 @@ CLASS DOCUMENTATION
1.57 (pi/2) results in no thrust at all.
@author Jon Berndt
@version $Id: FGThruster.h,v 1.26 2015/09/27 10:03:53 bcoconni Exp $
@version $Id: FGThruster.h,v 1.27 2017/03/03 23:00:39 bcoconni Exp $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -116,7 +116,7 @@ public:
struct Inputs {
double TotalDeltaT;
double H_agl;
FGColumnVector3 PQR;
FGColumnVector3 PQRi;
FGColumnVector3 AeroPQR;
FGColumnVector3 AeroUVW;
double Density;

View file

@ -55,7 +55,7 @@ using namespace std;
namespace JSBSim {
IDENT(IdSrc,"$Id: FGTurboProp.cpp,v 1.35 2016/07/10 12:39:28 bcoconni Exp $");
IDENT(IdSrc,"$Id: FGTurboProp.cpp,v 1.36 2017/02/26 11:41:28 bcoconni Exp $");
IDENT(IdHdr,ID_TURBOPROP);
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -111,8 +111,6 @@ bool FGTurboProp::Load(FGFDMExec* exec, Element *el)
// ToDo: Need to make sure units are properly accounted for below.
if (el->FindElement("milthrust"))
MilThrust = el->FindElementValueAsNumberConvertTo("milthrust","LBS");
if (el->FindElement("idlen1"))
IdleN1 = el->FindElementValueAsNumber("idlen1");
if (el->FindElement("maxn1"))
@ -197,7 +195,8 @@ void FGTurboProp::Calculate(void)
ThrottlePos = in.ThrottlePos[EngineNumber];
/* The thruster controls the engine RPM because it encapsulates the gear ratio and other transmission variables */
/* The thruster controls the engine RPM because it encapsulates the gear ratio
and other transmission variables */
RPM = Thruster->GetEngineRPM();
if (thrusterType == FGThruster::ttPropeller) {
((FGPropeller*)Thruster)->SetAdvance(in.PropAdvance[EngineNumber]);
@ -320,7 +319,6 @@ double FGTurboProp::Off(void)
double FGTurboProp::Run(void)
{
double thrust = 0.0;
double EngPower_HP;
Running = true; Starter = false; EngStarting = false;
@ -342,7 +340,6 @@ double FGTurboProp::Run(void)
OilPressure_psi = (N1/100.0*0.25+(0.1-(OilTemp_degK-273.15)*0.1/80.0)*N1/100.0) / 7692.0e-6; //from MPa to psi
//---
EPR = 1.0 + thrust/MilThrust;
OilTemp_degK = Seek(&OilTemp_degK, 353.15, 0.4-N1*0.001, 0.04);
@ -477,7 +474,6 @@ void FGTurboProp::SetDefaults(void)
N1 = 0.0;
HP = 0.0;
Type = etTurboprop;
MilThrust = 10000.0;
IdleN1 = 30.0;
MaxN1 = 100.0;
Reversed = false;
@ -590,7 +586,6 @@ void FGTurboProp::Debug(int from)
if (from == 2) { // called from Load()
cout << "\n ****MUJ MOTOR TURBOPROP****\n";
cout << "\n Engine Name: " << Name << endl;
cout << " MilThrust: " << MilThrust << endl;
cout << " IdleN1: " << IdleN1 << endl;
cout << " MaxN1: " << MaxN1 << endl;

View file

@ -46,7 +46,7 @@ INCLUDES
#include "FGEngine.h"
#include "math/FGTable.h"
#define ID_TURBOPROP "$Id: FGTurboProp.h,v 1.24 2016/07/10 12:39:28 bcoconni Exp $"
#define ID_TURBOPROP "$Id: FGTurboProp.h,v 1.25 2017/02/26 11:41:28 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@ -121,7 +121,6 @@ public:
bool GetCutoff(void) const { return Cutoff; }
double GetN1(void) const {return N1;}
double GetEPR(void) const {return EPR;}
double GetITT(void) const {return Eng_ITT_degC;}
double GetEngStarting(void) const { return EngStarting; }
@ -132,7 +131,6 @@ public:
inline int GetCondition(void) const { return Condition; }
void SetPhase( phaseType p ) { phase = p; }
void SetEPR(double epr) {EPR = epr;}
void SetReverse(bool reversed) { Reversed = reversed; }
void SetCutoff(bool cutoff) { Cutoff = cutoff; }
@ -145,7 +143,6 @@ public:
private:
phaseType phase; ///< Operating mode, or "phase"
double MilThrust; ///< Maximum Unaugmented Thrust, static @ S.L. (lbf)
double IdleN1; ///< Idle N1
double N1; ///< N1
double MaxN1; ///< N1 at 100% throttle
@ -155,7 +152,6 @@ private:
bool Reversed;
bool Cutoff;
double EPR;
double OilPressure_psi;
double OilTemp_degK;