FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Cable Class Reference

#include <Cable.h>

+ Inheritance diagram for Cable:
+ Collaboration diagram for Cable:

Public Member Functions

 Cable (std::string simObjectName, ISimObjectCreator *creator)
 The constructor sets the pointer to the output object and the parser object.
 
 ~Cable ()
 The destructor deletes dynamically allocated memory.
 
void OdeFcn (const double dT, const double *const adX, double *const adXDot) const
 
void InitialConditionSetup (const double dT, const double *const adCurrentIC, double *const adUpdatedIC, ISimObjectCreator *const creator)
 functionality for setting initialconditions based on input port results.
 
void FinalSetup (const double dT, const double *const adX, ISimObjectCreator *const creator)
 
void CalcOutput (const double dT, const double *const adX) const
 
bool HasJacobians () const override
 
void OdeJacobian (double T, const double *X, double *J, int nStates) override
 
int GetJacobianSparsity (int nStates, int *rowPtr, int *colIdx) override
 
const double * OutForceA (const double dT, const double *const adX)
 
const double * OutForceB (const double dT, const double *const adX)
 
const double * OutPosA (const double dT, const double *const adX)
 
const double * OutPosB (const double dT, const double *const adX)
 

Protected Member Functions

void UpdateLength (double newLength, double deltaT)
 
void UpdateStiffness (const double *const adForceA, const double *const adForceB)
 Updates the stiffness of the cable to ensure that this is not too large.
 
void UpdateInertia ()
 Updates the inertia of the cable according to the changing length.
 

Protected Attributes

ISignalPort * m_inLength
 The cable length input port.
 
ISignalPort * m_inVelA
 The velocity A input port.
 
ISignalPort * m_inVelB
 The velocity B input port.
 
ISignalPort * m_inPosA
 The position A input port.
 
ISignalPort * m_inPosB
 The position B input port.
 
int m_IStates
 The index to the internal states of the cable.
 
ICommonComputation * m_commonCalc
 Calculations necessary for more than one output port.
 
int m_numElements
 The number of elements to divide the cable into.
 
int m_numNodes
 The number of nodes of the cable.
 
double m_inertiaA
 The inertia of the end A.
 
double m_inertiaB
 The inertia of the end B.
 
double m_forceA [3]
 The force on the end A.
 
double m_forceB [3]
 The force on the end B.
 
double * m_lengths
 The lengths of the cable elements.
 
std::string m_cableName
 The identification name of the cable;.
 
InternalCableWithBottomContactm_internalCable
 
SCableSpec m_CableSpec
 The cable specification.
 

Detailed Description

This class simulates a cable object consisting of one or more elements. Each element is of type CableElDynStiff. Each element has methods to make it possible to use larger time steps in the integration. This is done by decreasing the stiffness of the element until the eigenfrequency of the element is low enough for the integration to be performed with the defined maximum step size.

Each element is regarded as a straight segment, responsible for calculating the forces acting on each of its ends, as well as the mass associated with each end node. The forces and mass from each element is added to the corresponding nodes of the cable, and the acceleration of each node is calculated in the OdeFcn.

The cable is influenced by:

  • Internal stiffness
  • Internal damping
  • Hydrodynamic normal and tangential forces
  • Buoyancy and gravity
  • Added mass

The calculation of these forces are more thoroughly explained in CableElDynStiff.

Properties
PropertyDefaultComment
NumElements2The number of cable elements.
Length100Not used, as it is now read from an input port.
Density-The density of the cable (kg/m^3).
NumericalDamping0Added numerical damping on each node. The damping force is calculated as \(\vec F_i = -k m_i \vec v_i\), where \(\vec F_i\) is the added damping force, \(k\) is the numerical damping factor, \(m_i\) is the node inertia and \(\vec v_i\) is the velocity of the node.
Diameter-The diameter of the cable.
E-The Young's modulus (elasticity) of the cable.
DampingRatio1The relative axial damping of the cable. 0 is no damping, 1 is critical damping.
FluidRho1025The density of the ambient fluid.
MaxStepLength0.01Controls the stiffness of the cable to allow integration with step lengths up to this value.
MaxTension-The maximum tension. If above this value, the tension is set to this this value.
MaxAcceleration1000The maximum acceleration. If above this value, the acceleration is set to this this value.
StepSafetyFactor50A safety factor between the MaxStepLength and the one used for calculating the stiffness of the cable.
MeanTension0Possibility to add a mean tension to correct for decreased stiffness of the cable.
AdaptationPeriod0If above zero, this tells the cable to correct its initial length to avoid length errors because of decreased stiffness.
MaterialNameTrawl/Wire2The material to use for visualizing the cable.
NumFaces5The number of planes to visualize the cable surface.
DrawScale2The scale of the visual appearance of the cable. This is used to make it more visible.
Input ports
TagSizeComment
Length1The length of the cable.
PosA3The position of end A.
PosB3The position of end B.
VelA3The velocity of end A.
VelB3The velocity of end B.
VelWater3The velocity of the water.
Output ports
TagSizeComment
ForceA3The force from end A of the cable.
ForceB3The force from end B of the cable.
PosA3The position of end A.
PosB3The position of end B.
Revision history:
  • 24.07.2007 KJR: Initial version.
  • 24.11.2010 KJR: Added some class documentation.

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