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