FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
PropellerJetCaster.h
1#pragma once
2
40#include <fhsim/ISimObjectLogger.h>
41#include <fhsim_environment/WakeSchedule.h>
42#include <fhsim_environment/WakeSourceSet.h>
43#include <marenv/wake/JetField.h>
44#include <memory>
45#include <string>
46
47namespace marenv::wake
48{
49class PropellerJet;
50} // namespace marenv::wake
51
52namespace environment
53{
54class EnvironmentProvider;
55} // namespace environment
56
58{
59
66{
67public:
75 PropellerJetCaster(const std::string& name, const WakeSettings& settings, double rho);
77
82 void Register(EnvironmentProvider& environment);
83
92 void Update(double T, const double* X, const PropelledObject& object, ISimObjectLogger& logger);
93
95 const std::string& Id() const { return m_id; }
97 std::shared_ptr<const marenv::wake::JetField> Field() const;
99 const marenv::wake::JetSourceInput& LastInput() const { return m_lastInput; }
101 const double* SourceVelocity() const { return m_sourceVelocity; }
103 const WakeSchedule& Schedule() const { return m_schedule; }
104
105private:
107 bool SkipUnusableInput(double T, const WakeCastState& reference, const PropellerJetInput& input, ISimObjectLogger& logger);
109 void CheckThrustDrift(double T, double effectiveThrust, ISimObjectLogger& logger);
111 void Rebuild(double T, const PropellerJetInput& input, double flowSpeed, ISimObjectLogger& logger);
112
113 std::string m_id;
114 WakeSettings m_settings;
115 double m_rho;
116 WakeSchedule m_schedule;
117 EnvironmentProvider* m_environment = nullptr;
118 std::shared_ptr<marenv::wake::PropellerJet> m_jet;
119 marenv::wake::JetSourceInput m_lastInput {};
120 double m_sourceVelocity[3] = {0.0, 0.0, 0.0};
121 bool m_skippingUnusable = false;
122 double m_frozenThrust = 0.0;
123};
124
125} // namespace environment::wake::detail
Definition PropellerJetCaster.h:66
std::shared_ptr< const marenv::wake::JetField > Field() const
The registered jet, for marenv::wake::WakeQuery::excludeJet; null before Register().
const WakeSchedule & Schedule() const
The schedule: rebuild count, Freeze state and the last |ΔT_eff|/T_eff.
Definition PropellerJetCaster.h:103
const std::string & Id() const
The registry id, <name>/jet.
Definition PropellerJetCaster.h:95
void Update(double T, const double *X, const PropelledObject &object, ISimObjectLogger &logger)
const double * SourceVelocity() const
The filtered source velocity u_s [m/s], NED.
Definition PropellerJetCaster.h:101
const marenv::wake::JetSourceInput & LastInput() const
The jet input of the last rebuild, ρ included, T_eff after relaxation; all zero before the first.
Definition PropellerJetCaster.h:99
void Register(EnvironmentProvider &environment)
PropellerJetCaster(const std::string &name, const WakeSettings &settings, double rho)
The casters behind BodyWake; internal, not for SimObjects (ENV-0102).
Definition CasterStep.h:19
Definition JetField.h:116