WSF
WsfPointMassSixDOF_ThrustProducerObject.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 WSFPOINTMASSSIXDOFTHRUSTPRODUCEROBJECT_HPP
13#define WSFPOINTMASSSIXDOFTHRUSTPRODUCEROBJECT_HPP
14
15class UtInput;
19
20namespace wsf
21{
22namespace six_dof
23{
25class TypeManager;
26
27class WSF_SIX_DOF_EXPORT PointMassThrustProducerObject : public ThrustProducerObject
28{
29public:
30 // This is used to create a type of a PointMassThrustProducerObject
34
35 ThrustProducerObject* Clone() const override;
36
37 // ProcessInput is called to read input data from a UtInput stream, which
38 // is typically an 'input file'.
39 bool ProcessInput(UtInput& aInput, TypeManager* aTypeManager) override;
40
41 // ProcessInput is called to read input data from a UtInput stream, which
42 // is typically an 'input file'.
43 bool ProcessTableInput(UtInput& aInput);
44
45 // ThrustProducerObject-derived classes should include CalculateThrust and
46 // UpdateThrust functions. CalculateThrust performs calculations but does
47 // not update 'state' while UpdateThrust performs calculations and also
48 // updates the state.
49
50
51 // The CalculateThrust function is called to calculate the engine's
52 // forces and moments. It does not change the state of the engine.
53 // To change the state, call UpdateThrust instead. This version
54 // uses the thrust producer's internal throttle values.
55 void CalculateThrust(double aDeltaT_sec,
56 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,
63 ForceAndRotationObject& aForceAndRotation,
64 double& aFuelBurnRate_pps,
65 double& aFuelBurned_lbs)
66 {
67 double thrustForce_lbs = 0.0;
68
69 mEnginePtr->CalculateThrust(aDeltaT_sec,
70 aAlt_ft,
71 aDynPress_lbsqft,
72 aStatPress_lbssqft,
73 aSpeed_fps,
74 aMach,
75 aAlpha_rad,
76 aBeta_rad,
77 thrustForce_lbs,
78 aFuelBurnRate_pps,
79 aFuelBurned_lbs);
80
81 CalcThrustProducerFM(thrustForce_lbs, aForceAndRotation);
82 }
83
84 // The UpdateThrust function is called to calculate the engine's
85 // forces and moments and update the state of the engine.
86 // To perform F&M calculations without changing the state, call the
87 // CalculateThrust function instead.
88 void UpdateThrust(double aDeltaT_sec,
89 double aAlt_ft,
90 double aDynPress_lbsqft,
91 double aStatPress_lbssqft,
92 double aSpeed_fps,
93 double aMach,
94 double aAlpha_rad,
95 double aBeta_rad,
96 ForceAndRotationObject& aForceAndRotation,
97 double& aFuelBurnRate_pps,
98 double& aFuelBurned_lbs)
99 {
100 double thrustForce_lbs = 0.0;
101
102 mEnginePtr->UpdateThrust(aDeltaT_sec,
103 aAlt_ft,
104 aDynPress_lbsqft,
105 aStatPress_lbssqft,
106 aSpeed_fps,
107 aMach,
108 aAlpha_rad,
109 aBeta_rad,
110 thrustForce_lbs,
111 aFuelBurnRate_pps,
112 aFuelBurned_lbs);
113
114 CalcThrustProducerFM(thrustForce_lbs, aForceAndRotation);
115 }
116
117 double GetThrottleMilSetting() override { return mThrottleSettingMIL; }
118 double GetThrottleAbSetting() override { return mThrottleSettingAB; }
119
120 // Set reference location and attitude (YPR) relative to parent
121 void SetThrustReferenceOffsetAttitude(const UtVec3dX& aReferenceLocation_ft, const UtVec3dX& aThrustYPR_rad) override;
122
123 // Direction of thrust relative to parent
124 void GetCurrentThrustVectorDirection(UtVec3dX& aDirection) const override;
125
126 // CalcCurrentThrustVectors provides the current thrust unit vector and thrust location
127 // in body coordinates including any thrust vectoring and reversing. The
128 // aThrustFactor indicates the magnitude factor for the thrust (positive is forward thrust
129 // and negative is reverse thrust, ranging from:
130 // 1 = full forward thrust to -0.5 = full reverse thrust
131 void CalcCurrentThrustVectors();
132
133protected:
135
136 // For deep copies within the class
137 void DeriveFrom(const ThrustProducerObject* aSrc) override;
138
139 // This will return the thrust vector using the thrust magnitude and current direction
140 UtVec3dX CalcThrustVectorFromThrust(double aThrust_lbs);
141
142 UtVec3dX CalcOmegaDotIncrementFromThrust(double aThrust_lbs);
143
144 // This calculates various thrust F&M vectors.
145 // It is used within the CalculateThrust function of thrust producers
146 void CalcThrustProducerFM(double aThrustMagnitude_lbs, ForceAndRotationObject& aForceAndMoment);
147
149
150 // These settings won't be used by all engine types
152 double mThrottleSettingAB = 0.0;
153
155};
156} // namespace six_dof
157} // namespace wsf
158
159#endif
Definition WsfSixDOF_ForceAndRotationObject.hpp:30
Definition WsfPointMassSixDOF_PropulsionSystem.hpp:26
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:28
double mThrottleSettingMIL
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:151
PointMassThrustProducerObject & operator=(const PointMassThrustProducerObject &other)=delete
void CalcThrustProducerFM(double aThrustMagnitude_lbs, ForceAndRotationObject &aForceAndMoment)
Definition WsfPointMassSixDOF_ThrustProducerObject.cpp:180
UtVec3dX mOmegaDotIncrementSlope_rps2_lbs
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:154
double GetThrottleMilSetting() override
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:117
bool ProcessInput(UtInput &aInput, TypeManager *aTypeManager) override
Definition WsfPointMassSixDOF_ThrustProducerObject.cpp:56
ThrustProducerObject * Clone() const override
Definition WsfPointMassSixDOF_ThrustProducerObject.cpp:51
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, ForceAndRotationObject &aForceAndRotation, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:88
double GetThrottleAbSetting() override
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:118
double mCurrentThrustFactor
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:148
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, ForceAndRotationObject &aForceAndRotation, double &aFuelBurnRate_pps, double &aFuelBurned_lbs)
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:55
double mThrottleSettingAB
Definition WsfPointMassSixDOF_ThrustProducerObject.hpp:152
bool ProcessTableInput(UtInput &aInput)
Definition WsfPointMassSixDOF_ThrustProducerObject.cpp:86
Definition WsfSixDOF_ThrustProducerObject.hpp:35
UtCloneablePtr< Engine > mEnginePtr
Definition WsfSixDOF_ThrustProducerObject.hpp:210
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