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
35{
39 bool structuralForce = true;
44};
45
46// Class definition
48{
49public:
51
54 NetCableElement(const NetCableElementSpec* spec, const NetCableOptions& options = {});
55
57
58 // Calculates the end forces on the cable element.
59 void AddEndForces(
60 double deltaT,
61 const double adPosA[3],
62 const double adVelA[3],
63 const double adPosB[3],
64 const double adVelB[3],
65 const double adFluidVel[3],
66 const double rhoWater,
67 double adForceA[3],
68 double adForceB[3]);
69
72
75
78
79 double GetStrainEnergy(const double adPosA[3], const double adPosB[3]) const;
80
86 void StrainEnergyGradient(const double adPosA[3], const double adPosB[3], double gradA[3], double gradB[3]) const;
87
88#ifdef FH_VISUALIZATION
90 void RenderInit(Ogre::Root* ogreRoot);
91
93 void RenderUpdate(const double adPosA[3], const double adPosB[3]);
94#endif
95 double m_nodeOffset;
96 int m_fromNodes[2];
97 int m_conn[2];
99 unsigned int m_numSpheres;
100 double* m_sphereD;
101 double* m_sphereMass;
102 double* m_spherePos;
103 unsigned int m_numDisks;
104 double* m_diskD;
106 double* m_diskMass;
107 double* m_diskPos;
109 std::vector<std::string> m_VsDiskMeshName;
110 std::vector<std::string> m_VsSphereMeshName;
111
113 double SurfaceHalfSize() const override;
114
115
116protected:
120 double SphereWetFraction(unsigned int i) const;
122 double DiskWetFraction(unsigned int i) const;
124 void AddWaveExcitation(double adForceA[3], double adForceB[3]) const;
125
127
129 void AddHydroForcesAppendices(double adForceA[3], double adForceB[3]);
130
132
133 // Constants
136
137#ifdef FH_VISUALIZATION
138 Ogre::Entity** m_renderSpheres;
139 Ogre::SceneNode** m_renderNodeSpheres;
140 Ogre::Entity** m_renderDisks;
141 Ogre::SceneNode** m_renderNodeDisks;
142#endif
143};
144
145
146#endif
Definition CableElDynStiff.h:31
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElementSpec.h:18
Definition NetCableElement.h:48
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:105
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:100
NetCableElement(const NetCableElementSpec *spec, const NetCableOptions &options={})
int m_fromNodes[2]
The nodes which this cable is constructed by dividing.
Definition NetCableElement.h:96
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:108
double * m_sphereMass
The mass of the connected spheres.
Definition NetCableElement.h:101
double * m_diskD
The diameter of the connected disks.
Definition NetCableElement.h:104
unsigned int m_numDisks
The number of disks connected.
Definition NetCableElement.h:103
double m_nodeOffset
The offset between the original nodes of the added node of this cable.
Definition NetCableElement.h:95
double m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElement.h:134
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:106
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElement.h:97
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
bool m_appendagesWereNearTheSurface
AppendagesNearTheSurface at the last call.
Definition NetCableElement.h:126
unsigned int m_numSpheres
The number of spheres connected.
Definition NetCableElement.h:99
double m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElement.h:135
double m_refineFactor
The factor telling how much mesh refinement is desired for this element.
Definition NetCableElement.h:98
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:109
double * m_diskPos
The position of the connected disks.
Definition NetCableElement.h:107
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).
void SetConstants()
Calculates parameters and sets physical constants.
double * m_spherePos
The position of the connected spheres.
Definition NetCableElement.h:102
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElement.h:110
NetCableOptions m_options
From the constructor.
Definition NetCableElement.h:131
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElement.h:35
bool namedAppendixMeshes
Definition NetCableElement.h:43
bool structuralForce
Definition NetCableElement.h:39