65 Name =
"FGStandardAtmosphere";
88 << 36089.2388 << 389.97
89 << 65616.7979 << 389.97
90 << 104986.8766 << 411.57
91 << 154199.4751 << 487.17
92 << 167322.8346 << 487.17
93 << 232939.6325 << 386.37
94 << 278385.8268 << 336.5028
95 << 298556.4304 << 336.5028;
107 << 3280.8399 << 31000.
108 << 6561.6798 << 28000.
109 << 13123.3596 << 22000.
110 << 19685.0394 << 8900.
111 << 26246.7192 << 4700.
112 << 32808.3990 << 1300.
113 << 39370.0787 << 230.
115 << 52493.4383 << 38.;
204 for (
b=0;
b < numRows-2; ++
b) {
206 if (GeoPotAlt < testAlt)
212 double deltaH = GeoPotAlt - BaseAlt;
216 double Exp =
g0 / (
Rdry*Lmb);
217 double factor = Tmb/(Tmb + Lmb*deltaH);
250 if (GeoPotAlt >= 0.0) {
277 if (GeoPotAlt >= 0.0)
298 for (
b=0;
b < numRows-2; ++
b) {
300 if (GeoPotAlt < testAlt)
306 double deltaH = GeoPotAlt - BaseAlt;
310 double Exp =
g0 / (
Rdry*Lmb);
311 double factor = Tmb/(Tmb + Lmb*deltaH);
400 std::cout <<
"Altitude (ft) Temp (F) Pressure (psf) Density (sl/ft3)" << std::endl;
401 std::cout <<
"------------- -------- -------------- ----------------" << std::endl;
402 for (
int i=0;
i<280000;
i+=1000) {
404 std::cout << std::setw(12) << std::setprecision(2) <<
i
405 <<
" " << std::setw(9) << std::setprecision(2) <<
Temperature - 459.67
406 <<
" " << std::setw(13) << std::setprecision(4) <<
Pressure
407 <<
" " << std::setw(18) << std::setprecision(8) <<
Density
427 for (
unsigned int bh=0; bh < numRows-1; bh++)
447 double deltaH = UpperAlt - BaseAlt;
448 double Tmb = BaseTemp
453 double Exp =
g0 / (
Rdry*Lmb);
454 double factor = Tmb/(Tmb + Lmb*deltaH);
509 double density_altitude = 0.0;
513 double Exp = -1.0 / (1.0 +
g0/(
Rdry*Lmb));
514 density_altitude = Hb + (Tmb / Lmb) * (pow(density / pb, Exp) - 1);
516 double Factor = -
Rdry*Tmb /
g0;
517 density_altitude = Hb + Factor * log(density / pb);
540 double pressure_altitude = 0.0;
544 double Exp = -
Rdry*Lmb /
g0;
545 pressure_altitude = Hb + (Tmb / Lmb) * (pow(pressure / Pb, Exp) - 1);
548 double Factor = -
Rdry*Tmb /
g0;
549 pressure_altitude = Hb + Factor * log(pressure / Pb);
560 return a*exp(
b*temperature_degC/(
c+temperature_degC));
597 double dewpoint_degC;
600 if (VaporPressure <= 0.0)
603 double x = log(VaporPressure/
a);
604 dewpoint_degC =
c*x / (
b - x);
728 if (from == 0) std::cout <<
"Instantiated: FGStandardAtmosphere" << std::endl;
729 if (from == 1) std::cout <<
"Destroyed: FGStandardAtmosphere" << std::endl;
bool Run(bool Holding) override
Runs the atmosphere forces model; called by the Executive.
eTemperature
Enums for specifying temperature units.
double ConvertToPSF(double t, ePressure unit=ePSF) const
Converts to PSF (pounds per square foot) from one of several unit systems.
virtual double GetPressureSL(ePressure to=ePSF) const
FGAtmosphere(FGFDMExec *)
Constructor.
double ConvertFromRankine(double t, eTemperature unit) const
Converts from Rankine to one of several unit systems.
static double Reng
Specific gas constant for air - ft*lbf/slug/R.
virtual double GetTemperature() const
Returns the actual, modeled temperature at the current altitude in degrees Rankine.
double ConvertToRankine(double t, eTemperature unit) const
Converts to Rankine from one of several unit systems.
double ConvertFromPSF(double t, ePressure unit=ePSF) const
Converts from PSF (pounds per square foot) to one of several unit systems.
virtual double GetPressure(void) const
Returns the pressure in psf.
static constexpr double StdDaySLpressure
virtual void Calculate(double altitude)
Calculate the atmosphere for the given altitude.
ePressure
Enums for specifying pressure units.
static constexpr double SHRatio
static constexpr double g0
Sea-level acceleration of gravity - ft/s^2.
static constexpr double RankineToCelsius(double rankine)
Converts from degrees Rankine to degrees Celsius.
FGPropertyManager * PropertyManager
virtual void SetSLTemperatureGradedDelta(eTemperature unit, double t)
Sets a Sea Level temperature delta that is ramped out by 86 km.
static constexpr double b
double CalculateDensityAltitude(double density, double geometricAlt) override
Calculates the density altitude given any temperature or pressure bias.
FGTable MaxVaporMassFraction
virtual double GetStdTemperature(double altitude) const
Returns the standard temperature in degrees Rankine at a specified altitude.
void SetDewPoint(eTemperature unit, double dewpoint)
Sets the dew point.
double GetVaporPressure(ePressure to) const
Returns the partial pressure of water vapor.
virtual double GetTemperatureDeltaGradient(eTemperature to)
Returns the temperature gradient to be applied on top of the standard temperature gradient.
std::vector< double > StdDensityBreakpoints
bool InitModel(void) override
virtual void PrintStandardAtmosphereTable()
Prints the U.S. Standard Atmosphere table.
FGTable StdAtmosTemperatureTable
double TemperatureDeltaGradient
double GradientFadeoutAltitude
void SetVaporPressure(ePressure unit, double Pv)
Sets the partial pressure of water vapor.
double CalculatePressureAltitude(double pressure, double geometricAlt) override
Calculates the pressure altitude given any temperature or pressure bias.
std::vector< double > PressureBreakpoints
void CalculateLapseRates()
Recalculate the lapse rate vectors when the temperature profile is altered in a way that would change...
void CalculatePressureBreakpoints(double SLpress)
Calculate (or recalculate) the atmospheric pressure breakpoints at the altitudes in the standard temp...
void SetTemperatureSL(double t, eTemperature unit=eFahrenheit) override
Sets the Sea Level temperature, if it is to be different than the standard.
virtual void ResetSLTemperature()
This function resets the model to apply no bias or delta gradient to the temperature.
static constexpr double a
Sonntag constants based on ref [2].
virtual void SetTemperatureBias(eTemperature unit, double t)
Sets the temperature bias to be added to the standard temperature at all altitudes.
void ValidateVaporMassFraction(double geometricAlt)
Validate the value of the vapor mass fraction.
static constexpr double Rdry
FGStandardAtmosphere(FGFDMExec *)
Constructor.
void CalculateStdDensityBreakpoints()
Calculate the atmospheric density breakpoints at the altitudes in the standard temperature table.
std::vector< double > StdLapseRates
virtual double GetTemperatureBias(eTemperature to) const
Returns the temperature bias over the sea level value in degrees Rankine.
std::vector< double > StdPressureBreakpoints
void Calculate(double altitude) override
Calculate the atmosphere for the given altitude.
virtual void SetTemperatureGradedDelta(double t, double h, eTemperature unit=eFahrenheit)
Sets the temperature delta value at the supplied altitude/elevation above sea level,...
void Debug(int from) override
virtual double GetStdPressure(double altitude) const
Returns the standard pressure at the specified altitude.
double GetSaturatedVaporPressure(ePressure to) const
Returns the saturated pressure of water vapor.
static constexpr double c
double GeometricAltitude(double geopotalt) const
Convert a geopotential altitude to a geometric altitude.
double GetRelativeHumidity(void) const
Returns the relative humidity in percent.
double GeopotentialAltitude(double geometalt) const
Convert a geometric altitude to a geopotential altitude.
static constexpr double Rwater
virtual void ResetSLPressure()
Resets the sea level to the Standard sea level pressure, and recalculates dependent parameters so tha...
void SetPressureSL(ePressure unit, double pressure) override
Sets the sea level pressure for modeling an off-standard pressure profile.
double SaturatedVaporPressure
std::vector< double > LapseRates
void CalculateSLDensity(void)
Calculate the SL density.
void CalculateSLSoundSpeedAndDensity(void)
Calculate the SL density and sound speed.
void SetRelativeHumidity(double RH)
Sets the relative humidity.
double GetVaporMassFractionPPM(void) const
Returns the vapor mass per million of dry air mass units (ppm).
double StdSLtemperature
Standard sea level conditions.
void SetTemperature(double t, double h, eTemperature unit=eFahrenheit) override
Sets the temperature at the supplied altitude, if it is to be different than the standard temperature...
virtual double GetStdDensity(double altitude) const
Returns the standard density at a specified altitude.
double GetDewPoint(eTemperature to) const
Returns the dew point.
virtual ~FGStandardAtmosphere()
Destructor.
double CalculateVaporPressure(double temperature)
Calculate the pressure of water vapor with the Magnus formula.
void SetVaporMassFractionPPM(double frac)
Sets the vapor mass per million of dry air mass units.