WSF
WsfSixDOF_JetEngine.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 WSFSIXDOFJETENGINEOBJECT_HPP
13#define WSFSIXDOFJETENGINEOBJECT_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <cinttypes>
18#include <string>
19#include <vector>
20
21class UtInput;
22#include "UtTable.hpp"
23#include "UtVec3dX.hpp"
24#include "WsfSixDOF_Engine.hpp"
26
27namespace wsf
28{
29namespace six_dof
30{
31class WSF_SIX_DOF_EXPORT JetEngine : public Engine
32{
33public:
34 // This is used to create a type of a ThrustProducerObject
35 explicit JetEngine(ThrustProducerObject* aParentObject);
36
37 ~JetEngine() = default;
38
39 JetEngine& operator=(const JetEngine& other) = delete;
40
41 bool ProcessInput(UtInput& aInput, TypeManager* aTypeManager) override;
42 bool Initialize(int64_t aSimTime_nanosec) override;
43
44 Engine* Clone() const override;
45
46 void DeriveFrom(const Engine* aSrc) override;
47
48 // By default, a jet engine will have "injectFuel" set to true.
49 // Setting it to false, will "shutdown" the engine, which will spool down
50 // its thrust. Setting it to true will "startup" the engine, which will
51 // spin up to idle thrust. Any change to the InjectFuel function should be
52 // called prior to calling UpdateThrust.
53 void InjectFuel(bool aInjectFuel) { mInjectFuel = aInjectFuel; }
54
55 // GetEnginePercentRPM returns the last 'updated' engine percent rpm
56 double GetEnginePercentRPM() const;
57
58 // GetNozzlePosition returns the last 'updated' normalized nozzle position
59 double GetNozzlePosition() const;
60
61 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
62 double GetFuelBurnRate_pph() const override;
63
64 // This provides the maximum potential thrust available, if full throttle, including
65 // afterburner (if available), is applied
66 double GetMaximumPotentialThrust_lbs(double aAlt_ft,
67 double aDynPress_lbsqft,
68 double aStatPress_lbssqft,
69 double aSpeed_fps,
70 double aMach,
71 double aAlpha_rad,
72 double aBeta_rad) override;
73
74 // This provides the minimum potential thrust available
75 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
76 double aDynPress_lbsqft,
77 double aStatPress_lbssqft,
78 double aSpeed_fps,
79 double aMach,
80 double aAlpha_rad,
81 double aBeta_rad) override;
82
83 // The SetThrottleLeverPosition function should be called prior to calling
84 // UpdateThrust so that the throttle will be properly set.
85 void SetThrottlePosition(double aThrottleLeverPosition) override;
86
87 // This returns the current throttle position
88 double GetThrottlePosition() const override;
89
90 // Start the engine.
91 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
92
93 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
94
95protected:
96 JetEngine(const JetEngine& aSrc);
97
98 // This CalculateThrust function is called internally by either
99 // CalculateThrust or UpdateThrust to calculate the engine's
100 // forces and moments. The aUpdateData flag determines whether
101 // or not to change the state of the engine.
102 void CalculateThrust(double aDeltaT_sec,
103 double aAlt_ft,
104 double aDynPress_lbsqft,
105 double aStatPress_lbssqft,
106 double aSpeed_fps,
107 double aMach,
108 double aAlpha_rad,
109 double aBeta_rad,
110 double& aForce_lbs,
111 double& aFuelBurnRate_pps,
112 double& aFuelBurned_lbs,
113 bool aUpdateData) override;
114
115 bool DetermineIfAfterburnerIsPresent();
116
118
119 // Simple Engine tabular data
120 UtCloneablePtr<UtTable::Curve> mIdleThrustTable{nullptr};
121 UtCloneablePtr<UtTable::Curve> mMilThrustTable{nullptr};
122 UtCloneablePtr<UtTable::Curve> mABThrustTable{nullptr};
123
124 // Improved Engine tabular data (mach/alt)
125 UtCloneablePtr<UtTable::Table> mIdleThrustMachAltTable{nullptr};
126 UtCloneablePtr<UtTable::Table> mMilThrustMachAltTable{nullptr};
127 UtCloneablePtr<UtTable::Table> mABThrustMachAltTable{nullptr};
128
129 // Improved Engine tabular data (alt/mach)
130 UtCloneablePtr<UtTable::Table> mIdleThrustAltMachTable{nullptr};
131 UtCloneablePtr<UtTable::Table> mMilThrustAltMachTable{nullptr};
132 UtCloneablePtr<UtTable::Table> mABThrustAltMachTable{nullptr};
133
134 double mTSFC_Idle_pph = 0.0;
135 double mTSFC_Mil_pph = 0.0;
136 double mTSFC_AB_pph = 0.0;
137
140 double mRatedThrustAB_lbs = 0.0;
141
145
147 double mEnginePercentRPM = 0.0;
148 double mNozzlePosition = 0.0;
149
150 double mSpinUpMil_per_sec = 0.0;
152 double mSpinUpAB_per_sec = 0.0;
154
155 UtCloneablePtr<UtTable::Curve> mSpinUpMilTable{nullptr};
156 UtCloneablePtr<UtTable::Curve> mSpinDownMilTable{nullptr};
157 UtCloneablePtr<UtTable::Curve> mSpinUpABTable{nullptr};
158 UtCloneablePtr<UtTable::Curve> mSpinDownABTable{nullptr};
159
161
163
164 bool mInjectFuel = true;
165
166 bool mEngineMaySmoke = false;
168};
169} // namespace six_dof
170} // namespace wsf
171
172#endif
Engine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_Engine.cpp:16
Definition WsfSixDOF_JetEngine.hpp:32
double mSpinDownMil_per_sec
Definition WsfSixDOF_JetEngine.hpp:151
UtCloneablePtr< UtTable::Curve > mABThrustTable
Definition WsfSixDOF_JetEngine.hpp:122
double mTSFC_Idle_pph
Definition WsfSixDOF_JetEngine.hpp:134
bool mThrottleLeverPositionSet
Definition WsfSixDOF_JetEngine.hpp:162
double mThrottleLeverPosition
Definition WsfSixDOF_JetEngine.hpp:117
double mCurrentFuelBurnRate_pph
Definition WsfSixDOF_JetEngine.hpp:160
JetEngine & operator=(const JetEngine &other)=delete
double mNozzlePosition
Definition WsfSixDOF_JetEngine.hpp:148
double mEffectiveTSFC_AB_pps
Definition WsfSixDOF_JetEngine.hpp:144
bool mEngineMaySmoke
Definition WsfSixDOF_JetEngine.hpp:166
UtCloneablePtr< UtTable::Table > mIdleThrustMachAltTable
Definition WsfSixDOF_JetEngine.hpp:125
double mSpinUpAB_per_sec
Definition WsfSixDOF_JetEngine.hpp:152
Engine * Clone() const override
Definition WsfSixDOF_JetEngine.cpp:133
double mEffectiveTSFC_Idle_pps
Definition WsfSixDOF_JetEngine.hpp:142
double mRatedThrustIdle_lbs
Definition WsfSixDOF_JetEngine.hpp:138
bool mInjectFuel
Definition WsfSixDOF_JetEngine.hpp:164
double mEffectiveTSFC_Mil_pps
Definition WsfSixDOF_JetEngine.hpp:143
void InjectFuel(bool aInjectFuel)
Definition WsfSixDOF_JetEngine.hpp:53
UtCloneablePtr< UtTable::Curve > mSpinDownMilTable
Definition WsfSixDOF_JetEngine.hpp:156
double mRatedThrustAB_lbs
Definition WsfSixDOF_JetEngine.hpp:140
UtCloneablePtr< UtTable::Curve > mSpinUpABTable
Definition WsfSixDOF_JetEngine.hpp:157
JetEngine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_JetEngine.cpp:25
void DeriveFrom(const Engine *aSrc) override
Definition WsfSixDOF_JetEngine.cpp:71
bool Initialize(int64_t aSimTime_nanosec) override
Definition WsfSixDOF_JetEngine.cpp:408
double mSpinUpMil_per_sec
Definition WsfSixDOF_JetEngine.hpp:150
double mEnginePercentRPM
Definition WsfSixDOF_JetEngine.hpp:147
double mTSFC_AB_pph
Definition WsfSixDOF_JetEngine.hpp:136
UtCloneablePtr< UtTable::Curve > mMilThrustTable
Definition WsfSixDOF_JetEngine.hpp:121
UtCloneablePtr< UtTable::Table > mABThrustMachAltTable
Definition WsfSixDOF_JetEngine.hpp:127
double mSpinDownAB_per_sec
Definition WsfSixDOF_JetEngine.hpp:153
double mTSFC_Mil_pph
Definition WsfSixDOF_JetEngine.hpp:135
UtCloneablePtr< UtTable::Table > mIdleThrustAltMachTable
Definition WsfSixDOF_JetEngine.hpp:130
UtCloneablePtr< UtTable::Table > mMilThrustMachAltTable
Definition WsfSixDOF_JetEngine.hpp:126
double mRatedThrustMil_lbs
Definition WsfSixDOF_JetEngine.hpp:139
double mEngineSmokesAboveLevel
Definition WsfSixDOF_JetEngine.hpp:167
UtCloneablePtr< UtTable::Table > mMilThrustAltMachTable
Definition WsfSixDOF_JetEngine.hpp:131
UtCloneablePtr< UtTable::Curve > mSpinDownABTable
Definition WsfSixDOF_JetEngine.hpp:158
bool ProcessInput(UtInput &aInput, TypeManager *aTypeManager) override
Definition WsfSixDOF_JetEngine.cpp:138
UtCloneablePtr< UtTable::Curve > mSpinUpMilTable
Definition WsfSixDOF_JetEngine.hpp:155
UtCloneablePtr< UtTable::Table > mABThrustAltMachTable
Definition WsfSixDOF_JetEngine.hpp:132
double mLastThrottleLeverPosition
Definition WsfSixDOF_JetEngine.hpp:146
UtCloneablePtr< UtTable::Curve > mIdleThrustTable
Definition WsfSixDOF_JetEngine.hpp:120
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
Copyrights Multiple, All Rights Reserved