WSF
WsfSixDOF_RamjetEngine.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 WSFSIXDOFRAMJETENGINE_HPP
13#define WSFSIXDOFRAMJETENGINE_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <cinttypes>
18#include <memory>
19#include <string>
20#include <vector>
21
22class UtInput;
23#include "UtTable.hpp"
24#include "UtVec3dX.hpp"
25#include "WsfSixDOF_Engine.hpp"
26
27namespace wsf
28{
29namespace six_dof
30{
31class WSF_SIX_DOF_EXPORT RamjetEngine : public Engine
32{
33public:
34 // This is used to create a type of a RamjetEngine
35 explicit RamjetEngine(ThrustProducerObject* aParentObject);
36
37 ~RamjetEngine() = default;
38
39 RamjetEngine& operator=(const RamjetEngine& other) = delete;
40
41 // ProcessInput reads initialization data
42 bool ProcessInput(UtInput& aInput, TypeManager* aTypeManager) override;
43 bool Initialize(int64_t aSimTime_nanosec) override;
44
45 Engine* Clone() const override;
46
47 void DeriveFrom(const Engine* aSrc) override;
48
49 // The InjectFuel function should be called prior to calling
50 // UpdateThrust so that the fueling will be properly set.
51 void InjectFuel(bool aInjectFuel) { mInjectFuel = aInjectFuel; }
52
53 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
54 double GetFuelBurnRate_pph() const override;
55
56 // This provides the maximum potential thrust available, if full throttle, including
57 // afterburner (if available), is applied
58 double GetMaximumPotentialThrust_lbs(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) override;
65
66 // This provides the minimum potential thrust available
67 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
68 double aDynPress_lbsqft,
69 double aStatPress_lbssqft,
70 double aSpeed_fps,
71 double aMach,
72 double aAlpha_rad,
73 double aBeta_rad) override;
74
75 // The SetThrottleLeverPosition function should be called prior to calling
76 // UpdateThrust so that the throttle will be properly set.
77 void SetThrottlePosition(double aThrottleLeverPosition) override;
78
79 // This returns the current throttle position
80 double GetThrottlePosition() const override;
81
82 // Start the engine.
83 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
84
85 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
86
87protected:
88 RamjetEngine(const RamjetEngine& aSrc);
89
90 // This CalculateThrust function is called internally by either
91 // CalculateThrust or UpdateThrust to calculate the engine's
92 // forces and moments. The aUpdateData flag determines whether
93 // or not to change the state of the engine.
94 void CalculateThrust(double aDeltaT_sec,
95 double aAlt_ft,
96 double aDynPress_lbsqft,
97 double aStatPress_lbssqft,
98 double aSpeed_fps,
99 double aMach,
100 double aAlpha_rad,
101 double aBeta_rad,
102 double& aForceAndMoment,
103 double& aFuelBurnRate_pps,
104 double& aFuelBurned_lbs,
105 bool aUpdateData) override;
106
107 // This is called in CalculateThrust to determine the thrust multiplier, which
108 // can range from 0 to 1 based on throttle lever position and the inject fuel
109 // condition. It also handles fuel injection effects and may modify the fuel
110 // burn request and the current thrust. The aDeadEngine argument denotes a
111 // dead engine (unable to produce thrust). The function returns true if the
112 // engine is dead (not producing thrust) or false if thrust is being produced.
113 bool CalcThrustMultiplier(bool aDeadEngine, double& aFuelBurnRequest_lbs, double& aThrust_lbs);
114
115 UtCloneablePtr<UtTable::Table> mThrustAltMachTable_lbs{nullptr};
116 UtCloneablePtr<UtTable::Table> mTsfcAltMachTable_pph{nullptr};
119
120 // This determines whether or not fuel will be injected (and thrust will be produced)
121 bool mInjectFuel = false;
122
123 // When true, this will always inject fuel, regardless of throttle command
125
126 // This is set to true once mInjectFuel is activated
128
129 // When true, this will allow a proportional throttle control, versus the default on/off control
131
132 // This is the minimum thrust level that may be used for proportional throttle control
134
135 // This is the current throttle level position. With default conditions, it will be either
136 // 0 or 1, but with proportional control, it will be between mMinThrottleMultiplier and 1.
138
139 // This is the overall thrust multiplier, which can range from 0 to 1 based on
140 // throttle lever position and the inject fuel condition.
142};
143} // namespace six_dof
144} // namespace wsf
145
146#endif
Engine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_Engine.cpp:16
Definition WsfSixDOF_RamjetEngine.hpp:32
UtCloneablePtr< UtTable::Table > mTsfcAltMachTable_pph
Definition WsfSixDOF_RamjetEngine.hpp:116
double mThrottleLeverPosition
Definition WsfSixDOF_RamjetEngine.hpp:137
Engine * Clone() const override
Definition WsfSixDOF_RamjetEngine.cpp:80
RamjetEngine & operator=(const RamjetEngine &other)=delete
bool mAfterburnerAppearanceWhenOperating
Definition WsfSixDOF_RamjetEngine.hpp:118
void DeriveFrom(const Engine *aSrc) override
Definition WsfSixDOF_RamjetEngine.cpp:47
double mMinProportionalThrust
Definition WsfSixDOF_RamjetEngine.hpp:133
bool mLatchFuelInjection
Definition WsfSixDOF_RamjetEngine.hpp:124
double mOverallThrustMultiplier
Definition WsfSixDOF_RamjetEngine.hpp:141
bool mInjectFuelTriggered
Definition WsfSixDOF_RamjetEngine.hpp:127
bool mUseProportionalThrottle
Definition WsfSixDOF_RamjetEngine.hpp:130
double mCurrentFuelBurnRate_pph
Definition WsfSixDOF_RamjetEngine.hpp:117
bool Initialize(int64_t aSimTime_nanosec) override
Definition WsfSixDOF_RamjetEngine.cpp:179
bool ProcessInput(UtInput &aInput, TypeManager *aTypeManager) override
Definition WsfSixDOF_RamjetEngine.cpp:85
UtCloneablePtr< UtTable::Table > mThrustAltMachTable_lbs
Definition WsfSixDOF_RamjetEngine.hpp:115
void InjectFuel(bool aInjectFuel)
Definition WsfSixDOF_RamjetEngine.hpp:51
RamjetEngine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_RamjetEngine.cpp:26
bool mInjectFuel
Definition WsfSixDOF_RamjetEngine.hpp:121
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