8#ifndef C_NET_ELEMENT_3N_WAKE_EFFECT
9#define C_NET_ELEMENT_3N_WAKE_EFFECT
12#include "CNetElementDef.h"
13#include "CPrintDuringExec.h"
17#include "Eigen/StdVector"
20typedef Eigen::Matrix<double,3,1> vec3;
23#ifdef FH_VISUALIZATION
25#ifdef USE_DYNAMIC_LINES
26#include "sfh/ogre/CDynamicLines.h"
28#include "sfh/ogre/C3DLine.h"
46 const std::string sNetName,
47 const unsigned long iID,
49 const int NBarsInWakeEffectCalc,
50 const double dNy_water,
51 const double dRho_water,
52 const double dKnotDiameterRatio,
53 const double dKnotMomStiff,
54 const double dKknotMomStiff_contact,
55 const double dCnLinearLimitAngle,
56 const double dCnLinear,
59 const double dTurbLimit,
60 const double dLamLimit,
61 const double dCt_nominal,
62 const double dCnKnots_nominal,
63 const double dDampingRatio,
64 const bool internalWakeEffectsActive,
65 const bool useActualSizeInWakeEffect,
66 const bool useReynoldsDependentDrag);
71 void AddNodeForces(
const double*
const adNodePosA_ned,
72 const double*
const adNodePosB_ned,
73 const double*
const adNodePosC_ned,
74 const double*
const adNodeVelA_ned,
75 const double*
const adNodeVelB_ned,
76 const double*
const adNodeVelC_ned,
77 const double*
const adAmbientCurrentVel_ned,
78 const double*
const adWaveParticleVel_ned,
79 const double*
const adWaterVel_ned,
80 double *
const adNodeForceA_ned,
81 double *
const adNodeForceB_ned,
82 double *
const adNodeForceC_ned,
83 const bool dUseScreenModel,
84 const bool dUseDragCoeffMoeFore2021,
86 const double dRhoWater,
87 double dHydroForcesRatio = 1.0,
88 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 CalcHydroDynamicForcesScreenModel(
143 const double*
const adNodePosA_ned,
144 const double*
const adNodePosB_ned,
145 const double*
const adNodePosC_ned,
146 const double*
const adNodeVelA_ned,
147 const double*
const adNodeVelB_ned,
148 const double*
const adNodeVelC_ned,
149 const double*
const adAmbientCurrentVel_ned,
150 const double*
const adWaveParticleVel_ned,
151 const double*
const adWaterVel_ned,
152 double *
const nodeAforce_ned,
153 double *
const nodeBforce_ned,
154 double *
const nodeCforce_ned,
155 const double rhoWater,
156 const bool useDragCoeffMoeFore2021,
159 void CalcHydroDynamicForces(
double meshBarComp_panel[6],
160 double meshBarLength[2],
161 double R_ned2panel[3][3],
162 const double*
const adNodeVelA_ned,
163 const double*
const adNodeVelB_ned,
164 const double*
const adNodeVelC_ned,
165 const double*
const adWaterVel_ned,
166 double elementVel_ned[3],
167 double totalDragPerNode_panel[3]);
169 void CalcDampingForces(
double elementVel_ned[3],
170 const double*
const adNodeVelA_ned,
171 const double*
const adNodeVelB_ned,
172 const double*
const adNodeVelC_ned,
173 const double*
const adWaterVel_ned,
174 double adDampingForcesNodeA[3],
175 double adDampingForcesNodeB[3],
176 double adDampingForcesNodeC[3],
177 double dAddedLinearDrag);
180 double DragCoeffCircularCylinderFromReynoldsNumber(
double Sn,
double Urel);
181 vec3 CalcRelativeVelocity(
184 const double*
const adNodeVelA_ned,
185 const double*
const adNodeVelB_ned,
186 const double*
const adNodeVelC_ned);
190 void SortPanelNodes(
int index,
const double * aadNodes[3],
double adNodePosA_mesh[2],
double adNodePosB_mesh[2],
double adNodePosC_mesh[2],
unsigned short* aiSort);
191 void FindTwineCrossings(
unsigned short index,
unsigned short kiNumMeshPerLine,
double* CoeffA,
double* CoeffB,
const double* aadNodes[3]);
193 double GetDragCoefficientFromPolynomial(
double nominalReynoldsNumber);
194 double Blevins(
double DX,
double DY,
double Cd);
195 double SquaredSumColumnIn2DDoubleArray(Eigen::MatrixXd input,
int colIndex,
int length);
196 Eigen::VectorXd PolynomialFit(Eigen::VectorXd alpha,
int nAlpha, Eigen::VectorXd targetArray,
int order);
197 double ComputePolynomialValue(std::string polynomialType,
double inputValue);
198 int m_maxUBarDimension;
199 int m_maxVBarDimension;
200 double *m_InternalWakeEffectPolynomial;
201 double *m_ExternalWakeEffectPolynomial;
202 int m_orderOfInternalPolynomial;
203 int m_orderOfExternalPolynomial;
204 bool m_InternalWakeEffectsActive;
205 bool m_isInShadowedRegionOfCage;
206 double m_distanceToWallInFront;
207 bool m_useReynoldsDependentDrag;
208 bool m_UseActualSizeInWakeEff;
209 int m_NBarsInWakeEffectCalc;
217 std::string m_sNetName;
219 double m_adNodeInertia[3];
226 double m_dKnotMomStiff;
227 double m_dKnotMomStiffContact;
228 double m_adNodeAPos_mesh[2];
229 double m_adNodeBPos_mesh[2];
230 double m_adNodeCPos_mesh[2];
231 double m_CnLinearLimitAngle;
238 double m_CnKnots_nominal;
242 double m_adNodesDistAB_mesh[2];
243 double m_adNodesDistAC_mesh[2];
244 double m_adNodesDistBC_mesh[2];
253 double m_dMeshOpeningAngle;
254 double m_ShadowEffect[3];
255 double m_ShadowEffectBias;
260 double m_kTwineDragNormal[2];
261 double m_nodeAforce_ned[3];
262 double m_nodeBforce_ned[3];
263 double m_nodeCforce_ned[3];
264 double m_dDampingCoeff;
266 double m_nodeAforce_ned_last[3];
267 double m_nodeBforce_ned_last[3];
268 double m_nodeCforce_ned_last[3];
271 bool m_isCoveredByROV;
273#ifdef FH_VISUALIZATION
275 Ogre::Root* m_pOgreRoot;
276 Ogre::SceneManager* m_pSceneMgr;
277 Ogre::Entity* m_apRenderElement[3];
278 Ogre::Entity* m_apRenderSphere[3];
279 Ogre::SceneNode* m_pRenderNodeMesh;
280 Ogre::SceneNode* m_apRenderNodeSphere[3];
281 Ogre::SceneNode* m_pRenderNodeOutline;
282 Ogre::SceneNode* m_pRenderNodeMaterial;
283#ifdef USE_DYNAMIC_LINES
284 CDynamicLines* m_pLines;
288 CDynamicLines* m_pLineOutline;
289 Ogre::ManualObject * m_pNetRenderObj;
292 unsigned short* m_aiSortU;
293 unsigned short* m_aiSortV;
294 unsigned long m_iNumTwines;
295 unsigned long m_iNumUTwines;
296 unsigned long m_iNumVTwines;
297 double* m_adInterpCoeffAu;
298 double* m_adInterpCoeffAv;
299 double* m_adInterpCoeffBu;
300 double* m_adInterpCoeffBv;
Definition: CNetElement3NWakeEffect.h:42
double CalcNodeInertia(int iNode)
Calculates the inertia of a node.
CNetElement3NWakeEffect(const std::string sNetName, const unsigned long iID, const CNetElementDef *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.
~CNetElement3NWakeEffect(void)
The destructor.
Class containing the description of a net panel and methods necessary for taking this over to triangu...
Definition: CNetElementDef.h:22