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]; } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%