WSF
WsfSixDOF_RocketSolidPropellantEngine.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 WSFSIXDOFROCKETSOLIDPROPELLANTENGINE_HPP
13#define WSFSIXDOFROCKETSOLIDPROPELLANTENGINE_HPP
14
15#include "wsf_six_dof_export.h"
16
17#include <cinttypes>
18#include <string>
19#include <vector>
20
21#include "UtCloneablePtr.hpp"
22class UtInput;
23#include "UtTable.hpp"
24#include "UtVec3dX.hpp"
25#include "WsfSixDOF_Engine.hpp"
27
28namespace wsf
29{
30namespace six_dof
31{
32class WSF_SIX_DOF_EXPORT RocketSolidPropellantEngine : public Engine
33{
34public:
35 // This is used to create a type of a RocketSolidPropellantEngine
37
39
41
42 // ProcessInput reads initialization data
43 bool ProcessInput(UtInput& aInput, TypeManager* aTypeManager) override;
44 bool Initialize(int64_t aSimTime_nanosec) override;
45
46 Engine* Clone() const override;
47
48 void DeriveFrom(const Engine* aSrc) override;
49
50 // The IgniteNow function is called to 'start' the rocket engine.
51 void IgniteNow() { mIsBurning = true; }
52
53 // GetPercentMaxThrust returns the last 'updated' engine thrust
54 // in terms of percent of maximum thrust
55 double GetPercentMaxThrust() const;
56
57 // GetFuelBurnRate_pph returns the current fuel/propellant burn rate in lbs/hr
58 double GetFuelBurnRate_pph() const override;
59
60 // This provides the maximum potential thrust available
61 double GetMaximumPotentialThrust_lbs(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) override;
68
69 // This provides the minimum potential thrust available
70 double GetMinimumPotentialThrust_lbs(double aAlt_ft,
71 double aDynPress_lbsqft,
72 double aStatPress_lbssqft,
73 double aSpeed_fps,
74 double aMach,
75 double aAlpha_rad,
76 double aBeta_rad) override;
77
78 // The SetThrottleLeverPosition function should be called prior to calling
79 // UpdateThrust so that the throttle will be properly set.
80 void SetThrottlePosition(double aThrottleLeverPosition) override;
81
82 // This returns the current throttle position
83 double GetThrottlePosition() const override;
84
85 // The Ignite function is called to 'start' the rocket engine.
86 void Ignite(int64_t aIgniteTimeInFrame_nanosec) override;
87
88 void Shutdown(int64_t aTerminateTime_nanosec = 0) override;
89
90protected:
92
93 // This CalculateThrust function is called internally by either
94 // CalculateThrust or UpdateThrust to calculate the engine's
95 // forces and moments. The aUpdateData flag determines whether
96 // or not to change the state of the engine.
97 void CalculateThrust(double aDeltaT_sec,
98 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,
105 double& aForceAndMoment,
106 double& aFuelBurnRate_pps,
107 double& aFuelBurned_lbs,
108 bool aUpdateData) override;
109
110 double Thrust_lbs(double aBurnTime_Sec, double aAlt_ft, double& aMassFlow_pps);
111
112 void UpdatePropellantMass(double aRemainingPropellant_lbs);
113
114 bool MayProduceSmokeTrail() const override { return mGenerateSmokeTrail; }
115
116 // Thrust versus time at sea level or vacuum.
117 // One of these must be specified.
118 UtCloneablePtr<UtTable::Curve> mThrustSeaLevelVersusTime{nullptr};
119 UtCloneablePtr<UtTable::Curve> mThrustVacuumVersusTime{nullptr};
120
121 // Specific impulse as a function of altitude.
122 // This must be specified or a default table will be used
123 UtCloneablePtr<UtTable::Curve> mIspAlt{nullptr};
124
125 double mIspSeaLevel = 0.0;
126 double mIspVacuum = 0.0;
127
128 double mRatedThrust_lbs = 0.0; // Used to determine percent thrust
129 double mLastThrust_lbs = 0.0;
130
131 bool mIsBurning = false;
132 double mBurnTime_sec = 0.0;
133
135
137};
138} // namespace six_dof
139} // namespace wsf
140
141#endif
Engine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_Engine.cpp:16
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:33
RocketSolidPropellantEngine(ThrustProducerObject *aParentObject)
Definition WsfSixDOF_RocketSolidPropellantEngine.cpp:27
double mIspSeaLevel
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:125
bool mIsBurning
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:131
bool Initialize(int64_t aSimTime_nanosec) override
Definition WsfSixDOF_RocketSolidPropellantEngine.cpp:159
bool mGenerateSmokeTrail
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:136
UtCloneablePtr< UtTable::Curve > mThrustSeaLevelVersusTime
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:118
double mBurnTime_sec
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:132
double mIspVacuum
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:126
RocketSolidPropellantEngine & operator=(const RocketSolidPropellantEngine &other)=delete
double mLastThrust_lbs
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:129
bool ProcessInput(UtInput &aInput, TypeManager *aTypeManager) override
Definition WsfSixDOF_RocketSolidPropellantEngine.cpp:84
double mCurrentFuelBurnRate_pph
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:134
void DeriveFrom(const Engine *aSrc) override
Definition WsfSixDOF_RocketSolidPropellantEngine.cpp:56
void IgniteNow()
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:51
UtCloneablePtr< UtTable::Curve > mIspAlt
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:123
UtCloneablePtr< UtTable::Curve > mThrustVacuumVersusTime
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:119
double mRatedThrust_lbs
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:128
bool MayProduceSmokeTrail() const override
Definition WsfSixDOF_RocketSolidPropellantEngine.hpp:114
Engine * Clone() const override
Definition WsfSixDOF_RocketSolidPropellantEngine.cpp:51
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