FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Ship::Ship2::VesselData Struct Reference

#include <VesselData.h>

+ Collaboration diagram for Ship::Ship2::VesselData:

Classes

struct  Section
 

Public Member Functions

Matrix6d RigidBodyMass () const
 The rigid-body mass matrix about the origin (the centre of gravity's offset included).
 
Vector6cd Excitation (double w, double beta) const
 
Eigen::Vector3d Drift (double w, double beta) const
 The mean drift force (surge, sway, yaw) per unit amplitude squared (zero without drift data).
 
Matrix6d AddedMassAt (double w) const
 Added mass and damping at frequency w (linear between the frequencies, held at the ends).
 
Matrix6d DampingAt (double w) const
 

Static Public Member Functions

static VesselData Load (const std::string &vesselFile)
 

Public Attributes

std::string name
 
std::string licence
 
std::string attribution
 
std::string directory
 where the files are
 
double rho = 1025.0
 
double g = 9.81
 
double lpp = 0.0
 
double beam = 0.0
 
double draught = 0.0
 
double loa = 0.0
 
double mass = 0.0
 [kg]
 
Eigen::Vector3d cog = Eigen::Vector3d::Zero()
 centre of gravity [m]
 
Eigen::Vector3d radii = Eigen::Vector3d::Zero()
 radii of gyration about it, roll, pitch, yaw [m]
 
std::vector< double > omega
 
std::vector< Matrix6d > addedMass
 
std::vector< Matrix6d > damping
 
Matrix6d addedMassZero = Matrix6d::Zero()
 
Matrix6d addedMassInfinite = Matrix6d::Zero()
 
bool hasZero = false
 
bool hasInfinite = false
 
Matrix6d restoring = Matrix6d::Zero()
 The restoring matrix about the origin, buoyancy and the gravity of mass at cog (WAMIT's convention).
 
std::vector< double > omegaExcitation
 
std::vector< double > betaExcitation
 
std::vector< std::vector< Vector6cd > > excitation
 
std::vector< double > omegaDrift
 
std::vector< double > betaDrift
 
std::vector< std::vector< Eigen::Vector3d > > drift
 
std::vector< Section > sections
 
bool symmetric = false
 

Detailed Description

A vessel's hydrodynamic database for Ship/Ship2 (ADR 0001): a vessel file <name>.vessel.json and the WAMIT files beside it (.1, .3, .hst, optionally .8), read into dimensional values in FhSim's body frame.

Body frame: x forward, y starboard, z down, origin at the vessel file's reference point (on the centreline, at the waterline of the loading condition). WAMIT's axes (x forward, y to port, z up) are turned by T = diag(1, -1, -1, 1, -1, -1): matrices M -> T M T, vectors F -> T F.

Waves: the heading beta is the direction the waves travel, from the body's x axis towards starboard [rad] (the WAMIT heading, from x towards port, with the sign changed); data given for 0 to 180 degrees (WAMIT) are mirrored for a hull symmetric about its centreline plane. The excitation is per unit wave amplitude, in WAMIT's time convention: a wave with elevation Re{a exp(i omega t)} at the origin gives the force Re{a X exp(i omega t)}. The mean drift (surge, sway, yaw) is per unit amplitude squared.

Member Function Documentation

◆ Excitation()

Vector6cd Ship::Ship2::VesselData::Excitation ( double  w,
double  beta 
) const

The excitation per unit amplitude at frequency w and heading beta [rad] (linear in both; held at the ends of the frequencies, zero outside them).

◆ Load()

static VesselData Ship::Ship2::VesselData::Load ( const std::string &  vesselFile)
static

Reads the vessel file and its WAMIT files.

Exceptions
std::runtime_errorfor a missing file, a file it cannot read, or a format it does not know.

Member Data Documentation

◆ symmetric

bool Ship::Ship2::VesselData::symmetric = false

The data are for a hull symmetric about its centreline plane (headings 0 to 180 deg, mirrored): the couplings of the symmetric modes (surge, heave, pitch) with the antisymmetric ones (sway, roll, yaw) are set to zero.


The documentation for this struct was generated from the following file: