Marine systems simulation
Cable.h
1
94#ifndef CABLE_H
95#define CABLE_H
96#include "SimObject.h"
97class CEnvironment;
98class C3DLine;
99
100class CCable : public SimObject
101{
102 public:
114 CCable(const string& simObjectName, ISimObjectCreator* const creator);
115
116 ~CCable();
117
130 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
131
132
148 void InitialConditionSetup(const double T, const double* const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
149
150 void FinalSetup(const double T, const double* const X, ISimObjectCreator* const creator);
151
152 const double* ForceA(const double T, const double* const X);
153 const double* ForceB(const double T, const double* const X);
154
155 void computeEndForces(const double T, const double* const X);
156
157#ifdef FH_VISUALIZATION
158 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
159 void RenderUpdate(const double T, const double* const X);
160#endif
161
162 protected:
179 void computeSegmentForces(const double T, const double* X, const double* pA, const double* pB, const double* vA, const double* vB, double* FA, double* FB);
180
181
197 void computeVirtualPoint(const double* const target, const double* const point, const double* const targetVel, const double* const pointVel, double* virtualPoint, double* virtualPointVel, double residual, double dResidual);
198
199 void testPositiveParam(double value, ISimObjectCreator* creator, string valueName);
200 void computeElementTension(const double* prev, const double* curr, double* force);
201
204 double m_Emodulus;
207 double m_diameter;
213
221
222 ISignalPort* m_PositionA;
223 ISignalPort* m_PositionB;
224 ISignalPort* m_VelocityA;
225 ISignalPort* m_VelocityB;
230
231 double m_endForceA[3];
232 double m_endForceB[3];
233 double m_nodeForceA[3];
234 double m_nodeForceB[3];
239 double m_virtualPointA[3];
240 double m_virtualPointB[3];
243 double m_residualA;
244 double m_residualB;
245 ICommonComputation* m_computeEndForces;
246
247 const double* m_posA;
248 const double* m_posB;
249 const double* m_velA;
250 const double* m_velB;
251
253
254#ifdef FH_VISUALIZATION
255 C3DLine* m_lines1;
256 C3DLine* m_lines2;
257#endif
258};
259#endif
Definition: Cable.h:101
ISignalPort * m_VelocityB
input port. Velocity of point A [m/s]
Definition: Cable.h:225
const double * ForceB(const double T, const double *const X)
output port. See PortDefs.h. Returns force at point A
double m_hydrodynamicDiameter
cable diameter [m]
Definition: Cable.h:208
CEnvironment * m_environment
Velocity of point B [m].
Definition: Cable.h:252
double m_endForceB[3]
reactive force at endpoint A [N]
Definition: Cable.h:232
void computeVirtualPoint(const double *const target, const double *const point, const double *const targetVel, const double *const pointVel, double *virtualPoint, double *virtualPointVel, double residual, double dResidual)
Computes position and velocity of the virtual point.
double m_submergedWeight
effective hydrodynamic diameter [m]
Definition: Cable.h:209
const double * ForceA(const double T, const double *const X)
retrieves pointer to environment object
void computeEndForces(const double T, const double *const X)
output port. See PortDefs.h. Returns force at point B
double m_segmentStiffness
length of spring between elements [m]
Definition: Cable.h:218
const double * m_posA
computation node for endpoint reaction forces
Definition: Cable.h:247
ISignalPort * m_retractedSpeedPortB
retraction rate at endpoint A [m/s]
Definition: Cable.h:229
double m_segmentMass
inverse mass of each element [kg^-1]
Definition: Cable.h:215
double m_elementMass
number of elements in the cable [#]
Definition: Cable.h:212
ISignalPort * m_PositionB
input port. Position of point A [m]
Definition: Cable.h:223
double m_retractedLengthA
force on first free node at endpoint A [N]
Definition: Cable.h:235
double m_virtualPointVelocityB[3]
when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual e...
Definition: Cable.h:242
double m_Emodulus
cable weight [kg/m]
Definition: Cable.h:204
void InitialConditionSetup(const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
Sets initial conditions based on the value of input ports.
double m_virtualPointVelocityA[3]
when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual e...
Definition: Cable.h:241
double m_cableLength
compute structural tension for a single element
Definition: Cable.h:202
CCable(const string &simObjectName, ISimObjectCreator *const creator)
Reads parameters, registers states, input/output ports and shared resources.
double m_virtualPointA[3]
number of nodes currently on winch B
Definition: Cable.h:239
double m_virtualPointB[3]
when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual e...
Definition: Cable.h:240
double m_diameter
displaced fluid volume per meter cable [m^2]
Definition: Cable.h:207
double m_displacementCrossSectionArea
cross section area of load bearing material [m^2]
Definition: Cable.h:206
double m_endForceA[3]
retraction rate at endpoint B [m/s]
Definition: Cable.h:231
int m_retractedNodesA
amount of retracted cable at endpoint B [m]
Definition: Cable.h:237
int * m_elementVelocityIndex
The relative index of the position state in the state array for each element [#].
Definition: Cable.h:220
const double * m_velA
Position of point B [m].
Definition: Cable.h:249
double m_tensileCrossSectionArea
Young's modulus of load bearing material [Pa].
Definition: Cable.h:205
int m_retractedNodesB
number of nodes currently on winch A
Definition: Cable.h:238
void computeSegmentForces(const double T, const double *X, const double *pA, const double *pB, const double *vA, const double *vB, double *FA, double *FB)
computes free nodes and both end forces
void computeElementTension(const double *prev, const double *curr, double *force)
test if a parameter is positive, and reports error if not.
double m_residualB
free length of closest free node [m]
Definition: Cable.h:244
double m_elementMassInverse
mass of each element [kg]
Definition: Cable.h:214
double m_residualA
when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual e...
Definition: Cable.h:243
ISignalPort * m_retractedLengthPortA
input port. Velocity of point B [m/s]
Definition: Cable.h:226
double m_cableWeight
total cable length [m]
Definition: Cable.h:203
ISignalPort * m_retractedSpeedPortA
amount of retracted cable at endpoint B [m]
Definition: Cable.h:228
ISignalPort * m_VelocityA
input port. Position of point B [m]
Definition: Cable.h:224
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
free allocated memory
int * m_elementPositionIndex
spring stiffness [N/m]
Definition: Cable.h:219
int m_numElements
structural axial damping. [N*s/m]
Definition: Cable.h:211
double m_internalDamping
weight of cable underwater [kg/m]
Definition: Cable.h:210
double m_nodeForceB[3]
force on first free node at endpoint A [N]
Definition: Cable.h:234
ISignalPort * m_PositionA
The relative index of the velocity state in the state array for each element [#].
Definition: Cable.h:222
double m_retractedLengthB
amount of retracted cable at endpoint A [m]
Definition: Cable.h:236
const double * m_velB
Velocity of point A [m].
Definition: Cable.h:250
ISignalPort * m_retractedLengthPortB
amount of retracted cable at endpoint A [m]
Definition: Cable.h:227
double m_segmentSubmergedMass
mass of each segment [kg]
Definition: Cable.h:216
const double * m_posB
Position of point A [m].
Definition: Cable.h:248
double m_segmentLength
submerged weight of each element [kg]
Definition: Cable.h:217
ICommonComputation * m_computeEndForces
free length of closest free node [m]
Definition: Cable.h:245
double m_nodeForceA[3]
reactive force at endpoint A [N]
Definition: Cable.h:233
Definition: CEnvironment.h:10