DBooots / KerbalWindTunnel

A mod for Kerbal Space Program to provide atmospheric performance data for spaceplanes and aircraft.
Other
11 stars 3 forks source link

New(1.3.0) windtunnel calculate to wrong results (for all, especially magic craft) #12

Closed Kerbinator-Fras closed 2 years ago

Kerbinator-Fras commented 2 years ago

AoA curves gives completely wrong results. For example, for heat-shield wing magic crafts, As reference, in magic wing flight test, it gives out a L/D of ~140-180 in flight An important use of stock windtunnel was to detect magic, though.

Kerbinator-Fras commented 2 years ago

3MG@}W66(GTD8IK0 `%XGV old (1.2.x mod version) windtunnel: correct

Kerbinator-Fras commented 2 years ago

OAKPL5PP%)1TYI`UEL9E0 K new (1.3.0 mod version) windtunnel: wrong

DBooots commented 2 years ago

Curious. None of the changes for 1.3.0 should have affected how lifting surfaces (such as heat shields) are modeled. Can you provide me with a (stock) craft file?

Kerbinator-Fras commented 2 years ago

000_TestCraft.zip Technical notes:

  1. (info) occluded heat shield have astonishing L/D (up to 900, see Stratzenblitz75's video)
  2. (this craft) to use (as I haven't develop propeller system, this craft is a bit incomplete), you need to use stock debug toolbar "hack gravity" to hack gravity to 0.05g, then use hyperedit to set orbit to 10000m, point to prograde and make sure you have horizon flat and brown side up on navball. Then turn on infinite electricity, ignite ion engine and turn off hack gravity to fly.
  3. (this craft) root part is fairing (root fairing has magic, for drag, only the base is taken into account iirc); l/d maximum should be ~150 (at least within 100-200) during flight
FastAndFishious commented 2 years ago

Two noteworthy things about fairings: windtunnel does NOT consider the magic rootpart fairing bug (I guess that’s also a windtunnel bug), and KSP miscalculates fairing drag coefficients in the VAB/SPH after reloading the craft (even switching editor triggers it), which DOES affect windtunnel, but the values update to their correct values after changing the faring’s number of sides as long as the fairing isn’t “expanded” by your mouse cursor. It’s probably something people using this mod should know. It’s dumb I know.

Also Kerbinator, you are completely correct on the magic faring glitch. When it’s the root part, occlusion still occurs, but only the base is considered for the fairing’s drag. This means drag will be much higher if the faces, especially the front one, aren’t fully covered, but lower if they are. I should note that covering the fairing’s inner face is always a good idea, because it still reduces drag when it’s not the root part (yay KSP logic).

Since we’re here, might as well add that windtunnel is somewhat off when it calculates part occlusion, with the worst offender being the 1.25m reaction wheel inside the 1.25m service bay, which is probably shielded in-game but not for windtunnel. I say probably, because my tests, consisting of turning the 1.25m probe core at various angles and seeing if it was shielded, were infuriatingly inconsistent, with the exact same craft behaving differently from time to time. Therefore, I’m not even sure if the reaction wheel case is consistent, so sorry if this information isn’t vey useful.

DBooots commented 2 years ago

Wind Tunnel leaves all occlusion calculation to the stock Drag Cubes system. That system may not be fully active in the Editor, which could result in service bays or fairings not occluding properly. Since the internals of the Drag Cubes system - occlusion in particular - aren't exposed, I'm not sure what I can do there. Things with procedural drag cubes might have a method I can call to force them to update. @FastAndFishious can you raise a separate issue describing that glitch?

@Kerbinator-CN can you confirm if version 1.3.1 resolved your original issue with wrong results?

FastAndFishious commented 2 years ago

Sure, I'll try to do that tomorrow. Also, thank you so much for taking the time to improve this mod, it's invaluable in the quest of pushing the game to its limits. Hopefully it will get the recognition it deserves!