Marine systems simulation
CCircularBuoy.h
1
2
3#ifndef C_CIRCULAR_BUOY_H
4#define C_CIRCULAR_BUOY_H
5#include <SimObject.h>
6#include <CEnvironment.h>
7#include <environment/DeepSeaGravityWaves.h>
8#include "sfh/constants.h"
9#include <sfh/text.h>
10#include <stdio.h>
11#include <math.h>
12#include <iostream>
13#include <vector>
14#include "Eigen/Eigen"
15using namespace std;
16using std::vector;
17typedef Eigen::Matrix<double,3,1> vec3;
18
19namespace Netcage {
69class CCircularBuoy : public SimObject
70{
71public:
83 CCircularBuoy(const string& simObjectName, ISimObjectCreator* const creator);
84 virtual void FinalSetup(const double T, const double* const X, ISimObjectCreator* const pCreator);
85 virtual ~CCircularBuoy();
86
98 void OdeFcn(const double T , const double* const X, double* const XDot, const bool IsMajorTimeStep);
99
100
101#ifdef FH_VISUALIZATION
110 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
111
120 void RenderUpdate(const double T, const double* const X);
121#endif
122
132 const virtual double* PosCables (const double T, const double* const X);
142 const virtual double* VelCables (const double T, const double* const X);
143
144
154 const virtual double* WaveElev (const double T, const double* const X);
155
165 //const double* const Velocity(const double T, const double* const X);
166 /*
167 const virtual double* const PosChainConnect(const double T, const double* const X);
168 const virtual double* const PosBridleConnect(const double T, const double* const X);
169 const virtual double* const VelChainConnect(const double T, const double* const X);
170 const virtual double* const VelBridleConnect(const double T, const double* const X);
171 */
172
173protected:
174
175 ISignalPort* m_ForceCables;
176
179
180 double m_posCables[3];
181 double m_velCables[3];
182 double m_waveElev;
183 double m_waveElevPos[2];
184 double m_qVec[4];
185
186 double m_mass;
187 double m_radius;
191 double m_Cd_xy;
192 double m_Cd_z;
193 double m_K3D;
196 double m_cog;
197
199 double m_a11;
200 double m_a33;
201 double m_a44;
202 double m_b11;
203 double m_b33;
204 double m_b44;
205 double m_c33;
206 double m_c44;
207 double m_I4;
208 double m_rho;
209 double m_g;
210
214
216 double m_F_FK[5];
217 double m_F_D[5];
218 double m_F_visc[5];
219 double m_F_hydTot[5];
220 double m_F_SumPress[5];
221
223 void ForcesHydrodynamic(const double T, const double* const X);
224 void ForcesPressureInt (const double T, const double* const X);
225 void RotationVector (const double T, const double* const X);
226
227private:
228
229#ifdef FH_VISUALIZATION
230 Ogre::SceneNode* m_RenderNode;
231 double m_RVis;
232 double m_HVis;
233 string m_Material;
234 double m_Color[3];
235#endif
236};
237#endif
238} // namespace
Definition: CEnvironment.h:10
Definition: DeepSeaGravityWaves.h:172
Definition: CCircularBuoy.h:70
double m_radius
Mass of the buoy.
Definition: CCircularBuoy.h:187
double m_F_D[5]
Froude-Kriloff pressure forces.
Definition: CCircularBuoy.h:217
DeepSeaGravityWaves * m_EnvironmentDSG
Pointer to DeepSeaGravityWaves -> CEnvironment.
Definition: CCircularBuoy.h:213
double m_b44
Potential damping z-direction.
Definition: CCircularBuoy.h:204
double m_offsetCables
Bottom cone height of the buoy.
Definition: CCircularBuoy.h:190
virtual const double * PosCables(const double T, const double *const X)
Output port. Returns current position of buoy cone apex.
double m_F_visc[5]
Diffraction forces.
Definition: CCircularBuoy.h:218
double m_F_SumPress[5]
Total hydrodynamic forces.
Definition: CCircularBuoy.h:220
double m_K3D
Drag coefficient sphere (z)
Definition: CCircularBuoy.h:193
void OdeFcn(const double T, const double *const X, double *const XDot, const bool IsMajorTimeStep)
Computes object derivatives as a function of time, states and input ports.
double m_c44
Spring stiffness z-direction.
Definition: CCircularBuoy.h:206
int m_VelocityIndex
The index of the position state in the state array.
Definition: CCircularBuoy.h:178
void ForcesHydrodynamic(const double T, const double *const X)
Froude-Kriloff and hydrostatic pressure forces summed over the wetted surface.
double m_posCables[3]
The index of the velocity state in the state array.
Definition: CCircularBuoy.h:180
double m_Cd_z
Drag coefficient circular cylinder (x,y)
Definition: CCircularBuoy.h:192
double m_a44
Added mass z-direction.
Definition: CCircularBuoy.h:201
double m_b33
Added mass x,y-direction.
Definition: CCircularBuoy.h:203
double m_a33
Added mass x,y-direction.
Definition: CCircularBuoy.h:200
void RotationVector(const double T, const double *const X)
Froude-Kriloff and static pressure forces integrated over instantanous wetted surface.
double m_linEqSwitch
Boolean. true if linear dynamic (Froude-Kriloff) and linaer static pressure is to be used.
Definition: CCircularBuoy.h:195
double m_qVec[4]
Chosen position at which wave elevation will be reported.
Definition: CCircularBuoy.h:184
double m_rho
Moment of inertia in pitch and roll approximation (Faltinsen 1990, Sea Loads on Ships and Offshore St...
Definition: CCircularBuoy.h:208
void ForcesPressureInt(const double T, const double *const X)
Hydrodynamic excitation forces.
double m_heightTotal
Radius of the buoy.
Definition: CCircularBuoy.h:188
bool m_isLinEq
3D body reduction effect (viscous forces)
Definition: CCircularBuoy.h:194
double m_a11
Center of gravity relative to base of cylindrical part of buoy.
Definition: CCircularBuoy.h:199
double m_F_FK[5]
Pointer to DeepSeaGravityWaves -> CEnvironment.
Definition: CCircularBuoy.h:216
ISignalPort * m_ForceCables
Output port. Returns current velocity.
Definition: CCircularBuoy.h:175
double m_Cd_xy
Offset length cable mounting.
Definition: CCircularBuoy.h:191
double m_c33
Potential damping in pitch and roll (Faltinsen 1990, Sea Loads on Ships and Offshore Structures)
Definition: CCircularBuoy.h:205
double m_cog
Switch. 1 if linear dynamic (Froude-Kriloff) and linaer static pressure is to be used.
Definition: CCircularBuoy.h:196
CEnvironment * m_Environment
Acceleration of gravity.
Definition: CCircularBuoy.h:212
double m_heightCone
Height (Total included cone) of the bouy.
Definition: CCircularBuoy.h:189
double m_I4
Spring stiffness in pitch and roll.
Definition: CCircularBuoy.h:207
double m_velCables[3]
Position of cable connectors (output variable)
Definition: CCircularBuoy.h:181
double m_b11
Added mass pitch and roll (Faltinsen 1990, Sea Loads on Ships and Offshore Structures)
Definition: CCircularBuoy.h:202
double m_waveElevPos[2]
Wave elevation at given (x,y) coordinate (output variable). Used for validation of class WaveEnergySp...
Definition: CCircularBuoy.h:183
virtual const double * VelCables(const double T, const double *const X)
Output port. Returns current velocity of buoy cone apex.
double m_F_hydTot[5]
Morison drag forces.
Definition: CCircularBuoy.h:219
double m_g
Water density.
Definition: CCircularBuoy.h:209
int m_PositionIndex
Input port. The external force from chains acting on the buoy.
Definition: CCircularBuoy.h:177
CCircularBuoy(const string &simObjectName, ISimObjectCreator *const creator)
Reads parameters, registers states, input/output ports and shared resources.
double m_mass
Rotation of buoy represented as a quaternion vector (matrix)
Definition: CCircularBuoy.h:186
virtual const double * WaveElev(const double T, const double *const X)
Output port. Returns wave elevation from the environmental model at the point defined by waveElevPosi...
double m_waveElev
Velocity of cable connectors (output variable)
Definition: CCircularBuoy.h:182
Class modelling a Net cage.
Definition: CBottomRing.h:35