WSF
WsfRigidBodySixDOF_AeroMovableObject.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 WSFRIGIDBODYSIXDOFAEROMOVABLEOBJECT_HPP
13#define WSFRIGIDBODYSIXDOFAEROMOVABLEOBJECT_HPP
14
15#include <string>
16
17#include "UtCloneablePtr.hpp"
18class UtInput;
19#include "UtTable.hpp"
20class UtVec3dX;
21
22namespace wsf
23{
24namespace six_dof
25{
26// The RigidBodyAeroMovableObject provides supplemental aerodynamics for an object,
27// beyond the 'core' aerodynamics of RigidBodyAeroCoreObject. It is used for
28// aerodynamics for components, landing gear, flaps, speed brakes, etc.
29
31{
32public:
35
37
39
40 // The SetExtendedValue function determines the extended amount of the item (0.0-1.0)
41 void SetExtendedValue(double aExtendedValue);
42
43 // The SetAngle_deg function determines the angle the item (typically, retracted = 0.0)
44 void SetAngle_deg(double aAngle_deg);
45
46 // ProcessInput reads initialization data
47 bool ProcessInput(UtInput& aInput);
48 bool Initialize();
49
50 // This sets the handle for the control surface (or other aero part)
51 void SetControlSurfaceHandle(size_t aHandle);
52
53 // This gets the handle for the control surface (or other aero part)
54 size_t GetControlSurfaceHandle() const;
55
56 // Returns the name string
57 std::string GetName() const;
58
59 // Either SetReferenceArea or SetReferenceAreas should be called during initialization
60 void SetReferenceArea(double aRefArea_sqft);
61
62 // Either SetReferenceArea or SetReferenceAreas should be called during initialization
63 void SetReferenceAreas(double aWingChord_ft, double aWingSpan_ft, double aWingArea_sqft);
64
65 // The CalculateMovableAeroFM function is called to calculate the aerodynamic
66 // forces and moments. The aLiftFactor is used for spoilers, which have the
67 // potential to spoil lift for the entire vehicle.
68 void CalculateMovableAeroFM(double aDynPress_lbsqft,
69 double aMach,
70 double aSpeed_fps,
71 double aAlpha_rad,
72 double aBeta_rad,
73 const UtVec3dX& aAngularRates_rps,
74 UtVec3dX& aMoment_ftlbs,
75 double& aLift_lbs,
76 double& aDrag_lbs,
77 double& aSideForce_lbs,
78 double& aLiftFactor,
79 double aAngle_deg);
80
81 // This calculates the pitching moment (Cm) including reference area effects
82 // but not including dynamic pressure effects.
83 double CalculateMovableAeroCmArea(double aMach, double aAlpha_rad, double aAngle_deg) const;
84
85 // This calculates the lift coefficient (CL) including reference area effects
86 // but not including dynamic pressure effects.
87 double CalculateMovableAeroCLArea(double aMach, double aAlpha_rad, double aAngle_deg) const;
88
89 // This calculates the lift coefficient (CL) without considering reference
90 // area effects.
91 double CalculateMovableAeroCL(double aMach, double aAlpha_rad, double aAngle_deg) const;
92
93 // This calculates the drag coefficient (Cd) including reference area effects
94 // but not including dynamic pressure effects.
95 double CalculateMovableAeroCdArea(double aMach, double aAlpha_rad, double aAngle_deg) const;
96
97protected:
99
100 // Lift
101 double CL_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const;
102
103 // Drag
104 double Cd_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const; // This should be used when drag
105 // is only a function of alpha
106 double Cd_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const; // This should be used when drag is
107 // only a function of beta
108 double Cd_AngleMach(double aMach,
109 double aAngle_deg) const; // This should be used when drag is a function of alpha and beta
110
111 // Side force
112 double CY_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const;
113
114 // Pitching moments
115 double Cm_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const;
116 double Cmq_AngleMach(double aMach, double aAngle_deg) const;
117
118 // Yawing moments
119 double Cn_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const;
120 double Cnr_AngleMach(double aMach, double aAngle_deg) const;
121
122 // Rolling moments
123 double Cl_AngleAlphaBeta(double aAlpha_rad, double aBeta_rad, double aAngle_deg) const;
124 double Clp_AngleMach(double aMach, double aAngle_deg) const;
125 double Clq_AngleMach(double aMach, double aAngle_deg) const;
126 double Clr_AngleMach(double aMach, double aAngle_deg) const;
127
128 std::string mName;
129
134 double mRefWingChord_ft = 0.0;
135 double mRefWingSpan_ft = 0.0;
136 double mRefWingArea_sqft = 0.0;
137 double mExtendedValue = 0.0;
138 double mAngle_deg = 0.0;
139
141
142 // This "reduced frequency" flag allows the use of reduced frequency rather than angular rates to compute aerodynamic derivatives
144
145 // Lift
146 UtCloneablePtr<UtTable::Table> mCL_AngleAlphaMachTablePtr{nullptr};
147
148 // Drag - Only one of these should be used
149 UtCloneablePtr<UtTable::Table> mCd_AngleAlphaMachTablePtr{
150 nullptr}; // This should be used when drag is only a function of alpha
151 UtCloneablePtr<UtTable::Table> mCd_AngleBetaMachTablePtr{
152 nullptr}; // This should be used when drag is only a function of beta
153 UtCloneablePtr<UtTable::Table> mCd_AngleMachTablePtr{
154 nullptr}; // This should be used when drag is a function of alpha and beta
155
156 // Side force
157 UtCloneablePtr<UtTable::Table> mCY_AngleBetaMachTablePtr{nullptr};
158
159 // Pitching moments
160 UtCloneablePtr<UtTable::Table> mCm_AngleAlphaMachTablePtr{nullptr};
161 UtCloneablePtr<UtTable::Table> mCmq_AngleMachTablePtr{nullptr};
162
163 // Yawing moments
164 UtCloneablePtr<UtTable::Table> mCn_AngleBetaMachTablePtr{nullptr};
165 UtCloneablePtr<UtTable::Table> mCnr_AngleMachTablePtr{nullptr};
166
167 // Rolling moments
168 UtCloneablePtr<UtTable::Table> mCl_AngleAlphaBetaTablePtr{
169 nullptr}; // This replaces the Mach-based version, instead using alpha/beta
170 UtCloneablePtr<UtTable::Table> mClp_AngleMachTablePtr{nullptr};
171 UtCloneablePtr<UtTable::Table> mClq_AngleMachTablePtr{nullptr};
172 UtCloneablePtr<UtTable::Table> mClr_AngleMachTablePtr{nullptr};
173};
174} // namespace six_dof
175} // namespace wsf
176
177#endif
UtCloneablePtr< UtTable::Table > mCl_AngleAlphaBetaTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:168
bool ProcessInput(UtInput &aInput)
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:40
void SetControlSurfaceHandle(size_t aHandle)
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:747
double Cn_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:416
UtCloneablePtr< UtTable::Table > mCmq_AngleMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:161
UtCloneablePtr< UtTable::Table > mCd_AngleMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:153
double mRefExternalArea_sqft
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:132
RigidBodyAeroMovableObject * Clone() const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:21
bool mUseInternalRefArea
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:131
double Clp_AngleMach(double aMach, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:457
std::string mName
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:128
double CY_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:375
bool mUseReducedFrequency
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:143
double Cd_AngleBetaMach(double aMach, double aBeta_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:348
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 WsfRigidBodySixDOF_AeroMovableObject.cpp:496
bool Initialize()
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:310
UtCloneablePtr< UtTable::Table > mClp_AngleMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:170
double CalculateMovableAeroCL(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:691
double Cd_AngleMach(double aMach, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:362
UtCloneablePtr< UtTable::Table > mCY_AngleBetaMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:157
double Cmq_AngleMach(double aMach, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:403
UtCloneablePtr< UtTable::Table > mCn_AngleBetaMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:164
double mRefWingChord_ft
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:134
UtCloneablePtr< UtTable::Table > mClr_AngleMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:172
UtCloneablePtr< UtTable::Table > mClq_AngleMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:171
double mExtendedValue
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:137
void SetAngle_deg(double aAngle_deg)
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:742
double mRefWingArea_sqft
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:136
UtCloneablePtr< UtTable::Table > mCnr_AngleMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:165
void SetExtendedValue(double aExtendedValue)
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:737
void SetReferenceArea(double aRefArea_sqft)
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:26
double Cnr_AngleMach(double aMach, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:430
UtCloneablePtr< UtTable::Table > mCL_AngleAlphaMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:146
double Cl_AngleAlphaBeta(double aAlpha_rad, double aBeta_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:443
UtCloneablePtr< UtTable::Table > mCd_AngleBetaMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:151
double mAngle_deg
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:138
RigidBodyAeroMovableObject(const RigidBodyAeroMovableObject &aSrc)=default
double mRefInternalArea_sqft
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:133
std::string GetName() const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:315
size_t mControlSurfaceHandle
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:140
UtCloneablePtr< UtTable::Table > mCm_AngleAlphaMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:160
double CL_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:320
UtCloneablePtr< UtTable::Table > mCd_AngleAlphaMachTablePtr
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:149
size_t GetControlSurfaceHandle() const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:752
bool mUseExternalRefArea
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:130
double mRefWingSpan_ft
Definition WsfRigidBodySixDOF_AeroMovableObject.hpp:135
double Clr_AngleMach(double aMach, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:483
double Cm_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:389
double Clq_AngleMach(double aMach, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:470
RigidBodyAeroMovableObject & operator=(const RigidBodyAeroMovableObject &other)=delete
double CalculateMovableAeroCdArea(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:696
double CalculateMovableAeroCmArea(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:644
double Cd_AngleAlphaMach(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:334
void SetReferenceAreas(double aWingChord_ft, double aWingSpan_ft, double aWingArea_sqft)
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:33
double CalculateMovableAeroCLArea(double aMach, double aAlpha_rad, double aAngle_deg) const
Definition WsfRigidBodySixDOF_AeroMovableObject.cpp:668
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