From 8e05816b43e257d7bb429bcedcb5a5dd707d7473 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Sat, 6 Oct 2018 19:24:06 +0200 Subject: [PATCH] Bug fixes for JSBSim atmosphere model at very high altitudes * Disables dew point transmission as the humidity model is not handling the case where the vapor saturation pressure gets higher than the ambient pressure. * Removed computations for temperatures at very high altitudes as they don't match with the rest of JSBSim atmosphere model. --- src/FDM/JSBSim/JSBSim.cxx | 4 +-- .../atmosphere/FGStandardAtmosphere.cpp | 32 +++---------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index 106adb63f..004647c81 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -697,8 +697,8 @@ bool FGJSBsim::copy_to_JSBsim() Atmosphere->SetTemperature(temperature->getDoubleValue(), get_Altitude(), FGAtmosphere::eCelsius); Atmosphere->SetPressureSL(FGAtmosphere::eInchesHg, pressureSL->getDoubleValue()); - static_cast(Atmosphere)->SetDewPoint(FGAtmosphere::eCelsius, - dew_point->getDoubleValue()); + // static_cast(Atmosphere)->SetDewPoint(FGAtmosphere::eCelsius, + // dew_point->getDoubleValue()); Winds->SetTurbType((FGWinds::tType)TURBULENCE_TYPE_NAMES[turbulence_model->getStringValue()]); switch( Winds->GetTurbType() ) { diff --git a/src/FDM/JSBSim/models/atmosphere/FGStandardAtmosphere.cpp b/src/FDM/JSBSim/models/atmosphere/FGStandardAtmosphere.cpp index 3e455c7a6..688471215 100644 --- a/src/FDM/JSBSim/models/atmosphere/FGStandardAtmosphere.cpp +++ b/src/FDM/JSBSim/models/atmosphere/FGStandardAtmosphere.cpp @@ -254,36 +254,12 @@ double FGStandardAtmosphere::GetTemperature(double altitude) const double FGStandardAtmosphere::GetStdTemperature(double altitude) const { - double Lk9 = 0.00658368; // deg R per foot - double Tinf = 1800.0; // Same as 1000 Kelvin - double temp = Tinf; + double GeoPotAlt = GeopotentialAltitude(altitude); - if (altitude < 298556.4) { // 91 km - station 8 + if (GeoPotAlt >= 0.0) + return StdAtmosTemperatureTable.GetValue(GeoPotAlt); - double GeoPotAlt = GeopotentialAltitude(altitude); - - if (GeoPotAlt >= 0.0) - temp = StdAtmosTemperatureTable.GetValue(GeoPotAlt); - else - temp = StdAtmosTemperatureTable.GetValue(0.0) + GeoPotAlt*LapseRates[0]; - - } else if (altitude < 360892.4) { // 110 km - station 9 - - temp = 473.7429 - 137.38176 * sqrt(1.0 - pow((altitude - 298556.4)/65429.462, 2.0)); - - } else if (altitude < 393700.8) { // 120 km - station 10 - - temp = 432 + Lk9 * (altitude - 360892.4); - - } else if (altitude < 3280839.9) { // 1000 km station 12 - - double lambda = 0.00001870364; - double eps = (altitude - 393700.8) * (20855531.5 + 393700.8) / (20855531.5 + altitude); - temp = Tinf - (Tinf - 648.0) * exp(-lambda*eps); - - } - - return temp; + return StdAtmosTemperatureTable.GetValue(0.0) + GeoPotAlt*LapseRates[0]; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%