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#include <vector>
23#ifdef FH_VISUALIZATION
24# pragma warning(push)
25# pragma warning(disable : 4251)
26# include <Ogre.h>
27# pragma warning(pop)
28
29# include "sfh/ogre/CDynamicLines.h"
30// #include "MeshGenerators.h"
31#endif
32
36{
40 bool structuralForce = true;
45};
46
47// Class definition
49{
50public:
52
55 NetCableElement(const NetCableElementSpec* spec, const NetCableOptions& options = {});
56
58
59 // Calculates the end forces on the cable element.
60 void AddEndForces(
61 double deltaT,
62 const double adPosA[3],
63 const double adVelA[3],
64 const double adPosB[3],
65 const double adVelB[3],
66 const double adFluidVel[3],
67 const double rhoWater,
68 double adForceA[3],
69 double adForceB[3]);
70
73
76
79
80 double GetStrainEnergy(const double adPosA[3], const double adPosB[3]) const;
81
87 void StrainEnergyGradient(const double adPosA[3], const double adPosB[3], double gradA[3], double gradB[3]) const;
88
89#ifdef FH_VISUALIZATION
91 void RenderInit(Ogre::Root* ogreRoot);
92
94 void RenderUpdate(const double adPosA[3], const double adPosB[3]);
95#endif
96 double m_nodeOffset;
97 int m_fromNodes[2];
98 int m_conn[2];
100 unsigned int m_numSpheres;
101 double* m_sphereD;
102 double* m_sphereMass;
103 double* m_spherePos;
104 unsigned int m_numDisks;
105 double* m_diskD;
107 double* m_diskMass;
108 double* m_diskPos;
110 std::vector<std::string> m_VsDiskMeshName;
111 std::vector<std::string> m_VsSphereMeshName;
112
114 double SurfaceHalfSize() const override;
115
116
117protected:
121 double SphereWetFraction(unsigned int i) const;
123 double DiskWetFraction(unsigned int i) const;
125 void AddWaveExcitation(double adForceA[3], double adForceB[3]) const;
126
128
130 void AddHydroForcesAppendices(double adForceA[3], double adForceB[3]);
131
133
134 // Constants
137
138#ifdef FH_VISUALIZATION
139 Ogre::Entity** m_renderSpheres;
140 Ogre::SceneNode** m_renderNodeSpheres;
141 Ogre::Entity** m_renderDisks;
142 Ogre::SceneNode** m_renderNodeDisks;
143#endif
144};
145
146
147#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:49
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:106
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:101
NetCableElement(const NetCableElementSpec *spec, const NetCableOptions &options={})
int m_fromNodes[2]
The nodes which this cable is constructed by dividing.
Definition NetCableElement.h:97
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:109
double * m_sphereMass
The mass of the connected spheres.
Definition NetCableElement.h:102
double * m_diskD
The diameter of the connected disks.
Definition NetCableElement.h:105
unsigned int m_numDisks
The number of disks connected.
Definition NetCableElement.h:104
double m_nodeOffset
The offset between the original nodes of the added node of this cable.
Definition NetCableElement.h:96
double m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElement.h:135
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:107
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElement.h:98
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
bool m_appendagesWereNearTheSurface
AppendagesNearTheSurface at the last call.
Definition NetCableElement.h:127
unsigned int m_numSpheres
The number of spheres connected.
Definition NetCableElement.h:100
double m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElement.h:136
double m_refineFactor
The factor telling how much mesh refinement is desired for this element.
Definition NetCableElement.h:99
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:110
double * m_diskPos
The position of the connected disks.
Definition NetCableElement.h:108
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:103
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElement.h:111
NetCableOptions m_options
From the constructor.
Definition NetCableElement.h:132
Class containing a cable element object, allowing for disks and spheres to be connected.
Definition NetCableElement.h:36
bool namedAppendixMeshes
Definition NetCableElement.h:44
bool structuralForce
Definition NetCableElement.h:40