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