FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
WindForce.h
1#ifndef CWindForce_h__
2#define CWindForce_h__
3
52#include <vector>
53#include <string>
54
55#include <Eigen/Eigen>
56#include <fhsim/simobject/SimObject.h>
57#include <fhsim_environment/EnvironmentProvider.h>
58
59#include "./Ship/Forces/Wind/WindCurve.h"
60
61namespace Ship{
62 class WindForce: public SimObject
63 {
64 public:
65 EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
66 WindForce(const std::string simObjectName, ISimObjectCreator* const creator);
67
68 void FinalSetup( const double T, const double *const X, ISimObjectCreator* const creator );
69
71 void OdeFcn(const double T, const double* const X, double* const XDot) const;
72
73 #ifdef FH_VISUALIZATION
74
76 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
77
79 void RenderUpdate( const double T, const double* const X);
80 #endif
81
82 const double* Force (const double T, const double* const X);
83
84 void Compute( const double T, const double* const _X ) const;
85
86 const double* Torque (const double T, const double* const X);
87
88 const double* Angle(const double T, const double* const X);
89 const double* Coefficient(const double T, const double* const X);
90
91 private:
92 mutable Eigen::Vector3d f,m;
93 mutable double m_apparentAngle;
94
95 double m_AreaFront;
96 double m_Length;
97 double m_xA0;
98 std::vector<double> m_xB;
99 std::vector<double> m_xA;
100 int m_xDataLength;
101 int m_yDataLength;
102 std::vector<double> m_yA;
103 std::vector<double> m_yB;
104 double m_yA0;
105 int m_nDataLength;
106 std::vector<double> m_nA;
107 std::vector<double> m_nB;
108 double m_nA0;
109
110 mutable double X;
111 mutable double Y;
112 mutable double N;
113
114 bool m_360degData;
115 mutable double m_dragCoefficient[3];
116 double m_Force[3];
117 double m_Torque[3];
118 double m_AreaLateral;
119 double m_Cp;
120 double m_Rho;
121
122 ISignalPort *m_InDirection;
123 ISignalPort *m_InVesselSpeed;
124 ISignalPort *m_InWindSpeed;
125 ICommonComputation *m_Compute;
126 WindCurve *MyWindCurve;
127
128 #ifdef FH_VISUALIZATION
129 Ogre::SceneNode* m_RenderNode;
130 #endif
131
132 };
133}
134#endif // CWindForce_h__
Definition WindCurve.h:8
Definition WindForce.h:63
void OdeFcn(const double T, const double *const X, double *const XDot) const
Method for calculating the derivative of the object states, which must be implemented in the individu...
Simple waypoint object.
Definition CableAttach.h:58