106 bool InitModel(
void)
override;
123 double GetTemperature(
double altitude)
const override;
131 virtual double GetStdTemperature(
double altitude)
const;
143 {
if (to == eCelsius || to == eKelvin)
return TemperatureBias/1.80;
else return TemperatureBias; }
148 {
if (to == eCelsius || to == eKelvin)
return TemperatureDeltaGradient/1.80;
else return TemperatureDeltaGradient; }
159 void SetTemperatureSL(
double t, eTemperature unit=eFahrenheit)
override;
172 void SetTemperature(
double t,
double h, eTemperature unit=eFahrenheit)
override;
183 virtual void SetTemperatureBias(eTemperature unit,
double t);
198 virtual void SetSLTemperatureGradedDelta(eTemperature unit,
double t);
207 virtual void SetTemperatureGradedDelta(
double t,
double h, eTemperature unit=eFahrenheit);
213 virtual void ResetSLTemperature();
220 double GetPressure(
double altitude)
const override;
223 virtual double GetStdPressure(
double altitude)
const;
231 void SetPressureSL(ePressure unit,
double pressure)
override;
235 virtual void ResetSLPressure();
242 virtual double GetStdDensity(
double altitude)
const;
252 void SetDewPoint(eTemperature unit,
double dewpoint);
255 double GetDewPoint(eTemperature to)
const;
260 void SetVaporPressure(ePressure unit,
double Pv);
264 double GetVaporPressure(ePressure to)
const;
268 double GetSaturatedVaporPressure(ePressure to)
const;
271 void SetRelativeHumidity(
double RH);
273 double GetRelativeHumidity(
void)
const;
276 void SetVaporMassFractionPPM(
double frac);
278 double GetVaporMassFractionPPM(
void)
const;
282 virtual void PrintStandardAtmosphereTable();
288 double TemperatureBias;
289 double TemperatureDeltaGradient;
290 double GradientFadeoutAltitude;
291 double VaporMassFraction;
292 double SaturatedVaporPressure;
294 FGTable StdAtmosTemperatureTable;
296 std::vector<double> LapseRates;
297 std::vector<double> PressureBreakpoints;
298 std::vector<double> StdPressureBreakpoints;
299 std::vector<double> StdDensityBreakpoints;
300 std::vector<double> StdLapseRates;
302 void Calculate(
double altitude)
override;
308 void CalculateLapseRates();
312 void CalculatePressureBreakpoints(
double SLpress);
316 void CalculateStdDensityBreakpoints();
319 double GeopotentialAltitude(
double geometalt)
const {
return (geometalt * EarthRadius) / (EarthRadius + geometalt); }
322 double GeometricAltitude(
double geopotalt)
const {
return (geopotalt * EarthRadius) / (EarthRadius - geopotalt); }
333 double CalculateDensityAltitude(
double density,
double geometricAlt)
override;
343 double CalculatePressureAltitude(
double pressure,
double geometricAlt)
override;
346 double CalculateVaporPressure(
double temperature);
349 void ValidateVaporMassFraction(
double geometricAlt);
355 void CalculateSLSoundSpeedAndDensity(
void);
357 void bind(
void)
override;
358 void Debug(
int from)
override;
361 static constexpr double EarthRadius = 6356766.0 / fttom;
365 static constexpr double a = 611.2/psftopa;
366 static constexpr double b = 17.62;
367 static constexpr double c = 243.12;
369 static constexpr double Mwater = 18.016 * kgtoslug / 1000.0;
370 static constexpr double Rdry = Rstar / Mair;
371 static constexpr double Rwater = Rstar / Mwater;