FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
TorpedoAnchor.h
1#ifndef CTorpedoAnchor_H
2#define CTorpedoAnchor_H
3
107#include <fhsim/simobject/ISimObjectCreator.h>
108
109#include <vector>
110
111namespace rigidbody
112{
113class CRigidCompositeBody;
114namespace soilforces
115{
116class SoilElement;
117}
118}; // namespace rigidbody
119namespace environment
120{
121class EnvironmentProvider;
122}
123
124class TorpedoAnchor : public SimObject
125{
126 public:
127 TorpedoAnchor(const std::string& simObjectName, ISimObjectCreator* const creator);
129 void OdeFcn(const double T, const double* const X, double* const XDot) const;
130
131 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const creator);
132
133#ifdef FH_VISUALIZATION
134 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
135 virtual void RenderUpdate(const double T, const double* const X);
136#endif
137
138 const double* Position(const double T, const double* const X);
139 const double* Velocity(const double T, const double* const X);
140 const double* Quater(const double T, const double* const X);
141 const double* Omega(const double T, const double* const X);
142
143 // Jacobian support (drag and added-mass derivatives omitted; none while the anchor is in contact with the seabed)
144 bool HasJacobians() const override;
145 void OdeJacobian(double T, const double* X, double* J, int nStates) override;
146 int GetJacobianSparsity(int nStates, int* rowPtr, int* colIdx) override;
147
148 protected:
150
151 double m_MaterialRho; // Total mass of anchor [kg]
152 double m_ShankLength; // Total volume displacement of anchor [m^3]
153 double m_ShankDiameter; // Relative added mass (to displaced fluid volume) [-]
154 double m_ShankThickness; // Total length of anchor [m]
155 double m_ShankFlukeAngle; // Length from anchor-tip to fluke [m]
156 double m_FlukeWidth; // Fluke width times fluke height [m^2]
157 double m_FlukeSideLength; // Main diameter of shank [m]
158 double m_FlukePointLength; // Length of fluke point [m]
159 double m_FlukeThickness; // Thickness of fluke [m]
160
161 ISignalPort* m_Force;
162 int m_PositionIndex;
163 int m_VelocityIndex;
164 int m_QuaterIndex;
165 int m_OmegaIndex;
166
167 environment::EnvironmentProvider* m_environment;
168 std::vector<rigidbody::soilforces::SoilElement*> m_soilElements;
169
170#ifdef FH_VISUALIZATION
171 Ogre::SceneNode* m_RenderNode;
172#endif
173};
174
175#endif
Definition TorpedoAnchor.h:125
std::vector< rigidbody::soilforces::SoilElement * > m_soilElements
The shank and the flukes, whose soil load comes from the SeafloorForces resource (owned by m_rigidBod...
Definition TorpedoAnchor.h:168
Definition CRigidCompositeBody.h:12