FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetCableElement.h
1
10
11#ifndef CNetCableElement_H
12#define CNetCableElement_H
13
14// Includes
15// #include <string>
16
17// #include <fhsim/FhSimMgr.h>
18#include "NetCableElementSpec.h"
19#include "cable/subroutines/CableElDynStiff.h"
20
21#include <cmath>
22#ifdef FH_VISUALIZATION
23# pragma warning(push)
24# pragma warning(disable : 4251)
25# include <Ogre.h>
26# pragma warning(pop)
27
28# include "sfh/ogre/CDynamicLines.h"
29// #include "MeshGenerators.h"
30#endif
31
32// Class definition
34{
35public:
37
40
42
43 // Calculates the end forces on the cable element.
44 void AddEndForces(
45 double deltaT,
46 const double adPosA[3],
47 const double adVelA[3],
48 const double adPosB[3],
49 const double adVelB[3],
50 const double adFluidVel[3],
51 const double rhoWater,
52 double adForceA[3],
53 double adForceB[3],
54 bool isScreen = false);
55
58
61
63 bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElement** sNewCable);
64
67
68 void DeleteSpheresAndDisks();
69
70 void AddSpheres(double* adD, double* adMass, double* adPos, std::vector<std::string> VsSphereMaterial, unsigned int num);
71 void AddDisks(double* adD, double* adThickness, double* adMass, double* adPos, std::vector<std::string> VsDiskMaterial, unsigned int num);
72
73 double GetStrainEnergy(double deltaT, const double adPosA[3], const double adVelA[3], const double adPosB[3], const double adVelB[3], const double adFluidVel[3], const double rhoWater);
74
80 void StrainEnergyGradient(const double adPosA[3], const double adPosB[3], double gradA[3], double gradB[3]) const;
81
84 double GetEffectiveStiffness() const { return m_eFactor * m_eA; }
85
87 double GetMeanTensionForce() const { return (1 - m_eFactor) * m_meanTension; }
88
92 double GetEffectiveDamping() const { return ma_dDampingCoeff * std::sqrt(m_eFactor); }
93
97
99 double GetNormalDragFactor() const { return ma_dNormalDragFactor; }
100
101#ifdef FH_VISUALIZATION
103 void RenderInit(Ogre::Root* ogreRoot);
104
106 void RenderUpdate(const double adPosA[3], const double adPosB[3]);
107#endif
109 int m_fromNodes[2];
110 int m_conn[2];
112 unsigned int m_numSpheres;
113 double* m_sphereD;
114 double* m_sphereMass;
115 double* m_spherePos;
116 unsigned int m_numDisks;
117 double* m_diskD;
119 double* m_diskMass;
120 double* m_diskPos;
122 std::vector<std::string> m_VsDiskMeshName;
123 std::vector<std::string> m_VsSphereMeshName;
124
126 double SurfaceHalfSize() const override;
127
128
129protected:
133 double SphereWetFraction(unsigned int i) const;
135 double DiskWetFraction(unsigned int i) const;
137 void AddWaveExcitation(double adForceA[3], double adForceB[3]) const;
138
140
142 void AddHydroForcesAppendices(double adForceA[3], double adForceB[3]);
143
144 // Constants
147
148#ifdef FH_VISUALIZATION
149 Ogre::Entity** m_renderSpheres;
150 Ogre::SceneNode** m_renderNodeSpheres;
151 Ogre::Entity** m_renderDisks;
152 Ogre::SceneNode** m_renderNodeDisks;
153#endif
154};
155
156
157#endif
double ma_dDampingCoeff
A intermediate damping calculation to increase the computational efficiency.
Definition CableElBasics.h:186
double ma_dNormalDragFactor
A factor used when calculating the normal drag force.
Definition CableElBasics.h:200
double ma_dTangentialDragFactor
A factor used when calculating the tangential drag force.
Definition CableElBasics.h:199
double m_eA
The linear stiffness of the element.
Definition CableElBasics.h:140
Definition CableElDynStiff.h:34
double m_eFactor
The factor multiplied by the Young modulus.
Definition CableElDynStiff.h:77
double m_meanTension
The mean tension of the cable element.
Definition CableElDynStiff.h:68
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementSpec.h:18
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElement.h:34
void AddWaveExcitation(double adForceA[3], double adForceB[3]) const
Adds the Froude-Krylov and added-mass wave excitation of the element (normal to it,...
double * m_diskThickness
The thickness of the connected disks.
Definition NetCableElement.h:118
double SurfaceHalfSize() const override
The largest of the element's and its floats' half-sizes, for the surface gate (R66).
double * m_sphereD
The diameter of the connected spheres.
Definition NetCableElement.h:113
int m_fromNodes[2]
The nodes which this cable is constructed by dividing.
Definition NetCableElement.h:109
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
double m_addedWeightInWater
The weight in water added to the element.
Definition NetCableElement.h:121
double * m_sphereMass
The mass of the connected spheres.
Definition NetCableElement.h:114
double * m_diskD
The diameter of the connected disks.
Definition NetCableElement.h:117
unsigned int m_numDisks
The number of disks connected.
Definition NetCableElement.h:116
double m_nodeOffset
The offset between the original nodes of the added node of this cable.
Definition NetCableElement.h:108
double m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElement.h:145
bool AppendagesNearTheSurface() override
True while a float may be at the surface (R66).
void AddHydroForcesAppendices(double adForceA[3], double adForceB[3])
Calculates the hydrodynamic forces on spheres and disks attached to the cable.
double * m_diskMass
The mass of the connected disks.
Definition NetCableElement.h:119
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElement.h:110
double GetEffectiveDamping() const
Definition NetCableElement.h:92
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
bool m_appendagesWereNearTheSurface
AppendagesNearTheSurface at the last call.
Definition NetCableElement.h:139
unsigned int m_numSpheres
The number of spheres connected.
Definition NetCableElement.h:112
double m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElement.h:146
double m_refineFactor
The factor telling how much mesh refinement is desired for this element.
Definition NetCableElement.h:111
void StrainEnergyGradient(const double adPosA[3], const double adPosB[3], double gradA[3], double gradB[3]) const
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition NetCableElement.h:122
double * m_diskPos
The position of the connected disks.
Definition NetCableElement.h:120
bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElement **sNewCable)
Divides the element in two.
double SphereWetFraction(unsigned int i) const
The wet fraction of sphere i, its own cap at its position (R66).
double DiskWetFraction(unsigned int i) const
The wet fraction of disk i (R66).
double GetMeanTensionForce() const
The mean-tension part of the axial force, (1 − eFactor) · mean tension [N]; constant within a step (o...
Definition NetCableElement.h:87
void SetConstants()
Calculates parameters and sets physical constants.
double GetTangentialDragFactor() const
Definition NetCableElement.h:96
double * m_spherePos
The position of the connected spheres.
Definition NetCableElement.h:115
double GetNormalDragFactor() const
Normal drag prefactor (= ma_dNormalDragFactor).
Definition NetCableElement.h:99
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElement.h:123
double GetEffectiveStiffness() const
Definition NetCableElement.h:84