Marine systems simulation
CCylinder.h
1
50#ifndef C_CYLINDER_H
51#define C_CYLINDER_H
52#include <SimObject.h>
53#include <CEnvironment.h>
54#include <environment/DeepSeaGravityWaves.h>
55#include "sfh/constants.h"
56#include <sfh/text.h>
57#include <stdio.h>
58#include <math.h>
59#include <iostream>
60#include <vector>
61#include "Eigen/Eigen"
62using namespace std;
63using std::vector;
64typedef Eigen::Matrix<double,3,1> vec3;
65
66namespace Netcage {
67
68
81class CCylinder : public SimObject
82{
83public:
99 CCylinder(const string& simObjectName, ISimObjectCreator* const creator);
100 virtual void FinalSetup(const double T, const double* const X, ISimObjectCreator* const pCreator);
101 virtual ~CCylinder();
102
114 void OdeFcn(const double T , const double* const X, double* const XDot, const bool IsMajorTimeStep);
115
116
117#ifdef FH_VISUALIZATION
126 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
127
136 void RenderUpdate(const double T, const double* const X);
137#endif
138
148 const double* const Position(const double T, const double* const X);
149 const double* const Velocity(const double T, const double* const X);
150
152 const virtual double* PosCables (const double T, const double* const X);
153 const virtual double* VelCables (const double T, const double* const X);
154
164 //const double* const Velocity(const double T, const double* const X);
165 /*
166 const virtual double* const PosChainConnect(const double T, const double* const X);
167 const virtual double* const PosBridleConnect(const double T, const double* const X);
168 const virtual double* const VelChainConnect(const double T, const double* const X);
169 const virtual double* const VelBridleConnect(const double T, const double* const X);
170 */
171
172protected:
173
174 ISignalPort* m_ForceCables;
175
178
179 double m_posCables[3];
180 double m_velCables[3];
181 double m_qVec[4];
183 double m_outerRadius;
184 double m_rhoHDPE;
185 double m_mass;
186 double m_radius;
187 double m_depth;
191 double m_Cd_xy;
192 double m_Cd_z;
193 double m_K3D;
196 double m_cog;
197
199 double* m_CollarConnectVel;
200 int m_nCollarConnect;
201 ISignalPort ** m_CollarConnectExtForce;
202
203 double* m_NetRoofConnectPos;
204 double* m_NetRoofConnectVel;
205 int m_nNetRoofConnect;
206 ISignalPort ** m_NetRoofConnectExtForce;
207
209 double m_a11;
210 double m_a33;
211 double m_a44;
212 double m_b11;
213 double m_b33;
214 double m_b44;
215 double m_c33;
216 double m_c44;
217 double m_I4;
218
219 double m_rho;
220 double m_g;
221
224
226 double m_F_FK[5];
227 double m_F_D[5];
228 double m_F_visc[5];
229 double m_F_hydTot[5];
230 double m_F_SumPress[5];
231
233 void ForcesHydrodynamic(const double T, const double* const X);
234 void ForcesPressureInt (const double T, const double* const X);
235 void RotationVector (const double T, const double* const X);
236
237 const virtual double* CollarConnectPos (const double T, const double* const X, int iCollarConnect);
238 const virtual double* CollarConnectVel (const double T, const double* const X, int iCollarConnect);
239
240 const virtual double* NetRoofConnectPos (const double T, const double* const X, int iNetRoofConnect);
241 const virtual double* NetRoofConnectVel (const double T, const double* const X, int iNetRoofCollarConnect);
242
243 Eigen::Matrix3d RotationMatrix(Eigen::Vector3d vector);
244
245private:
246
247#ifdef FH_VISUALIZATION
248 Ogre::SceneNode* m_RenderNode;
249 double m_RVis;
250 double m_HVis;
251 string m_Material;
252 double m_Color[3];
253#endif
254};
255#endif
256} // namespace
Definition: DeepSeaGravityWaves.h:172
Definition: CCylinder.h:82
double m_F_FK[5]
Pointer to DeepSeaGravityWaves -> CEnvironment.
Definition: CCylinder.h:226
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_F_hydTot[5]
Morison drag forces.
Definition: CCylinder.h:229
double m_radius
Mass of the buoy.
Definition: CCylinder.h:186
double m_g
Water density.
Definition: CCylinder.h:220
double m_qVec[4]
Velocity of cable connectors (output variable)
Definition: CCylinder.h:181
double m_Cd_xy
Offset length cable mounting.
Definition: CCylinder.h:191
virtual const double * CollarConnectPos(const double T, const double *const X, int iCollarConnect)
Calculates rotation quaternion.
int m_PositionIndex
Input port. The external force from chains acting on the buoy.
Definition: CCylinder.h:176
double m_cog
Switch. 1 if linear dynamic (Froude-Kriloff) and linaer static pressure is to be used.
Definition: CCylinder.h:196
double * m_CollarConnectPos
Center of gravity relative to base of cylindrical part of buoy.
Definition: CCylinder.h:198
double m_rho
Moment of inertia in pitch and roll approximation (Faltinsen 1990, Sea Loads on Ships and Offshore St...
Definition: CCylinder.h:219
double m_I4
Spring stiffness in pitch and roll.
Definition: CCylinder.h:217
double m_b11
Added mass pitch and roll (Faltinsen 1990, Sea Loads on Ships and Offshore Structures)
Definition: CCylinder.h:212
double m_F_visc[5]
Diffraction forces.
Definition: CCylinder.h:228
double m_heightCone
Height (Total included cone) of the bouy.
Definition: CCylinder.h:189
void ForcesHydrodynamic(const double T, const double *const X)
Froude-Kriloff and hydrostatic pressure forces summed over the wetted surface.
CCylinder(const string &simObjectName, ISimObjectCreator *const creator)
Reads parameters, registers states, input/output ports and shared resources.
double m_F_D[5]
Froude-Kriloff pressure forces.
Definition: CCylinder.h:227
double m_a11
Coefficients.
Definition: CCylinder.h:209
double m_linEqSwitch
Boolean. true if linear dynamic (Froude-Kriloff) and linaer static pressure is to be used.
Definition: CCylinder.h:195
double m_heightTotal
Depth of tube in the water.
Definition: CCylinder.h:188
double m_K3D
Drag coefficient sphere (z)
Definition: CCylinder.h:193
double m_innerRadius
Rotation of buoy represented as a quaternion vector (matrix)
Definition: CCylinder.h:182
double m_velCables[3]
Position of cable connectors (output variable)
Definition: CCylinder.h:180
bool m_isLinEq
3D body reduction effect (viscous forces)
Definition: CCylinder.h:194
ISignalPort * m_ForceCables
Output port. Returns current velocity.
Definition: CCylinder.h:174
double m_a44
Added mass z-direction.
Definition: CCylinder.h:211
double m_F_SumPress[5]
Total hydrodynamic forces.
Definition: CCylinder.h:230
double m_offsetCables
Bottom cone height of the buoy.
Definition: CCylinder.h:190
void RotationVector(const double T, const double *const X)
Froude-Kriloff and static pressure forces integrated over instantanous wetted surface.
DeepSeaGravityWaves * m_Environment
Acceleration of gravity.
Definition: CCylinder.h:223
int m_VelocityIndex
The index of the position state in the state array.
Definition: CCylinder.h:177
double m_b33
Added mass x,y-direction.
Definition: CCylinder.h:213
void ForcesPressureInt(const double T, const double *const X)
Hydrodynamic excitation forces.
double m_Cd_z
Drag coefficient circular cylinder (x,y)
Definition: CCylinder.h:192
double m_c33
Potential damping in pitch and roll (Faltinsen 1990, Sea Loads on Ships and Offshore Structures)
Definition: CCylinder.h:215
double m_c44
Spring stiffness z-direction.
Definition: CCylinder.h:216
virtual const double * PosCables(const double T, const double *const X)
Output functions. Positions.
double m_posCables[3]
The index of the velocity state in the state array.
Definition: CCylinder.h:179
const double *const Position(const double T, const double *const X)
Output port. Returns current position.
double m_depth
Radius of the buoy.
Definition: CCylinder.h:187
double m_b44
Potential damping z-direction.
Definition: CCylinder.h:214
double m_a33
Added mass x,y-direction.
Definition: CCylinder.h:210
Class modelling a Net cage.
Definition: CBottomRing.h:35