ferram4 / Ferram-Aerospace-Research

Aerodynamics model for Kerbal Space Program
Other
239 stars 131 forks source link

Atmospheric density for EAS/IAS #121

Closed Crzyrndm closed 8 years ago

Crzyrndm commented 8 years ago

FAR's "GetCurrentDensity" method used for the IAS/EAS speed transforms returns a constant value per body. https://github.com/ferram4/Ferram-Aerospace-Research/blob/master/FerramAerospaceResearch/FARGUI/FARFlightGUI/AirspeedSettingsGUI.cs#L163

With the thermal system in play, atmospheric density now depends on location as well as altitude (which this method doesn't account for), yes?

ferram4 commented 8 years ago

Should be taken care of in the latest dev build.

Crzyrndm commented 8 years ago

Doesn't appear to be working as expected. With a Surface velocity of 300m/s and altitude of 1000m at the KSC (density from FAR GUI = 0.995) IAS => 12.2m/s EAS => 7.5m/s

An install of 1.15.4 in the same conditions gives results of: IAS => 456.0m/s EAS => 282.3m/s

And the values if getCurrentDensity is replaced by vessel.atmDensity IAS => 436.9m/s EAS => 270.5m/s

ferram4 commented 8 years ago

There, should be fixed. Forgot a factor of 1000 in the calculation.

Crzyrndm commented 8 years ago

The result remains significantly different than previous implementations. Launching just the Aeris 3A up to 1000m at the KSC, the part averaged density is 0.7744, density calculated from vessel dynamic pressure (replacing part average) or vessel.atmDensity both give 0.9969

EDIT A bit of extra logging shows some parts have a zeroed dynamicPressureKpa property (I'm assuming the landing gear since there was 3)

ferram4 commented 8 years ago

Alright, I think it's due to parts with physics disabled, so I removed them from the calculation. That should finally fix everything.

Crzyrndm commented 8 years ago

One final (hopefully) issue, it's still averaging by the number of parts on the vessel, not the number of valid parts

ferram4 commented 8 years ago

... I am clearly not a smart man. Should be fixed.

Crzyrndm commented 8 years ago

Verifying that it appears to behave as expected