WSF
P6DofRamjetEngineObject.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 P6DOFRAMJETENGINEOBJECT_H
13#define P6DOFRAMJETENGINEOBJECT_H
14
15#include "p6dof_export.h"
16
17#include <cinttypes>
18#include <memory>
19#include <string>
20#include <vector>
21
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 P6DofRamjetEngineObject(P6DofScenario* aScenario);
35
36 ~P6DofRamjetEngineObject() override;
37
39
40 // Each engine class returns its own unique class type
41 std::string GetClassType() override { return "Ramjet"; }
42
43 // ProcessInput reads initialization data
44 bool ProcessInput(UtInput& aInput) override;
45 bool Initialize(int64_t aSimTime_nanosec) override;
46
48
49 void DeriveFrom(const P6DofRamjetEngineObject* aSrc);
50
51 void SetControlInputHandles(const P6DofFlightControlSystem* aFlightControls) override;
52 void SetControlInputValues(const P6DofFlightControlSystem* aFlightControls) override;
53
54 // The CalculateThrust function is called to calculate the engine's
55 // forces and moments. It does not change the state of the engine.
56 // To change the state, call UpdateThrust instead. This version
57 // uses the thrust producer's internal throttle values.
58 void CalculateThrust(double aDeltaT_sec,
59 double aAlt_ft,
60 double aDynPress_lbsqft,
61 double aStatPress_lbssqft,
62 double aSpeed_fps,
63 double aMach,
64 double aAlpha_rad,
65 double aBeta_rad,
66 P6DofForceAndMomentsObject& aForceAndMoment,
67 double& aFuelBurnRate_pps,
68 double& aFuelBurned_lbs) override;
69
70 // The InjectFuel function should be called prior to calling
71 // UpdateThrust so that the fueling will be properly set.
72 void InjectFuel(bool aInjectFuel) { mInjectFuel = aInjectFuel; }
73
74 // The UpdateThrust function is called to calculate the engine's
75 // forces and moments and update the state of the engine.
76 // To perform F&M calculations without changing the state, call the
77 // CalculateThrust function instead.
78 void UpdateThrust(double aDeltaT_sec,
79 double aAlt_ft,
80 double aDynPress_lbsqft,
81 double aStatPress_lbssqft,
82 double aSpeed_fps,
83 double aMach,
84 double aAlpha_rad,
85 double aBeta_rad,
86 P6DofForceAndMomentsObject& aForceAndMoment,
87 double& aFuelBurnRate_pps,
88 double& aFuelBurned_lbs) override;
89
90 // SetFuelTank sets the fuel source for the engine
91 void SetFuelTank(const std::string& aFuelTankName);
92
93 // GetFuelTank returns the current fuel source
94 P6DofFuelTank* GetFuelTank() const;
95
96 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
97 double GetFuelBurnRate_pph() const override;
98
99 // This provides the maximum potential thrust available, if full throttle, including
100 // afterburner (if available), is applied
101 double GetMaximumPotentialThrust_lbs(double aAlt_ft,
102 double aDynPress_lbsqft,
103 double aStatPress_lbssqft,
104 double aSpeed_fps,
105 double aMach,
106 double aAlpha_rad,
107 double aBeta_rad) override;
108
109 // This provides the minimum potential thrust available
110 double GetMinimumPotentialThrust_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 // Ramjet engines do not have mass properties (the engine mass is
119 // included in the overall empty mass of the P6DofVehicle instead).
121
122 // The SetThrottleLeverPosition function should be called prior to calling
123 // UpdateThrust so that the throttle will be properly set.
124 void SetThrottlePosition(double aThrottleLeverPosition) override;
125
126 // This returns the current throttle position
127 double GetThrottlePosition() const override;
128
129 // Start the engine.
130 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
131
132 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
133
134protected:
136
137 // This CalculateThrust function is called internally by either
138 // CalculateThrust or UpdateThrust to calculate the engine's
139 // forces and moments. The aUpdateData flag determines whether
140 // or not to change the state of the engine.
141 void CalculateThrust(double aDeltaT_sec,
142 double aAlt_ft,
143 double aDynPress_lbsqft,
144 double aStatPress_lbssqft,
145 double aSpeed_fps,
146 double aMach,
147 double aAlpha_rad,
148 double aBeta_rad,
149 P6DofForceAndMomentsObject& aForceAndMoment,
150 double& aFuelBurnRate_pps,
151 double& aFuelBurned_lbs,
152 bool aUpdateData);
153
154 // This is called in CalculateThrust to determine the thrust multiplier, which
155 // can range from 0 to 1 based on throttle lever position and the inject fuel
156 // condition. It also handles fuel injection effects and may modify the fuel
157 // burn request and the current thrust. The aDeadEngine argument denotes a
158 // dead engine (unable to produce thrust). The function returns true if the
159 // engine is dead (not producing thrust) or false if thrust is being produced.
160 bool CalcThrustMultiplier(bool aDeadEngine, double& aFuelBurnRequest_lbs, double& aThrust_lbs);
161
162 // Fuel tank information
164 std::shared_ptr<UtTable::Table> mThrustAltMachTable_lbs = nullptr;
165 std::shared_ptr<UtTable::Table> mTsfcAltMachTable_pph = nullptr;
170
171 // This determines whether or not fuel will be injected (and thrust will be produced)
172 bool mInjectFuel = false;
173
174 // When true, this will always inject fuel, regardless of throttle command
176
177 // This is set to true once mInjectFuel is activated
179
180 // When true, this will allow a proportional throttle control, versus the default on/off control
182
183 // This is the minimum thrust level that may be used for proportional throttle control
185
186 // This is the current throttle level position. With default conditions, it will be either
187 // 0 or 1, but with proportional control, it will be between mMinThrottleMultiplier and 1.
189
190 // This is the overall thrust multiplier, which can range from 0 to 1 based on
191 // throttle lever position and the inject fuel condition.
193};
194
195#endif
Definition P6DofFlightControlSystem.hpp:42
Definition P6DofForceAndMomentsObject.hpp:24
Definition P6DofFuelTank.hpp:33
P6DofObject * Clone() const
Definition P6DofObject.cpp:24
Definition P6DofRamjetEngineObject.hpp:31
bool mInjectFuel
Definition P6DofRamjetEngineObject.hpp:172
double mOverallThrustMultiplier
Definition P6DofRamjetEngineObject.hpp:192
P6DofFuelTank * mCurrentFuelTank
Definition P6DofRamjetEngineObject.hpp:163
std::shared_ptr< UtTable::Table > mThrustAltMachTable_lbs
Definition P6DofRamjetEngineObject.hpp:164
P6DofRamjetEngineObject & operator=(const P6DofRamjetEngineObject &other)=delete
ThrustControlInputValueData * mThrottleSettingPitch
Definition P6DofRamjetEngineObject.hpp:168
double mCurrentFuelBurnRate_pph
Definition P6DofRamjetEngineObject.hpp:166
bool mLatchFuelInjection
Definition P6DofRamjetEngineObject.hpp:175
double mThrottleLeverPosition
Definition P6DofRamjetEngineObject.hpp:188
void InjectFuel(bool aInjectFuel)
Definition P6DofRamjetEngineObject.hpp:72
std::shared_ptr< UtTable::Table > mTsfcAltMachTable_pph
Definition P6DofRamjetEngineObject.hpp:165
bool mUseProportionalThrottle
Definition P6DofRamjetEngineObject.hpp:181
double mMinProportionalThrust
Definition P6DofRamjetEngineObject.hpp:184
std::string GetClassType() override
Definition P6DofRamjetEngineObject.hpp:41
P6DofRamjetEngineObject(P6DofScenario *aScenario)
Definition P6DofRamjetEngineObject.cpp:27
void CalculateCurrentMassProperties() override
Definition P6DofRamjetEngineObject.hpp:120
bool mAfterburnerAppearanceWhenOperating
Definition P6DofRamjetEngineObject.hpp:169
bool mInjectFuelTriggered
Definition P6DofRamjetEngineObject.hpp:178
ThrustControlInputValueData * mThrottleSettingYaw
Definition P6DofRamjetEngineObject.hpp:167
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