From: Bertrand <bco...@us...> - 2017-03-03 23:00:44
|
Update of /cvsroot/jsbsim/JSBSim/src/models/propulsion In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27414/src/models/propulsion Modified Files: FGEngine.cpp FGEngine.h FGPropeller.cpp FGPropeller.h FGThruster.h Log Message: The propeller gyroscopic moment is now using vPQRi because the moment shall be evaluated in the ECI frame. This is for the consistency of the code since FGAccelerations computes the accelerations in the ECI frame and as such is expecting forces and moments to be expressed in that same frame. The documentation has also been updated to mention the 'version' attribute of the <propeller> section that was added to address the [bugs:#110] Index: FGEngine.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGEngine.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -r1.67 -r1.68 *** FGEngine.cpp 27 Sep 2015 09:54:21 -0000 1.67 --- FGEngine.cpp 3 Mar 2017 23:00:39 -0000 1.68 *************** *** 159,163 **** Thruster->in.TotalDeltaT = in.TotalDeltaT; Thruster->in.H_agl = in.H_agl; ! Thruster->in.PQR = in.PQR; Thruster->in.AeroPQR = in.AeroPQR; Thruster->in.AeroUVW = in.AeroUVW; --- 159,163 ---- Thruster->in.TotalDeltaT = in.TotalDeltaT; Thruster->in.H_agl = in.H_agl; ! Thruster->in.PQRi = in.PQRi; Thruster->in.AeroPQR = in.AeroPQR; Thruster->in.AeroUVW = in.AeroUVW; Index: FGEngine.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGEngine.h,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** FGEngine.h 27 Sep 2015 10:16:57 -0000 1.47 --- FGEngine.h 3 Mar 2017 23:00:39 -0000 1.48 *************** *** 139,143 **** FGColumnVector3 AeroUVW; FGColumnVector3 AeroPQR; ! FGColumnVector3 PQR; std::vector <double> ThrottleCmd; std::vector <double> MixtureCmd; --- 139,143 ---- FGColumnVector3 AeroUVW; FGColumnVector3 AeroPQR; ! FGColumnVector3 PQRi; std::vector <double> ThrottleCmd; std::vector <double> MixtureCmd; Index: FGPropeller.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGPropeller.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -r1.59 -r1.60 *** FGPropeller.cpp 26 Feb 2017 12:09:46 -0000 1.59 --- FGPropeller.cpp 3 Mar 2017 23:00:39 -0000 1.60 *************** *** 81,86 **** Sense_multiplier = 1.0; ! if (prop_element->HasAttribute("version")) ! if (prop_element->GetAttributeValueAsNumber("version") > 1.0) Sense_multiplier = -1.0; --- 81,86 ---- Sense_multiplier = 1.0; ! if (prop_element->HasAttribute("version") ! && prop_element->GetAttributeValueAsNumber("version") > 1.0) Sense_multiplier = -1.0; *************** *** 147,150 **** --- 147,151 ---- RPM = 0; vTorque.InitMatrix(); + vH.InitMatrix(); D4 = Diameter*Diameter*Diameter*Diameter; D5 = D4*Diameter; *************** *** 274,279 **** vH(eX) = Ixx*omega*Sense*Sense_multiplier; - vH(eY) = 0.0; - vH(eZ) = 0.0; if (omega > 0.0) ExcessTorque = PowerAvailable / omega; --- 275,278 ---- *************** *** 286,290 **** // Transform Torque and momentum first, as PQR is used in this // equation and cannot be transformed itself. ! vMn = in.PQR*(Transform()*vH) + Transform()*vTorque; return Thrust; // return thrust in pounds --- 285,289 ---- // Transform Torque and momentum first, as PQR is used in this // equation and cannot be transformed itself. ! vMn = in.PQRi*(Transform()*vH) + Transform()*vTorque; return Thrust; // return thrust in pounds *************** *** 306,310 **** // 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 // now feathering and reversing should be done in Manual Pitch Mode. if (!Feathered) { --- 305,309 ---- // 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 compatiblity, but // now feathering and reversing should be done in Manual Pitch Mode. if (!Feathered) { Index: FGPropeller.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGPropeller.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** FGPropeller.h 26 Feb 2017 12:09:46 -0000 1.27 --- FGPropeller.h 3 Mar 2017 23:00:39 -0000 1.28 *************** *** 58,68 **** %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! /** FGPropeller models a propeller given the tabular data for Ct and Cp, ! indexed by the advance ratio "J". ! <h3>Configuration File Format:</h3> ! @code <sense> {1 | -1} </sense> ! <propeller name="{string}"> <ixx> {number} </ixx> <diameter unit="IN"> {number} </diameter> --- 58,69 ---- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ ! /** FGPropeller models a propeller given the tabular data for Ct (thrust) and ! Cp (power), indexed by the advance ratio "J". ! ### Configuration File Format ! ! ~~~{.xml} <sense> {1 | -1} </sense> ! <propeller name="{string}" version="{string}"> <ixx> {number} </ixx> <diameter unit="IN"> {number} </diameter> *************** *** 103,111 **** </table> - </propeller> ! @endcode - <h3>Configuration Parameters:</h3> <pre> \<ixx> - Propeller rotational inertia. --- 104,112 ---- </table> </propeller> ! ~~~ ! ! ### Configuration Parameters <pre> \<ixx> - Propeller rotational inertia. *************** *** 127,149 **** </pre> ! 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> ! ! 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$ ! @see FGEngine ! @see FGThruster */ --- 128,165 ---- </pre> ! 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. ! ! 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$ ! @see FGEngine ! @see FGThruster */ *************** *** 164,167 **** --- 180,184 ---- ~FGPropeller(); + /// Reset the initial conditions. void ResetToIC(void); *************** *** 169,178 **** 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. @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 **/ void SetEngineRPM(double rpm) {RPM = rpm/GearRatio;} --- 186,196 ---- 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 \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 */ void SetEngineRPM(double rpm) {RPM = rpm/GearRatio;} *************** *** 189,192 **** --- 207,213 ---- 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;} *************** *** 258,275 **** @return the thrust in pounds */ double Calculate(double EnginePower); FGColumnVector3 GetPFactor(void) const; std::string GetThrusterLabels(int id, const std::string& delimeter); std::string GetThrusterValues(int id, const std::string& delimeter); ! void SetReverseCoef (double c) { Reverse_coef = c; } double GetReverseCoef (void) const { return Reverse_coef; } void SetReverse (bool r) { Reversed = r; } bool GetReverse (void) const { return Reversed; } void SetFeather (bool f) { Feathered = f; } bool GetFeather (void) const { return Feathered; } double GetThrustCoefficient(void) const {return ThrustCoeff;} double GetHelicalTipMach(void) const {return HelicalTipMach;} int GetConstantSpeed(void) const {return ConstantSpeed;} void SetInducedVelocity(double Vi) {Vinduced = Vi;} double GetInducedVelocity(void) const {return Vinduced;} --- 279,311 ---- @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;} Index: FGThruster.h =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/src/models/propulsion/FGThruster.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** FGThruster.h 27 Sep 2015 10:03:53 -0000 1.26 --- FGThruster.h 3 Mar 2017 23:00:39 -0000 1.27 *************** *** 117,121 **** double TotalDeltaT; double H_agl; ! FGColumnVector3 PQR; FGColumnVector3 AeroPQR; FGColumnVector3 AeroUVW; --- 117,121 ---- double TotalDeltaT; double H_agl; ! FGColumnVector3 PQRi; FGColumnVector3 AeroPQR; FGColumnVector3 AeroUVW; |