WSF
P6DofRocketSolidPropellantObject.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 P6DOFROCKETSOLIDPROPELLANTOBJECT_H
13#define P6DOFROCKETSOLIDPROPELLANTOBJECT_H
14
15#include "p6dof_export.h"
16
17#include <cinttypes>
18#include <string>
19#include <vector>
20
22#include "UtCloneablePtr.hpp"
23#include "UtTable.hpp"
24#include "UtVec3dX.hpp"
25
26class P6DofScenario;
27class UtInput;
28
30{
31public:
32 // This is used to create a type of a P6DofThrustProducerObject
34
36
38
39 // Each engine class returns its own unique class type
40 std::string GetClassType() override { return "SolidRocket"; }
41
42 // ProcessInput reads initialization data
43 bool ProcessInput(UtInput& aInput) override;
44 bool Initialize(int64_t aSimTime_nanosec) override;
45
47
49
50 void SetControlInputHandles(const P6DofFlightControlSystem* aFlightControls) override;
51 void SetControlInputValues(const P6DofFlightControlSystem* aFlightControls) override;
52
53 // The IgniteNow function is called to 'start' the rocket engine.
54 void IgniteNow() { mIsBurning = true; }
55
56 // The CalculateThrust function is called to calculate the engine's
57 // forces and moments. It does not change the state of the engine.
58 // To change the state, call UpdateThrust instead. This version
59 // uses the thrust producer's internal throttle values.
60 void CalculateThrust(double aDeltaT_sec,
61 double aAlt_ft,
62 double aDynPress_lbsqft,
63 double aStatPress_lbssqft,
64 double aSpeed_fps,
65 double aMach,
66 double aAlpha_rad,
67 double aBeta_rad,
68 P6DofForceAndMomentsObject& aForceAndMoment,
69 double& aFuelBurnRate_pps,
70 double& aFuelBurned_lbs) override;
71
72 // The UpdateThrust function is called to calculate the engine's
73 // forces and moments and update the state of the engine.
74 // To perform F&M calculations without changing the state, call the
75 // CalculateThrust function instead.
76 void UpdateThrust(double aDeltaT_sec,
77 double aAlt_ft,
78 double aDynPress_lbsqft,
79 double aStatPress_lbssqft,
80 double aSpeed_fps,
81 double aMach,
82 double aAlpha_rad,
83 double aBeta_rad,
84 P6DofForceAndMomentsObject& aForceAndMoment,
85 double& aFuelBurnRate_pps,
86 double& aFuelBurned_lbs) override;
87
88 // GetPercentMaxThrust returns the last 'updated' engine thrust
89 // in terms of percent of maximum thrust
90 double GetPercentMaxThrust() const;
91
92 // GetCurrentPropellant_lbs returns the amount of propellant remaining
93 double GetCurrentPropellant_lbs() const;
94
95 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
96 double GetFuelBurnRate_pph() const override;
97
98 // GetMaxPropellant_lbs returns the max propellant weight in lbs
99 double GetMaxPropellant_lbs() const;
100
101 // This provides the maximum potential thrust available
102 double GetMaximumPotentialThrust_lbs(double aAlt_ft,
103 double aDynPress_lbsqft,
104 double aStatPress_lbssqft,
105 double aSpeed_fps,
106 double aMach,
107 double aAlpha_rad,
108 double aBeta_rad) override;
109
110 // This provides the minimum potential thrust available
111 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
112 double aDynPress_lbsqft,
113 double aStatPress_lbssqft,
114 double aSpeed_fps,
115 double aMach,
116 double aAlpha_rad,
117 double aBeta_rad) override;
118
119 // Solid-propellant rockets have mass properties. These
120 // mass properties include the propellant mass.
121 void CalculateCurrentMassProperties() override;
122
123 // The SetThrottleLeverPosition function should be called prior to calling
124 // UpdateThrust so that the throttle will be properly set.
125 void SetThrottlePosition(double aThrottleLeverPosition) override;
126
127 // This returns the current throttle position
128 double GetThrottlePosition() const override;
129
130 // The Ignite function is called to 'start' the rocket engine.
131 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
132
133 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
134
135protected:
137
138 // This CalculateThrust function is called internally by either
139 // CalculateThrust or UpdateThrust to calculate the engine's
140 // forces and moments. The aUpdateData flag determines whether
141 // or not to change the state of the engine.
142 void CalculateThrust(double aDeltaT_sec,
143 double aAlt_ft,
144 double aDynPress_lbsqft,
145 double aStatPress_lbssqft,
146 double aSpeed_fps,
147 double aMach,
148 double aAlpha_rad,
149 double aBeta_rad,
150 P6DofForceAndMomentsObject& aForceAndMoment,
151 double& aFuelBurnRate_pps,
152 double& aFuelBurned_lbs,
153 bool aUpdateData);
154
155 double Thrust_lbs(double aBurnTime_Sec, double aAlt_ft, double& aMassFlow_pps);
156
157 bool MayProduceSmokeTrail() const override { return mGenerateSmokeTrail; }
158
159 // Thrust versus time at sea level or vacuum.
160 // One of these must be specified.
161 UtCloneablePtr<UtTable::Curve> mThrustSeaLevelVersusTime;
162 UtCloneablePtr<UtTable::Curve> mThrustVacuumVersusTime;
163
164 // Specific impulse as a function of altitude.
165 // This must be specified or a default table will be used
166 UtCloneablePtr<UtTable::Curve> mIspAlt;
167
170
171 double mRatedThrust_lbs; // Used to determine percent thrust
173
176
179
181
182 // This is the location of the center of mass of the propellant,
183 // relative to the parent object
185
188
190};
191
192#endif
Definition P6DofFlightControlSystem.hpp:42
Definition P6DofForceAndMomentsObject.hpp:24
P6DofObject * Clone() const
Definition P6DofObject.cpp:24
Definition P6DofRocketSolidPropellantObject.hpp:30
void IgniteNow()
Definition P6DofRocketSolidPropellantObject.hpp:54
double mLastThrust_lbs
Definition P6DofRocketSolidPropellantObject.hpp:172
P6DofRocketSolidPropellantObject(P6DofScenario *aScenario)
Definition P6DofRocketSolidPropellantObject.cpp:28
double mIspVacuum
Definition P6DofRocketSolidPropellantObject.hpp:169
UtCloneablePtr< UtTable::Curve > mIspAlt
Definition P6DofRocketSolidPropellantObject.hpp:166
double mRatedThrust_lbs
Definition P6DofRocketSolidPropellantObject.hpp:171
bool MayProduceSmokeTrail() const override
Definition P6DofRocketSolidPropellantObject.hpp:157
std::string GetClassType() override
Definition P6DofRocketSolidPropellantObject.hpp:40
P6DofRocketSolidPropellantObject & operator=(const P6DofRocketSolidPropellantObject &other)=delete
bool mGenerateSmokeTrail
Definition P6DofRocketSolidPropellantObject.hpp:189
UtCloneablePtr< UtTable::Curve > mThrustVacuumVersusTime
Definition P6DofRocketSolidPropellantObject.hpp:162
double mBurnTime_sec
Definition P6DofRocketSolidPropellantObject.hpp:178
ThrustControlInputValueData * mThrottleSettingYaw
Definition P6DofRocketSolidPropellantObject.hpp:186
bool mIsBurning
Definition P6DofRocketSolidPropellantObject.hpp:177
double mPropellantMass_lbs
Definition P6DofRocketSolidPropellantObject.hpp:174
ThrustControlInputValueData * mThrottleSettingPitch
Definition P6DofRocketSolidPropellantObject.hpp:187
double mIspSeaLevel
Definition P6DofRocketSolidPropellantObject.hpp:168
double mMaxPropellantMass_lbs
Definition P6DofRocketSolidPropellantObject.hpp:175
UtCloneablePtr< UtTable::Curve > mThrustSeaLevelVersusTime
Definition P6DofRocketSolidPropellantObject.hpp:161
double mCurrentFuelBurnRate_pph
Definition P6DofRocketSolidPropellantObject.hpp:180
UtVec3dX mPropellantCmLocation_ft
Definition P6DofRocketSolidPropellantObject.hpp:184
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 CalculateCurrentMassProperties()=0
virtual void SetControlInputValues(const P6DofFlightControlSystem *aFlightControls)=0
Definition P6DofThrustProducerObject.hpp:253
Copyrights Multiple, All Rights Reserved