9#ifndef C_SCREEN_ELEMENT_3N
10#define C_SCREEN_ELEMENT_3N
13#include "CScreenElementDef.h"
14#include "CPrintDuringExec.h"
17#include "Eigen/StdVector"
20#define vec3 Eigen::Matrix<double,3,1>
27#ifdef FH_VISUALIZATION
29#ifdef USE_DYNAMIC_LINES
30#include "sfh/ogre/CDynamicLines.h"
32#include "sfh/ogre/C3DLine.h"
50 const std::string sNetName,
51 const unsigned long iID,
53 const int NBarsInWakeEffectCalc,
54 const double dNy_water,
55 const double dRho_water,
56 const double dKnotDiameterRatio,
57 const double dKnotMomStiff,
58 const double dKknotMomStiff_contact,
59 const double dCnLinearLimitAngle,
60 const double dCnLinear,
63 const double dTurbLimit,
64 const double dLamLimit,
65 const double dCt_nominal,
66 const double dCnKnots_nominal,
67 const double dDampingRatio,
68 const bool internalWakeEffectsActive,
69 const bool useActualSizeInWakeEffect,
70 const bool useReynoldsDependentDrag);
75 void AddNodeForces(
const double*
const adNodePosA_ned,
76 const double*
const adNodePosB_ned,
77 const double*
const adNodePosC_ned,
78 const double*
const adNodeVelA_ned,
79 const double*
const adNodeVelB_ned,
80 const double*
const adNodeVelC_ned,
81 const double*
const adWaterVel_ned,
82 double *
const adNodeForceA_ned,
83 double *
const adNodeForceB_ned,
84 double *
const adNodeForceC_ned,
87 const double*
const harmonicForceCoeffs,
88 double dHydroForcesRatio = 1.0,
89 double dAddedLinearDrag = 0.0);
95 void GenerateInternalWakeEffectPolynomial(
double* currentVel);
96 void GenerateExternalWakeEffectPolynomial(
double* currentVel);
97 bool IsInShadowedRegionOfCage();
98 void SetInShadowedRegionOfCage(
bool value);
99 void SetDistanceToWallInFront(
double distance);
100 double GetExternalWakeEffect(
double* currentVel,
double* posA,
double* posB,
double* posC);
101 double GetInternalWakeEffect(
double* currentVel,
double* posA,
double* posB,
double* posC);
105#ifdef FH_VISUALIZATION
107 void RenderInit(Ogre::Root* pOgreRoot);
110 void RenderUpdate(
const double*
const adPosA,
const double*
const adPosB,
111 const double*
const adPosC );
114 void setElementIsCoveredByROV(
bool _covered);
117 void CalcTensionForces(
double meshBarComp_panel[6],
double meshBarLength[2],
118 double twineTension[2],
double nodeATension_panel[3],
double nodeBTension_panel[3],
119 double nodeCTension_panel[3]);
121 void CalcLocalUVComponents(
double nodesABdist_panel[3],
double nodesACdist_panel[3],
122 double nodesBCdist_panel[3],
double meshBarComp_panel[6],
double meshBarLength[2]);
124 void CalcMeshContactForces(
double meshBarComp_panel[6],
125 double meshBarLength[2],
126 double nodeAMeshOpeningRes_panel[3],
127 double nodeBMeshOpeningRes_panel[3],
128 double nodeCMeshOpeningRes_panel[3],
129 double nodeATwineContactRes_panel[3],
130 double nodeBTwineContactRes_panel[3],
131 double nodeCTwineContactRes_panel[3]);
133 double CalcVelocities(
double R_ned2panel[3][3],
134 const double*
const adNodeVelA_ned,
135 const double*
const adNodeVelB_ned,
136 const double*
const adNodeVelC_ned,
137 const double*
const adWaterVel_ned,
138 double elementVel_ned[3],
139 double hydDynVel_ned[3],
140 double hydDynVel_panel[3]);
142 void CalcHydroDynamicForces(
double meshBarComp_panel[6],
143 double meshBarLength[2],
144 double R_ned2panel[3][3],
145 const double*
const adNodeVelA_ned,
146 const double*
const adNodeVelB_ned,
147 const double*
const adNodeVelC_ned,
148 const double*
const adWaterVel_ned,
149 double elementVel_ned[3],
150 double totalDragPerNode_panel[3]);
152 void CalcDampingForces(
double elementVel_ned[3],
153 const double*
const adNodeVelA_ned,
154 const double*
const adNodeVelB_ned,
155 const double*
const adNodeVelC_ned,
156 const double*
const adWaterVel_ned,
157 double adDampingForcesNodeA[3],
158 double adDampingForcesNodeB[3],
159 double adDampingForcesNodeC[3],
160 double dAddedLinearDrag);
164 void SortPanelNodes(
int index,
const double * aadNodes[3],
double adNodePosA_mesh[2],
double adNodePosB_mesh[2],
double adNodePosC_mesh[2],
unsigned short* aiSort);
165 void FindTwineCrossings(
unsigned short index,
unsigned short kiNumMeshPerLine,
double* CoeffA,
double* CoeffB,
const double* aadNodes[3]);
167 double GetDragCoefficientFromPolynomial(
double nominalReynoldsNumber);
168 double Blevins(
double DX,
double DY,
double Cd);
169 double SquaredSumColumnIn2DDoubleArray(Eigen::MatrixXd input,
int colIndex,
int length);
170 Eigen::VectorXd PolynomialFit(Eigen::VectorXd alpha,
int nAlpha, Eigen::VectorXd targetArray,
int order);
171 double ComputePolynomialValue(std::string polynomialType,
double inputValue);
172 int m_maxUBarDimension;
173 int m_maxVBarDimension;
174 double *m_InternalWakeEffectPolynomial;
175 double *m_ExternalWakeEffectPolynomial;
176 int m_orderOfInternalPolynomial;
177 int m_orderOfExternalPolynomial;
178 bool m_InternalWakeEffectsActive;
179 bool m_isInShadowedRegionOfCage;
180 double m_distanceToWallInFront;
181 bool m_useReynoldsDependentDrag;
182 bool m_UseActualSizeInWakeEff;
183 int m_NBarsInWakeEffectCalc;
198 std::string m_sNetName;
200 double m_adNodeInertia[3];
207 double m_dKnotMomStiff;
208 double m_dKnotMomStiffContact;
209 double m_adNodeAPos_mesh[2];
210 double m_adNodeBPos_mesh[2];
211 double m_adNodeCPos_mesh[2];
212 double m_CnLinearLimitAngle;
219 double m_CnKnots_nominal;
223 double m_adNodesDistAB_mesh[2];
224 double m_adNodesDistAC_mesh[2];
225 double m_adNodesDistBC_mesh[2];
234 double m_dMeshOpeningAngle;
235 double m_ShadowEffect[3];
236 double m_ShadowEffectBias;
241 double m_kTwineDragNormal[2];
242 double m_nodeAforce_ned[3];
243 double m_nodeBforce_ned[3];
244 double m_nodeCforce_ned[3];
245 double m_dDampingCoeff;
253 double m_nodeAforce_ned_last[3];
254 double m_nodeBforce_ned_last[3];
255 double m_nodeCforce_ned_last[3];
258 bool m_isCoveredByROV;
260#ifdef FH_VISUALIZATION
262 Ogre::Root* m_pOgreRoot;
263 Ogre::SceneManager* m_pSceneMgr;
264 Ogre::Entity* m_apRenderElement[3];
265 Ogre::Entity* m_apRenderSphere[3];
266 Ogre::SceneNode* m_pRenderNodeMesh;
267 Ogre::SceneNode* m_apRenderNodeSphere[3];
268 Ogre::SceneNode* m_pRenderNodeOutline;
269 Ogre::SceneNode* m_pRenderNodeMaterial;
270#ifdef USE_DYNAMIC_LINES
271 CDynamicLines* m_pLines;
275 CDynamicLines* m_pLineOutline;
276 Ogre::ManualObject * m_pNetRenderObj;
279 unsigned short* m_aiSortU;
280 unsigned short* m_aiSortV;
281 unsigned long m_iNumTwines;
282 unsigned long m_iNumUTwines;
283 unsigned long m_iNumVTwines;
284 double* m_adInterpCoeffAu;
285 double* m_adInterpCoeffAv;
286 double* m_adInterpCoeffBu;
287 double* m_adInterpCoeffBv;
Definition: CScreenElement3N.h:46
double CalcNodeInertia(int iNode)
Calculates the inertia of a node.
CScreenElement3N(const std::string sNetName, const unsigned long iID, const CScreenElementDef *pNetPanel, const int NBarsInWakeEffectCalc, const double dNy_water, const double dRho_water, const double dKnotDiameterRatio, const double dKnotMomStiff, const double dKknotMomStiff_contact, const double dCnLinearLimitAngle, const double dCnLinear, const double dCnTurb, const double dCnLam, const double dTurbLimit, const double dLamLimit, const double dCt_nominal, const double dCnKnots_nominal, const double dDampingRatio, const bool internalWakeEffectsActive, const bool useActualSizeInWakeEffect, const bool useReynoldsDependentDrag)
The constructor.
~CScreenElement3N(void)
The destructor.
Definition: CScreenElementDef.h:23