|
FhSim
3.1.0
Marine systems simulation
|
#include <HydroBody.h>
Public Member Functions | |
| HydroBody (ISimObjectCreator *creator, const std::string &angularRateName, double convergenceTime, rigid_body::MunkMoment munk) | |
| void | SetInertia (const double rigid[6], const double added[6]) |
| const BodyKinematics6Dof & | Kinematics () const |
| The kinematic states and their indices. | |
| const double * | RigidInertia () const |
| The diagonal of the rigid-body inertia. | |
| const double * | AddedMass () const |
| The diagonal of the added mass. | |
| double | InverseMass (int i) const |
The entry i of the diagonal of M^-1. | |
| hydro_body::FlowFrame | Frame (const double *X, const double waterVel_n[3]) const |
| hydro_body::FlowFrame | Frame (const environment::wake::BodyFlowInteraction &flow, double t, const double *X) const |
Frame(X, waterVel_n) with the water velocity of flow at the body origin at time t (BodyFlowInteraction::WaterVelocity). | |
| hydro_body::FlowFrame | LocalFrame (const double *localX, const double waterVel_n[3]) const |
| hydro_body::FlowFrame | LocalFrame (const environment::wake::BodyFlowInteraction &flow, double t, const double *localX) const |
LocalFrame(localX, waterVel_n) with the water velocity of flow at the body origin at time t. | |
| void | Derivatives (const hydro_body::FlowFrame &frame, const hydro_body::Wrench &wrench, const double *X, double *XDot) const |
| void | AddJacobian (const double *localX, const hydro_body::FlowFrame &frame, double dWrench[6][6], double *J, int nStates) const |
The states, the inertia and the derivatives of a rigid body moving through water. See HydroBody.h.
The inertia is diagonal: M = diag(M_RB) + diag(M_A), with M_RB the rigid body's and M_A the added mass, entries 0-2 translational and 3-5 rotational about the body axes.
| HydroBody::HydroBody | ( | ISimObjectCreator * | creator, |
| const std::string & | angularRateName, | ||
| double | convergenceTime, | ||
| rigid_body::MunkMoment | munk | ||
| ) |
Registers the kinematic states with creator (BodyKinematics6Dof). The inertia is zero until SetInertia() is called.
| creator | The creator of the SimObject that owns the body. |
| angularRateName | The name of the angular-rate state, for example AngVel or Omega. |
| convergenceTime | The time constant [s] with which the quaternion norm is driven towards one. |
| munk | Whether the moment carries the Munk moment (rigid_body::MunkMoment). |
| void HydroBody::AddJacobian | ( | const double * | localX, |
| const hydro_body::FlowFrame & | frame, | ||
| double | dWrench[6][6], | ||
| double * | J, | ||
| int | nStates | ||
| ) | const |
Adds the kinematic blocks to a Jacobian and writes its velocity block: M^-1 (dWrench + the derivative of the Coriolis-centripetal terms), the water velocity held fixed (rigid_body::AddOmegaTermsJacobian).
| [in] | localX | The object's slice of the state vector, as OdeJacobian is handed it. |
| [in] | frame | The frame of localX (LocalFrame()). |
| [in,out] | dWrench | The derivative of the body's wrench against (u, v, w, p, q, r); the Coriolis-centripetal terms are added to it. |
| [in,out] | J | The object's Jacobian, nStates by nStates, row major; the velocity block is overwritten, the kinematic blocks are added to. |
| [in] | nStates | The number of states of the object. |
| void HydroBody::Derivatives | ( | const hydro_body::FlowFrame & | frame, |
| const hydro_body::Wrench & | wrench, | ||
| const double * | X, | ||
| double * | XDot | ||
| ) | const |
The derivatives of the 13 kinematic states: the kinematics and M^-1 (wrench + the Coriolis-centripetal terms).
| [in] | frame | The frame of X. |
| [in] | wrench | The sum of the body's loads at X. |
| [in] | X | The global state vector. |
| [out] | XDot | The global derivative vector; only the 13 kinematic entries are written. |
| hydro_body::FlowFrame HydroBody::Frame | ( | const double * | X, |
| const double | waterVel_n[3] | ||
| ) | const |
The flow frame of the global state X (as OdeFcn is handed it), with the given water velocity.
| [in] | X | The global state vector. |
| [in] | waterVel_n | The water velocity at the body origin, NED [m/s]. |
| hydro_body::FlowFrame HydroBody::LocalFrame | ( | const double * | localX, |
| const double | waterVel_n[3] | ||
| ) | const |
The flow frame of the object's state slice localX (as OdeJacobian is handed it), with the given water velocity.
| void HydroBody::SetInertia | ( | const double | rigid[6], |
| const double | added[6] | ||
| ) |
Sets the inertia and inverts it.
| rigid | The diagonal of the rigid-body inertia M_RB. |
| added | The diagonal of the added mass M_A. |