FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
HeaveRollPitch Class Reference

Classes

struct  Defaults
 

Public Types

using Dof = std::array< double, 3 >
 Three generalized loads or coordinates: (heave, roll, pitch).
 

Public Member Functions

 HeaveRollPitch (ISimObjectCreator *creator, double length, double breadth, const Defaults &defaults)
 
int AddStates (ISimObjectCreator *creator)
 Adds the states Motion, MotionRate and Excitation (3 each, in that order, contiguous) and returns the index of the first.
 
void SetEnvironment (environment::EnvironmentProvider *environment)
 The provider of the waves, or nullptr for calm water. Not owned.
 
void OdeFcn (double T, const double *X, double *XDot, const double *pose, const Dof &extraLoad) const
 
void OdeJacobian (double T, const double *X, double *J, int nStates, int first, int poseIndex) const
 
Dof AccelerationPerLoad (const Dof &dLoad) const
 
Dof RawWaveLoads (double T, const double *pose) const
 Unfiltered wave loads (Fz, Mphi, Mtheta) at time T for the body at pose (N, E, psi).
 
Dof VerticalAccelerations (const double *motion, const double *rate, const Dof &load) const
 Accelerations of heave, roll and pitch for the given motion, rates and loads.
 
int MotionIndex () const
 
int RateIndex () const
 
int ExcitationIndex () const
 
double Rho () const
 
double Lcf () const
 
double Mass () const
 
double WaterplaneArea () const
 
double Draught () const
 Mass / (Rho WaterplaneArea) [m].
 
const Dof & Inertia () const
 Diagonal of M + A.
 
const Dof & Stiffness () const
 Diagonal of C.
 
const Dof & Damping () const
 Diagonal of B.
 

Constructor & Destructor Documentation

◆ HeaveRollPitch()

HeaveRollPitch::HeaveRollPitch ( ISimObjectCreator *  creator,
double  length,
double  breadth,
const Defaults &  defaults 
)

Reads the parameters and reports errors through creator. length and breadth [m] are the hull's, the owner has read and checked them.

Member Function Documentation

◆ AccelerationPerLoad()

Dof HeaveRollPitch::AccelerationPerLoad ( const Dof &  dLoad) const

Change of the heave, roll and pitch accelerations for a change dLoad of the loads (heave force, roll and pitch moment): for the owner's Jacobian columns of its extra loads.

◆ OdeFcn()

void HeaveRollPitch::OdeFcn ( double  T,
const double *  X,
double *  XDot,
const double *  pose,
const Dof &  extraLoad 
) const

Writes the 9 XDot entries of the states. X is the model-global state, pose the (north, east, heading) of the body in it, and extraLoad the heave force, roll and pitch moment the owner adds to the filtered wave loads [N, N m].

◆ OdeJacobian()

void HeaveRollPitch::OdeJacobian ( double  T,
const double *  X,
double *  J,
int  nStates,
int  first,
int  poseIndex 
) const

Writes the Jacobian rows of the 9 states. X and J are the owner's local slice and nStates its size. first is the local index of Motion (MotionRate and Excitation follow), poseIndex the local index of north (east and heading follow). The owner has zeroed J. The columns of the extra loads stay with the owner.


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