WSF
P6DofAtmosphere.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 P6DOFATMOSPHERE_H
13#define P6DOFATMOSPHERE_H
14
15#include "p6dof_export.h"
16
17#include <string>
18
19#include "UtCloneablePtr.hpp"
20#include "UtTable.hpp"
21
22class UtInput;
23class UtVec3dX;
24
26
27class P6DOF_EXPORT P6DofAtmosphere
28{
29public:
31 explicit P6DofAtmosphere(const std::string& aFilename);
32
33 P6DofAtmosphere& operator=(const P6DofAtmosphere& other) = delete;
34
35 P6DofAtmosphere* Clone() const;
36
37 ~P6DofAtmosphere() = default;
38
39 // SpeedOfSoundAtAltitude_fps returns the speed of sound at the specified
40 // altitude (ft).
41 double SpeedOfSoundAtAltitude_fps(double aAltitude_ft) const;
42
43 // AirDensityAtAltitude returns the density of air at the specified
44 // altitude (ft). Density is specified in units of
45 // [ ((lbf*sec^2)/ft^4) or slugs/ft^3 ]
46 double AirDensityAtAltitude(double aAltitude_ft) const;
47
48 // StaticPressureAtAltitude returns the static pressure at the specified
49 // altitude (ft). Static Pressure is specified in units of (lbs-force)/(ft^2)
50 double StaticPressureAtAltitude(double aAltitude_ft) const;
51
52 // TemperatureAtAltitude_F returns the temperature at the specified
53 // altitude (ft). Temperature is specified in units of degrees Fahrenheit
54 double TemperatureAtAltitude_F(double aAltitude_ft) const;
55
56 // TemperatureAtAltitude_R returns the temperature at the specified
57 // altitude (ft). Temperature is specified in units of degrees Rankine
58 double TemperatureAtAltitude_R(double aAltitude_ft) const;
59
60 // CalcMachAtAltitude returns the Mach for a vehicle at the specified
61 // altitude (ft) and speed (ft/sec)
62 double CalcMachAtAltitude(double aAltitude_ft, double aSpeed_fps) const;
63
64 // DensityRatioAtAltitude returns the density pressure ratio (often
65 // called sigma) for a vehicle at the specified altitude (ft)
66 double DensityRatioAtAltitude(double aAltitude_ft) const;
67
68 // StaticPressureRatioAtAltitude returns the static pressure ratio (often
69 // called delta) for a vehicle at the specified altitude (ft)
70 double StaticPressureRatioAtAltitude(double aAltitude_ft) const;
71
72 // TemperatureRatioAtAltitude returns the temperature ratio (often
73 // called theta) for a vehicle at the specified altitude (ft)
74 double TemperatureRatioAtAltitude(double aAltitude_ft) const;
75
76 // GetAeroParametersAtAltitude returns several parameters for a vehicle
77 // at the specified altitude (ft) and speed (ft/sec). Parameters
78 // include air density [ ((lbf*sec^2)/ft^4) or slugs/ft^3 ],
79 // dynamic pressure (lbf/sq-ft), static pressure (lbf/sq-ft), and Mach.
80 void GetAeroParametersAtAltitude(double aAltitude_ft,
81 double aSpeed_fps,
82 double& aAirDensity,
83 double& aDynamicPressure_psf,
84 double& aStaticPressure_psf,
85 double& aMach) const;
86
87 // This returns the KTAS based on the specified KCAS/KIAS and altitude
88 double CalcKtasFromKcas(double aAltitude_ft, double aSpeed_kcas) const;
89
90 // This returns the KTAS based on the specified mach and altitude
91 double CalcKtasFromMach(double aAltitude_ft, double aSpeed_mach) const;
92
93 // This returns the KTAS based on the specified speed in fps
94 double CalcKtasFromFps(double aSpeed_fps) const;
95
96 // This returns the KCAS/KIAS based on the specified KTAS and altitude
97 double CalcKcasFromKtas(double aAltitude_ft, double aSpeed_ktas) const;
98
99 // This returns the KCAS/KIAS based on the specified mach and altitude
100 double CalcKcasFromMach(double aAltitude_ft, double aSpeed_mach) const;
101
102 // This returns the KCAS/KIAS based on the specified speed in fps and altitude
103 double CalcKcasFromFps(double aAltitude_ft, double aSpeed_fps) const;
104
105 // This returns the mach based on the specified KCAS/KIAS and altitude
106 double CalcMachFromKcas(double aAltitude_ft, double aSpeed_kcas) const;
107
108 // This returns the mach based on the specified KTAS and altitude
109 double CalcMachFromKtas(double aAltitude_ft, double aSpeed_ktas) const;
110
111 // This returns the mach based on the specified speed in fps and altitude
112 double CalcMachFromFps(double aAltitude_ft, double aSpeed_fps) const;
113
114 // This returns the speed in fps based on the specified KCAS/KIAS and altitude
115 double CalcFpsFromKcas(double aAltitude_ft, double aSpeed_kcas) const;
116
117 // This returns the speed in fps based on the specified KTAS
118 double CalcFpsFromKtas(double aSpeed_ktas) const;
119
120 // This returns the speed in fps based on the specified mach and altitude
121 double CalcFpsFromMach(double aAltitude_ft, double aSpeed_mach) const;
122
123 // This returns the dynamic pressure in lbs/sq-ft based on the specified speed
124 // in fps and altitude
125 double CalcDynamicPressure_lbft2(double aAltitude_ft, double aSpeed_fps) const;
126
127 // This returns the speed in fps based on the specified altitude and
128 // dynamic pressure
129 double CalcFpsFromAltitudeDynamicPressure(double aAltitude_ft, double aPressure_lbft2) const;
130
131 // This returns the altitude band where contrailing will occur. Returns true
132 // is contrailing conditions exist, false if no contrailing will occur.
133 bool ContrailAltitudeBand_ft(double& aLowAltitude_ft, double& aHighAltitude_ft) const;
134
135 // This returns true if the specified altitude is within the contrailing band. If
136 // it is not within the band or contrailing conditions do not exist, it returns false.
137 bool WithinContrailAltitudeBand(double aAltitude_ft) const;
138
139 bool ProcessInput(UtInput& aInput);
140
141private:
142 P6DofAtmosphere(const P6DofAtmosphere& aSrc) = default;
143
144 UtCloneablePtr<UtTable::Curve> mDensityAltitudeTablePtr{nullptr};
145 UtCloneablePtr<UtTable::Curve> mPressureAltitudeTablePtr{nullptr};
146 UtCloneablePtr<UtTable::Curve> mSpeedOfSoundAltitudeTablePtr{nullptr};
147 UtCloneablePtr<UtTable::Curve> mTemperatureAltitudeTablePtr{nullptr};
148
149 bool mContrailingConditionsExist;
150 double mMinContrailingAltitude_ft;
151 double mMaxContrailingAltitude_ft;
152};
153
154#endif
bool ContrailAltitudeBand_ft(double &aLowAltitude_ft, double &aHighAltitude_ft) const
Definition P6DofAtmosphere.cpp:346
bool WithinContrailAltitudeBand(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:357
double CalcFpsFromAltitudeDynamicPressure(double aAltitude_ft, double aPressure_lbft2) const
Definition P6DofAtmosphere.cpp:337
double CalcMachAtAltitude(double aAltitude_ft, double aSpeed_fps) const
Definition P6DofAtmosphere.cpp:89
double TemperatureAtAltitude_R(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:151
P6DofAtmosphere & operator=(const P6DofAtmosphere &other)=delete
double AirDensityAtAltitude(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:106
double StaticPressureAtAltitude(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:134
double CalcDynamicPressure_lbft2(double aAltitude_ft, double aSpeed_fps) const
Definition P6DofAtmosphere.cpp:328
double CalcMachFromKtas(double aAltitude_ft, double aSpeed_ktas) const
Definition P6DofAtmosphere.cpp:283
double CalcMachFromKcas(double aAltitude_ft, double aSpeed_kcas) const
Definition P6DofAtmosphere.cpp:277
double CalcFpsFromKtas(double aSpeed_ktas) const
Definition P6DofAtmosphere.cpp:318
double StaticPressureRatioAtAltitude(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:175
double CalcKcasFromMach(double aAltitude_ft, double aSpeed_mach) const
Definition P6DofAtmosphere.cpp:249
double CalcKcasFromFps(double aAltitude_ft, double aSpeed_fps) const
Definition P6DofAtmosphere.cpp:256
double CalcKcasFromKtas(double aAltitude_ft, double aSpeed_ktas) const
Definition P6DofAtmosphere.cpp:242
P6DofAtmosphere()
Definition P6DofAtmosphere.cpp:22
P6DofAtmosphere * Clone() const
Definition P6DofAtmosphere.cpp:69
double DensityRatioAtAltitude(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:163
double TemperatureRatioAtAltitude(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:187
void GetAeroParametersAtAltitude(double aAltitude_ft, double aSpeed_fps, double &aAirDensity, double &aDynamicPressure_psf, double &aStaticPressure_psf, double &aMach) const
Definition P6DofAtmosphere.cpp:199
double CalcKtasFromFps(double aSpeed_fps) const
Definition P6DofAtmosphere.cpp:237
bool ProcessInput(UtInput &aInput)
Definition P6DofAtmosphere.cpp:369
double TemperatureAtAltitude_F(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:146
double CalcMachFromFps(double aAltitude_ft, double aSpeed_fps) const
Definition P6DofAtmosphere.cpp:290
double SpeedOfSoundAtAltitude_fps(double aAltitude_ft) const
Definition P6DofAtmosphere.cpp:74
double CalcFpsFromKcas(double aAltitude_ft, double aSpeed_kcas) const
Definition P6DofAtmosphere.cpp:295
double CalcKtasFromMach(double aAltitude_ft, double aSpeed_mach) const
Definition P6DofAtmosphere.cpp:230
~P6DofAtmosphere()=default
double CalcKtasFromKcas(double aAltitude_ft, double aSpeed_kcas) const
Definition P6DofAtmosphere.cpp:223
double CalcFpsFromMach(double aAltitude_ft, double aSpeed_mach) const
Definition P6DofAtmosphere.cpp:323
Copyrights Multiple, All Rights Reserved