From 752b8d0accaedd35a7b5efa178354a2eb5e4b659 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Wed, 3 Jun 2015 13:55:00 +0200 Subject: [PATCH] Add the option to (properly) revert the propellers moment of inertia calculation --- src/FDM/JSBSim/models/propulsion/FGPropeller.cpp | 10 ++++++++-- src/FDM/JSBSim/models/propulsion/FGPropeller.h | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp b/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp index 7ed41d49a..6b36d5dec 100644 --- a/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGPropeller.cpp @@ -45,7 +45,7 @@ using namespace std; namespace JSBSim { -IDENT(IdSrc,"$Id: FGPropeller.cpp,v 1.49 2014/12/27 14:37:37 dpculp Exp $"); +IDENT(IdSrc,"$Id: FGPropeller.cpp,v 1.51 2015/04/20 12:12:49 ehofman Exp $"); IDENT(IdHdr,ID_PROPELLER); /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -79,6 +79,12 @@ FGPropeller::FGPropeller(FGFDMExec* exec, Element* prop_element, int num) if (prop_element->FindElement("ixx")) Ixx = prop_element->FindElementValueAsNumberConvertTo("ixx", "SLUG*FT2"); + + Sense_multiplier = 1.0; + if (prop_element->HasAttribute("version")) + if (prop_element->GetAttributeValueAsNumber("version") > 1.0) + Sense_multiplier = -1.0; + if (prop_element->FindElement("diameter")) Diameter = prop_element->FindElementValueAsNumberConvertTo("diameter", "FT"); if (prop_element->FindElement("numblades")) @@ -273,7 +279,7 @@ double FGPropeller::Calculate(double EnginePower) // natural axis of the engine. The transform takes place in the base class // FGForce::GetBodyForces() function. - vH(eX) = Ixx*omega*Sense; + vH(eX) = Ixx*omega*Sense*Sense_multiplier; vH(eY) = 0.0; vH(eZ) = 0.0; diff --git a/src/FDM/JSBSim/models/propulsion/FGPropeller.h b/src/FDM/JSBSim/models/propulsion/FGPropeller.h index ceb4b326a..192782411 100644 --- a/src/FDM/JSBSim/models/propulsion/FGPropeller.h +++ b/src/FDM/JSBSim/models/propulsion/FGPropeller.h @@ -45,7 +45,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_PROPELLER "$Id: FGPropeller.h,v 1.20 2011/10/31 14:54:41 bcoconni Exp $" +#define ID_PROPELLER "$Id: FGPropeller.h,v 1.22 2015/04/20 11:40:45 ehofman Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -142,7 +142,7 @@ CLASS DOCUMENTATION
  • Various NACA Technical Notes and Reports
  • @author Jon S. Berndt - @version $Id: FGPropeller.h,v 1.20 2011/10/31 14:54:41 bcoconni Exp $ + @version $Id: FGPropeller.h,v 1.22 2015/04/20 11:40:45 ehofman Exp $ @see FGEngine @see FGThruster */ @@ -283,7 +283,7 @@ private: double MaxRPM; double Pitch; double P_Factor; - double Sense; + double Sense, Sense_multiplier; double Advance; double ExcessTorque; double D4; -- 2.39.5