10#ifndef CCableElBasics_H
11#define CCableElBasics_H
14#include <marenv/marenv.h>
18#include <fhsim_environment/hydrodynamics/CylinderHydro.h>
19#include <fhsim_environment/hydrodynamics/WetCylinderLaw.h>
22#include <fhsim/Exceptions.h>
25#ifdef FH_VISUALIZATION
29# pragma warning(disable : 4251)
32# include "sfh/ogre/CDynamicLines.h"
37#include "cable/subroutines/CableAxialLaw.h"
52 const double adPosA[3],
53 const double adVelA[3],
54 const double adPosB[3],
55 const double adVelB[3],
56 const double adFluidVel[3],
57 const double rhoWater,
82#ifdef FH_VISUALIZATION
84 virtual void RenderInit(Ogre::Root* ogreRoot);
87 virtual void RenderUpdate(
const double adPosA[3],
const double adPosB[3]);
126 for (
int k = 0; k < 3; k++)
162 const double posA[3],
const double posB[3],
163 const double velA[3],
const double velB[3],
164 const double vFluid[3],
double rhoWater,
165 double dFA_dvA[9],
double dFA_dvB[9],
166 double dFB_dvA[9],
double dFB_dvB[9])
const;
180 const double posA[3],
const double posB[3],
181 const double velA[3],
const double velB[3],
182 const double vFluid[3],
double rhoWater,
183 double dFA_dpA[9],
double dFA_dpB[9],
184 double dFB_dpA[9],
double dFB_dpB[9])
const;
207#ifdef FH_VISUALIZATION
208 std::string m_materialName;
209 unsigned short m_cableFaces;
214 static void Require(std::string& error,
bool passed,
const std::string& requirement,
double value);
232 double WetFractionAt(
const double posA[3],
const double posB[3],
double submergence[2],
double& axisVertical)
const;
240 const double adVelA[3],
241 const double adPosB[3],
242 const double adVelB[3],
243 const double adFluidVel[3],
244 const double rhoWater);
251 void AddNumericalDamping(
const double adVelA[3],
const double adVelB[3],
double adForceA[3],
double adForceB[3])
const;
254 void AddGravityBuoyancy(
double adForceA[3],
double adForceB[3],
const double adPosA[3],
const double adPosB[3]);
279#ifdef FH_VISUALIZATION
280 Ogre::Root* m_ogreRoot;
281 Ogre::SceneManager* m_sceneMgr;
282 Ogre::Entity* m_renderElement;
283 Ogre::SceneNode* m_renderNode;
284 CDynamicLines* m_lines;
285 Ogre::ManualObject* m_cableRenderObj;
288 Ogre::Entity* m_renderSphere;
289 Ogre::SceneNode* m_renderNodeSphere;
Class containing a fundamental cable element object.
Definition CableElBasics.h:42
virtual double SurfaceHalfSize() const
The half-size the surface gate needs: the element's radius; larger with floats (NetCableElement).
Definition CableElBasics.h:118
double m_waveAcceleration[3]
The water particle acceleration at the element (SetWaveAcceleration) [m/s²].
Definition CableElBasics.h:223
void AddHydroForcesCable(double adForceA[3], double adForceB[3])
Calculates the hydrodynamic forces on the cable and the spheres and disks attached to it....
double ma_dVnAmp_A
The scalar hydrodynamic normal velocity of the end A (saturated with the vector).
Definition CableElBasics.h:270
double m_submergence[2]
z + η at the ends at the last CalcFoundation [m]; deep before the first.
Definition CableElBasics.h:220
~CableElBasics()
The destructor.
void SetSurfaceElevation(double etaA, double etaB)
Definition CableElBasics.h:111
double m_rhoWaterFull
The water density the owner passed, unblended [kg/m³]; also that of the stiffness factor (CableElDynS...
Definition CableElBasics.h:101
double InertiaShare() const
The inertia force factor of one end node: half of (1 + Ca) rho V f (environment::cylinder_hydro::Iner...
double m_numericalDamping
The numerical damping rate [1/s]: a dashpot between the two end nodes, c = k m_e / 2 (owner ruling 20...
Definition CableElBasics.h:198
CableElBasics()
The constructor.
double ma_adVt_B[3]
The hydrodynamic axial velocity of the end B.
Definition CableElBasics.h:273
double ma_dCompressionSpeed
The speed at which the distance between the two ends decreases.
Definition CableElBasics.h:277
double ma_adVt_A[3]
The hydrodynamic axial velocity of the end A: its own velocity against the water, the part along the ...
Definition CableElBasics.h:272
double m_rhoWater
The density of the surrounding fluid: the water density blended with the air density by the submerged...
Definition CableElBasics.h:100
double ma_dVtAmp_A
The speed of the hydrodynamic axial velocity of the end A (unsigned, saturated with the vector).
Definition CableElBasics.h:274
double ma_dVelAmp
The scalar average hydrodynamic velocity of the element.
Definition CableElBasics.h:263
double m_surfaceElevation[2]
η above the ends [m] (SetSurfaceElevation).
Definition CableElBasics.h:219
double ma_dVnAmp
The scalar average normal hydrodynamic velocity of the element.
Definition CableElBasics.h:267
double m_dE
The Young modulus of the element.
Definition CableElBasics.h:95
double WetFractionAt(const double posA[3], const double posB[3], double submergence[2], double &axisVertical) const
double m_wetFraction
The element's wet fraction at the last CalcFoundation (CylinderWetFraction).
Definition CableElBasics.h:222
void DragPositionJacobian(const double posA[3], const double posB[3], const double velA[3], const double velB[3], const double vFluid[3], double rhoWater, double dFA_dpA[9], double dFA_dpB[9], double dFB_dpA[9], double dFB_dpB[9]) const
double m_rhoAir
The air density, kg/m³ (marenv's constant, owner ruling O5).
Definition CableElBasics.h:102
double m_normalDragCoeff
The normal drag coefficient of the cable element.
Definition CableElBasics.h:99
double ma_dVtAmp_B
The speed of the hydrodynamic axial velocity of the end B.
Definition CableElBasics.h:275
double ma_adDirection[3]
Memory allocation to increase the computational efficiency.
Definition CableElBasics.h:261
double BlendedFluidDensity(const double posA[3], const double posB[3]) const
double m_massInWaterPerMeter[2]
The mass in water distributed to each node, per meter cable.
Definition CableElBasics.h:206
double ma_adVel[3]
The average hydrodynamic velocity of the element.
Definition CableElBasics.h:262
double m_dD
The diameter of the element.
Definition CableElBasics.h:94
double ma_adVt[3]
The average tangential hydrodynamic velocity of the element.
Definition CableElBasics.h:264
double m_weightInWaterPerMeter[2]
The weight in water distributed to each node, per meter cable.
Definition CableElBasics.h:205
void AddNumericalDamping(const double adVelA[3], const double adVelB[3], double adForceA[3], double adForceB[3]) const
Adds the numerical damping: a dashpot between the end nodes, F_A = c (v_B - v_A), F_B = -F_A,...
void AddWaveExcitationCable(double adForceA[3], double adForceB[3]) const
Adds the rope's Froude-Krylov and added-mass wave excitation (owner rulings R67, R104)....
void SetWaveAcceleration(const double acceleration[3])
Definition CableElBasics.h:124
virtual void UpdateLength(double newLength)
Upates the length of the cable element, and its dependant properties.
double ma_dVnAmp_B
The scalar hydrodynamic normal velocity of the end B.
Definition CableElBasics.h:271
double m_minLength
The minimum length of the element.
Definition CableElBasics.h:195
virtual bool AppendagesNearTheSurface()
True when a float on the element is near the surface, so its weight must be recomputed every call; no...
Definition CableElBasics.h:217
void CalcFoundation(const double adPosA[3], const double adVelA[3], const double adPosB[3], const double adVelB[3], const double adFluidVel[3], const double rhoWater)
double m_addedWeightInWater
The weight in water added to the element.
Definition CableElBasics.h:97
double m_weightInWater[2]
The weight in water distributed to each node.
Definition CableElBasics.h:203
double m_eA
The linear stiffness of the element.
Definition CableElBasics.h:201
double ma_adVn_B[3]
The hydrodynamic normal velocity of the end B.
Definition CableElBasics.h:269
double ma_dLength
The actual distance between the ends.
Definition CableElBasics.h:276
double m_maxTension
The maximum tension in the element.
Definition CableElBasics.h:196
virtual void AddStructuralForces(double adForceA[3], double adForceB[3])=0
double ElementMass() const
The mass of the element as integrated: the sum of the masses of its two end nodes [kg].
Definition CableElBasics.h:76
double m_dL0
The relaxed length of the element.
Definition CableElBasics.h:93
double m_axisVertical
The vertical component of the unit axis A→B at the last CalcFoundation.
Definition CableElBasics.h:221
double m_dA
The cross sectional area of the cable.
Definition CableElBasics.h:202
static void Require(std::string &error, bool passed, const std::string &requirement, double value)
When passed is false and error is still empty, sets error to "@p requirement (is @p value)"; keeps th...
virtual void AddEndForces(const double adPosA[3], const double adVelA[3], const double adPosB[3], const double adVelB[3], const double adFluidVel[3], const double rhoWater, double adForceA[3], double adForceB[3])
Calculates the end forces on the cable element.
double ma_adVn_A[3]
The hydrodynamic normal velocity of the end A: its own velocity against the water,...
Definition CableElBasics.h:268
double ma_dVtAmp
The scalar average tangential hydrodynamic velocity of the element.
Definition CableElBasics.h:265
double m_massInWater[2]
The mass in water distributed to each node.
Definition CableElBasics.h:204
double ma_adVn[3]
The average normal hydrodynamic velocity of the element.
Definition CableElBasics.h:266
unsigned long m_iD
The ID of the element.
Definition CableElBasics.h:91
virtual void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
void AddGravityBuoyancy(double adForceA[3], double adForceB[3], const double adPosA[3], const double adPosB[3])
Adds the forces from gravity and buoyancy to the nodes. CalcFoundation must be run first.
virtual std::string CheckAndInitialize()
void WaveExcitationPositionJacobian(const double posA[3], const double posB[3], const double acceleration[3], double dF_dpB[9]) const
void DragVelocityJacobian(const double posA[3], const double posB[3], const double velA[3], const double velB[3], const double vFluid[3], double rhoWater, double dFA_dvA[9], double dFA_dvB[9], double dFB_dvA[9], double dFB_dvB[9]) const
virtual void SetConstants()
Calculates parameters and sets physical constants.
double m_tangentialFrictionCoeff
The tangential drag coefficient of the cable element.
Definition CableElBasics.h:98
double GetDampingCoeff() const
Definition CableElBasics.h:73
double m_rho
The density of the element material.
Definition CableElBasics.h:96
std::string m_cableName
The name of the parent cable.
Definition CableElBasics.h:92
double m_dampingRatio
The relative damping ratio of the cable.
Definition CableElBasics.h:197
constexpr double seawaterDensity
Ocean water density [kg/m^3].
Definition marenv.h:20
constexpr double airDensity
Air density [kg/m^3].
Definition marenv.h:21