Marine systems simulation
CMembraneElement.h
1
7
8#ifndef C_MEMBRANE_ELEMENT
9#define C_MEMBRANE_ELEMENT
10
11#include <math.h>
12#include <net/CNetElementDef.h>
13#include "CPrintDuringExec.h"
14
15#ifdef FH_VISUALIZATION
16//#define USE_DYNAMIC_LINES
17#ifndef USE_DYNAMIC_LINES
18#include "sfh/ogre/C3DLine.h"
19#include "sfh/ogre/CDynamicLines.h"
20
21#endif
22#endif
23
24//#define RENDER_OUTLINE
25#define RENDER_MESH
26//#define ATTACH_SPHERE
27//#define RENDER_MATERIAL
28//#define FILTER_FORCES
29//#define CNETELEMENT3N_TRANSPARENT
30
31namespace Netcage {
32
33class CDynamicLines; // forward declaration
34
36{
37public:
40 const std::string sNetName,
41 const unsigned long iID,
42 const CNetElementDef* pNetPanel,
43 const double dNy_water,
44 const double dRho_water);
45
48
49 void AddNodeForces(const double* const adNodePosA_ned,
50 const double* const adNodePosB_ned,
51 const double* const adNodePosC_ned,
52 const double* const adNodeVelA_ned,
53 const double* const adNodeVelB_ned,
54 const double* const adNodeVelC_ned,
55 const double* const adWaterVel_ned,
56 double * const adNodeForceA_ned,
57 double * const adNodeForceB_ned,
58 double * const adNodeForceC_ned,
59 double * pressCoeffAngle,
60 double * pressCoeff,
61 double dHydroForcesRatio = 1.0,
62 double dAddedLinearDrag = 0.0);
63
65 void AddNodeForces(const double* const adNodePosA_ned,
66 const double* const adNodePosB_ned,
67 const double* const adNodePosC_ned,
68 const double* const adNodeVelA_ned,
69 const double* const adNodeVelB_ned,
70 const double* const adNodeVelC_ned,
71 const double* const adWaterVel_ned,
72 double * const adNodeForceA_ned,
73 double * const adNodeForceB_ned,
74 double * const adNodeForceC_ned,
75 double dHydroForcesRatio = 1.0,
76 double dAddedLinearDrag = 0.0);
77
79 double CalcNodeInertia(int iNode);
80
81#ifdef FH_VISUALIZATION
83 void RenderInit(Ogre::Root* pOgreRoot);
84
86 void RenderUpdate( const double* const adPosA, const double* const adPosB,
87 const double* const adPosC );
88#endif
89
90
91private:
92
93/*
94 void CalcTensionForces( double meshBarComp_panel[6], double meshBarLength[2],
95 double twineTension[2], double nodeATension_panel[3], double nodeBTension_panel[3],
96 double nodeCTension_panel[3]);
97*/
98
99/*
100 void CalcLocalUVComponents( double nodesABdist_panel[3], double nodesACdist_panel[3],
101 double nodesBCdist_panel[3], double meshBarComp_panel[6], double meshBarLength[2]);
102*/
103/*
104 void CalcMeshContactForces( double meshBarComp_panel[6],
105 double meshBarLength[2],
106 double nodeAMeshOpeningRes_panel[3],
107 double nodeBMeshOpeningRes_panel[3],
108 double nodeCMeshOpeningRes_panel[3],
109 double nodeATwineContactRes_panel[3],
110 double nodeBTwineContactRes_panel[3],
111 double nodeCTwineContactRes_panel[3]);
112*/
113
114 double CalcVelocities(double R_ned2panel[3][3],
115 const double* const adNodeVelA_ned,
116 const double* const adNodeVelB_ned,
117 const double* const adNodeVelC_ned,
118 const double* const adWaterVel_ned,
119 double elementVel_ned[3],
120 double hydDynVel_ned[3],
121 double hydDynVel_panel[3]);
122
123
124 void CalcHydroDynamicForces(
125 //double meshBarComp_panel[6],
126 //double meshBarLength[2],
127 double AoA,
128 double PanelArea,
129 double R_ned2panel[3][3],
130 const double* const adNodeVelA_ned,
131 const double* const adNodeVelB_ned,
132 const double* const adNodeVelC_ned,
133 const double* const adWaterVel_ned,
134 double elementVel_ned[3],
135 double totalDragPerNode_panel[3]);
136
137 void CalcDampingForces( double elementVel_ned[3],
138 const double* const adNodeVelA_ned,
139 const double* const adNodeVelB_ned,
140 const double* const adNodeVelC_ned,
141 const double* const adWaterVel_ned,
142 double adDampingForcesNodeA[3],
143 double adDampingForcesNodeB[3],
144 double adDampingForcesNodeC[3],
145 double dAddedLinearDrag);
146
147 // Input
148 unsigned long m_iID;
149 std::string m_sNetName;
150 double m_ny_water;
151 double m_adNodeInertia[3];
152 //double m_rho_water; ///< Density of water.
153 //double m_rho_twines; ///< Material density of twines.
154 //double m_EModulus; ///< E-modulus of twine material.
155 //double m_dBarD; ///< Diameter of twines.
156 //double m_dKnotD; ///< Diameter of knots.
157 //double m_dBarL0; ///< Unstretched length of mesh bar.
158 //double m_dKnotMomStiff; ///< Moment stiffness for mesh resistance to opening forces, Priour (2001, p. 236) sets its value to 0.001.
159 //double m_dKnotMomStiffContact; ///< Moment stiffness for twine contact forces, Priour (unpublished notes Nov. 2006, p. 8) calculates it as 0.01*meshBarLength_unstretched*meshBarLength_unstretched*EModulus*twineCrossSecArea/knotDiameter.
160 double m_adNodeAPos_mesh[2];
161 double m_adNodeBPos_mesh[2];
162 double m_adNodeCPos_mesh[2];
163 //double m_CnLinearLimitAngle; ///< = 4*pi/180 Angle (in radians) below which a linear model for the normal force coefficient Cn applies (Ersdal and Faltinsen, 2006, Table 3).
164 //double m_CnLinear; ///< = 0.068 Constant in the expression for the linear model of the normal force coefficient Cn (Ersdal and Faltinsen, 2006, Table 3)
165 //double m_CnTurb; ///< = 0.8 Constant in the expression for the modified cross-flow principle for the normal force coefficient Cn (Ersdal& Faltinsen, 2006, Eqs. 27 & 28 and Table 3).
166 //double m_CnLam; ///< = 1.15 Constant in the expression for the modified cross-flow principle for the normal force coefficient Cn (Ersdal& Faltinsen, 2006, Eqs. 27 & 28 and Table 3).
167 //double m_TurbLimit; ///< = 3.4*10^5 Value defining upper limit for turbulent boundary layer (Ersdal& Faltinsen, 2006, Eqs. 27 & 28 and Table 3), accounting for the 'real' Reynolds number due to the twines having an angle to the effective hydrodynamic velocity and thus increasing the hydrodynamic length.
168 //double m_LamLimit; ///< = 2.0*10^5 Value defining lower limit for laminar boundary layer (Ersdal& Faltinsen, 2006, Eqs. 27 & 28 and Table 3), accounting for the 'real' Reynolds number due to the twines having an angle to the effective hydrodynamic velocity and thus increasing the hydrodynamic length.
169 //double m_Ct_nominal; ///< = 0.01 Approximate tangential drag force coefficient for cylinders (Ersdal, 2004; White, 1972, 1988, 1991; Ackroyd, 1982). Curvature of cylinder implies increased tangential friction force compared to flat plate results. Relevant values for Ct for cylinders typically varies from 0.008 to 0.015. To be multiplied by PI due to the typical expression for the drag force.
170 //double m_CnKnots_nominal; ///< = 1.15 Knot drag force coefficient by approximation (Fredheim and Enerhaug, personal communication). To be multiplied by PI and knot radius squared due to the typical expression for the drag force.
171
172 // Calculated element properties
173 //double m_twineCrossSecArea; ///< The cross sectional area of each twine.
174 double m_adNodesDistAB_mesh[2];
175 double m_adNodesDistAC_mesh[2];
176 double m_adNodesDistBC_mesh[2];
177 //double m_dMeshDet; ///< Determinant (Priour, 2005, Eq. 7).
178 double m_dNumMeshes;
179 double m_dNumUBars;
180 double m_dNumVBars;
181 double m_dNumKnots;
182 double m_dWeight;
183 //double m_dEATwine; ///< = m_EModulus * m_twineCrossSecArea.
184
185 double m_dMeshOpeningAngle;
186 double m_ShadowEffect[3];
187 double m_ShadowEffectBias;
188 // Calculated constants for increased computational performance.
189 //double m_Ct;
190 //double m_kKnot;
191 double m_NodeWeight;
192 //double m_kTwineDragNormal[2];
193 double m_nodeAforce_ned[3];
194 double m_nodeBforce_ned[3];
195 double m_nodeCforce_ned[3];
196 double m_dDampingCoeff;
197#ifdef FILTER_FORCES
198 double m_nodeAforce_ned_last[3];
199 double m_nodeBforce_ned_last[3];
200 double m_nodeCforce_ned_last[3];
201#endif
202
203#ifdef FH_VISUALIZATION
204 // Visualization specifics
205 Ogre::Root* m_pOgreRoot;
206 Ogre::SceneManager* m_pSceneMgr;
207 Ogre::Entity* m_apRenderElement[3];
208 Ogre::Entity* m_apRenderSphere[3];
209 Ogre::SceneNode* m_pRenderNodeMesh;
210 Ogre::SceneNode* m_apRenderNodeSphere[3];
211 Ogre::SceneNode* m_pRenderNodeOutline;
212 Ogre::SceneNode* m_pRenderNodeMaterial;
213#ifdef USE_DYNAMIC_LINES
214 CDynamicLines* m_pLines;
215#else
216 C3DLine* m_pLines;
217#endif
218 CDynamicLines* m_pLineOutline;
219 Ogre::ManualObject * m_pNetRenderObj;
220
221 // Visualization variables
222 unsigned short* m_aiSortU;
223 unsigned short* m_aiSortV;
224 unsigned long m_iNumTwines;
225 unsigned long m_iNumUTwines;
226 unsigned long m_iNumVTwines;
227 double* m_adInterpCoeffAu;
228 double* m_adInterpCoeffAv;
229 double* m_adInterpCoeffBu;
230 double* m_adInterpCoeffBv;
231#endif
232
233};
234
235} // namespace
236#endif
Class containing the description of a net panel and methods necessary for taking this over to triangu...
Definition: CNetElementDef.h:22
Definition: CMembraneElement.h:36
~CMembraneElement(void)
The destructor.
CMembraneElement(const std::string sNetName, const unsigned long iID, const CNetElementDef *pNetPanel, const double dNy_water, const double dRho_water)
The constructor.
double CalcNodeInertia(int iNode)
Calculates the inertia of a node.
void AddNodeForces(const double *const adNodePosA_ned, const double *const adNodePosB_ned, const double *const adNodePosC_ned, const double *const adNodeVelA_ned, const double *const adNodeVelB_ned, const double *const adNodeVelC_ned, const double *const adWaterVel_ned, double *const adNodeForceA_ned, double *const adNodeForceB_ned, double *const adNodeForceC_ned, double dHydroForcesRatio=1.0, double dAddedLinearDrag=0.0)
Adds node forces for none-cage membrane elements.
Class modelling a Net cage.
Definition: CBottomRing.h:35