WSF
WsfPointMassSixDOF_MoverTestObject.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 WSFPOINTMASSSIXDOFMOVERTESTOBJECT_HPP
13#define WSFPOINTMASSSIXDOFMOVERTESTOBJECT_HPP
14
17
18namespace wsf
19{
20namespace six_dof
21{
22class WSF_SIX_DOF_EXPORT PointMassMoverTestObject : public MoverTestObject
23{
24public:
26 explicit PointMassMoverTestObject(PointMassMover* aParentMover);
27
28 Mover* GetParentVehicle() const override;
29
30 // This creates an autopilot config file will the current autopilot data. it can be used
31 // the Autotune function (above).
32 void CreateAutopilotConfigFile(const std::string& aFilename) override;
33
34 // This function is used to determine if the vehicle can fly at the specified altitude (in feet),
35 // velocity (in ft/sec), throttle setting, and flaps setting. The throttle input assumes that
36 // 0 is idle, 1 is full power without augmentation/afterburner (military power), and 2 is
37 // full power with full augmentation/afterburner (full afterburner). The flaps input assumes that
38 // 0 is fully retracted and 1 is fully deployed. The function returns a CanFlyAtReturnValue,
39 // which can be CAN_NOT_FLY, CONTROL_FAIL, or CAN_FLY.
40 utils::CanFlyAtReturnValue CanFlyAt(double aAltitude_ft, double aVelocity_fps, double aThrottle, double aFlaps = 0.0) override;
41
42 // This returns the turn rate (deg/sec) with the specified specific excess power (in ft/sec),
43 // true airspeed (in ft/sec), and throttle setting (where 0 is idle, 1 is military power
44 // (full power without afterburner), and 2 is full afterburner).
45 double TurnRateAt(double aSpecificExcessPower_fps, double aTrueSpeed_fps, double aThrottleSetting) override;
46
47 // This returns the turn rate (deg/sec) with the required specific excess power (ft/sec)
48 // at the the specified conditions, including current mass (lbs), maximum g-load,
49 // altitude (ft), airspeed (ft/sec), and throttle setting (where 0 is idle, 1 is
50 // military power (full power without afterburner), and 2 is full afterburner).
51 double TurnRateWithConditions(double aSpecificExcessPower_fps,
52 double aCurrentMass_lbs,
53 double aMaxGLoad,
54 double aAltitude_ft,
55 double aAirspeed_fps,
56 double aThrottleSetting) override;
57
58 // This creates the autopilot support file for the current vehicle, outputting to the
59 // specified filename.
60 void CreateAutopilotSupportFile(const std::string& aFilename) override;
61
62 // This creates the autopilot support file for the current vehicle, outputting to the
63 // specified filename. This variant includes a limit to max mach.
64 void CreateAutopilotSupportFileWithMaxMach(const std::string& aFilename, const double& aMaxMach) override;
65
66 // In addition to limiting alpha, we may also need to limit the g-load.
67 // If necessary, this will limit alpha to stay under the g-load limit.
68 void LimitAlphaByMaxGLoad(double aMach, double aMaxGLoad, double aDynPressure_ppsqft, double& aAlpha_rad) override;
69
70 // In addition to limiting alpha, we may also need to limit the g-load.
71 // If necessary, this will limit alpha to stay under the g-load limit.
72 void LimitAlphaByMaxGLoad(double aMach,
73 double aMaxGLoad,
74 double aDynPressure_ppsqft,
75 double aCurrentMass_lbs,
76 double& aAlpha_rad) override;
77
78 // Modifies base vehicle mass, does NOT modify fuel mass. Used for testing.
79 void SetVehicleMass(double aMass_lbs) override;
80
81 // This provides the maximum instantaneous g-load as a function of altitude (ft) and
82 // speed (Mach) for a specified mass (lbs). This is the maximum pitch g-load based on
83 // conditions and does not consider any thrust effects. Hence, this can calculate the
84 // g-load for speeds that may not be attainable under normal operation. This function
85 // can be used for both aircraft and weapons.
86 double MaxInstantaneousGLoad(double aAltitude_ft, double aMach, double aCurrentMass_lbs) override;
87
88protected:
89 // This returns the angle of attack (alpha) in radians at the specified altitude (ft),
90 // speed (ft/sec), and desired drag (lbs).
91 double AlphaAtDesiredDrag(double aAlt_ft, double aSpeed_fps, double aDrag_lbs, bool& aOk) override;
92
93 // This provides the angle of attack (alpha) in radians at the specified altitude (ft),
94 // speed (Mach), and desired drag (lbs) with the specified current mass and while
95 // limited to the specified max g-load.
96 bool AlphaAtDesiredDrag(double aAlt_ft,
97 double aMach,
98 double aDrag_lbs,
99 double aCurrentMass_lbs,
100 double aMaxGLoad,
101 double& aAlpha_rad) override;
102
103 // This calculates the drag (lbs) and angle of attack (alpha, in deg) when in level flight
104 // at the specified altitude (ft) and speed (Mach) with the specified gross weight.
105 // Returns true if successful.
106 bool CalcLevelFlightDragAndAlpha(double aAltitude_ft,
107 double aMach,
108 double aGrossWeight_lbs,
109 double& aDrag_lbs,
110 double& aAlpha_deg) override;
111
113};
114} // namespace six_dof
115} // namespace wsf
116
117#endif
Definition WsfSixDOF_MoverTestObject.hpp:33
This is a base class for detailed air movers. This umbrella can cover RB6 or PM6 models.
Definition WsfSixDOF_Mover.hpp:58
utils::CanFlyAtReturnValue CanFlyAt(double aAltitude_ft, double aVelocity_fps, double aThrottle, double aFlaps=0.0) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:41
PointMassMover * mParentMover
Definition WsfPointMassSixDOF_MoverTestObject.hpp:112
void LimitAlphaByMaxGLoad(double aMach, double aMaxGLoad, double aDynPressure_ppsqft, double &aAlpha_rad) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:278
bool CalcLevelFlightDragAndAlpha(double aAltitude_ft, double aMach, double aGrossWeight_lbs, double &aDrag_lbs, double &aAlpha_deg) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:743
PointMassMoverTestObject(PointMassMover *aParentMover)
Constructor.
Definition WsfPointMassSixDOF_MoverTestObject.cpp:23
double AlphaAtDesiredDrag(double aAlt_ft, double aSpeed_fps, double aDrag_lbs, bool &aOk) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:481
double TurnRateAt(double aSpecificExcessPower_fps, double aTrueSpeed_fps, double aThrottleSetting) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:54
void SetVehicleMass(double aMass_lbs) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:409
double MaxInstantaneousGLoad(double aAltitude_ft, double aMach, double aCurrentMass_lbs) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:414
void CreateAutopilotSupportFile(const std::string &aFilename) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:261
double TurnRateWithConditions(double aSpecificExcessPower_fps, double aCurrentMass_lbs, double aMaxGLoad, double aAltitude_ft, double aAirspeed_fps, double aThrottleSetting) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:154
Mover * GetParentVehicle() const override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:28
void CreateAutopilotConfigFile(const std::string &aFilename) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:33
void CreateAutopilotSupportFileWithMaxMach(const std::string &aFilename, const double &aMaxMach) override
Definition WsfPointMassSixDOF_MoverTestObject.cpp:269
Definition WsfPointMassSixDOF_Mover.hpp:33
CanFlyAtReturnValue
Definition WsfSixDOF_Utils.hpp:31
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