WSF
P6DofRocketLiquidPropellantObject.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 P6DOFROCKETLIQUIDPROPELLANTOBJECT_H
13#define P6DOFROCKETLIQUIDPROPELLANTOBJECT_H
14
15#include "p6dof_export.h"
16
17#include <cinttypes>
18#include <string>
19#include <vector>
20
22#include "UtTable.hpp"
23#include "UtVec3dX.hpp"
24
25class P6DofFuelTank;
26class UtInput;
27
29{
30public:
31 // This is used to create a type of a P6DofThrustProducerObject
33
35
37
38 // Each engine class returns its own unique class type
39 std::string GetClassType() override { return "LiquidRocket"; }
40
41 // ProcessInput reads initialization data
42 bool ProcessInput(UtInput& aInput) override;
43 bool Initialize(int64_t aSimTime_nanosec) override;
44
46
48
49 void SetControlInputHandles(const P6DofFlightControlSystem* aFlightControls) override;
50 void SetControlInputValues(const P6DofFlightControlSystem* aFlightControls) override;
51
52 // The CalculateThrust function is called to calculate the engine's
53 // forces and moments. It does not change the state of the engine.
54 // To change the state, call UpdateThrust instead. This version
55 // uses the thrust producer's internal throttle values.
56 void CalculateThrust(double aDeltaT_sec,
57 double aAlt_ft,
58 double aDynPress_lbsqft,
59 double aStatPress_lbssqft,
60 double aSpeed_fps,
61 double aMach,
62 double aAlpha_rad,
63 double aBeta_rad,
64 P6DofForceAndMomentsObject& aForceAndMoment,
65 double& aFuelBurnRate_pps,
66 double& aFuelBurned_lbs) override;
67
68 // The UpdateThrust function is called to calculate the engine's
69 // forces and moments and update the state of the engine.
70 // To perform F&M calculations without changing the state, call the
71 // CalculateThrust function instead.
72 void UpdateThrust(double aDeltaT_sec,
73 double aAlt_ft,
74 double aDynPress_lbsqft,
75 double aStatPress_lbssqft,
76 double aSpeed_fps,
77 double aMach,
78 double aAlpha_rad,
79 double aBeta_rad,
80 P6DofForceAndMomentsObject& aForceAndMoment,
81 double& aFuelBurnRate_pps,
82 double& aFuelBurned_lbs) override;
83
84 // SetFuelTank sets the fuel source for the engine
85 void SetFuelTank(const std::string& aFuelTankName);
86
87 // GetFuelTank returns the current fuel source
88 P6DofFuelTank* GetFuelTank() const;
89
90 // GetPercentMaxThrust returns the last 'updated' engine thrust
91 // in terms of percent of maximum thrust
92 double GetPercentMaxThrust() const;
93
94 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
95 double GetFuelBurnRate_pph() const override;
96
97 // This provides the maximum potential thrust available, if full throttle is applied
98 double GetMaximumPotentialThrust_lbs(double aAlt_ft,
99 double aDynPress_lbsqft,
100 double aStatPress_lbssqft,
101 double aSpeed_fps,
102 double aMach,
103 double aAlpha_rad,
104 double aBeta_rad) override;
105
106 // This provides the minimum potential thrust available
107 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
108 double aDynPress_lbsqft,
109 double aStatPress_lbssqft,
110 double aSpeed_fps,
111 double aMach,
112 double aAlpha_rad,
113 double aBeta_rad) override;
114
115 // Liquid-propellant rockets do not have mass properties (the engine mass
116 // is included in the overall empty mass of the P6DofVehicle instead).
118
119 // The SetThrottleLeverPosition function should be called prior to calling
120 // UpdateThrust so that the throttle will be properly set.
121 void SetThrottlePosition(double aThrottleLeverPosition) override;
122
123 // This returns the current throttle position
124 double GetThrottlePosition() const override;
125
126 // Start the engine.
127 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
128
129 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
130
131protected:
133
134 // This CalculateThrust function is called internally by either
135 // CalculateThrust or UpdateThrust to calculate the engine's
136 // forces and moments. The aUpdateData flag determines whether
137 // or not to change the state of the engine.
138 void CalculateThrust(double aDeltaT_sec,
139 double aAlt_ft,
140 double aDynPress_lbsqft,
141 double aStatPress_lbssqft,
142 double aSpeed_fps,
143 double aMach,
144 double aAlpha_rad,
145 double aBeta_rad,
146 P6DofForceAndMomentsObject& aForceAndMoment,
147 double& aFuelBurnRate_pps,
148 double& aFuelBurned_lbs,
149 bool aUpdateData);
150
151 bool MayProduceSmokeTrail() const override { return mGenerateSmokeTrail; }
152
155
156 // Fuel tank information
158
159 // Normalized thrust as a function of altitude
160 // This must be specified or a default table will be used
161 UtCloneablePtr<UtTable::Curve> mNormalizedThrustAlt;
162
163 // Specific impulse as a function of altitude
164 // This must be specified or a default table will be used
165 UtCloneablePtr<UtTable::Curve> mIspAlt;
166
167 // Throttle versus time. This is an optional table to drive the
168 // throttle. Otherwise, conventional throttle control is used.
169 UtCloneablePtr<UtTable::Curve> mThrottleVersusTime;
170
171 // Max rated thrust at sea level or vacuum.
172 // One of these must be specified.
174 // double mMaxThrustVacuum;
175
176 // Max and min throttle range. These must be specified, or a
177 // default of 1.0 and 0.0 will be used.
178 // Note: Max throttle may be greater than 1.0 (100%).
181
182 // Propellant mass flow at sea level or vacuum
183 // One of these will be calculated
186
188
191
194
196
199
201};
202
203#endif
Definition P6DofFlightControlSystem.hpp:42
Definition P6DofForceAndMomentsObject.hpp:24
Definition P6DofFuelTank.hpp:33
P6DofObject * Clone() const
Definition P6DofObject.cpp:24
Definition P6DofRocketLiquidPropellantObject.hpp:29
UtCloneablePtr< UtTable::Curve > mNormalizedThrustAlt
Definition P6DofRocketLiquidPropellantObject.hpp:161
ThrustControlInputValueData * mThrottleSettingPitch
Definition P6DofRocketLiquidPropellantObject.hpp:198
double mMaxThrustSeaLevel
Definition P6DofRocketLiquidPropellantObject.hpp:173
double mCurrentFuelBurnRate_pph
Definition P6DofRocketLiquidPropellantObject.hpp:195
P6DofFuelTank * mCurrentFuelTank
Definition P6DofRocketLiquidPropellantObject.hpp:157
double mMinThrottle
Definition P6DofRocketLiquidPropellantObject.hpp:180
UtCloneablePtr< UtTable::Curve > mThrottleVersusTime
Definition P6DofRocketLiquidPropellantObject.hpp:169
double mMaxMassFlowSeaLevel
Definition P6DofRocketLiquidPropellantObject.hpp:184
std::string GetClassType() override
Definition P6DofRocketLiquidPropellantObject.hpp:39
bool mIsBurning
Definition P6DofRocketLiquidPropellantObject.hpp:189
double mMaxThrottle
Definition P6DofRocketLiquidPropellantObject.hpp:179
double mThrottleLeverPosition
Definition P6DofRocketLiquidPropellantObject.hpp:153
double mBurnTime_Sec
Definition P6DofRocketLiquidPropellantObject.hpp:190
double mMaxMassFlowVacuum
Definition P6DofRocketLiquidPropellantObject.hpp:185
double mNormalizedSpinUp_per_sec
Definition P6DofRocketLiquidPropellantObject.hpp:192
double mLastThrottleLeverPosition
Definition P6DofRocketLiquidPropellantObject.hpp:154
bool MayProduceSmokeTrail() const override
Definition P6DofRocketLiquidPropellantObject.hpp:151
ThrustControlInputValueData * mThrottleSettingYaw
Definition P6DofRocketLiquidPropellantObject.hpp:197
P6DofRocketLiquidPropellantObject(P6DofScenario *aScenario)
Definition P6DofRocketLiquidPropellantObject.cpp:29
double mNormalizedSpinDown_per_sec
Definition P6DofRocketLiquidPropellantObject.hpp:193
UtCloneablePtr< UtTable::Curve > mIspAlt
Definition P6DofRocketLiquidPropellantObject.hpp:165
P6DofRocketLiquidPropellantObject & operator=(const P6DofRocketLiquidPropellantObject &other)=delete
double mEngineThrustPercent
Definition P6DofRocketLiquidPropellantObject.hpp:187
void CalculateCurrentMassProperties() override
Definition P6DofRocketLiquidPropellantObject.hpp:117
bool mGenerateSmokeTrail
Definition P6DofRocketLiquidPropellantObject.hpp:200
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