34#ifndef FGSTANDARDATMOSPHERE_H
35#define FGSTANDARDATMOSPHERE_H
357 void bind(
void)
override;
358 void Debug(
int from)
override;
366 static constexpr double b = 17.62;
367 static constexpr double c = 243.12;
eTemperature
Enums for specifying temperature units.
static constexpr double Mair
Mean molecular weight for air - slug/mol.
FGAtmosphere(FGFDMExec *)
Constructor.
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.
static constexpr double Rstar
Universal gas constant - ft*lbf/R/mol.
virtual double GetPressure(void) const
Returns the pressure in psf.
ePressure
Enums for specifying pressure units.
static constexpr double psftopa
static constexpr double kgtoslug
static constexpr double fttom
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.
static constexpr double Mwater
Mean molecular weight for water - slug/mol.
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.
static constexpr double EarthRadius
Earth radius in ft as defined for ISA 1976.
std::vector< double > StdLapseRates
virtual double GetTemperatureBias(eTemperature to) const
Returns the temperature bias over the sea level value in degrees Rankine.
virtual double GetStdTemperatureSL() const
Returns the standard sea level temperature 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.
virtual double GetStdTemperatureRatio(double h) const
Returns the ratio of the standard temperature at the supplied altitude over the standard sea level te...
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.