FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetCableElementWithConstraints.h
1
10
11#ifndef NetCableElementWithConstraints_H
12#define NetCableElementWithConstraints_H
13
14// Includes
15//#include <string>
16//#include <fhsim/FhSimMgr.h>
17#include "cable/subroutines/CableElDynStiff.h"
18#include "NetCableElementSpec.h"
19#ifdef FH_VISUALIZATION
20#pragma warning(push)
21#pragma warning( disable : 4251 )
22 #include <Ogre.h>
23#pragma warning(pop)
24 #include "sfh/ogre/CDynamicLines.h"
25//#include "MeshGenerators.h"
26#endif
27
28//Class definition
30{
31public:
34
38
41
44 double deltaT,
45 const double adPosA[3],
46 const double adVelA[3],
47 const double adPosB[3],
48 const double adVelB[3],
49 const double adFluidVel[3],
50 const double rhoWater,
51 double adForceA[3],
52 double adForceB[3]);
53
56
59
61 bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElementWithConstraints** sNewCable);
62
65
66 void DeleteSpheresAndDisks();
67
68 void AddSpheres(double* adD, double* adMass, double* adPos, std::vector<std::string> VsSphereMaterial, int num);
69 void AddDisks(double* adD, double* adThickness, double* adMass, double* adPos, std::vector<std::string> VsDiskMaterial, int num);
70
71#ifdef FH_VISUALIZATION
73 void RenderInit(Ogre::Root* ogreRoot);
74
76 void RenderUpdate( const double adPosA[3], const double adPosB[3]);
77#endif
78 double m_nodeOffset;
79 int m_fromNodes[2];
80 int m_conn[2];
83 double* m_sphereD;
84 double* m_sphereMass;
85 double* m_spherePos;
87 double* m_diskD;
89 double* m_diskMass;
90 double* m_diskPos;
92 std::vector<std::string> m_VsDiskMeshName;
93 std::vector<std::string> m_VsSphereMeshName;
94
96 double SurfaceHalfSize() const override;
97
98
99protected:
103 double SphereWetFraction(unsigned int i) const;
105 double DiskWetFraction(unsigned int i) const;
107 void AddWaveExcitation(double adForceA[3], double adForceB[3]) const;
108
110
111
113 void AddHydroForcesAppendices(double adForceA[3], double adForceB[3]);
114
115 // Constants
118
119#ifdef FH_VISUALIZATION
120 Ogre::Entity** m_renderSpheres;
121 Ogre::SceneNode** m_renderNodeSpheres;
122 Ogre::Entity** m_renderDisks;
123 Ogre::SceneNode** m_renderNodeDisks;
124#endif
125
126};
127
128
129#endif
Definition CableElDynStiff.h:34
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 NetCableElementWithConstraints.h:30
double m_normalDragCoeffDisk
The normal drag coefficient of a disk.
Definition NetCableElementWithConstraints.h:117
double * m_diskD
The diameter of the connected disks.
Definition NetCableElementWithConstraints.h:87
bool m_appendagesWereNearTheSurface
AppendagesNearTheSurface at the last call.
Definition NetCableElementWithConstraints.h:109
~NetCableElementWithConstraints()
The destructor.
NetCableElementWithConstraints(const NetCableElementWithConstraints *old)
The copy constructor.
int m_numDisks
The number of disks connected.
Definition NetCableElementWithConstraints.h:86
double SurfaceHalfSize() const override
The largest of the element's and its floats' half-sizes, for the surface gate (R66).
int m_fromNodes[2]
The nodes which this cable is constructed by dividing.
Definition NetCableElementWithConstraints.h:79
double * m_spherePos
The position of the connected spheres.
Definition NetCableElementWithConstraints.h:85
double * m_diskPos
The position of the connected disks.
Definition NetCableElementWithConstraints.h:90
int m_numSpheres
The number of spheres connected.
Definition NetCableElementWithConstraints.h:82
void AddEndForces(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, double adForceA[3], double adForceB[3])
Calculates the end forces on the cable element.
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.
NetCableElementWithConstraints()
The constructor.
double m_refineFactor
The factor telling how much mesh refinement is desired for this element.
Definition NetCableElementWithConstraints.h:81
void SetConstants()
Calculates parameters and sets physical constants.
double * m_diskThickness
The thickness of the connected disks.
Definition NetCableElementWithConstraints.h:88
double m_nodeOffset
The offset between the original nodes of the added node of this cable.
Definition NetCableElementWithConstraints.h:78
void CalcMassAndWeight()
Calculates the mass and weight of the element in water.
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 SphereWetFraction(unsigned int i) const
The wet fraction of sphere i, its own cap at its position (R66).
bool CheckAndInitialize()
Does the initialization and checking to make sure that the element is ready for simulation.
std::vector< std::string > m_VsSphereMeshName
The names of the materials of the attached spheres.
Definition NetCableElementWithConstraints.h:93
double DiskWetFraction(unsigned int i) const
The wet fraction of disk i (R66).
double m_addedWeightInWater
The weight in water added to the element.
Definition NetCableElementWithConstraints.h:91
double * m_sphereMass
The mass of the connected spheres.
Definition NetCableElementWithConstraints.h:84
double * m_diskMass
The mass of the connected disks.
Definition NetCableElementWithConstraints.h:89
double m_dragCoeffSphere
The drag coefficient of a sphere.
Definition NetCableElementWithConstraints.h:116
double * m_sphereD
The diameter of the connected spheres.
Definition NetCableElementWithConstraints.h:83
std::vector< std::string > m_VsDiskMeshName
The names of the materials of the attached disks.
Definition NetCableElementWithConstraints.h:92
bool Divide(int aiNodes[2], int newNode, int newElementID, NetCableElementWithConstraints **sNewCable)
Divides the element in two.
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElementWithConstraints.h:80