FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
FlukeAnchor.h
1#ifndef CFlukeAnchor_H
2#define CFlukeAnchor_H
3
98#include <fhsim/simobject/ISimObjectCreator.h>
99
100namespace rigidbody
101{
102class CRigidCompositeBody;
103};
104namespace environment
105{
106class EnvironmentProvider;
107}
108
109class FlukeAnchor : public SimObject
110{
111 public:
112 FlukeAnchor(const std::string& simObjectName, ISimObjectCreator* const creator);
113 ~FlukeAnchor();
114 void OdeFcn(const double T, const double* const X, double* const XDot) const;
115
116 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const creator);
117
118#ifdef FH_VISUALIZATION
119 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
120 void RenderUpdate(const double T, const double* const X);
121#endif
122
123 const double* Position(const double T, const double* const X);
124 const double* Velocity(const double T, const double* const X);
125 const double* Quater(const double T, const double* const X);
126 const double* Omega(const double T, const double* const X);
127
128 // Jacobian support (drag, soil and added-mass derivatives omitted)
129 bool HasJacobians() const override;
130 void OdeJacobian(double T, const double* X, double* J, int nStates) override;
131 int GetJacobianSparsity(int nStates, int* rowPtr, int* colIdx) override;
132
133 protected:
135
136
137 double m_MaterialRho; // Total mass of anchor [kg]
138 double m_ShankLength; // Total volume displacement of anchor [m^3]
139 double m_ShankDiameter; // Relative added mass (to displaced fluid volume) [-]
140 double m_ShankThickness; // Total length of anchor [m]
141 double m_ShankFlukeAngle; // Length from anchor-tip to fluke [m]
142 double m_FlukeWidth; // Fluke width times fluke height [m^2]
143 double m_FlukeSideLength; // Main diameter of shank [m]
144 double m_FlukePointLength;
145 double m_FlukeThickness; // Anchor drag coefficient [-]
146
147 ISignalPort* m_Force;
148 int m_PositionIndex;
149 int m_VelocityIndex;
150 int m_QuaterIndex;
151 int m_OmegaIndex;
152
160 int LocalIndex(int globalStateIndex) const { return globalStateIndex - m_PositionIndex; }
161
162 environment::EnvironmentProvider* m_environment;
163
164#ifdef FH_VISUALIZATION
165 Ogre::SceneNode* m_RenderNode;
166 Ogre::SceneNode* m_seabed;
167#endif
168};
169
170
171#endif
Definition FlukeAnchor.h:110
int LocalIndex(int globalStateIndex) const
Definition FlukeAnchor.h:160
Definition CRigidCompositeBody.h:12