WSF
WsfAero.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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFAERO_HPP
16#define WSFAERO_HPP
17
18#include "wsf_export.h"
19
20#include "UtAtmosphere.hpp"
21class UtInput;
22#include "WsfObject.hpp"
23class UtEntity;
24
28
30{
31public:
32 WsfAero(const UtAtmosphere& aAtmosphere);
33 ~WsfAero() override;
34
35 WsfAero* Clone() const override = 0;
36
37 virtual bool Initialize(double aSimTime, UtEntity* aPlatformPtr);
38
39 virtual void Update(double aSimTime, double aRequestedYForce = 0.0, double aRequestedZForce = 0.0, double aTVC_Force = 0.0);
40
41 bool ProcessInput(UtInput& aInput) override;
42
45 double GetDrag() const { return mDrag; }
46
48 virtual void GetECSForces(double aECSForces[3]) const
49 {
50 aECSForces[0] = -mDrag;
51 aECSForces[1] = mYForce;
52 aECSForces[2] = mZForce;
53 }
54
55 double GetQS() const { return mDynPressure * mRefArea; }
56
61 double GetMaximumForce() const { return mMaximumForce; }
62
64 double LiftCurveSlope() const { return mLiftCurveSlope; }
65
66 virtual double CalculateDrag(double aAltitude_m, double aMach, double aWeight_N) const { return 0.0; }
67
68protected:
69 std::string GetPlatformName() const;
70 WsfAero(const WsfAero& aSrc);
71
72 // Calculates and returns the dynamic pressure in N/m^2 given altitude in meters and speed in m/s
73 double GetDynamicPressure(double aAltitude_m, double aSpeed_mps) const;
74
75 // Calculates and returns the Mach number given the altitude and speed.
76 double GetMach(double aAltitude_m, double aSpeed_mps) const;
77
78 // Calculates and returns the speed in m/s given the altitude and Mach number
79 double GetSpeed(double aAltitude_m, double aMach) const;
80
81 // Prevent use of operator= by declaring, but not defining.
82 WsfAero& operator=(const WsfAero& aRhs) = delete;
83
87 UtEntity* mEntityPtr;
88
89 UtAtmosphere mAtm;
90
91 // Characteristic attributes are listed first (intrinsic to the object),
92 // and State values (which may vary with time) are listed later:
93
94 double mRefArea;
95
96 // -------------------------------------------------------
97 // The State values below are refreshed with each call to Update():
98
99 double mAltitude;
101 double mSpeed;
102 double mMach;
103
104 double mDrag;
105 double mZForce;
106 double mYForce;
108 double mLiftCurveSlope; // dCL/dAlpha (off body X-axis) assumed constant.
109 bool mDebug;
111};
112
113#endif
aObjectPtr Update(simTime)
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfAero.hpp:30
double GetQS() const
Definition WsfAero.hpp:55
double GetDrag() const
Definition WsfAero.hpp:45
double LiftCurveSlope() const
Return the partial derivative of lift coefficient with angle of attack. Assumed constant.
Definition WsfAero.hpp:64
double GetMaximumForce() const
Definition WsfAero.hpp:61
UtAtmosphere mAtm
Definition WsfAero.hpp:89
double mZForce
Definition WsfAero.hpp:105
double mMach
Definition WsfAero.hpp:102
WsfAero & operator=(const WsfAero &aRhs)=delete
double mDrag
Definition WsfAero.hpp:104
double mRefArea
Definition WsfAero.hpp:94
bool mInitialized
Definition WsfAero.hpp:110
double mDynPressure
Definition WsfAero.hpp:100
double mSpeed
Definition WsfAero.hpp:101
bool mDebug
Definition WsfAero.hpp:109
double mAltitude
Definition WsfAero.hpp:99
virtual double CalculateDrag(double aAltitude_m, double aMach, double aWeight_N) const
Definition WsfAero.hpp:66
virtual bool Initialize(double aSimTime, UtEntity *aPlatformPtr)
Definition WsfAero.cpp:75
WsfAero(const UtAtmosphere &aAtmosphere)
Definition WsfAero.cpp:28
double mLiftCurveSlope
Definition WsfAero.hpp:108
double mMaximumForce
Definition WsfAero.hpp:107
virtual void GetECSForces(double aECSForces[3]) const
Get the 3-D resultant aerodynamic forces in the Entity Coordinate System frame.
Definition WsfAero.hpp:48
WsfAero * Clone() const override=0
double mYForce
Definition WsfAero.hpp:106
UtEntity * mEntityPtr
Definition WsfAero.hpp:87
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
virtual bool ProcessInput(UtInput &aInput)
Definition WsfObject.cpp:140
Copyrights Multiple, All Rights Reserved