WSF
P6DofAeroMovableObject.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#ifndef P6DOFAEROMOVABLEOBJECT_H
13#define P6DOFAEROMOVABLEOBJECT_H
14
15#include <string>
16
17#include "UtCloneablePtr.hpp"
18#include "UtTable.hpp"
19
20class UtInput;
21class UtVec3dX;
22
23// The P6DofAeroMovableObject provides supplemental aerodynamics for an object,
24// beyond the 'core' aerodynamics of P6DofAeroCoreObject. It is used for
25// aerodynamics for components, landing gear, flaps, speed brakes, etc.
26
28{
29public:
32
34
36
37 // The SetExtendedValue function determines the extended amount of the item (0.0-1.0)
38 void SetExtendedValue(double aExtendedValue);
39
40 // The SetAngle_deg function determines the angle the item (typically, retracted = 0.0)
41 void SetAngle_deg(double aAngle_deg);
42
43 // ProcessInput reads initialization data
44 bool ProcessInput(UtInput& aInput);
45 bool Initialize();
46
47 // This sets the handle for the control surface (or other aero part)
48 void SetControlSurfaceHandle(size_t aHandle);
49
50 // This gets the handle for the control surface (or other aero part)
51 size_t GetControlSurfaceHandle() const;
52
53 // Returns the name string
54 std::string GetName() const;
55
56 // Either SetReferenceArea or SetReferenceAreas should be called during initialization
57 void SetReferenceArea(double aRefArea_sqft);
58
59 // Either SetReferenceArea or SetReferenceAreas should be called during initialization
60 void SetReferenceAreas(double aWingChord_ft, double aWingSpan_ft, double aWingArea_sqft);
61
62 // The CalculateMovableAeroFM function is called to calculate the aerodynamic
63 // forces and moments. The aLiftFactor is used for spoilers, which have the
64 // potential to spoil lift for the entire vehicle.
65 void CalculateMovableAeroFM(double aDynPress_lbsqft,
66 double aMach,
67 double aSpeed_fps,
68 double aAlpha_rad,
69 double aBeta_rad,
70 const UtVec3dX& aAngularRates_rps,
71 UtVec3dX& aMoment_ftlbs,
72 double& aLift_lbs,
73 double& aDrag_lbs,
74 double& aSideForce_lbs,
75 double& aLiftFactor,
76 double aAngle_deg);
77
78 // This calculates the pitching moment (Cm) including reference area effects
79 // but not including dynamic pressure effects.
80 double CalculateMovableAeroCmArea(double aMach, double aAlpha_rad, double aAngle_deg) const;
81
82 // This calculates the lift coefficient (CL) including reference area effects
83 // but not including dynamic pressure effects.
84 double CalculateMovableAeroCLArea(double aMach, double aAlpha_rad, double aAngle_deg) const;
85
86 // This calculates the lift coefficient (CL) without considering reference
87 // area effects.
88 double CalculateMovableAeroCL(double aMach, double aAlpha_rad, double aAngle_deg) const;
89
90 // This calculates the drag coefficient (Cd) including reference area effects
91 // but not including dynamic pressure effects.
92 double CalculateMovableAeroCdArea(double aMach, double aAlpha_rad, double aAngle_deg) const;
93
94 // This is deprecated. This is currently use to allow "legacy" stability derivatives.
95 // However, it may be removed (along with legacy stability derivatives in later versions.
96 bool UseLegacyAero() const { return mUseLegacy; }
97
98protected:
100
101 // Lift
102 double CL_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const;
103 double CLFactor_AngleMach(double aMach, double aAngle_deg) const;
104
105 // Drag
106 double Cd_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const; // This should be used when drag
107 // is only a function of alpha
108 double Cd_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const; // This should be used when drag is
109 // only a function of beta
110 double Cd_AngleMach(double aMach,
111 double aAngle_deg) const; // This should be used when drag is a function of alpha and beta
112
113 // Side force
114 double CY_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const;
115
116 // Pitching moments
117 double Cm_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const;
118 double Cmq_AngleMach(double aMach, double aAngle_deg) const;
119
120 // Yawing moments
121 double Cn_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const;
122 double Cnr_AngleMach(double aMach, double aAngle_deg) const;
123
124 // Rolling moments
125 double Cl_AngleMach(double aMach, double aAngle_deg) const;
126 double Cl_AngleAlphaBeta(double aAlpha_rad, double aBeta_rad, double aAngle_deg) const;
127 double Clp_AngleMach(double aMach, double aAngle_deg) const;
128 double Clq_AngleMach(double aMach, double aAngle_deg) const;
129 double Clr_AngleMach(double aMach, double aAngle_deg) const;
130
131 std::string mName;
132
137 double mRefWingChord_ft = 0.0;
138 double mRefWingSpan_ft = 0.0;
139 double mRefWingArea_sqft = 0.0;
140 double mExtendedValue = 0.0;
141 double mAngle_deg = 0.0;
142
144
145 // This "legacy" flag allows the use of older aero stability derivatives, which are deprecated and should no longer be used
146 bool mUseLegacy = false;
147
148 // This "reduced frequency" flag allows the use of reduced frequency rather than angular rates to compute aerodynamic derivatives
150
151 // Lift
152 UtCloneablePtr<UtTable::Table> mCL_AngleAlphaMachTablePtr{nullptr};
153 UtCloneablePtr<UtTable::Table> mCLFactor_AngleMachTablePtr{nullptr};
154
155 // Drag - Only one of these should be used
156 UtCloneablePtr<UtTable::Table> mCd_AngleAlphaMachTablePtr{
157 nullptr}; // This should be used when drag is only a function of alpha
158 UtCloneablePtr<UtTable::Table> mCd_AngleBetaMachTablePtr{
159 nullptr}; // This should be used when drag is only a function of beta
160 UtCloneablePtr<UtTable::Table> mCd_AngleMachTablePtr{
161 nullptr}; // This should be used when drag is a function of alpha and beta
162
163 // Side force
164 UtCloneablePtr<UtTable::Table> mCY_AngleBetaMachTablePtr{nullptr};
165
166 // Pitching moments
167 UtCloneablePtr<UtTable::Table> mCm_AngleAlphaMachTablePtr{nullptr};
168 UtCloneablePtr<UtTable::Table> mCmq_AngleMachTablePtr{nullptr};
169
170 // Yawing moments
171 UtCloneablePtr<UtTable::Table> mCn_AngleBetaMachTablePtr{nullptr};
172 UtCloneablePtr<UtTable::Table> mCnr_AngleMachTablePtr{nullptr};
173
174 // Rolling moments
175 UtCloneablePtr<UtTable::Table> mCl_AngleMachTablePtr{nullptr};
176 UtCloneablePtr<UtTable::Table> mCl_AngleAlphaBetaTablePtr{
177 nullptr}; // This replaces the Mach-based version, instead using alpha/beta
178 UtCloneablePtr<UtTable::Table> mClp_AngleMachTablePtr{nullptr};
179 UtCloneablePtr<UtTable::Table> mClq_AngleMachTablePtr{nullptr};
180 UtCloneablePtr<UtTable::Table> mClr_AngleMachTablePtr{nullptr};
181};
182
183#endif
UtCloneablePtr< UtTable::Table > mCl_AngleAlphaBetaTablePtr
Definition P6DofAeroMovableObject.hpp:176
UtCloneablePtr< UtTable::Table > mCL_AngleAlphaMachTablePtr
Definition P6DofAeroMovableObject.hpp:152
size_t GetControlSurfaceHandle() const
Definition P6DofAeroMovableObject.cpp:820
UtCloneablePtr< UtTable::Table > mClr_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:180
double mRefWingChord_ft
Definition P6DofAeroMovableObject.hpp:137
void SetReferenceAreas(double aWingChord_ft, double aWingSpan_ft, double aWingArea_sqft)
Definition P6DofAeroMovableObject.cpp:33
double Cnr_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:479
UtCloneablePtr< UtTable::Table > mCd_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:160
double CalculateMovableAeroCdArea(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:766
std::string GetName() const
Definition P6DofAeroMovableObject.cpp:351
double Cd_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:397
double mExtendedValue
Definition P6DofAeroMovableObject.hpp:140
UtCloneablePtr< UtTable::Table > mClq_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:179
bool mUseInternalRefArea
Definition P6DofAeroMovableObject.hpp:134
double CalculateMovableAeroCLArea(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:740
P6DofAeroMovableObject(const P6DofAeroMovableObject &aSrc)=default
UtCloneablePtr< UtTable::Table > mCm_AngleAlphaMachTablePtr
Definition P6DofAeroMovableObject.hpp:167
std::string mName
Definition P6DofAeroMovableObject.hpp:131
UtCloneablePtr< UtTable::Table > mCY_AngleBetaMachTablePtr
Definition P6DofAeroMovableObject.hpp:164
double Cn_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:465
void SetAngle_deg(double aAngle_deg)
Definition P6DofAeroMovableObject.cpp:810
double Cl_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:492
size_t mControlSurfaceHandle
Definition P6DofAeroMovableObject.hpp:143
bool mUseExternalRefArea
Definition P6DofAeroMovableObject.hpp:133
UtCloneablePtr< UtTable::Table > mCLFactor_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:153
double Clr_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:545
bool mUseReducedFrequency
Definition P6DofAeroMovableObject.hpp:149
double Cd_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:411
bool Initialize()
Definition P6DofAeroMovableObject.cpp:346
double mRefWingArea_sqft
Definition P6DofAeroMovableObject.hpp:139
UtCloneablePtr< UtTable::Table > mCd_AngleAlphaMachTablePtr
Definition P6DofAeroMovableObject.hpp:156
P6DofAeroMovableObject & operator=(const P6DofAeroMovableObject &other)=delete
~P6DofAeroMovableObject()=default
double Cm_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:438
UtCloneablePtr< UtTable::Table > mCl_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:175
double CalculateMovableAeroCL(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:761
double CL_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:356
void SetExtendedValue(double aExtendedValue)
Definition P6DofAeroMovableObject.cpp:805
double Cl_AngleAlphaBeta(double aAlpha_rad, double aBeta_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:505
void SetReferenceArea(double aRefArea_sqft)
Definition P6DofAeroMovableObject.cpp:26
double Cmq_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:452
double CLFactor_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:370
bool UseLegacyAero() const
Definition P6DofAeroMovableObject.hpp:96
double mRefInternalArea_sqft
Definition P6DofAeroMovableObject.hpp:136
double CalculateMovableAeroCmArea(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:718
double Cd_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:383
double CY_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:424
double mRefExternalArea_sqft
Definition P6DofAeroMovableObject.hpp:135
bool mUseLegacy
Definition P6DofAeroMovableObject.hpp:146
UtCloneablePtr< UtTable::Table > mClp_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:178
bool ProcessInput(UtInput &aInput)
Definition P6DofAeroMovableObject.cpp:40
P6DofAeroMovableObject * Clone() const
Definition P6DofAeroMovableObject.cpp:21
void SetControlSurfaceHandle(size_t aHandle)
Definition P6DofAeroMovableObject.cpp:815
double Clq_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:532
P6DofAeroMovableObject()=default
UtCloneablePtr< UtTable::Table > mCn_AngleBetaMachTablePtr
Definition P6DofAeroMovableObject.hpp:171
UtCloneablePtr< UtTable::Table > mCmq_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:168
UtCloneablePtr< UtTable::Table > mCd_AngleBetaMachTablePtr
Definition P6DofAeroMovableObject.hpp:158
double mRefWingSpan_ft
Definition P6DofAeroMovableObject.hpp:138
double mAngle_deg
Definition P6DofAeroMovableObject.hpp:141
double Clp_AngleMach(double aMach, double aAngle_deg) const
Definition P6DofAeroMovableObject.cpp:519
UtCloneablePtr< UtTable::Table > mCnr_AngleMachTablePtr
Definition P6DofAeroMovableObject.hpp:172
void CalculateMovableAeroFM(double aDynPress_lbsqft, double aMach, double aSpeed_fps, double aAlpha_rad, double aBeta_rad, const UtVec3dX &aAngularRates_rps, UtVec3dX &aMoment_ftlbs, double &aLift_lbs, double &aDrag_lbs, double &aSideForce_lbs, double &aLiftFactor, double aAngle_deg)
Definition P6DofAeroMovableObject.cpp:558
Copyrights Multiple, All Rights Reserved