Marine systems simulation
TriangularNetElement.h
1#pragma once
2
3#include "fish/eigen_matrix_defs.h"
4#include "sfh/constants.h"
5
6namespace Fish{
7
9public:
10 struct NetData{
11 double CnLinearLimitAngle;
12 double CnLinear;
13 double CnTurb;
14 double CnLam;
15 double TurbLimit;
16 double LamLimit;
17 double Ct_nominal;
19 double DampingCoeff;
20 double BarD;
21 double KnotD;
22 double BarL0;
23 double NodeAPos_mesh[2];
24 double NodeBPos_mesh[2];
25 double NodeCPos_mesh[2];
26 double TwineEA;
27
29 CnLinearLimitAngle = 4.0*sfh::pi/180.0;
30 CnLinear = 0.068;
31 CnTurb = 0.8;
32 CnLam = 1.15;
33 TurbLimit = 3.4e5;
34 LamLimit = 2.0e5;
35 Ct_nominal = 0.01;
36 CnKnots_nominal = 1.15;
37 }
38
39 double CalculateMeshVolume(double NodalDistribution[3] = nullptr){
40 vec2 BC = vec2(NodeCPos_mesh)-vec2(NodeBPos_mesh);
41 vec2 CA = vec2(NodeAPos_mesh)-vec2(NodeCPos_mesh);
42 vec2 AB = vec2(NodeBPos_mesh)-vec2(NodeAPos_mesh);
43 double N = std::abs(0.5*(CA.x()*AB.y() - CA.y()*AB.x()));
44 double Volume = sfh::pi/4.0*BarD*BarD*BarL0*N;
45 if(NodalDistribution){
46 vec3 nDist(BC.norm(),CA.norm(),AB.norm());
47 double MassDivider = nDist.squaredNorm();
48 for(int i = 0; i < 3; ++i){
49 NodalDistribution[i] = nDist(i)*nDist(i)*Volume/MassDivider;
50 }
51 }
52 return Volume;
53 }
54 };
55
56 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57 TriangularNetElement(NetData net/*, PointMass* PA, PointMass* PB, PointMass* PC, HorizontalFlowField* FlowField = nullptr*/);
58 ~TriangularNetElement();
59
60 //virtual bool ComputeOdeFunction(double Time, ConstVectorMap& States, VectorMap& StatesDot, TripletList& Jacobian);
61 //virtual void AddProcessNoise(ConstVectorMap& States, TripletList& ProcessNoise){}
62 //virtual void InitialConditionSetup( const double T, const double *const currentIC, double* const updatedIC, ConstVectorMap& CurrentStates, VectorMap& UpdatedStates, ConstMatrixMap& CurrentCovariance, MatrixMap& UpdatedCovariance ){}
63 mat3 CalcForces(const mat32& TriangleVectors_ned/*, const vec3& Velocity_ned*/);
64 mat3 CalcForces2(const mat32& TriangleVectors_ned);
65private:
66
67 //vec2 CalcDragCoefficients(const vec2& sin_hydDynAngle, double nominalReynoldsNumber);
68 //vec3 CalcHydroDynamicForces(const mat2& MeshUV_panel,const vec3& relativeVelocity_panel);
69 //vec3 CalcHydroDynamicForces(const mat2& MeshUV_panel,const vec3& relativeVelocity_panel, mat3& Jacobian);
70
71 //PointMass* m_PA;
72 //PointMass* m_PB;
73 //PointMass* m_PC;
74 NetData m_NetData;
75
76 // Calculated element properties
77 mat23 m_Vertices;
78 mat23 m_EdgeVector;
79 mat23 m_EdgePerpendicular;
80
81 mat2 m_MeshBarConverter;
82 double m_MeshDeterminant;
83 double m_Ct;
84 double m_kKnot;
85 double m_TwineDragNormal;
86 double m_CurrentCd;
87
88};
89};
Definition: TriangularNetElement.h:8
Definition: TriangularNetElement.h:10
void SetStandardValues()
= EModulus * TwineCrossSecArea.
Definition: TriangularNetElement.h:28
double BarL0
Diameter of knots.
Definition: TriangularNetElement.h:22
double TwineEA
Position of node C in net mesh (u,v) coordinates (Priour, 1997, 1999, 2001, 2003, 2005)
Definition: TriangularNetElement.h:26
double NodeCPos_mesh[2]
Position of node B in net mesh (u,v) coordinates (Priour, 1997, 1999, 2001, 2003, 2005)
Definition: TriangularNetElement.h:25
double Ct_nominal
= 2.0*10^5 Value defining lower limit for laminar boundary layer (Ersdal& Faltinsen,...
Definition: TriangularNetElement.h:17
double LamLimit
= 3.4*10^5 Value defining upper limit for turbulent boundary layer (Ersdal& Faltinsen,...
Definition: TriangularNetElement.h:16
double BarD
A coefficient used to calculate rotational and structural damping.
Definition: TriangularNetElement.h:20
double DampingCoeff
= 1.15 Knot drag force coefficient by approximation (Fredheim and Enerhaug, personal communication)....
Definition: TriangularNetElement.h:19
double NodeBPos_mesh[2]
Position of node A in net mesh (u,v) coordinates (Priour, 1997, 1999, 2001, 2003, 2005)
Definition: TriangularNetElement.h:24
double CnKnots_nominal
= 0.01 Approximate tangential drag force coefficient for cylinders (Ersdal, 2004; White,...
Definition: TriangularNetElement.h:18
double NodeAPos_mesh[2]
Length of mesh bar.
Definition: TriangularNetElement.h:23
double CnLinear
= 4*pi/180 Angle (in radians) below which a linear model for the normal force coefficient Cn applies ...
Definition: TriangularNetElement.h:12
double CnTurb
= 0.068 Constant in the expression for the linear model of the normal force coefficient Cn (Ersdal an...
Definition: TriangularNetElement.h:13
double TurbLimit
= 1.15 Constant in the expression for the modified cross-flow principle for the normal force coeffici...
Definition: TriangularNetElement.h:15
double KnotD
Diameter of twines.
Definition: TriangularNetElement.h:21
double CnLam
= 0.8 Constant in the expression for the modified cross-flow principle for the normal force coefficie...
Definition: TriangularNetElement.h:14