Marine systems simulation
Cable Class Reference
+ Inheritance diagram for Cable:
+ Collaboration diagram for Cable:

Public Member Functions

 Cable (const string &simObjectName, ISimObjectCreator *const creator)
 Reads parameters, registers states, input/output ports and shared resources. More...
 
void OdeFcn (const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
 free allocated memory More...
 
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. More...
 
void FinalSetup (const double T, const double *const X, ISimObjectCreator *const creator)
 
const double * ForceA (const double T, const double *const X)
 retrieves pointer to environment object
 
const double * ForceB (const double T, const double *const X)
 output port. See PortDefs.h. Returns force at point A
 
void computeEndForces (const double T, const double *const X)
 output port. See PortDefs.h. Returns force at point B
 

Protected Member Functions

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 More...
 
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. More...
 
void testPositiveParam (double value, ISimObjectCreator *creator, string valueName)
 
void computeElementTension (const double *prev, const double *curr, double *force)
 test if a parameter is positive, and reports error if not.
 

Protected Attributes

double m_cableLength
 compute structural tension for a single element
 
double m_cableWeight
 total cable length [m]
 
double m_Emodulus
 cable weight [kg/m]
 
double m_tensileCrossSectionArea
 Young's modulus of load bearing material [Pa].
 
double m_displacementCrossSectionArea
 cross section area of load bearing material [m^2]
 
double m_diameter
 displaced fluid volume per meter cable [m^2]
 
double m_hydrodynamicDiameter
 cable diameter [m]
 
double m_submergedWeight
 effective hydrodynamic diameter [m]
 
double m_internalDamping
 weight of cable underwater [kg/m]
 
int m_numElements
 structural axial damping. [N*s/m]
 
double m_elementMass
 number of elements in the cable [#]
 
double m_elementMassInverse
 mass of each element [kg]
 
double m_segmentMass
 inverse mass of each element [kg^-1]
 
double m_segmentSubmergedMass
 mass of each segment [kg]
 
double m_segmentLength
 submerged weight of each element [kg]
 
double m_segmentStiffness
 length of spring between elements [m]
 
int * m_elementPositionIndex
 spring stiffness [N/m]
 
int * m_elementVelocityIndex
 The relative index of the position state in the state array for each element [#].
 
ISignalPort * m_PositionA
 The relative index of the velocity state in the state array for each element [#].
 
ISignalPort * m_PositionB
 input port. Position of point A [m]
 
ISignalPort * m_VelocityA
 input port. Position of point B [m]
 
ISignalPort * m_VelocityB
 input port. Velocity of point A [m/s]
 
ISignalPort * m_retractedLengthPortA
 input port. Velocity of point B [m/s]
 
ISignalPort * m_retractedLengthPortB
 amount of retracted cable at endpoint A [m]
 
ISignalPort * m_retractedSpeedPortA
 amount of retracted cable at endpoint B [m]
 
ISignalPort * m_retractedSpeedPortB
 retraction rate at endpoint A [m/s]
 
double m_endForceA [3]
 retraction rate at endpoint B [m/s]
 
double m_endForceB [3]
 reactive force at endpoint A [N]
 
double m_nodeForceA [3]
 reactive force at endpoint A [N]
 
double m_nodeForceB [3]
 force on first free node at endpoint A [N]
 
double m_retractedLengthA
 force on first free node at endpoint A [N]
 
double m_retractedLengthB
 amount of retracted cable at endpoint A [m]
 
int m_retractedNodesA
 amount of retracted cable at endpoint B [m]
 
int m_retractedNodesB
 number of nodes currently on winch A
 
double m_virtualPointA [3]
 number of nodes currently on winch B
 
double m_virtualPointB [3]
 when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual endpoint [m]
 
double m_virtualPointVelocityA [3]
 when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual endpoint [m]
 
double m_virtualPointVelocityB [3]
 when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual endpoint [m/s]
 
double m_residualA
 when cable is winched, the closest free node is attracted towards a ghost point "beyond" the actual endpoint [m/s]
 
double m_residualB
 free length of closest free node [m]
 
ICommonComputation * m_computeEndForces
 free length of closest free node [m]
 
const double * m_posA
 computation node for endpoint reaction forces
 
const double * m_posB
 Position of point A [m].
 
const double * m_velA
 Position of point B [m].
 
const double * m_velB
 Velocity of point A [m].
 
CEnvironmentm_environment
 Velocity of point B [m].
 

Constructor & Destructor Documentation

◆ Cable()

Cable::Cable ( const string &  simObjectName,
ISimObjectCreator *const  creator 
)

This constructor performs all initial setup for a point mass simobject. Reading in parameters, setting up communication interface i.e. output ports, input ports, and states, plus additional 'one time only' resource setup.

Parameters
[in]simObjectName-> The name of the simobject. Used primarily by superclass constructor
[in]creator-> Retrieve parameters. Register states, ports and shared resources

Member Function Documentation

◆ computeSegmentForces()

void Cable::computeSegmentForces ( const double  T,
const double *  X,
const double *  pA,
const double *  pB,
const double *  vA,
const double *  vB,
double *  FA,
double *  FB 
)
protected

Computes all forces acting on an element

Computes structural and environmental forces acting on an element i.e. the cable length between two cable nodes, and distributes the total force on the two nodes.

Parameters
[in]T-> current simulation time
[in]X-> current simulation state
[in]pA-> position of element A
[in]pB-> position of element B
[in]vA-> velocity of element A
[in]vB-> velocity of element B
[out]FA-> force on element A
[out]FB-> force on element B

◆ computeVirtualPoint()

void Cable::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 
)
protected

Winch functionality is implemented by pulling the closest free node towards a virtual point rather than the actual endpoint.

Parameters
[in]target-> actual endpoint position
[in]point-> position of free node
[in]targetVel-> actual endpoint velocity
[in]pointVel-> velocity of free node
[in]residual-> free element length
[in]dResidual-> rate of change in free element length
[out]virtualPoint-> position of virtual point
[out]virtualPointVel-> velocity of virtual point

◆ InitialConditionSetup()

void Cable::InitialConditionSetup ( const double  T,
const double *const  currentIC,
double *const  updatedIC,
ISimObjectCreator *const  creator 
)

Sets initial conditions based on the value of input ports. Element positions of free nodes are equally distributed between endpoint positions. Element Velocity are linearly interpolated between endpoint velocity

Parameters
[in]T-> The time at the beginning of the simulation. Usually but not necessarily zero
[in]currentIC-> Array of initial conditions. If the value is QNAN, the value is not set yet and can be set by the SimObject, otherwise the value is set, and can not be changed. Trying to change an already set value will trigger an error
[in]creator-> Report back to creator if output port are not ready
[out]updatedIC-> Array of ONAN. Any initial condition that are ready to be set, should be written to this array.

◆ OdeFcn()

void Cable::OdeFcn ( const double  T,
const double *const  X,
double *const  XDot,
const bool  bIsMajorTimeStep 
)

Computes object derivatives as a function of time, states and input ports

Returns state derivatives. Velocity as derivative of position, external-force/mass and gravity as derivative of velocity. Adjusts position of not-free nodes.

Parameters
[in]T-> current simulation time
[in]X-> current simulation state
[out]XDot-> state derivatives
[in]bIsMajorTimeStep-> Is this a major time step?

The documentation for this class was generated from the following file: