Skip to content

Commit

Permalink
Account for the vehicle angular rates in the computation of propeller…
Browse files Browse the repository at this point in the history
…s local velocities.

As per the discussion in the issue #333 and eqn 8.2-1 in Stevens & Lewis' "Aircraft Control & Simulation".
  • Loading branch information
bcoconni committed Dec 6, 2020
1 parent 4595a18 commit cdebbf2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/models/propulsion/FGForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ moments due to the difference between the point of application and the cg.

#include "FGForce.h"
#include "FGFDMExec.h"
#include "models/FGMassBalance.h"
#include "models/FGAuxiliary.h"

using namespace std;
Expand All @@ -50,9 +49,8 @@ namespace JSBSim {

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

FGForce::FGForce(FGFDMExec *FDMExec) :
fdmex(FDMExec),
ttype(tNone)
FGForce::FGForce(FGFDMExec *FDMExec)
: fdmex(FDMExec), MassBalance(fdmex->GetMassBalance()), ttype(tNone)
{
vFn.InitMatrix();
vMn.InitMatrix();
Expand Down Expand Up @@ -87,7 +85,7 @@ const FGColumnVector3& FGForce::GetBodyForces(void)
// needs to be done like this to convert from structural to body coords.
// CG and RP values are in inches

FGColumnVector3 vDXYZ = fdmex->GetMassBalance()->StructuralToBody(vActingXYZn);
FGColumnVector3 vDXYZ = MassBalance->StructuralToBody(vActingXYZn);

vM = vMn + vDXYZ*vFb;

Expand Down
2 changes: 2 additions & 0 deletions src/models/propulsion/FGForce.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ INCLUDES

#include "FGJSBBase.h"
#include "math/FGMatrix33.h"
#include "models/FGMassBalance.h"

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
Expand Down Expand Up @@ -305,6 +306,7 @@ class FGForce : public FGJSBBase

protected:
FGFDMExec *fdmex;
std::shared_ptr<FGMassBalance> MassBalance;
FGColumnVector3 vFn;
FGColumnVector3 vMn;
FGColumnVector3 vOrient;
Expand Down
7 changes: 6 additions & 1 deletion src/models/propulsion/FGPropeller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ void FGPropeller::ResetToIC(void)

double FGPropeller::Calculate(double EnginePower)
{
FGColumnVector3 localAeroVel = Transform().Transposed() * in.AeroUVW;
FGColumnVector3 vDXYZ = MassBalance->StructuralToBody(vActingXYZn);
// Local air velocity is obtained from Stevens & Lewis' "Aircraft Control and
// Simualtion (3rd edition)" eqn 8.2-1
// Variables in.AeroUVW and in.AeroPQR include the wind and turbulence effects
// as computed by FGAuxiliary.
FGColumnVector3 localAeroVel = Transform().Transposed() * (in.AeroUVW + in.AeroPQR*vDXYZ);
double omega, PowerAvailable;

double Vel = localAeroVel(eU);
Expand Down

0 comments on commit cdebbf2

Please sign in to comment.