From 31ca7206955a20fa512cb5c4a1e37b32cf1c60e7 Mon Sep 17 00:00:00 2001 From: Sean McLeod Date: Thu, 27 Apr 2023 19:35:27 +0200 Subject: [PATCH] Correct VEAS to use standard day SL density --- src/FGFDMExec.cpp | 1 - src/models/FGAtmosphere.h | 3 +++ src/models/FGAuxiliary.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FGFDMExec.cpp b/src/FGFDMExec.cpp index d5b39c8de1..1b1616d238 100644 --- a/src/FGFDMExec.cpp +++ b/src/FGFDMExec.cpp @@ -464,7 +464,6 @@ void FGFDMExec::LoadInputs(unsigned int idx) case eAuxiliary: Auxiliary->in.Pressure = Atmosphere->GetPressure(); Auxiliary->in.Density = Atmosphere->GetDensity(); - Auxiliary->in.DensitySL = Atmosphere->GetDensitySL(); Auxiliary->in.PressureSL = Atmosphere->GetPressureSL(); Auxiliary->in.Temperature = Atmosphere->GetTemperature(); Auxiliary->in.SoundSpeed = Atmosphere->GetSoundSpeed(); diff --git a/src/models/FGAtmosphere.h b/src/models/FGAtmosphere.h index 95d54e486b..06f297e4d9 100644 --- a/src/models/FGAtmosphere.h +++ b/src/models/FGAtmosphere.h @@ -293,6 +293,9 @@ class JSBSIM_API FGAtmosphere : public FGModel { virtual void bind(void); void Debug(int from) override; + +public: + static constexpr double StdDaySLdensity = StdDaySLpressure / (Reng0 * StdDaySLtemperature); }; } // namespace JSBSim diff --git a/src/models/FGAuxiliary.cpp b/src/models/FGAuxiliary.cpp index c28346f963..bc854aaa92 100644 --- a/src/models/FGAuxiliary.cpp +++ b/src/models/FGAuxiliary.cpp @@ -198,7 +198,7 @@ bool FGAuxiliary::Run(bool Holding) if (abs(Mach) > 0.0) { vcas = VcalibratedFromMach(Mach, in.Pressure); - veas = sqrt(2 * qbar / in.DensitySL); + veas = sqrt(2 * qbar / FGAtmosphere::StdDaySLdensity); } else vcas = veas = 0.0;