Marine systems simulation
FNetElement.h
1
12#ifndef F_NETELEMENT_H
13#define F_NETELEMENT_H
14#include <cmath>
15#include "sfh/constants.h"
16
17
18
19/*
20 * /// <li> Calculates cross-sectional area of twine; all twines in a net element are equal.
21 m_twineCrossSecArea = sfh::pi*twineDiameter*twineDiameter/4;
22
26 for (int i = 0; i<2; i++)
27 {
28 m_nodesABdist_mesh[i] = m_nodeBPos_mesh[i] - m_nodeAPos_mesh[i];
29 m_nodesACdist_mesh[i] = m_nodeCPos_mesh[i] - m_nodeAPos_mesh[i];
30 m_nodesBCdist_mesh[i] = m_nodeCPos_mesh[i] - m_nodeBPos_mesh[i];
31 }
32
36 m_meshDet = sfh::math::Abs(m_nodesACdist_mesh[0]*m_nodesABdist_mesh[1] - m_nodesABdist_mesh[0]*m_nodesACdist_mesh[1]);
37 if (sfh::math::Abs(m_meshDet) < 1.0)
38 CPrintDuringExec::WriteLog("In CNetElement3N::Initialize() for net "
39 + m_sNetName
40 + " and section with id "
41 + sfh::text::Int2Str(m_iID)
42 + ". The mesh determinant in is less than 1.0. This may be caused by two nodes of a net section being too close. Check your input!", "TempOut.txt");
43
50 m_numMeshes = sfh::math::Abs(m_meshDet/2); // Number of meshes in the triangular element.
51 m_numBars = sfh::math::Abs(m_meshDet); // Number of bars equals twice the number of meshes (Priour, 2005, Eq. 7).
52 m_numUBars = sfh::math::Abs(m_meshDet/2); // Number of u-bars is half the total number of mesh bars.
53 m_numVBars = sfh::math::Abs(m_meshDet/2); // Number of v-bars is half the total number of mrsh bars.
54 m_numKnots = sfh::math::Abs(m_meshDet/2); // Number of knots equals the number of meshes;
55
57 m_weight = (m_rho_twines - m_rho_water)*m_twineCrossSecArea*m_meshBarLength_unstretched*m_numBars;
58 m_NodeWeight = m_weight / 3;
59
60 m_Ct = m_Ct_nominal*sfh::pi; // Approximate tangential drag force coefficient, nominal coefficient multiplied by PI due to the typical expression for the drag force.
61
64 double CnKnots = m_CnKnots_nominal * sfh::pi * m_knotDiameter * m_knotDiameter / 4;
65 m_kKnot = 0.5 * m_rho_water * m_knotDiameter * m_numKnots * CnKnots;
66
68 m_kTwineDragNormal[0] = 0.5 * m_rho_water * m_twineDiameter * (m_meshBarLength_unstretched - m_knotDiameter) * m_numUBars ;
69 m_kTwineDragNormal[1] = 0.5 * m_rho_water * m_twineDiameter * (m_meshBarLength_unstretched - m_knotDiameter) * m_numVBars ;
70
71 m_EATwine = m_EModulus * m_twineCrossSecArea;
72 m_dDampingRatio = 10.0;
73 double avgMeshesBetweenNodes = (sfh::math::Norm(m_nodesABdist_mesh, 3) + sfh::math::Norm(m_nodesACdist_mesh, 3) + sfh::math::Norm(m_nodesBCdist_mesh, 3)) / 3;
74 double avgNodeDist = avgMeshesBetweenNodes * m_meshBarLength_unstretched;
75 m_dDampingCoeff = m_dDampingRatio * sqrt(m_NodeWeight * m_EATwine * m_numBars / avgMeshesBetweenNodes / avgNodeDist) ;
76 *
77 */
78
79// Sets some constants common for all net panels.
80namespace netconstants
81{
82 const double dHydroForcesRatio = 1;
83 const double dAddedLinearDrag = 0;
84 const double knotDiameterRatio = 2.0;
85 const double m_ny_water = 1.19e-6;
86 const double rho_water = 1025;
87 const double m_knotMomStiff = 0;// 0.001;
88 const double CnLinearLimitAngle = 4.0 * sfh::pi / 180;
89 const double CnLinear = 0.068 ;
90 const double CnTurb = 0.8;
91 const double CnLam = 1.15;
92 const double TurbLimit = 3.4e5;
93 const double LamLimit = 2.0e5;
94 const double Ct_nominal = 0.01;
95 const double CnKnots_nominal = 1.15;
96};
97
98void AddNetPanelNodeForces(
99 int iElement,
100 const double* adPosAndVel,
101 const int* aiPosIndex,
102 const int* aiVelIndex,
103 const double* adWaterVel_ned,
104 double* adNodeForces,
105 int* aiNetConn,
106 double* adNodesDistMesh,
107 double* adMesdDet,
108 double* adEATwine,
109 double* adMeshBarLength_unstretched,
110 double* adKnotDiameter,
111 double* adKnotMomStiff_contact,
112 double* adNodeWeight,
113 double* adDampingCoeff,
114 double* adKKnot,
115 double* adTwineDragNormal,
116 double* adTwineDiameter,
117 const double m_CnLinearLimitAngle,
118 const double m_CnLinear,
119 const double m_CnTurb,
120 const double m_CnLam,
121 const double m_TurbLimit,
122 const double m_LamLimit,
123 const double m_Ct_nominal,
124 const double m_CnKnots_nominal);
125
126#endif
Definition: FNetElement.h:81
const double m_ny_water
Kinematic viscosity of water.
Definition: FNetElement.h:85