WSF
P6DofJetEngineObject.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 2003-2015 The Boeing 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 P6DOFJETENGINEOBJECT_H
13#define P6DOFJETENGINEOBJECT_H
14
15#include "p6dof_export.h"
16
17#include <cinttypes>
18#include <string>
19#include <vector>
20
23#include "UtTable.hpp"
24#include "UtVec3dX.hpp"
25
26class P6DofFuelTank;
27class P6DofScenario;
28class UtInput;
29
31{
32public:
33 // This is used to create a type of a P6DofThrustProducerObject
34 explicit P6DofJetEngineObject(P6DofScenario* aScenario);
35
36 ~P6DofJetEngineObject() override;
37
39
40 // Each engine class returns its own unique class type
41 std::string GetClassType() override { return "Jet"; }
42
43 bool ProcessInput(UtInput& aInput) override;
44 bool Initialize(int64_t aSimTime_nanosec) override;
45
47
48 void DeriveFrom(const P6DofJetEngineObject* aSrc);
49
50 void SetControlInputHandles(const P6DofFlightControlSystem* aFlightControls) override;
51 void SetControlInputValues(const P6DofFlightControlSystem* aFlightControls) override;
52
53 // The CalculateThrust function is called to calculate the engine's
54 // forces and moments. It does not change the state of the engine.
55 // To change the state, call UpdateThrust instead. This version
56 // uses the thrust producer's internal throttle values.
57 void CalculateThrust(double aDeltaT_sec,
58 double aAlt_ft,
59 double aDynPress_lbsqft,
60 double aStatPress_lbssqft,
61 double aSpeed_fps,
62 double aMach,
63 double aAlpha_rad,
64 double aBeta_rad,
65 P6DofForceAndMomentsObject& aForceAndMoment,
66 double& aFuelBurnRate_pps,
67 double& aFuelBurned_lbs) override;
68
69 // By default, a jet engine will have "injectFuel" set to true.
70 // Setting it to false, will "shutdown" the engine, which will spool down
71 // its thrust. Setting it to true will "startup" the engine, which will
72 // spin up to idle thrust. Any change to the InjectFuel function should be
73 // called prior to calling UpdateThrust.
74 void InjectFuel(bool aInjectFuel) { mInjectFuel = aInjectFuel; }
75
76 // The UpdateThrust function is called to calculate the engine's
77 // forces and moments and update the state of the engine.
78 // To perform F&M calculations without changing the state, call the
79 // CalculateThrust function instead.
80 void UpdateThrust(double aDeltaT_sec,
81 double aAlt_ft,
82 double aDynPress_lbsqft,
83 double aStatPress_lbssqft,
84 double aSpeed_fps,
85 double aMach,
86 double aAlpha_rad,
87 double aBeta_rad,
88 P6DofForceAndMomentsObject& aForceAndMoment,
89 double& aFuelBurnRate_pps,
90 double& aFuelBurned_lbs) override;
91
92 // SetFuelTank sets the fuel source for the engine
93 void SetFuelTank(const std::string& aFuelTankName);
94
95 // GetFuelTank returns the current fuel source
96 P6DofFuelTank* GetFuelTank() const;
97
98
99 // GetEnginePercentRPM returns the last 'updated' engine percent rpm
100 double GetEnginePercentRPM() const;
101
102 // GetNozzlePosition returns the last 'updated' normalized nozzle position
103 double GetNozzlePosition() const;
104
105 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
106 double GetFuelBurnRate_pph() const override;
107
108 // This provides the maximum potential thrust available, if full throttle, including
109 // afterburner (if available), is applied
110 double GetMaximumPotentialThrust_lbs(double aAlt_ft,
111 double aDynPress_lbsqft,
112 double aStatPress_lbssqft,
113 double aSpeed_fps,
114 double aMach,
115 double aAlpha_rad,
116 double aBeta_rad) override;
117
118 // This provides the minimum potential thrust available
119 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
120 double aDynPress_lbsqft,
121 double aStatPress_lbssqft,
122 double aSpeed_fps,
123 double aMach,
124 double aAlpha_rad,
125 double aBeta_rad) override;
126
127 // Jet engines do not have mass properties (the engine mass is
128 // included in the overall empty mass of the P6DofVehicle instead).
130
131 // The SetThrottleLeverPosition function should be called prior to calling
132 // UpdateThrust so that the throttle will be properly set.
133 void SetThrottlePosition(double aThrottleLeverPosition) override;
134
135 // This returns the current throttle position
136 double GetThrottlePosition() const override;
137
138 // Start the engine.
139 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
140
141 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
142
143protected:
145
146 // This CalculateThrust function is called internally by either
147 // CalculateThrust or UpdateThrust to calculate the engine's
148 // forces and moments. The aUpdateData flag determines whether
149 // or not to change the state of the engine.
150 void CalculateThrust(double aDeltaT_sec,
151 double aAlt_ft,
152 double aDynPress_lbsqft,
153 double aStatPress_lbssqft,
154 double aSpeed_fps,
155 double aMach,
156 double aAlpha_rad,
157 double aBeta_rad,
158 P6DofForceAndMomentsObject& aForceAndMoment,
159 double& aFuelBurnRate_pps,
160 double& aFuelBurned_lbs,
161 bool aUpdateData);
162
163 bool DetermineIfAfterburnerIsPresent();
164
166
167 // Fuel tank information
169
170 // Simple Engine tabular data
171 UtCloneablePtr<UtTable::Curve> mIdleThrustTable;
172 UtCloneablePtr<UtTable::Curve> mMilThrustTable;
173 UtCloneablePtr<UtTable::Curve> mABThrustTable;
174
175 // Improved Engine tabular data (mach/alt)
176 UtCloneablePtr<UtTable::Table> mIdleThrustMachAltTable;
177 UtCloneablePtr<UtTable::Table> mMilThrustMachAltTable;
178 UtCloneablePtr<UtTable::Table> mABThrustMachAltTable;
179
180 // Improved Engine tabular data (alt/mach)
181 UtCloneablePtr<UtTable::Table> mIdleThrustAltMachTable;
182 UtCloneablePtr<UtTable::Table> mMilThrustAltMachTable;
183 UtCloneablePtr<UtTable::Table> mABThrustAltMachTable;
184
188
192
196
200
205
206 UtCloneablePtr<UtTable::Curve> mSpinUpMilTable;
207 UtCloneablePtr<UtTable::Curve> mSpinDownMilTable;
208 UtCloneablePtr<UtTable::Curve> mSpinUpABTable;
209 UtCloneablePtr<UtTable::Curve> mSpinDownABTable;
210
212
218
220
222
225};
226
227#endif
Definition P6DofFlightControlSystem.hpp:42
Definition P6DofForceAndMomentsObject.hpp:24
Definition P6DofFuelTank.hpp:33
Definition P6DofJetEngineObject.hpp:31
double mRatedThrustAB_lbs
Definition P6DofJetEngineObject.hpp:191
double mThrottleLeverPosition
Definition P6DofJetEngineObject.hpp:165
UtCloneablePtr< UtTable::Curve > mSpinDownABTable
Definition P6DofJetEngineObject.hpp:209
UtCloneablePtr< UtTable::Table > mIdleThrustAltMachTable
Definition P6DofJetEngineObject.hpp:181
UtCloneablePtr< UtTable::Curve > mIdleThrustTable
Definition P6DofJetEngineObject.hpp:171
UtCloneablePtr< UtTable::Table > mABThrustMachAltTable
Definition P6DofJetEngineObject.hpp:178
P6DofFuelTank * mCurrentFuelTank
Definition P6DofJetEngineObject.hpp:168
double mLastThrottleLeverPosition
Definition P6DofJetEngineObject.hpp:197
void InjectFuel(bool aInjectFuel)
Definition P6DofJetEngineObject.hpp:74
ThrustControlInputValueData * mThrottleSettingPitch
Definition P6DofJetEngineObject.hpp:217
UtCloneablePtr< UtTable::Table > mIdleThrustMachAltTable
Definition P6DofJetEngineObject.hpp:176
double mTSFC_Mil_pph
Definition P6DofJetEngineObject.hpp:186
ThrustControlInputValueData * mThrottleSettingReverser
Definition P6DofJetEngineObject.hpp:215
double mCurrentFuelBurnRate_pph
Definition P6DofJetEngineObject.hpp:211
double mRatedThrustIdle_lbs
Definition P6DofJetEngineObject.hpp:189
void CalculateCurrentMassProperties() override
Definition P6DofJetEngineObject.hpp:129
double mEffectiveTSFC_Idle_pps
Definition P6DofJetEngineObject.hpp:193
UtCloneablePtr< UtTable::Curve > mSpinDownMilTable
Definition P6DofJetEngineObject.hpp:207
ThrustControlInputValueData * mThrottleSettingAB
Definition P6DofJetEngineObject.hpp:214
double mSpinDownAB_per_sec
Definition P6DofJetEngineObject.hpp:204
P6DofJetEngineObject(P6DofScenario *aScenario)
Definition P6DofJetEngineObject.cpp:28
UtCloneablePtr< UtTable::Table > mMilThrustMachAltTable
Definition P6DofJetEngineObject.hpp:177
ThrustControlInputValueData * mThrottleSettingMIL
Definition P6DofJetEngineObject.hpp:213
UtCloneablePtr< UtTable::Curve > mMilThrustTable
Definition P6DofJetEngineObject.hpp:172
std::string GetClassType() override
Definition P6DofJetEngineObject.hpp:41
ThrustControlInputValueData * mThrottleSettingYaw
Definition P6DofJetEngineObject.hpp:216
bool mThrottleLeverPositionSet
Definition P6DofJetEngineObject.hpp:219
double mNozzlePosition
Definition P6DofJetEngineObject.hpp:199
double mEffectiveTSFC_AB_pps
Definition P6DofJetEngineObject.hpp:195
double mTSFC_AB_pph
Definition P6DofJetEngineObject.hpp:187
UtCloneablePtr< UtTable::Table > mABThrustAltMachTable
Definition P6DofJetEngineObject.hpp:183
P6DofJetEngineObject & operator=(const P6DofJetEngineObject &other)=delete
double mTSFC_Idle_pph
Definition P6DofJetEngineObject.hpp:185
double mEffectiveTSFC_Mil_pps
Definition P6DofJetEngineObject.hpp:194
double mEnginePercentRPM
Definition P6DofJetEngineObject.hpp:198
bool mEngineMaySmoke
Definition P6DofJetEngineObject.hpp:223
double mSpinUpMil_per_sec
Definition P6DofJetEngineObject.hpp:201
double mEngineSmokesAboveLevel
Definition P6DofJetEngineObject.hpp:224
UtCloneablePtr< UtTable::Curve > mABThrustTable
Definition P6DofJetEngineObject.hpp:173
bool mInjectFuel
Definition P6DofJetEngineObject.hpp:221
double mSpinUpAB_per_sec
Definition P6DofJetEngineObject.hpp:203
double mRatedThrustMil_lbs
Definition P6DofJetEngineObject.hpp:190
double mSpinDownMil_per_sec
Definition P6DofJetEngineObject.hpp:202
UtCloneablePtr< UtTable::Curve > mSpinUpABTable
Definition P6DofJetEngineObject.hpp:208
UtCloneablePtr< UtTable::Curve > mSpinUpMilTable
Definition P6DofJetEngineObject.hpp:206
UtCloneablePtr< UtTable::Table > mMilThrustAltMachTable
Definition P6DofJetEngineObject.hpp:182
P6DofObject * Clone() const
Definition P6DofObject.cpp:24
Definition P6DofScenario.hpp:25
virtual void SetControlInputHandles(const P6DofFlightControlSystem *aFlightControls)=0
virtual void SetThrottlePosition(double aThrottleLeverPosition)=0
virtual double GetFuelBurnRate_pph() const =0
virtual double GetThrottlePosition() const =0
virtual void Shutdown(int64_t aTerminateTime_nanosec=0)=0
virtual bool Initialize(int64_t aSimTime_nanosec)=0
virtual bool ProcessInput(UtInput &aInput)=0
virtual double GetMinimumPotentialThrust_lbs(double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad)=0
virtual void Ignite(int64_t aIgniteTimeInFrame_nanosec)=0
virtual void UpdateThrust(double aDeltaT_sec, double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad, P6DofForceAndMomentsObject &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)=0
void DeriveFrom(const P6DofThrustProducerObject *aSrc)
Definition P6DofThrustProducerObject.cpp:103
P6DofThrustProducerObject(P6DofScenario *aScenario)
Definition P6DofThrustProducerObject.cpp:25
virtual void CalculateThrust(double aDeltaT_sec, double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad, P6DofForceAndMomentsObject &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)=0
virtual double GetMaximumPotentialThrust_lbs(double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad)=0
virtual void SetControlInputValues(const P6DofFlightControlSystem *aFlightControls)=0
Definition P6DofThrustProducerObject.hpp:253
Copyrights Multiple, All Rights Reserved