Marine systems simulation
CSimpleBuoy.h
1#ifndef C_SIMPLE_BUOY_H
2#define C_SIMPLE_BUOY_H
3#include <SimObject.h>
4#include "CEnvironment.h"
5#include "sfh/constants.h"
6#include <sfh/text.h>
7#include <stdio.h>
8#include <math.h>
9#include <iostream>
10#include <vector>
11#include "Eigen/Eigen"
12
13#ifdef FH_VISUALIZATION
14#include "sfh/ogre/C3DLine.h"
15#endif
16
17namespace System {
18
20class SimpleBuoy : public SimObject
21{
22public:
23 SimpleBuoy(const string& simObjectName, ISimObjectCreator* const creator);
24 virtual void FinalSetup(const double T, const double* const X, ISimObjectCreator* const pCreator);
25 virtual ~SimpleBuoy();
26
27 void OdeFcn(const double T , const double* const X, double* const XDot, const bool IsMajorTimeStep);
28
29#ifdef FH_VISUALIZATION
30 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
31
32 void RenderUpdate(const double T, const double* const X);
33#endif
34
35 const virtual double* ConnectForce (const double T, const double* const X);
36
37 const virtual double* WaveElev (const double T, const double* const X);
38
39protected:
40
41 ISignalPort* m_inPos;
42 ISignalPort* m_inForce;
43
44 double m_connectForce[3];
45 double m_waveElev;
46
47 double m_buoyPos[3];
48 double m_connPos[3];
49 double m_connLength;
50
51 double m_rho;
52 double m_g;
53 double m_c33;
54
55 double m_K3D;
56 double m_Cd_h;
57 double m_Cd_v;
58
59 double m_radius;
61 double m_heightCone;
63 double m_cog;
64 double m_freeBoard;
65
68 Eigen::Quaternion<double> m_QuatL2G;
69 double m_Mass;
70 double m_addMass;
71 double m_damp;
74 double m_Tau;
75 virtual const double* Position(const double dT, const double* const adX);
76 virtual const double* Velocity(const double dT, const double* const adX);
77 double m_outPos[3];
78 double m_outVel[3];
79
82
85 double m_heightDrag;
86 double m_rampTime;
87
89 double m_Cm_h;
90 double m_Cm_v;
91
92private:
93
94#ifdef FH_VISUALIZATION
95 Ogre::SceneNode* m_RenderNode;
96 double m_RVis;
97 double m_HVis;
98 string m_Material;
99 double m_Color[3];
100
101 C3DLine * m_Line;
102#endif
103};
104#endif
105} // namespace
Definition: CEnvironment.h:10
Definition: CSimpleBuoy.h:21
double m_Cd_v
Drag coefficient horizontal.
Definition: CSimpleBuoy.h:57
int m_IStatePos
Linear damping used in equation of motion (ODE).
Definition: CSimpleBuoy.h:72
double m_heightTotal
Radius of the buoy.
Definition: CSimpleBuoy.h:60
double m_waveElev
Output varialbe.
Definition: CSimpleBuoy.h:45
double m_g
Water density.
Definition: CSimpleBuoy.h:52
double m_freeBoard
Center of gravity relative to base of cylindrical part of buoy.
Definition: CSimpleBuoy.h:64
double m_cog
Offset length cable mounting.
Definition: CSimpleBuoy.h:63
double m_Tau
The index of the velocity state.
Definition: CSimpleBuoy.h:74
bool m_solODE
Free board.
Definition: CSimpleBuoy.h:67
CEnvironment * m_Environment
Sea environment variables.
Definition: CSimpleBuoy.h:81
double m_c33
Acceleration of gravity.
Definition: CSimpleBuoy.h:53
double m_offsetCables
Bottom cone height of the buoy.
Definition: CSimpleBuoy.h:62
double m_maxBuoyancy
Pointer to DeepSeaGravityWaves -> CEnvironment.
Definition: CSimpleBuoy.h:84
double m_addMass
The mass of the object.
Definition: CSimpleBuoy.h:70
double m_Cd_h
3D body reduction effect (viscous forces)
Definition: CSimpleBuoy.h:56
double m_damp
Added mass used in equation of motion (ODE).
Definition: CSimpleBuoy.h:71
double m_heightCone
Height (Total included cone) of the bouy.
Definition: CSimpleBuoy.h:61
double m_radius
Drag coefficient vertical.
Definition: CSimpleBuoy.h:59
double m_connectForce[3]
Input port.
Definition: CSimpleBuoy.h:44
virtual const double * Position(const double dT, const double *const adX)
Stabilization parameter (dependent on integrator time step), m_Tau <= 0.0: no stabilization.
double m_Cm_h
Froude-Kriloff and diffraction force.
Definition: CSimpleBuoy.h:89
int m_IStateVel
The index of the position state.
Definition: CSimpleBuoy.h:73
double m_K3D
Spring stiffness z-direction.
Definition: CSimpleBuoy.h:55
double m_buoyPos[3]
Output varialbe.
Definition: CSimpleBuoy.h:47
ISignalPort * m_inForce
Input port.
Definition: CSimpleBuoy.h:42
Class modelling a flexible bottom ring, inheriting from CRing in RMCable lib.
Definition: CCable.h:142