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
54
61std::array<double, 2> ReadTensionStabilityFactors(ISimObjectCreator& creator, const std::string& name, double defaultFactor = 1.0);
62
65{
66public:
71 CableSegment(const CableMaterial& material, double elementLength, double frequencyCoefficient);
72
73 double ElementLength() const { return m_elementLength; }
75 double ElementMass() const;
77 double ElementDisplacedVolume() const;
79 double ElementWeightInWater() const;
81 CoRiBoDynamics::vec6 ElementInertia() const;
84
87
91 CoRiBoDynamics::TrawlCableCollisionManager::CableCollisionManagerProperties CollisionProperties(const std::vector<int>& elements, double stiffnessFactor, double collisionFrequencyCoefficient) const;
92
95
97 int AddElement(CoRiBoDynamics::ConstraintSolver& solver, ElementStates& element, const CoRiBoDynamics::EnvironmentForces& forces) const;
98
100 std::vector<int> AddElements(CoRiBoDynamics::ConstraintSolver& solver, std::vector<ElementStates>::iterator first, std::vector<ElementStates>::iterator last, const CoRiBoDynamics::EnvironmentForces& forces) const;
101
102private:
103 CableMaterial m_material;
104 double m_elementLength;
105 double m_frequencyCoefficient;
106};
107
109std::vector<double> ElementCentres(double length, int numElements);
110
124void 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);
125
127constexpr double kStraightLineTolerance = 1e-9;
128
143void 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);
144
146void LayOutLine(ISimObjectCreator& creator, const std::string& lengthParameter, const CoRiBoDynamics::vec3& P1, const CoRiBoDynamics::vec3& P2, double length, const std::vector<ElementStates>& elements, double* states);
147} // namespace trawl_mooring
Definition TrawlCableConstraintSets.h:134
One segment of equal rigid cylinders on the constraint solver.
Definition CableSegment.h:65
double ElementWeightInWater() const
The element's weight in water, g (m - ρV) [N], with the trawl cables' ρ and g.
CoRiBoDynamics::TrawlCableJointConstraint::CableProperties JointProperties(const std::vector< int > &elements) const
The joint properties of the segment over the solver elements elements.
double ElementMass() const
Mass per length times element length [kg].
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.
int AddElement(CoRiBoDynamics::ConstraintSolver &solver, ElementStates &element, const CoRiBoDynamics::EnvironmentForces &forces) const
Adds one element on solver with the added mass of its water (reading forces' environment) and sets it...
CoRiBoDynamics::EnvironmentForces::CableSegment EnvironmentSegment(const std::vector< int > &elements) const
The environment-force properties over 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 CoRiBoDynamics::EnvironmentForces &forces) const
Adds the elements [first, last) in order; returns their solver indices.
CoRiBoDynamics::TrawlCableCollisionManager::CableCollisionManagerProperties CollisionProperties(const std::vector< int > &elements, double stiffnessFactor, double collisionFrequencyCoefficient) const
Definition TrawlCableConstraintSets.h:136
Definition TrawlCableConstraintSets.h:16
The properties of the elements of one cable segment.
Definition CableSegmentWaterForce.h:28
The material of one cable segment.
Definition CableSegment.h:42
double tensileArea
Cross-section area of the load-bearing material [m²].
Definition CableSegment.h:44
double massPerLength
Mass per length [kg/m].
Definition CableSegment.h:50
double youngsModulus
E-modulus of the load-bearing material [Pa].
Definition CableSegment.h:47
std::array< double, 2 > tensionStability
Divides the bending frequency response; multiplies the bending stiffness.
Definition CableSegment.h:52
double displacementArea
Cross-section area that displaces water [m²].
Definition CableSegment.h:49
double shearModulus
G-modulus of the load-bearing material [Pa].
Definition CableSegment.h:48
double diameter
Nominal diameter [m].
Definition CableSegment.h:43
double secondAreaMoment
Second area moment of the load-bearing material [m⁴].
Definition CableSegment.h:45
double structuralDamping
Relative structural damping; 1 is critical.
Definition CableSegment.h:51
double torsionalAreaMoment
Torsional area moment of the load-bearing material [m⁴].
Definition CableSegment.h:46
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