WSF
WsfRigidBodySixDOF_PropulsionSystem.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFRIGIDBODYSIXDOFPROPULSIONSYSTEM_HPP
13#define WSFRIGIDBODYSIXDOFPROPULSIONSYSTEM_HPP
14
18
19namespace wsf
20{
21namespace six_dof
22{
24class RigidBodyMover;
26
27class WSF_SIX_DOF_EXPORT RigidBodyPropulsionSystem : public PropulsionSystem
28{
29public:
31
33
35
36 void SetParentVehicle(Mover* aParentVehicle) override;
37
38 // ProcessInput reads initialization data
39 bool ProcessInput(UtInput& aInput, const TypeManager* aTypeManager);
40 bool Initialize(int64_t aSimTime_nanosec) override;
41
42 // GetThrustProduceList returns the list of engines in this propulsion object
43 const std::vector<std::unique_ptr<RigidBodyThrustProducerObject>>& GetThrustProducerList() const
44 {
45 return mEngineList;
46 }
47
48 // The CalculatePropulsionFM function is called to calculate the propulsion
49 // forces and moments. It does not change the state of the propulsion object.
50 // To change the state, call UpdatePropulsionFM instead. This version
51 // uses the thrust producer's internal throttle values.
52 void CalculatePropulsionFM(double aDeltaT_sec,
53 double aAlt_ft,
54 double aDynPress_lbsqft,
55 double aStatPress_lbssqft,
56 double aSpeed_fps,
57 double aMach,
58 double aAlpha_rad,
59 double aBeta_rad,
60 ForceAndMomentsObject& aForceAndMoment,
61 double& aFuelBurnRate_pps,
62 double& aFuelBurned_lbs);
63
64 // The UpdatePropulsionFM function is called to calculate the propulsion
65 // forces and moments and update the state of the propulsion object.
66 // To perform F&M calculations without changing the state, call the
67 // CalculatePropulsionFM function instead. This version
68 // uses the thrust producer's internal throttle values.
69 void UpdatePropulsionFM(double aDeltaT_sec,
70 double aAlt_ft,
71 double aDynPress_lbsqft,
72 double aStatPress_lbssqft,
73 double aSpeed_fps,
74 double aMach,
75 double aAlpha_rad,
76 double aBeta_rad,
77 ForceAndMomentsObject& aForceAndMoment,
78 double& aFuelBurnRate_pps,
79 double& aFuelBurned_lbs);
80
81 // .....................................................................................................
82
83 void SetControlInputHandles(const RigidBodyFlightControlSystem* aFlightControlSystem);
84 void SetControlInputValues(const RigidBodyFlightControlSystem* aFlightControlSystem);
85
86 // .....................................................................................................
87
88 // GetThrustProducerObjectByName returns the engine with the specified name
89 ThrustProducerObject* GetThrustProducerObjectByName(const std::string& aName) const override;
90
91 // GetThrustProduceByIndex returns the engine with the specified index
92 ThrustProducerObject* GetThrustProducerByIndex(size_t aIndex) const override;
93
94 // SetThrottleLeverPosition sets the throttles on all engines of this object
95 void SetThrottleLeverPosition(double aThrottleLeverPosition) override;
96
97 // EnableThrustVectoring enables/disable thrust vectoring
98 void EnableThrustVectoring(bool aEnableThrustVectoring) override;
99
100 // SetThrustVectoringPitch_deg sets the thrust vectoring in yaw
101 void SetThrustVectoringYaw_deg(double aThrustVectoringAngle_deg);
102
103 // SetThrustVectoringPitch_deg sets the thrust vectoring in pitch
104 void SetThrustVectoringPitch_deg(double aThrustVectoringAngle_deg);
105
106 // SetThrustVectoringPitch_deg sets the thrust vectoring in pitch
107 void SetThrustReverser(double aThrustReverserSetting);
108
109 // EnableThrustReverser enables/disable thrust vectoring
110 void EnableThrustReverser(bool aEnableThrustReverser);
111
112 // Returns true if reverser is enabled
114
115 // Returns true if an afterburner is present on any engine
116 bool AfterburnerIsPresent() const override;
117
118 // GetNumThrustProducers returns the number of engines in this propulsion object
119 size_t GetNumThrustProducers() const override;
120
121 // Ignite ignites/starts all engines of this object
122 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
123
124 // Shutdown terminates thrust for all engines of this object
125 // aTerminateTime_sec is the time termination occurs
126 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
127
128 // This returns true is at least one thrust producer is producing thrust
129 bool IsProducingThrust() const override;
130
131 // This specifies the fuel feed (input tank name) for the specified engine.
132 // It returns true if the assignment is successful.
133 bool SetFuelFeed(std::string& aEngineName, std::string aFuelTankName) override;
134
135 // This specifies the fuel feed (input tank name) for all engines.
136 // It returns true if the assignment is successful.
137 bool SetFuelFeed(std::string aFuelTankName) override;
138
139 // .....................................................................................................
140
141 // Appearance Parameters. These will determine if any engine has the specified condition.
142 // After using this function, individual engines can be consulted for their conditions.
143
144 // Return true if at least one engine is operating.
145 // If aTestSubobjects (optional) is true, if will test subobjects. Otherwise, it
146 // will only test its own propulsion objects (the default).
147 bool AnEngineIsOperating(bool aTestSubobjects = false) const override;
148
149 // Return true if at least one engine is operating
150 // If aTestSubobjects (optional) is true, if will test subobjects. Otherwise, it
151 // will only test its own propulsion objects (the default).
152 bool AnEngineIsSmoking(bool aTestSubobjects = false) const override;
153
154 // Return true if at least one engine is operating
155 // If aTestSubobjects (optional) is true, if will test subobjects. Otherwise, it
156 // will only test its own propulsion objects (the default).
157 bool AnEngineHasAfterburnerOn(bool aTestSubobjects = false) const override;
158
159 // Return true if at least one engine is contrailing
160 // If aTestSubobjects (optional) is true, if will test subobjects. Otherwise, it
161 // will only test its own propulsion objects (the default).
162 bool AnEngineIsContrailing(bool aTestSubobjects = false) const override;
163
164 // Return true if at least one engine has a smoke trailing effect
165 // If aTestSubobjects (optional) is true, if will test subobjects. Otherwise, it
166 // will only test its own propulsion objects (the default).
167 bool AnEngineIsEmittingSmokeTrail(bool aTestSubobjects = false) const override;
168
169 // This will make an engine smoke. If an index of zero is used, all engines will smoke.
170 void MakeAnEngineSmoke(int aEngineIndex) override;
171
172 // .....................................................................................................
173
174protected:
176
177 void PropulsionCalculationsFM(double aDeltaT_sec,
178 double aAlt_ft,
179 double aDynPress_lbsqft,
180 double aStatPress_lbssqft,
181 double aSpeed_fps,
182 double aMach,
183 double aAlpha_rad,
184 double aBeta_rad,
185 ForceAndMomentsObject& aForceAndMoment,
186 double& aFuelBurnRate_pps,
187 double& aFuelBurned_lbs,
188 bool aUpdateData);
189
190 std::vector<std::unique_ptr<RigidBodyThrustProducerObject>> mEngineList;
191
192 // mThrustControlInputValueDataList contains the mThrottleSetting[...] members below
193 std::vector<std::unique_ptr<RigidBodyThrustProducerObject::ThrustControlInputValueData>> mThrustControlInputValueDataList;
194
200
201 bool mThrustReverserSet = false;
204
207
210};
211} // namespace six_dof
212} // namespace wsf
213
214#endif
Definition WsfSixDOF_ForceAndMomentsObject.hpp:28
This is a base class for detailed air movers. This umbrella can cover RB6 or PM6 models.
Definition WsfSixDOF_Mover.hpp:58
Definition WsfRigidBodySixDOF_FlightControlSystem.hpp:44
Definition WsfRigidBodySixDOF_Mover.hpp:38
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:28
const std::vector< std::unique_ptr< RigidBodyThrustProducerObject > > & GetThrustProducerList() const
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:43
double mThrustReverserSetting
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:208
bool mThrustVectorYawSet
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:202
RigidBodyPropulsionSystem * Clone() const
Definition WsfRigidBodySixDOF_PropulsionSystem.cpp:38
bool mEnableThrustReverser
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:209
bool ThrustReverserEnabled() const
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:113
std::vector< std::unique_ptr< RigidBodyThrustProducerObject::ThrustControlInputValueData > > mThrustControlInputValueDataList
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:193
void SetParentVehicle(Mover *aParentVehicle) override
Definition WsfRigidBodySixDOF_PropulsionSystem.cpp:28
RigidBodyThrustProducerObject::ThrustControlInputValueData * mThrottleSettingMIL
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:195
RigidBodyThrustProducerObject::ThrustControlInputValueData * mThrottleSettingPitch
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:199
double mThrustVectoringAngleYaw_deg
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:205
double mThrustVectoringAnglePitch_deg
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:206
bool ProcessInput(UtInput &aInput, const TypeManager *aTypeManager)
Definition WsfRigidBodySixDOF_PropulsionSystem.cpp:180
bool Initialize(int64_t aSimTime_nanosec) override
Definition WsfRigidBodySixDOF_PropulsionSystem.cpp:106
RigidBodyThrustProducerObject::ThrustControlInputValueData * mThrottleSettingReverser
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:197
RigidBodyPropulsionSystem & operator=(const RigidBodyPropulsionSystem &other)=delete
bool mThrustReverserSet
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:201
RigidBodyThrustProducerObject::ThrustControlInputValueData * mThrottleSettingYaw
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:198
bool mThrustVectorPitchSet
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:203
RigidBodyThrustProducerObject::ThrustControlInputValueData * mThrottleSettingAB
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:196
std::vector< std::unique_ptr< RigidBodyThrustProducerObject > > mEngineList
Definition WsfRigidBodySixDOF_PropulsionSystem.hpp:190
Definition WsfSixDOF_ThrustProducerObject.hpp:35
Definition WsfSixDOF_TypeManager.hpp:32
Definition WsfSA_Processor.hpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfRigidBodySixDOF_ThrustProducerObject.hpp:120
Copyrights Multiple, All Rights Reserved