1#ifndef WavePropulsionHull_H
2#define WavePropulsionHull_H
146#include <fhsim_environment/BodyFlowInteraction.h>
147#include <fhsim_environment/WakeSourceSet.h>
154 void FinalSetup(
double T,
const double* X, ISimObjectCreator* creator)
override;
155 void PreOdeFcn(
double T,
const double* X, IStateUpdater* updater)
override;
157 const double* ThrustPort(
double T,
const double* X);
158 const double* RudderForcePort(
double T,
const double* X);
161 const environment::wake::BodyFlowInteraction&
Flow()
const {
return m_flow; }
166 std::array<double, 3>
WaterVelocity(
double T,
const double* X)
const override;
174 class HullCaster final :
public environment::wake::PropelledObject
181 environment::wake::WakeCastState Reference(
double T,
const double* X)
const override;
182 void CurrentLoad(
double T,
const double* X,
const double freeStream[3],
const double flowDir[3],
double force[3],
183 double& frontalArea,
double rearCentre[3])
const override;
184 environment::wake::PropellerJetInput PropellerJet(
double T,
const double* X)
const override;
191 std::array<double, 3> Centre(
const double* X)
const;
202 Actuation<S> Actuate(
double propellerSpeed,
double rudderAngle,
const S& u,
const S& v,
const S& r)
const;
205 std::array<S, 6> LoadsOf(
const Actuation<S>& actuation,
double rudderAngle)
const;
208 void HoldInputs(
double T,
const double* X);
210 ISignalPort* m_inPropellerSpeed =
nullptr;
211 ISignalPort* m_inRudderAngle =
nullptr;
213 double m_diameter = 0.0;
214 double m_kt[3] = {0.0, 0.0, 0.0};
215 double m_wakeFraction = 0.0;
216 double m_thrustDeduction = 0.0;
217 double m_propellerX = 0.0;
218 double m_propellerZ = 0.0;
220 double m_rudderArea = 0.0;
221 double m_liftSlope = 0.0;
222 double m_rudderX = 0.0;
223 double m_rudderZ = 0.0;
224 double m_hullInteraction = 0.0;
225 double m_hullInteractionX = 0.0;
226 double m_slipstreamFactor = 0.0;
228 double m_heldPropellerSpeed = 0.0;
229 double m_heldRudderAngle = 0.0;
231 double m_thrustOut = 0.0;
232 std::array<double, 2> m_rudderForceOut {};
235 environment::wake::BodyFlowInteraction m_flow;
236 std::array<double, 3> m_heldWater {};
Definition WaveHull.h:243
std::array< double, 3 > Dof
Three generalized loads or coordinates: (heave, roll, pitch) or (surge, sway, yaw).
Definition WaveHull.h:246
std::array< double, 6 > Loads
Generalized loads on the six modes, ordered surge, sway, heave, roll, pitch, yaw [N,...
Definition WaveHull.h:248
Definition WavePropulsionHull.h:150
std::array< Dof, 6 > ExtraLoadsVelocityJacobian(const Dof &velocity) const override
std::array< double, 3 > HeldWaterVelocity() const override
The water velocity of the step [m/s], NED, which OdeJacobian holds fixed. The base: still water.
Definition WavePropulsionHull.h:167
const environment::wake::BodyFlowInteraction & Flow() const
The current and wakes it receives, the hull wake and jet it casts (read only, for tests).
Definition WavePropulsionHull.h:161
Loads ExtraLoads(double T, const double *X, const Dof &velocity) const override
std::array< double, 3 > WaterVelocity(double T, const double *X) const override