FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Propeller4Q.h
1#ifndef Propeller4Q_h__
2#define Propeller4Q_h__
79#include <vector>
80#include <memory>
81#include <Eigen/Eigen>
82#include <fhsim/simobject/SimObject.h>
83#include <fhsim_environment/EnvironmentProvider.h>
84#include "PropulsorWakeField.h"
85#include <cstddef>
86#include <string>
87#include "Ship/AzimuthCurve.h"
88
89#ifdef FH_VISUALIZATION
90 #include "sfh/ogre/CDynamicLines.h"
91#endif
92
93namespace Ship{
94
97 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
98 Eigen::Quaterniond orientationNED = Eigen::Quaterniond::Identity();
99 Eigen::Vector3d positionNED = Eigen::Vector3d::Zero();
100 Eigen::Vector3d velocityNED = Eigen::Vector3d::Zero();
101 double flowStateHigh = 0;
102 double Rs = 0;
103 };
104
106 marenv::Status Propeller4QJet(const Propeller4QWakeState& state, double T, const double position[3], double currentVelocity[3]);
107
108 using Propeller4QCurrentField = PropulsorWakeField<Propeller4QWakeState>;
109
110 class Propeller4Q:public SimObject{
111 public:
112 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
113
116 Ruth = 666,Smogeli
117 };
118
121 Open,Ducted,Tunnel
122 };
123
125 struct Curve4Q{
126 std::unique_ptr<AzimuthCurve<double> > Ct;
127 std::unique_ptr<AzimuthCurve<double> > Cq;
128 };
129
130 Propeller4Q(const std::string simObjectName, ISimObjectCreator* const creator);
131
132
133 void FinalSetup( const double T, const double *const X, ISimObjectCreator* const creator );
134 void OdeFcn(const double T, const double* const X, double* const XDot) const;
136 void AcceptedStep(double T, const double* X) override;
137
138
139#ifdef FH_VISUALIZATION
140 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
141 void RenderUpdate( const double T, const double* const X);
142#endif
143
145 const double* Us(const double T, const double* const X);
147 const double* Rs(const double T, const double* const X);
149 const double* BetaT(const double T, const double* const X);
150
152 const double* BetaQ(const double T, const double* const X);
153
155 const double* Ct(const double T, const double* const X);
156
158 const double* Cq(const double T, const double* const X);
159
161 const double* ForceNED(const double T, const double* const X);
162
164 const double* TorqueNED(const double T, const double* const X);
165
167 const double* ForceBody(const double T, const double* const X);
168
170 const double* TorqueBody(const double T, const double* const X);
171
173 const double* BetaH(const double T, const double* const X);
174
176 const double* PDCurrent(const double T, const double* const X);
177
179 const double* ForceCorrectedBody(const double T, const double* const X);
180
182 const double* TorqueCorrectedBody(const double T, const double* const X);
183
185 const double* ForceCorrectedNED(const double T, const double* const X);
186
188 const double* TorqueCorrectedNED(const double T, const double* const X);
189
191 const double* ShaftTorqueCorrectedBody(const double T, const double* const X);
193 const double* ShaftTorqueBody(const double T, const double* const X);
194
196 const double* ShaftPowerCorrected(const double T, const double* const X);
197
199 const double* ShaftPower(const double T, const double* const X);
200
202 void Compute(const double T, const double* const X) const;
203 protected:
205 ICommonComputation *m_compute;
206
208 mutable Eigen::Vector3d m_ForceNED;
210 mutable Eigen::Vector3d m_ForceBody;
211
213 mutable Eigen::Vector3d m_TorqueNED;
215 mutable Eigen::Vector3d m_TorqueBody;
216
218 mutable Eigen::Vector3d m_ForceCorrectedNED;
220 mutable Eigen::Vector3d m_ForceCorrectedBody;
221
223 mutable Eigen::Vector3d m_TorqueCorrectedNED;
225 mutable Eigen::Vector3d m_TorqueCorrectedBody;
226
227
229 mutable double m_shaftTorque;
230
233
235 mutable double m_shaftPower;
236
238 mutable double m_shaftPowerCorrected;
239
242
245
249 double m_Us;
250
252 mutable double m_Rs;
253
255 mutable double m_betaT;
256
258 mutable double m_betaQ;
259
261 mutable double m_beta_h;
262
264 mutable double m_PDcur;
265
267 ISignalPort *m_InOrientationNED;
268
270 ISignalPort *m_InMyRPM;
271
273 ISignalPort *m_InMyPD;
274
276 ISignalPort *m_InVelocityNED;
277
279 ISignalPort *m_InPositionNED;
280
282 environment::EnvironmentProvider *m_environment = nullptr;
283
285 std::shared_ptr<Propeller4QCurrentField> m_currentField = std::make_shared<Propeller4QCurrentField>(Propeller4QJet);
286
289
292
295
298
301
304
306 int m_IndexRotationalFlowState1;
307
309 int m_IndexRotationalFlowState2;
310
312 double m_D;
313
315 int m_numPD = 0;
316
318 std::vector<double> m_PD;
319
321 std::vector<Curve4Q> m_curve;
322
324 mutable double m_Cq;
325
327 mutable double m_Ct;
328
331
334
336 mutable double m_U;
337
340
343
344 bool m_azimuthinMainLoss;
345
346#ifdef FH_VISUALIZATION
348 int m_IndexPropellerRotationSatet;
349
351 bool m_reverseRotationDirection;
352
354 CDynamicLines * m_lines;
355
357 Ogre::SceneNode* m_RenderNode;
358
360 Ogre::SceneNode* m_RenderNodePropeller;
361#endif
362 };
363}
364#endif // Propeller4Q_h__
Definition Propeller4Q.h:110
ISignalPort * m_InPositionNED
Definition Propeller4Q.h:279
Eigen::Vector3d m_ForceCorrectedNED
Definition Propeller4Q.h:218
const double * ForceBody(const double T, const double *const X)
double m_shaftPowerScaling
Definition Propeller4Q.h:241
double m_shaftPower
Definition Propeller4Q.h:235
Eigen::Vector3d m_TorqueCorrectedBody
Definition Propeller4Q.h:225
PropellerType m_PropellerType
Definition Propeller4Q.h:288
const double * TorqueCorrectedBody(const double T, const double *const X)
const double * TorqueNED(const double T, const double *const X)
const double * Cq(const double T, const double *const X)
VentilationTheory m_VentilationTheory
Definition Propeller4Q.h:291
double m_shaftPowerCorrected
Definition Propeller4Q.h:238
ISignalPort * m_InOrientationNED
Definition Propeller4Q.h:267
double m_shaftTorqueCorrected
Definition Propeller4Q.h:232
ISignalPort * m_InMyPD
Definition Propeller4Q.h:273
double m_betaT
Definition Propeller4Q.h:255
Eigen::Vector3d m_ForceBody
Definition Propeller4Q.h:210
int m_IndexVentialtionStateT
Definition Propeller4Q.h:297
const double * Rs(const double T, const double *const X)
double m_U
Definition Propeller4Q.h:336
double m_beta_h
Definition Propeller4Q.h:261
std::shared_ptr< Propeller4QCurrentField > m_currentField
Definition Propeller4Q.h:285
int m_numPD
Definition Propeller4Q.h:315
int m_IndexVentialtionStateQ
Definition Propeller4Q.h:294
const double * PDCurrent(const double T, const double *const X)
Eigen::Vector3d m_TorqueBody
Definition Propeller4Q.h:215
const double * ForceNED(const double T, const double *const X)
const double * Ct(const double T, const double *const X)
Eigen::Vector3d m_TorqueNED
Definition Propeller4Q.h:213
double m_deltaBetaPlus
Definition Propeller4Q.h:330
int m_IndexAxialFlowStateLow
Definition Propeller4Q.h:300
double m_ThrustDeduction
Definition Propeller4Q.h:342
environment::EnvironmentProvider * m_environment
Definition Propeller4Q.h:282
double m_Ct
Definition Propeller4Q.h:327
std::vector< Curve4Q > m_curve
Definition Propeller4Q.h:321
double m_WakeFraction
Definition Propeller4Q.h:339
void AcceptedStep(double T, const double *X) override
Copies the wake state of the accepted state into the jet field (G4).
double m_D
Definition Propeller4Q.h:312
const double * BetaH(const double T, const double *const X)
ISignalPort * m_InVelocityNED
Definition Propeller4Q.h:276
const double * ShaftPowerCorrected(const double T, const double *const X)
double m_Rs
Definition Propeller4Q.h:252
Eigen::Vector3d m_TorqueCorrectedNED
Definition Propeller4Q.h:223
const double * BetaQ(const double T, const double *const X)
const double * ShaftPower(const double T, const double *const X)
const double * ForceCorrectedNED(const double T, const double *const X)
const double * ForceCorrectedBody(const double T, const double *const X)
double m_PDcur
Definition Propeller4Q.h:264
double m_shaftTorque
Definition Propeller4Q.h:229
const double * ShaftTorqueCorrectedBody(const double T, const double *const X)
const double * ShaftTorqueBody(const double T, const double *const X)
Eigen::Vector3d m_ForceNED
Definition Propeller4Q.h:208
double m_deltaBetaMinus
Definition Propeller4Q.h:333
double m_Cq
Definition Propeller4Q.h:324
std::vector< double > m_PD
Definition Propeller4Q.h:318
VentilationTheory
Definition Propeller4Q.h:115
Eigen::Vector3d m_ForceCorrectedBody
Definition Propeller4Q.h:220
const double * TorqueBody(const double T, const double *const X)
ISignalPort * m_InMyRPM
Definition Propeller4Q.h:270
double m_propellerThrustScaling
Definition Propeller4Q.h:244
int m_IndexAxialFlowStateHigh
Definition Propeller4Q.h:303
const double * Us(const double T, const double *const X)
const double * BetaT(const double T, const double *const X)
const double * TorqueCorrectedNED(const double T, const double *const X)
PropellerType
Definition Propeller4Q.h:120
double m_Us
Definition Propeller4Q.h:249
double m_betaQ
Definition Propeller4Q.h:258
Definition PropulsorWakeField.h:25
Status
Definition marenv.h:44
Simple waypoint object.
Definition CableAttach.h:58
marenv::Status Propeller4QJet(const Propeller4QWakeState &state, double T, const double position[3], double currentVelocity[3])
The jet behind the propeller (G4: reads only the copy of the state).
The state the four-quadrant propeller jet needs, copied after each accepted step (zero jet by default...
Definition Propeller4Q.h:96
Definition Propeller4Q.h:125