FlightGear next
JSBSim::FGStandardAtmosphere Class Reference

#include <FGStandardAtmosphere.h>

Inherits JSBSim::FGAtmosphere.

Public Member Functions

 FGStandardAtmosphere (FGFDMExec *)
 Constructor.
 
virtual ~FGStandardAtmosphere ()
 Destructor.
 
bool InitModel (void) override
 
Temperature access functions.

There are several ways to get the temperature, and several modeled temperature values that can be retrieved.

The U.S. Standard Atmosphere temperature either at a specified altitude, or at sea level can be retrieved. These two temperatures do NOT include the effects of any bias or delta gradient that may have been supplied by the user. The modeled temperature and the modeled temperature at sea level can also be retrieved. These two temperatures DO include the effects of an optionally user-supplied bias or delta gradient.

double GetTemperature (double altitude) const override
 Returns the actual modeled temperature in degrees Rankine at a specified altitude.
 
virtual double GetStdTemperature (double altitude) const
 Returns the standard temperature in degrees Rankine at a specified altitude.
 
virtual double GetStdTemperatureSL () const
 Returns the standard sea level temperature in degrees Rankine.
 
virtual double GetStdTemperatureRatio (double h) const
 Returns the ratio of the standard temperature at the supplied altitude over the standard sea level temperature.
 
virtual double GetTemperatureBias (eTemperature to) const
 Returns the temperature bias over the sea level value in degrees Rankine.
 
virtual double GetTemperatureDeltaGradient (eTemperature to)
 Returns the temperature gradient to be applied on top of the standard temperature gradient.
 
void SetTemperatureSL (double t, eTemperature unit=eFahrenheit) override
 Sets the Sea Level temperature, if it is to be different than the standard.
 
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 void SetTemperatureBias (eTemperature unit, double t)
 Sets the temperature bias to be added to the standard temperature at all altitudes.
 
virtual void SetSLTemperatureGradedDelta (eTemperature unit, double t)
 Sets a Sea Level temperature delta that is ramped out by 86 km.
 
virtual void SetTemperatureGradedDelta (double t, double h, eTemperature unit=eFahrenheit)
 Sets the temperature delta value at the supplied altitude/elevation above sea level, to be added to the standard temperature and ramped out by 86 km.
 
virtual void ResetSLTemperature ()
 This function resets the model to apply no bias or delta gradient to the temperature.
 
Pressure access functions.
double GetPressure (double altitude) const override
 Returns the pressure at a specified altitude in psf.
 
virtual double GetStdPressure (double altitude) const
 Returns the standard pressure at the specified altitude.
 
void SetPressureSL (ePressure unit, double pressure) override
 Sets the sea level pressure for modeling an off-standard pressure profile.
 
virtual void ResetSLPressure ()
 Resets the sea level to the Standard sea level pressure, and recalculates dependent parameters so that the pressure calculations are standard.
 
Density access functions.
virtual double GetStdDensity (double altitude) const
 Returns the standard density at a specified altitude.
 
- Public Member Functions inherited from JSBSim::FGAtmosphere
 FGAtmosphere (FGFDMExec *)
 Constructor.
 
virtual ~FGAtmosphere ()
 Destructor.
 
bool Run (bool Holding) override
 Runs the atmosphere forces model; called by the Executive.
 
virtual double GetTemperature () const
 Returns the actual, modeled temperature at the current altitude in degrees Rankine.
 
virtual double GetTemperatureSL () const
 Returns the actual, modeled sea level temperature in degrees Rankine.
 
virtual double GetTemperatureRatio () const
 Returns the ratio of the at-current-altitude temperature as modeled over the sea level value.
 
virtual double GetTemperatureRatio (double h) const
 Returns the ratio of the temperature as modeled at the supplied altitude over the sea level value.
 
virtual double GetPressure (void) const
 Returns the pressure in psf.
 
virtual double GetPressureSL (ePressure to=ePSF) const
 
virtual double GetPressureRatio (void) const
 Returns the ratio of at-altitude pressure over the sea level value.
 
virtual double GetDensity (void) const
 Returns the density in slugs/ft^3.
 
virtual double GetDensity (double altitude) const
 Returns the density in slugs/ft^3 at a given altitude in ft.
 
virtual double GetDensitySL (void) const
 Returns the sea level density in slugs/ft^3.
 
virtual double GetDensityRatio (void) const
 Returns the ratio of at-altitude density over the sea level value.
 
virtual double GetSoundSpeed (void) const
 Returns the speed of sound in ft/sec.
 
virtual double GetSoundSpeed (double altitude) const
 Returns the speed of sound in ft/sec at a given altitude in ft.
 
virtual double GetSoundSpeedSL (void) const
 Returns the sea level speed of sound in ft/sec.
 
virtual double GetSoundSpeedRatio (void) const
 Returns the ratio of at-altitude sound speed over the sea level value.
 
virtual double GetAbsoluteViscosity (void) const
 Returns the absolute viscosity.
 
