WSF
WsfSixDOF_RocketLiquidPropellantEngine.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 WSFSIXDOFROCKETLIQUIDPROPELLANTENGINE_HPP
13#define WSFSIXDOFROCKETLIQUIDPROPELLANTENGINE_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"
25
26namespace wsf
27{
28namespace six_dof
29{
30class WSF_SIX_DOF_EXPORT RocketLiquidPropellantEngine : public Engine
31{
32public:
33 // This is used to create a type of a RocketLiquidPropellantEngine
35
37
39
40 // ProcessInput reads initialization data
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 // GetPercentMaxThrust returns the last 'updated' engine thrust
49 // in terms of percent of maximum thrust
50 double GetPercentMaxThrust() const;
51
52 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
53 double GetFuelBurnRate_pph() const override;
54
55 // This provides the maximum potential thrust available, if full throttle is applied
56 double GetMaximumPotentialThrust_lbs(double aAlt_ft,
57 double aDynPress_lbsqft,
58 double aStatPress_lbssqft,
59 double aSpeed_fps,
60 double aMach,
61 double aAlpha_rad,
62 double aBeta_rad) override;
63
64 // This provides the minimum potential thrust available
65 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
66 double aDynPress_lbsqft,
67 double aStatPress_lbssqft,
68 double aSpeed_fps,
69 double aMach,
70 double aAlpha_rad,
71 double aBeta_rad) override;
72
73 // The SetThrottleLeverPosition function should be called prior to calling
74 // UpdateThrust so that the throttle will be properly set.
75 void SetThrottlePosition(double aThrottleLeverPosition) override;
76
77 // This returns the current throttle position
78 double GetThrottlePosition() const override;
79
80 // Start the engine.
81 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
82
83 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
84
85protected:
87
88 // This CalculateThrust function is called internally by either
89 // CalculateThrust or UpdateThrust to calculate the engine's
90 // forces and moments. The aUpdateData flag determines whether
91 // or not to change the state of the engine.
92 void CalculateThrust(double aDeltaT_sec,
93 double aAlt_ft,
94 double aDynPress_lbsqft,
95 double aStatPress_lbssqft,
96 double aSpeed_fps,
97 double aMach,
98 double aAlpha_rad,
99 double aBeta_rad,
100 double& aForceAndMoment,
101 double& aFuelBurnRate_pps,
102 double& aFuelBurned_lbs,
103 bool aUpdateData) override;
104
105 bool MayProduceSmokeTrail() const override { return mGenerateSmokeTrail; }
106
109
110 // Normalized thrust as a function of altitude
111 // This must be specified or a default table will be used
112 UtCloneablePtr<UtTable::Curve> mNormalizedThrustAlt{nullptr};
113
114 // Specific impulse as a function of altitude
115 // This must be specified or a default table will be used
116 UtCloneablePtr<UtTable::Curve> mIspAlt{nullptr};
117
118 // Throttle versus time. This is an optional table to drive the
119 // throttle. Otherwise, conventional throttle control is used.
120 UtCloneablePtr<UtTable::Curve> mThrottleVersusTime{nullptr};
121
122 // Max rated thrust at sea level or vacuum.
123 // One of these must be specified.
124 double mMaxThrustSeaLevel = 0.0;
125 // double mMaxThrustVacuum;
126
127 // Max and min throttle range. These must be specified, or a
128 // default of 1.0 and 0.0 will be used.
129 // Note: Max throttle may be greater than 1.0 (100%).
130 double mMaxThrottle = 1.0;
131 double mMinThrottle = 0.0;
132
133 // Propellant mass flow at sea level or vacuum
134 // One of these will be calculated
136 double mMaxMassFlowVacuum = 0.0;
137
139
140 bool mIsBurning = false;
141 double mBurnTime_Sec = 0.0;
142
145
147
149};
150} // namespace six_dof
151} // namespace wsf
152
153#endif
Engine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_Engine.cpp:16
UtCloneablePtr< UtTable::Curve > mThrottleVersusTime
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:120
double mCurrentFuelBurnRate_pph
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:146
double GetMinimumPotentialThrust_lbs(double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:502
RocketLiquidPropellantEngine & operator=(const RocketLiquidPropellantEngine &other)=delete
bool ProcessInput(UtInput &aInput, TypeManager *aTypeManager) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:94
void Ignite(int64_t aIgniteTimeInFrame_nanosec) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:537
bool mGenerateSmokeTrail
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:148
double mEngineThrustPercent
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:138
void Shutdown(int64_t aTerminateTime_nanosec=0) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:544
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, double &aForceAndMoment, double &aFuelBurnRate_pps, double &aFuelBurned_lbs, bool aUpdateData) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:200
double mMaxMassFlowVacuum
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:136
double mNormalizedSpinDown_per_sec
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:144
UtCloneablePtr< UtTable::Curve > mIspAlt
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:116
double mThrottleLeverPosition
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:107
bool mIsBurning
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:140
Engine * Clone() const override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:56
double mMinThrottle
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:131
double GetMaximumPotentialThrust_lbs(double aAlt_ft, double aDynPress_lbsqft, double aStatPress_lbssqft, double aSpeed_fps, double aMach, double aAlpha_rad, double aBeta_rad) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:481
double GetThrottlePosition() const override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:532
double mMaxMassFlowSeaLevel
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:135
double mMaxThrustSeaLevel
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:124
double mNormalizedSpinUp_per_sec
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:143
double mBurnTime_Sec
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:141
double mMaxThrottle
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:130
bool Initialize(int64_t aSimTime_nanosec) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:192
bool MayProduceSmokeTrail() const override
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:105
double GetFuelBurnRate_pph() const override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:476
void SetThrottlePosition(double aThrottleLeverPosition) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:514
double mLastThrottleLeverPosition
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:108
UtCloneablePtr< UtTable::Curve > mNormalizedThrustAlt
Definition WsfSixDOF_RocketLiquidPropellantEngine.hpp:112
void DeriveFrom(const Engine *aSrc) override
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:61
double GetPercentMaxThrust() const
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:471
RocketLiquidPropellantEngine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_RocketLiquidPropellantEngine.cpp:27
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