1
0
Fork 0

Sync with latest JSBSim

This commit is contained in:
curt 2001-11-09 04:38:53 +00:00
parent 8ff6965f98
commit fee8c33799
10 changed files with 1596 additions and 1591 deletions

View file

@ -93,9 +93,7 @@ FGColumnVector3& FGForce::GetBodyForces(void) {
vDXYZ(2) = (vXYZn(2) - fdmex->GetMassBalance()->GetXYZcg(2))*INCHTOFT; //cg and rp values are in inches
vDXYZ(3) = -(vXYZn(3) - fdmex->GetMassBalance()->GetXYZcg(3))*INCHTOFT;
// include rotational effects. vH will be set in descendent class such as
// FGPropeller, and in most other cases will be zero.
vM = vMn + vDXYZ*vFb + fdmex->GetRotation()->GetPQR()*vH;
vM = vMn + vDXYZ*vFb;
return vFb;
}

View file

@ -67,10 +67,6 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
*Prop_cfg >> MinPitch;
} else if (token == "MAXPITCH") {
*Prop_cfg >> MaxPitch;
} else if (token == "P_FACTOR") {
*Prop_cfg >> P_Factor;
} else if (token == "SENSE") {
*Prop_cfg >> Sense;
} else if (token == "EFFICIENCY") {
*Prop_cfg >> rows >> cols;
if (cols == 1) Efficiency = new FGTable(rows);
@ -101,14 +97,6 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
cout << " Number of Blades = " << numBlades << endl;
cout << " Minimum Pitch = " << MinPitch << endl;
cout << " Maximum Pitch = " << MaxPitch << endl;
if (P_Factor > 0.0) cout << " P-Factor = " << P_Factor << endl;
if (Sense > 0.0) {
cout << " Rotation Sense = CW (viewed from pilot looking forward)" << endl;
} else if (Sense < 0.0) {
cout << " Rotation Sense = CCW (viewed from pilot looking forward)" << endl;
} else {
cout << " Rotation Sense = indeterminate" << endl;
}
cout << " Efficiency: " << endl;
Efficiency->Print();
cout << " Thrust Coefficient: " << endl;
@ -180,8 +168,10 @@ float FGPropeller::Calculate(float PowerAvailable)
vFn(1) = Thrust;
omega = RPS*2.0*M_PI;
// Must consider rotated axis for propeller (V-22, helicopter case)
// FIX THIS !!
// The Ixx value and rotation speed given below are for rotation about the
// natural axis of the engine. The transform takes place in the base class
// FGForce::GetBodyForces() function.
vH(eX) = Ixx*omega*fabs(Sense)/Sense;
vH(eY) = 0.0;
vH(eZ) = 0.0;
@ -190,6 +180,9 @@ float FGPropeller::Calculate(float PowerAvailable)
Torque = PowerAvailable / omega;
RPM = (RPS + ((Torque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
vMn = fdmex->GetRotation()->GetPQR()*vH + Torque*Sense;
return Thrust; // return thrust in pounds
}

View file

@ -41,6 +41,7 @@ INCLUDES
#include "FGThruster.h"
#include "FGTable.h"
#include "FGTranslation.h"
#include "FGRotation.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
@ -115,6 +116,10 @@ public:
@param pitch the pitch of the blade in degrees. */
void SetPitch(float pitch) {Pitch = pitch;}
void SetPFactor(double pf) {P_Factor = pf;}
void SetSense(double s) { Sense = s;}
/// Retrieves the pitch of the propeller in degrees.
float GetPitch(void) { return Pitch; }

View file

@ -185,7 +185,8 @@ bool FGPropulsion::Load(FGConfigFile* AC_cfg)
string thrusterFileName, thrType;
string parameter;
string enginePath = FDMExec->GetEnginePath();
float xLoc, yLoc, zLoc, Pitch, Yaw;
double xLoc, yLoc, zLoc, Pitch, Yaw;
double P_Factor = 0, Sense = 0.0;
int Feed;
bool ThrottleAdded = false;
@ -305,12 +306,20 @@ bool FGPropulsion::Load(FGConfigFile* AC_cfg)
else if (token == "ZLOC") *AC_cfg >> zLoc;
else if (token == "PITCH") *AC_cfg >> Pitch;
else if (token == "YAW") *AC_cfg >> Yaw;
else if (token == "P_FACTOR") *AC_cfg >> P_Factor;
else if (token == "SENSE") *AC_cfg >> Sense;
else cerr << "Unknown identifier: " << token << " in engine file: "
<< engineFileName << endl;
}
Thrusters[numThrusters]->SetLocation(xLoc, yLoc, zLoc);
Thrusters[numThrusters]->SetAnglesToBody(0, Pitch, Yaw);
if (thrType == "FG_PROPELLER" && P_Factor > 0.001) {
((FGPropeller*)Thrusters[numThrusters])->SetPFactor(P_Factor);
cout << " P-Factor: " << P_Factor << endl;
((FGPropeller*)Thrusters[numThrusters])->SetSense(Sense);
cout << " Sense: " << Sense << endl;
}
Thrusters[numThrusters]->SetdeltaT(dt*rate);
numThrusters++;