virtual double GetKinematicViscosity (void) const
 Returns the kinematic viscosity.
 
virtual double GetDensityAltitude () const
 
virtual double GetPressureAltitude () const
 
- Public Member Functions inherited from JSBSim::FGModel
 FGModel (FGFDMExec *)
 Constructor.
 
 ~FGModel () override
 Destructor.
 
void SetRate (unsigned int tt)
 Set the ouput rate for the model in frames.
 
unsigned int GetRate (void)
 Get the output rate for the model in frames.
 
FGFDMExecGetExec (void)
 
void SetPropertyManager (FGPropertyManager *fgpm)
 
virtual SGPath FindFullPathName (const SGPath &path) const
 
const std::string & GetName (void)
 
virtual bool Load (Element *el)
 
- Public Member Functions inherited from JSBSim::FGModelFunctions
virtual ~FGModelFunctions ()
 
void RunPreFunctions (void)
 
void RunPostFunctions (void)
 
bool Load (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void PreLoad (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
void PostLoad (Element *el, FGFDMExec *fdmex, std::string prefix="")
 
std::string GetFunctionStrings (const std::string &delimeter) const
 Gets the strings for the current set of functions.
 
std::string GetFunctionValues (const std::string &delimeter) const
 Gets the function values.
 
FGFunctionGetPreFunction (const std::string &name)
 Get one of the "pre" function.
 
- Public Member Functions inherited from JSBSim::FGJSBBase
 FGJSBBase ()
 Constructor for FGJSBBase.
 
virtual ~FGJSBBase ()
 Destructor for FGJSBBase.
 
void PutMessage (const Message &msg)
 Places a Message structure on the Message queue.
 
void PutMessage (const std::string &text)
 Creates a message with the given text and places it on the queue.
 
void PutMessage (const std::string &text, bool bVal)
 Creates a message with the given text and boolean value and places it on the queue.
 
void PutMessage (const std::string &text, int iVal)
 Creates a message with the given text and integer value and places it on the queue.
 
void PutMessage (const std::string &text, double dVal)
 Creates a message with the given text and double value and places it on the queue.
 
int SomeMessages (void) const
 Reads the message on the queue (but does not delete it).
 
void ProcessMessage (void)
 Reads the message on the queue and removes it from the queue.
 
MessageProcessNextMessage (void)
 Reads the next message on the queue and removes it from the queue.
 
void disableHighLighting (void)
 Disables highlighting in the console output.
 

Humidity access functions

double StdSLtemperature
 Standard sea level conditions.
 
double StdSLdensity
 
double StdSLpressure
 
double StdSLsoundspeed
 
double TemperatureBias
 
double TemperatureDeltaGradient
 
double GradientFadeoutAltitude
 
double VaporMassFraction
 
double SaturatedVaporPressure
 
FGTable StdAtmosTemperatureTable
 
FGTable MaxVaporMassFraction
 
std::vector< double > LapseRates
 
std::vector< double > PressureBreakpoints
 
std::vector< double > StdPressureBreakpoints
 
std::vector< double > StdDensityBreakpoints
 
std::vector< double > StdLapseRates
 
static constexpr double EarthRadius = 6356766.0 / fttom
 Earth radius in ft as defined for ISA 1976.
 
static constexpr double a = 611.2/psftopa
 Sonntag constants based on ref [2].
 
static constexpr double b = 17.62
 
static constexpr double c = 243.12
 
static constexpr double Mwater = 18.016 * kgtoslug / 1000.0
 Mean molecular weight for water - slug/mol.
 
static constexpr double Rdry = Rstar / Mair
 
static constexpr double Rwater = Rstar / Mwater
 
void SetDewPoint (eTemperature unit, double dewpoint)
 Sets the dew point.
 
double GetDewPoint (eTemperature to) const
 Returns the dew point.
 
void SetVaporPressure (ePressure unit, double Pv)
 Sets the partial pressure of water vapor.
 
double GetVaporPressure (ePressure to) const
 Returns the partial pressure of water vapor.
 
double GetSaturatedVaporPressure (ePressure to) const
 Returns the saturated pressure of water vapor.
 
void SetRelativeHumidity (double RH)
 Sets the relative humidity.
 
double GetRelativeHumidity (void) const
 Returns the relative humidity in percent.
 
void SetVaporMassFractionPPM (double frac)
 Sets the vapor mass per million of dry air mass units.
 
double GetVaporMassFractionPPM (void) const
 Returns the vapor mass per million of dry air mass units (ppm).
 
virtual void PrintStandardAtmosphereTable ()
 Prints the U.S. Standard Atmosphere table.
 
void Calculate (double altitude) override
 Calculate the atmosphere for the given altitude.
 
void CalculateLapseRates ()
 Recalculate the lapse rate vectors when the temperature profile is altered in a way that would change the lapse rates, such as when a gradient is applied.
 
void CalculatePressureBreakpoints (double SLpress)
 Calculate (or recalculate) the atmospheric pressure breakpoints at the altitudes in the standard temperature table.
 
void CalculateStdDensityBreakpoints ()
 Calculate the atmospheric density breakpoints at the altitudes in the standard temperature table.
 
double GeopotentialAltitude (double geometalt) const
 Convert a geometric altitude to a geopotential altitude.
 
double GeometricAltitude (double geopotalt) const
 Convert a geopotential altitude to a geometric altitude.
 
double CalculateDensityAltitude (double density, double geometricAlt) override
 Calculates the density altitude given any temperature or pressure bias.
 
double CalculatePressureAltitude (double pressure, double geometricAlt) override
 Calculates the pressure altitude given any temperature or pressure bias.
 
double CalculateVaporPressure (double temperature)
 Calculate the pressure of water vapor with the Magnus formula.
 
void ValidateVaporMassFraction (double geometricAlt)
 Validate the value of the vapor mass fraction.
 
void CalculateSLDensity (void)
 Calculate the SL density.
 
void CalculateSLSoundSpeedAndDensity (void)
 Calculate the SL density and sound speed.
 
void bind (void) override
 
void Debug (int from) override
 

Additional Inherited Members

- Public Types inherited from JSBSim::FGAtmosphere
enum  eTemperature {
  eNoTempUnit =0 , eFahrenheit , eCelsius , eRankine ,
  eKelvin
}
 Enums for specifying temperature units. More...
 
enum  ePressure {
  eNoPressUnit =0 , ePSF , eMillibars , ePascals ,
  eInchesHg
}
 Enums for specifying pressure units. More...
 
- Public Types inherited from JSBSim::FGJSBBase
enum  { eL = 1 , eM , eN }
 Moments L, M, N. More...
 
enum  { eP = 1 , eQ , eR }
 Rates P, Q, R. More...
 
enum  { eU = 1 , eV , eW }
 Velocities U, V, W. More...
 
enum  { eX = 1 , eY , eZ }
 Positions X, Y, Z. More...
 
enum  { ePhi = 1 , eTht , ePsi }
 Euler angles Phi, Theta, Psi. More...
 
enum  { eDrag = 1 , eSide , eLift }
 Stability axis forces, Drag, Side force, Lift. More...
 
enum  { eRoll = 1 , ePitch , eYaw }
 Local frame orientation Roll, Pitch, Yaw. More...
 
enum  { eNorth = 1 , eEast , eDown }
 Local frame position North, East, Down. More...
 
enum  { eLat = 1 , eLong , eRad }
 Locations Radius, Latitude, Longitude. More...
 
enum  {
  inNone = 0 , inDegrees , inRadians , inMeters ,
  inFeet
}
 Conversion specifiers. More...
 
static const std::string & GetVersion (void)
 Returns the version number of JSBSim.
 
static constexpr double KelvinToFahrenheit (double kelvin)
 Converts from degrees Kelvin to degrees Fahrenheit.
 
static constexpr double CelsiusToRankine (double celsius)
 Converts from degrees Celsius to degrees Rankine.
 
static constexpr double RankineToCelsius (double rankine)
 Converts from degrees Rankine to degrees Celsius.
 
static constexpr double KelvinToRankine (double kelvin)
 Converts from degrees Kelvin to degrees Rankine.
 
static constexpr double RankineToKelvin (double rankine)
 Converts from degrees Rankine to degrees Kelvin.
 
static constexpr double FahrenheitToCelsius (double fahrenheit)
 Converts from degrees Fahrenheit to degrees Celsius.
 
static constexpr double CelsiusToFahrenheit (double celsius)
 Converts from degrees Celsius to degrees Fahrenheit.
 
static constexpr double CelsiusToKelvin (double celsius)
 Converts from degrees Celsius to degrees Kelvin.
 
static constexpr double KelvinToCelsius (double kelvin)
 Converts from degrees Kelvin to degrees Celsius.
 
static constexpr double FeetToMeters (double measure)
 Converts from feet to meters.
 
static double PitotTotalPressure (double mach, double p)
 Compute the total pressure in front of the Pitot tube.
 
static double MachFromImpactPressure (double qc, double p)
 Compute the Mach number from the differential pressure (qc) and the static pressure.
 
static double VcalibratedFromMach (double mach, double p)
 Calculate the calibrated airspeed from the Mach number.
 
static double MachFromVcalibrated (double vcas, double p)
 Calculate the Mach number from the calibrated airspeed.Based on the formulas in the US Air Force Aircraft Performance Flight Testing Manual (AFFTC-TIH-99-01).
 
static bool EqualToRoundoff (double a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, float b)
 Finite precision comparison.
 
static bool EqualToRoundoff (float a, double b)
 Finite precision comparison.
 
static bool EqualToRoundoff (double a, float b)
 Finite precision comparison.
 
static constexpr double Constrain (double min, double value, double max)
 Constrain a value between a minimum and a maximum value.
 
static constexpr double sign (double num)
 
static double GaussianRandomNumber (void)
 
struct JSBSim::FGAtmosphere::Inputs in
 
static constexpr double StdDaySLtemperature = 518.67
 
static constexpr double StdDaySLpressure = 2116.228
 
static const double StdDaySLsoundspeed = sqrt(SHRatio*Reng*StdDaySLtemperature)
 
- Static Public Attributes inherited from JSBSim::FGJSBBase
static char highint [5] = {27, '[', '1', 'm', '\0' }
 highlights text
 
static char halfint [5] = {27, '[', '2', 'm', '\0' }
 low intensity text
 
static char normint [6] = {27, '[', '2', '2', 'm', '\0' }
 normal intensity text
 
static char reset [5] = {27, '[', '0', 'm', '\0' }
 resets text properties
 
static char underon [5] = {27, '[', '4', 'm', '\0' }
 underlines text
 
static char underoff [6] = {27, '[', '2', '4', 'm', '\0' }
 underline off
 
static char fgblue [6] = {27, '[', '3', '4', 'm', '\0' }
 blue text
 
static char fgcyan [6] = {27, '[', '3', '6', 'm', '\0' }
 cyan text
 
static char fgred [6] = {27, '[', '3', '1', 'm', '\0' }
 red text
 
static char fggreen [6] = {27, '[', '3', '2', 'm', '\0' }
 green text
 
static char fgdef [6] = {27, '[', '3', '9', 'm', '\0' }
 default text
 
static short debug_lvl = 1
 
double ConvertToRankine (double t, eTemperature unit) const
 Converts to Rankine from one of several unit systems.
 
double ConvertFromRankine (double t, eTemperature unit) const
 Converts from Rankine to one of several unit systems.
 
double ConvertToPSF (double t, ePressure unit=ePSF) const
 Converts to PSF (pounds per square foot) 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.
 
- Protected Member Functions inherited from JSBSim::FGModel
bool Upload (Element *el, bool preLoad)
 Uploads this model in memory.
 
static std::string CreateIndexedPropertyName (const std::string &Property, int index)
 
double SLtemperature
 
double SLdensity
 
double SLpressure
 
double SLsoundspeed
 
double Temperature
 
double Density
 
double Pressure
 
double Soundspeed
 
double PressureAltitude
 
double DensityAltitude
 
double Viscosity
 
double KinematicViscosity
 
- Protected Attributes inherited from JSBSim::FGModel
unsigned int exe_ctr
 
unsigned int rate
 
std::string Name
 
FGFDMExecFDMExec
 
FGPropertyManagerPropertyManager
 
- Protected Attributes inherited from JSBSim::FGModelFunctions
std::vector< FGFunction * > PreFunctions
 
std::vector< FGFunction * > PostFunctions
 
FGPropertyReader LocalProperties
 
static constexpr double SutherlandConstant = 198.72
 
static constexpr double Beta = 2.269690E-08
 
static constexpr double Rstar = 8.31432 * kgtoslug / KelvinToRankine(fttom * fttom)
 Universal gas constant - ft*lbf/R/mol.
 
static constexpr double Mair = 28.9645 * kgtoslug / 1000.0
 Mean molecular weight for air - slug/mol.
 
static constexpr double g0 = 9.80665 / fttom
 Sea-level acceleration of gravity - ft/s^2.
 
static double Reng = Rstar / Mair
 Specific gas constant for air - ft*lbf/slug/R.
 
static constexpr double SHRatio = 1.4
 
static Message localMsg
 
static std::queue< MessageMessages
 
static unsigned int messageId = 0
 
static constexpr double radtodeg = 180. / 3.14159265358979323846
 
static constexpr double degtorad = 3.14159265358979323846 / 180.
 
static constexpr double hptoftlbssec = 550.0
 
static constexpr double psftoinhg = 0.014138
 
static constexpr double psftopa = 47.88
 
static constexpr double ktstofps = 1.68781
 
static constexpr double fpstokts = 1.0 / ktstofps
 
static constexpr double inchtoft = 1.0/12.0
 
static constexpr double fttom = 0.3048
 
static constexpr double m3toft3 = 1.0/(fttom*fttom*fttom)
 
static constexpr double in3tom3 = inchtoft*inchtoft*inchtoft/m3toft3
 
static constexpr double inhgtopa = 3386.38
 
static constexpr double slugtolb = 32.174049
 Note that definition of lbtoslug by the inverse of slugtolb and not to a different constant you can also get from some tables will make lbtoslug*slugtolb == 1 up to the magnitude of roundoff.
 
static constexpr double lbtoslug = 1.0/slugtolb
 
static constexpr double kgtolb = 2.20462
 
static constexpr double kgtoslug = 0.06852168
 
static const std::string needed_cfg_version = "2.0"
 
static const std::string JSBSim_version = JSBSIM_VERSION " " __DATE__ " " __TIME__
 
static int gaussian_random_number_phase = 0
 

Detailed Description

Definition at line 98 of file FGStandardAtmosphere.h.

Constructor & Destructor Documentation

◆ FGStandardAtmosphere()

JSBSim::FGStandardAtmosphere::FGStandardAtmosphere ( FGFDMExec * fdmex)

Constructor.

Definition at line 59 of file FGStandardAtmosphere.cpp.

◆ ~FGStandardAtmosphere()

JSBSim::FGStandardAtmosphere::~FGStandardAtmosphere ( )
virtual

Destructor.

Definition at line 145 of file FGStandardAtmosphere.cpp.

Member Function Documentation

◆ bind()

void JSBSim::FGStandardAtmosphere::bind ( void )
overrideprotectedvirtual

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 671 of file FGStandardAtmosphere.cpp.

◆ Calculate()

void JSBSim::FGStandardAtmosphere::Calculate ( double altitude)
overrideprotectedvirtual

Calculate the atmosphere for the given altitude.

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 179 of file FGStandardAtmosphere.cpp.

◆ CalculateDensityAltitude()

double JSBSim::FGStandardAtmosphere::CalculateDensityAltitude ( double density,
double geometricAlt )
overrideprotectedvirtual

Calculates the density altitude given any temperature or pressure bias.

Calculated density for the specified geometric altitude given any temperature or pressure biases is passed in.

Parameters
density
geometricAlt
See also
https://en.wikipedia.org/wiki/Density_altitude https://wahiduddin.net/calc/density_altitude.htm

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 494 of file FGStandardAtmosphere.cpp.

◆ CalculateLapseRates()

void JSBSim::FGStandardAtmosphere::CalculateLapseRates ( )
protected

Recalculate the lapse rate vectors when the temperature profile is altered in a way that would change the lapse rates, such as when a gradient is applied.

This function is also called to initialize the lapse rate vector.

Definition at line 422 of file FGStandardAtmosphere.cpp.

◆ CalculatePressureAltitude()

double JSBSim::FGStandardAtmosphere::CalculatePressureAltitude ( double pressure,
double geometricAlt )
overrideprotectedvirtual

Calculates the pressure altitude given any temperature or pressure bias.

Calculated density for the specified geometric altitude given any temperature or pressure biases is passed in.

Parameters
pressure
geometricAlt
See also
https://en.wikipedia.org/wiki/Pressure_altitude

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 525 of file FGStandardAtmosphere.cpp.

◆ CalculatePressureBreakpoints()

void JSBSim::FGStandardAtmosphere::CalculatePressureBreakpoints ( double SLpress)
protected

Calculate (or recalculate) the atmospheric pressure breakpoints at the altitudes in the standard temperature table.

Definition at line 439 of file FGStandardAtmosphere.cpp.

◆ CalculateSLDensity()

void JSBSim::FGStandardAtmosphere::CalculateSLDensity ( void )
inlineprotected

Calculate the SL density.

Definition at line 352 of file FGStandardAtmosphere.h.

◆ CalculateSLSoundSpeedAndDensity()

void JSBSim::FGStandardAtmosphere::CalculateSLSoundSpeedAndDensity ( void )
protected

Calculate the SL density and sound speed.

Definition at line 234 of file FGStandardAtmosphere.cpp.

◆ CalculateStdDensityBreakpoints()

void JSBSim::FGStandardAtmosphere::CalculateStdDensityBreakpoints ( )
protected

Calculate the atmospheric density breakpoints at the altitudes in the standard temperature table.

Definition at line 485 of file FGStandardAtmosphere.cpp.

◆ CalculateVaporPressure()

double JSBSim::FGStandardAtmosphere::CalculateVaporPressure ( double temperature)
protected

Calculate the pressure of water vapor with the Magnus formula.

Definition at line 557 of file FGStandardAtmosphere.cpp.

◆ Debug()

void JSBSim::FGStandardAtmosphere::Debug ( int from)
overrideprotectedvirtual

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 719 of file FGStandardAtmosphere.cpp.

◆ GeometricAltitude()

double JSBSim::FGStandardAtmosphere::GeometricAltitude ( double geopotalt) const
inlineprotected

Convert a geopotential altitude to a geometric altitude.

Definition at line 322 of file FGStandardAtmosphere.h.

◆ GeopotentialAltitude()

double JSBSim::FGStandardAtmosphere::GeopotentialAltitude ( double geometalt) const
inlineprotected

Convert a geometric altitude to a geopotential altitude.

Definition at line 319 of file FGStandardAtmosphere.h.

◆ GetDewPoint()

double JSBSim::FGStandardAtmosphere::GetDewPoint ( eTemperature to) const

Returns the dew point.

Parameters
toThe unit of measure that the dew point should be supplied in.

Definition at line 595 of file FGStandardAtmosphere.cpp.

◆ GetPressure()

double JSBSim::FGStandardAtmosphere::GetPressure ( double altitude) const
overridevirtual

Returns the pressure at a specified altitude in psf.

Implements JSBSim::FGAtmosphere.

Definition at line 191 of file FGStandardAtmosphere.cpp.

◆ GetRelativeHumidity()

double JSBSim::FGStandardAtmosphere::GetRelativeHumidity ( void ) const

Returns the relative humidity in percent.

Definition at line 637 of file FGStandardAtmosphere.cpp.

◆ GetSaturatedVaporPressure()

double JSBSim::FGStandardAtmosphere::GetSaturatedVaporPressure ( ePressure to) const

Returns the saturated pressure of water vapor.

Parameters
toThe unit of measure that the water vapor should be supplied in.

Definition at line 630 of file FGStandardAtmosphere.cpp.

◆ GetStdDensity()

double JSBSim::FGStandardAtmosphere::GetStdDensity ( double altitude) const
virtual

Returns the standard density at a specified altitude.

Definition at line 320 of file FGStandardAtmosphere.cpp.

◆ GetStdPressure()

double JSBSim::FGStandardAtmosphere::GetStdPressure ( double altitude) const
virtual

Returns the standard pressure at the specified altitude.

Definition at line 285 of file FGStandardAtmosphere.cpp.

◆ GetStdTemperature()

double JSBSim::FGStandardAtmosphere::GetStdTemperature ( double altitude) const
virtual

Returns the standard temperature in degrees Rankine at a specified altitude.

Parameters
altitudeThe altitude in feet above sea level (ASL) to get the temperature at.
Returns
The STANDARD temperature in degrees Rankine at the specified altitude.

Definition at line 273 of file FGStandardAtmosphere.cpp.

◆ GetStdTemperatureRatio()

virtual double JSBSim::FGStandardAtmosphere::GetStdTemperatureRatio ( double h) const
inlinevirtual

Returns the ratio of the standard temperature at the supplied altitude over the standard sea level temperature.

Definition at line 139 of file FGStandardAtmosphere.h.

◆ GetStdTemperatureSL()

virtual double JSBSim::FGStandardAtmosphere::GetStdTemperatureSL ( ) const
inlinevirtual

Returns the standard sea level temperature in degrees Rankine.

Returns
The STANDARD temperature at sea level in degrees Rankine.

Definition at line 135 of file FGStandardAtmosphere.h.

◆ GetTemperature()

double JSBSim::FGStandardAtmosphere::GetTemperature ( double altitude) const
overridevirtual

Returns the actual modeled temperature in degrees Rankine at a specified altitude.

Parameters
altitudeThe altitude above sea level (ASL) in feet.
Returns
Modeled temperature in degrees Rankine at the specified altitude.

Implements JSBSim::FGAtmosphere.

Definition at line 244 of file FGStandardAtmosphere.cpp.

◆ GetTemperatureBias()

virtual double JSBSim::FGStandardAtmosphere::GetTemperatureBias ( eTemperature to) const
inlinevirtual

Returns the temperature bias over the sea level value in degrees Rankine.

Definition at line 142 of file FGStandardAtmosphere.h.

◆ GetTemperatureDeltaGradient()

virtual double JSBSim::FGStandardAtmosphere::GetTemperatureDeltaGradient ( eTemperature to)
inlinevirtual

Returns the temperature gradient to be applied on top of the standard temperature gradient.

Definition at line 147 of file FGStandardAtmosphere.h.

◆ GetVaporMassFractionPPM()

double JSBSim::FGStandardAtmosphere::GetVaporMassFractionPPM ( void ) const

Returns the vapor mass per million of dry air mass units (ppm).

Definition at line 655 of file FGStandardAtmosphere.cpp.

◆ GetVaporPressure()

double JSBSim::FGStandardAtmosphere::GetVaporPressure ( ePressure to) const

Returns the partial pressure of water vapor.

Parameters
toThe unit of measure that the water vapor should be supplied in.

Definition at line 622 of file FGStandardAtmosphere.cpp.

◆ InitModel()

bool JSBSim::FGStandardAtmosphere::InitModel ( void )
overridevirtual

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 152 of file FGStandardAtmosphere.cpp.

◆ PrintStandardAtmosphereTable()

void JSBSim::FGStandardAtmosphere::PrintStandardAtmosphereTable ( )
virtual

Prints the U.S. Standard Atmosphere table.

Definition at line 398 of file FGStandardAtmosphere.cpp.

◆ ResetSLPressure()

void JSBSim::FGStandardAtmosphere::ResetSLPressure ( )
virtual

Resets the sea level to the Standard sea level pressure, and recalculates dependent parameters so that the pressure calculations are standard.

Definition at line 476 of file FGStandardAtmosphere.cpp.

◆ ResetSLTemperature()

void JSBSim::FGStandardAtmosphere::ResetSLTemperature ( )
virtual

This function resets the model to apply no bias or delta gradient to the temperature.

The delta gradient and bias values are reset to 0.0, and the standard temperature is used for the entire temperature profile at all altitudes.

Definition at line 464 of file FGStandardAtmosphere.cpp.

◆ SetDewPoint()

void JSBSim::FGStandardAtmosphere::SetDewPoint ( eTemperature unit,
double dewpoint )

Sets the dew point.

Parameters
dewpointThe dew point in the units specified
unitThe unit of measure that the specified dew point is supplied in.

Definition at line 585 of file FGStandardAtmosphere.cpp.

◆ SetPressureSL()

void JSBSim::FGStandardAtmosphere::SetPressureSL ( ePressure unit,
double pressure )
overridevirtual

Sets the sea level pressure for modeling an off-standard pressure profile.

This could be useful in the case where the pressure at an airfield is known or set for a particular simulation run.

Parameters
pressureThe pressure in the units specified.
unitthe unit of measure that the specified pressure is supplied in.

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 225 of file FGStandardAtmosphere.cpp.

◆ SetRelativeHumidity()

void JSBSim::FGStandardAtmosphere::SetRelativeHumidity ( double RH)

Sets the relative humidity.

Parameters
RHThe relative humidity in percent.

Definition at line 645 of file FGStandardAtmosphere.cpp.

◆ SetSLTemperatureGradedDelta()

void JSBSim::FGStandardAtmosphere::SetSLTemperatureGradedDelta ( eTemperature unit,
double t )
virtual

Sets a Sea Level temperature delta that is ramped out by 86 km.

The value of the delta is used to calculate a delta gradient that is applied to the temperature at all altitudes below 86 km (282152 ft). For instance, if a temperature of 20 degrees F is supplied, the delta gradient would be 20/282152 - or, about 7.09E-5 degrees/ft. At sea level, the full 20 degrees would be added to the standard temperature, but that 20 degree delta would be reduced by 7.09E-5 degrees for every foot of altitude above sea level, so that by 86 km, there would be no further delta added to the standard temperature. The graded delta can be used along with the a bias to tailor the temperature profile as desired.

Parameters
tthe sea level temperature delta value in the unit provided.
unitthe unit of the temperature.

Definition at line 371 of file FGStandardAtmosphere.cpp.

◆ SetTemperature()

void JSBSim::FGStandardAtmosphere::SetTemperature ( double t,
double h,
eTemperature unit = eFahrenheit )
overridevirtual

Sets the temperature at the supplied altitude, if it is to be different than the standard temperature.

This function will calculate a bias - a difference - from the standard atmosphere temperature at the supplied altitude and will apply that calculated bias to the entire temperature profile. If a graded delta is present, that will be included in the calculation - that is, regardless of any graded delta present, a temperature bias will be determined so that the temperature requested in this function call will be reached.

Parameters
tThe temperature value in the unit provided.
hThe altitude in feet above sea level.
unitThe unit of the temperature.

Implements JSBSim::FGAtmosphere.

Definition at line 327 of file FGStandardAtmosphere.cpp.

◆ SetTemperatureBias()

void JSBSim::FGStandardAtmosphere::SetTemperatureBias ( eTemperature unit,
double t )
virtual

Sets the temperature bias to be added to the standard temperature at all altitudes.

This function sets the bias - the difference - from the standard atmosphere temperature. This bias applies to the entire temperature profile. Another way to set the temperature bias is to use the SetSLTemperature function, which replaces the value calculated by this function with a calculated bias.

Parameters
tthe temperature value in the unit provided.
unitthe unit of the temperature.

Definition at line 345 of file FGStandardAtmosphere.cpp.

◆ SetTemperatureGradedDelta()

void JSBSim::FGStandardAtmosphere::SetTemperatureGradedDelta ( double t,
double h,
eTemperature unit = eFahrenheit )
virtual

Sets the temperature delta value at the supplied altitude/elevation above sea level, to be added to the standard temperature and ramped out by 86 km.

This function computes the sea level delta from the standard atmosphere temperature at sea level.

Parameters
tthe temperature skew value in the unit provided.
unitthe unit of the temperature.

Definition at line 383 of file FGStandardAtmosphere.cpp.

◆ SetTemperatureSL()

void JSBSim::FGStandardAtmosphere::SetTemperatureSL ( double t,
eTemperature unit = eFahrenheit )
overridevirtual

Sets the Sea Level temperature, if it is to be different than the standard.

This function will calculate a bias - a difference - from the standard atmosphere temperature and will apply that bias to the entire temperature profile. This is one way to set the temperature bias. Using the SetTemperatureBias function will replace the value calculated by this function.

Parameters
tthe temperature value in the unit provided.
unitthe unit of the temperature.

Reimplemented from JSBSim::FGAtmosphere.

Definition at line 363 of file FGStandardAtmosphere.cpp.

◆ SetVaporMassFractionPPM()

void JSBSim::FGStandardAtmosphere::SetVaporMassFractionPPM ( double frac)

Sets the vapor mass per million of dry air mass units.

Parameters
fracThe fraction of water in ppm of dry air.

Definition at line 662 of file FGStandardAtmosphere.cpp.

◆ SetVaporPressure()

void JSBSim::FGStandardAtmosphere::SetVaporPressure ( ePressure unit,
double Pv )

Sets the partial pressure of water vapor.

Parameters
PvThe vapor pressure in the units specified
unitThe unit of measure that the specified vapor pressure is supplied in.

Definition at line 612 of file FGStandardAtmosphere.cpp.

◆ ValidateVaporMassFraction()

void JSBSim::FGStandardAtmosphere::ValidateVaporMassFraction ( double geometricAlt)
protected

Validate the value of the vapor mass fraction.

Definition at line 565 of file FGStandardAtmosphere.cpp.

Member Data Documentation

◆ a

double JSBSim::FGStandardAtmosphere::a = 611.2/psftopa
staticconstexprprotected

Sonntag constants based on ref [2].

They are valid for temperatures between -45 degC (-49 degF) and 60 degC (140 degF) with a precision of +/-0.35 degC (+/-0.63 degF)

Definition at line 365 of file FGStandardAtmosphere.h.

◆ b

double JSBSim::FGStandardAtmosphere::b = 17.62
staticconstexprprotected

Definition at line 366 of file FGStandardAtmosphere.h.

◆ c

double JSBSim::FGStandardAtmosphere::c = 243.12
staticconstexprprotected

Definition at line 367 of file FGStandardAtmosphere.h.

◆ EarthRadius

double JSBSim::FGStandardAtmosphere::EarthRadius = 6356766.0 / fttom
staticconstexprprotected

Earth radius in ft as defined for ISA 1976.

Definition at line 361 of file FGStandardAtmosphere.h.

◆ GradientFadeoutAltitude

double JSBSim::FGStandardAtmosphere::GradientFadeoutAltitude
protected

Definition at line 290 of file FGStandardAtmosphere.h.

◆ LapseRates

std::vector<double> JSBSim::FGStandardAtmosphere::LapseRates
protected

Definition at line 296 of file FGStandardAtmosphere.h.

◆ MaxVaporMassFraction

FGTable JSBSim::FGStandardAtmosphere::MaxVaporMassFraction
protected

Definition at line 295 of file FGStandardAtmosphere.h.

◆ Mwater

double JSBSim::FGStandardAtmosphere::Mwater = 18.016 * kgtoslug / 1000.0
staticconstexprprotected

Mean molecular weight for water - slug/mol.

Definition at line 369 of file FGStandardAtmosphere.h.

◆ PressureBreakpoints

std::vector<double> JSBSim::FGStandardAtmosphere::PressureBreakpoints
protected

Definition at line 297 of file FGStandardAtmosphere.h.

◆ Rdry

double JSBSim::FGStandardAtmosphere::Rdry = Rstar / Mair
staticconstexprprotected

Definition at line 370 of file FGStandardAtmosphere.h.

◆ Rwater

double JSBSim::FGStandardAtmosphere::Rwater = Rstar / Mwater
staticconstexprprotected

Definition at line 371 of file FGStandardAtmosphere.h.

◆ SaturatedVaporPressure

double JSBSim::FGStandardAtmosphere::SaturatedVaporPressure
protected

Definition at line 292 of file FGStandardAtmosphere.h.

◆ StdAtmosTemperatureTable

FGTable JSBSim::FGStandardAtmosphere::StdAtmosTemperatureTable
protected

Definition at line 294 of file FGStandardAtmosphere.h.

◆ StdDensityBreakpoints

std::vector<double> JSBSim::FGStandardAtmosphere::StdDensityBreakpoints
protected

Definition at line 299 of file FGStandardAtmosphere.h.

◆ StdLapseRates

std::vector<double> JSBSim::FGStandardAtmosphere::StdLapseRates
protected

Definition at line 300 of file FGStandardAtmosphere.h.

◆ StdPressureBreakpoints

std::vector<double> JSBSim::FGStandardAtmosphere::StdPressureBreakpoints
protected

Definition at line 298 of file FGStandardAtmosphere.h.

◆ StdSLdensity

double JSBSim::FGStandardAtmosphere::StdSLdensity
protected

Definition at line 286 of file FGStandardAtmosphere.h.

◆ StdSLpressure

double JSBSim::FGStandardAtmosphere::StdSLpressure
protected

Definition at line 286 of file FGStandardAtmosphere.h.

◆ StdSLsoundspeed

double JSBSim::FGStandardAtmosphere::StdSLsoundspeed
protected

Definition at line 286 of file FGStandardAtmosphere.h.

◆ StdSLtemperature

double JSBSim::FGStandardAtmosphere::StdSLtemperature
protected

Standard sea level conditions.

Definition at line 286 of file FGStandardAtmosphere.h.

◆ TemperatureBias

double JSBSim::FGStandardAtmosphere::TemperatureBias
protected

Definition at line 288 of file FGStandardAtmosphere.h.

◆ TemperatureDeltaGradient

double JSBSim::FGStandardAtmosphere::TemperatureDeltaGradient
protected

Definition at line 289 of file FGStandardAtmosphere.h.

◆ VaporMassFraction

double JSBSim::FGStandardAtmosphere::VaporMassFraction
protected

Definition at line 291 of file FGStandardAtmosphere.h.


The documentation for this class was generated from the following files: