Marine systems simulation
CycloidalPropeller.h
1#ifndef CycloidalPropeller_h_
2#define CycloidalPropeller_h_
24#include <cmath>
25
26#include <Eigen/Eigen>
27#include <sfh/constants.h>
28
29#include <SimObject.h>
30#include <CEnvironment.h>
31
32namespace Ship{
33 class CycloidalPropeller: public SimObject, ICurrentField{
34 public:
35 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36 CycloidalPropeller(const string simObjectName, ISimObjectCreator* const creator);
37 void Compute(const double T, const double * const X);
38 void OdeFcn(const double T, const double *const X, double *const XDot, const bool IsMajorTimeStep);
39
40 const double * ForceNED(const double T, const double * const X);
41 const double * TorqueNED(const double T, const double * const X);
42
43 const double * ForceBody(const double T, const double * const X);
44 const double * TorqueBody(const double T, const double * const X);
45
46 const double* ShaftTorqueCorrectedBody(const double T, const double* const X);
47 const double* ShaftTorqueBody(const double T, const double* const X);
48
49 const double* ShaftPowerCorrected(const double T, const double* const X);
50 const double* ShaftPower(const double T, const double* const X);
51
52 void GetCurrent(const double T, const double* const X, const double position[3], double* currentVelocity);
53
54 void FinalSetup(const double T, const double *const X, ISimObjectCreator* const creator);
55 #ifdef FH_VISUALIZATION
56 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
57 void RenderUpdate(const double T, const double* const X);
58 #endif
59 private:
60
61 double Ct ( double intensity )const{
62 return std::pow(std::sin( intensity*sfh::pi/2 ),2.0);
63 }
64
65 #ifdef FH_VISUALIZATION
66 int m_rotationState;
67 bool m_reverseRotationDirection;
68
69 Ogre::SceneNode *m_RenderNode;
70 Ogre::SceneNode *m_RenderNodeFoil;
71 #endif
72
73 int m_currentState;
74 double m_ct;
75 double m_ct_angle;
76 double m_cq;
77 double m_cq_angle;
78 double m_D;
79 double m_b;
80
81 double m_shaftTorque;
82 double m_shaftPower;
83
84
85 double m_torqueScale;
86 double m_thrustScale;
87
88 Eigen::Vector3d m_force;
89 Eigen::Vector3d m_torque;
90
91 Eigen::Vector3d m_forceBody;
92 Eigen::Vector3d m_torqueBody;
93
94 ICommonComputation * m_compute;
95
96 ISignalPort * m_inRPM;
97 ISignalPort * m_inThrustIntensity;
98 ISignalPort * m_inThrustVectorBody;
99
100 ISignalPort * m_inPositionNED;
101 ISignalPort * m_inVelocityNED;
102 ISignalPort * m_inOrientationNED;
103
104 CEnvironment *m_environment;
105
106 };
107}
108#endif // CycloidalPropeller_h__
Definition: CEnvironment.h:10
Definition: ICurrentField.h:4
Definition: CycloidalPropeller.h:33
Simple waypoint object.
Definition: CableAttach.h:16