FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
CableSegment.h
1#pragma once
2
19#include "CableSegmentWaterForce.h"
20#include "TrawlCableConstraintSets.h"
21
22#include <array>
23#include <fhsim/simobject/ISimObjectCreator.h>
24#include <fhsim_coribo/ConstraintSolver.h>
25#include <string>
26#include <vector>
27
28namespace trawl_mooring
29{
32{
33 int p;
34 int q;
35 int v;
36 int w;
37 int n;
38};
39
48ElementStates AddElementStates(ISimObjectCreator* creator, const std::string& prefix, int i);
49
64
71std::array<double, 2> ReadTensionStabilityFactors(ISimObjectCreator& creator, const std::string& name, double defaultFactor = 1.0);
72
75{
76public:
81 CableSegment(const CableMaterial& material, double elementLength, double frequencyCoefficient);
82
83 double ElementLength() const { return m_elementLength; }
85 double ElementMass() const;
87 double ElementDisplacedVolume() const;
89 double ElementWeightInWater() const;
91 CoRiBoDynamics::vec6 ElementInertia() const;
94
97
101 trawl_mooring::TrawlCableCollisionManager::CableCollisionManagerProperties CollisionProperties(const std::vector<int>& elements, double stiffnessFactor, double collisionFrequencyCoefficient) const;
102
108 trawl_mooring::EnvironmentForces::CableSegment EnvironmentSegment(const std::vector<int>& elements, bool gaussPointDrag = false) const;
109
111 int AddElement(CoRiBoDynamics::ConstraintSolver& solver, ElementStates& element, const trawl_mooring::EnvironmentForces& forces) const;
112
114 std::vector<int> AddElements(CoRiBoDynamics::ConstraintSolver& solver, std::vector<ElementStates>::iterator first, std::vector<ElementStates>::iterator last, const trawl_mooring::EnvironmentForces& forces) const;
115
116private:
117 CableMaterial m_material;
118 double m_elementLength;
119 double m_frequencyCoefficient;
120};
121
123std::vector<double> ElementCentres(double length, int numElements);
124
138void LayOnCatenary(const CoRiBoDynamics::vec3& P1, const CoRiBoDynamics::vec3& P2, double A, double D, const std::vector<double>& coordinates, const std::vector<ElementStates>& elements, double* states);
139
141constexpr double kStraightLineTolerance = 1e-9;
142
157void LayOutLine(ISimObjectCreator& creator, const std::string& lengthParameter, const CoRiBoDynamics::vec3& P1, const CoRiBoDynamics::vec3& P2, double length, double unstretchedLength, const std::vector<double>& coordinates, const std::vector<ElementStates>& elements, double* states);
158
160void LayOutLine(ISimObjectCreator& creator, const std::string& lengthParameter, const CoRiBoDynamics::vec3& P1, const CoRiBoDynamics::vec3& P2, double length, const std::vector<ElementStates>& elements, double* states);
161} // namespace trawl_mooring
One segment of equal rigid cylinders on the constraint solver.
Definition CableSegment.h:75
int AddElement(CoRiBoDynamics::ConstraintSolver &solver, ElementStates &element, const trawl_mooring::EnvironmentForces &forces) const
Adds one element on solver with the added mass of its water (reading forces' environment) and sets it...
double ElementWeightInWater() const
The element's weight in water, g (m - ρV) [N], with the trawl cables' ρ and g.
double ElementMass() const
Mass per length times element length [kg].
trawl_mooring::EnvironmentForces::CableSegment EnvironmentSegment(const std::vector< int > &elements, bool gaussPointDrag=false) const
trawl_mooring::TrawlCableCollisionManager::CableCollisionManagerProperties CollisionProperties(const std::vector< int > &elements, double stiffnessFactor, double collisionFrequencyCoefficient) const
double ElementDisplacedVolume() const
Element length times displacement area [m³].
trawl_cable_water::Segment WaterSegment() const
The element as the water forces and the added mass take it.
trawl_mooring::TrawlCableJointConstraint::CableProperties JointProperties(const std::vector< int > &elements) const
The joint properties of the segment over the solver elements elements.
CoRiBoDynamics::vec6 ElementInertia() const
Mass and the moments of inertia of a solid cylinder of the nominal diameter about its centre (z the a...
CableSegment(const CableMaterial &material, double elementLength, double frequencyCoefficient)
std::vector< int > AddElements(CoRiBoDynamics::ConstraintSolver &solver, std::vector< ElementStates >::iterator first, std::vector< ElementStates >::iterator last, const trawl_mooring::EnvironmentForces &forces) const
Adds the elements [first, last) in order; returns their solver indices.
Definition TrawlCableConstraintSets.h:136
The properties of the elements of one cable segment.
Definition CableSegmentWaterForce.h:33
The material of one cable segment.
Definition CableSegment.h:52
double tensileArea
Cross-section area of the load-bearing material [m²].
Definition CableSegment.h:54
double massPerLength
Mass per length [kg/m].
Definition CableSegment.h:60
double youngsModulus
E-modulus of the load-bearing material [Pa].
Definition CableSegment.h:57
std::array< double, 2 > tensionStability
Divides the bending frequency response; multiplies the bending stiffness.
Definition CableSegment.h:62
double displacementArea
Cross-section area that displaces water [m²].
Definition CableSegment.h:59
double shearModulus
G-modulus of the load-bearing material [Pa].
Definition CableSegment.h:58
double diameter
Nominal diameter [m].
Definition CableSegment.h:53
double secondAreaMoment
Second area moment of the load-bearing material [m⁴].
Definition CableSegment.h:55
double structuralDamping
Relative structural damping; 1 is critical.
Definition CableSegment.h:61
double torsionalAreaMoment
Torsional area moment of the load-bearing material [m⁴].
Definition CableSegment.h:56
The state indices of one rigid element and its index in the solver.
Definition CableSegment.h:32
int q
Orientation quaternion w, x, y, z (4 states).
Definition CableSegment.h:34
int p
Position (3 states).
Definition CableSegment.h:33
int w
Angular velocity (3 states).
Definition CableSegment.h:36
int v
Velocity (3 states).
Definition CableSegment.h:35
int n
The element's index in the constraint solver, set when it is added.
Definition CableSegment.h:37
Definition TrawlCableConstraintSets.h:138
Definition TrawlCableConstraintSets.h:18