DBooots / KerbalWindTunnel

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

Override AoA in Flight Envelope #16

Open Arrowstar opened 2 years ago

Arrowstar commented 2 years ago

I have a desire to produce altitude/speed/drag coefficient envelopes at angles of attack other than the "level flight AoA" that seems to be in use in the Flight Envelope tab. Would it be possible to provide a UI widget on the Flight Envelopes tab that allows the user to override that AoA selection?

The use case here is for modeling the drag on a launch vehicle that is ascending through Kerbin's atmosphere. I want to be able to provide 2D (altitude/speed) and ultimately 3D (altitude/speed/AoA) look up tables to my drag model for computing drag force. Being able to specify AoA is critical to this.

Please let me know if I can provide any additional information. Thank you!

DBooots commented 2 years ago

This feature is already on my to-do list. The lookup table actually needs to be three 2D tables (Lift, Wing drag, Body drag) parametrized by mach number and AoA (for Stock aero, at least. FAR support is looking increasingly unlikely for this mod). Bicubic interpolation will almost exactly match stock behavior.

On one hand, I can use this discovery to 'cheat' on the graph generation and on the other I can add an 'Export Aerodynamic Parameters' button that will create these three tables. Lift and Wing Drag will simply get multiplied by dynamic pressure, but Body Drag will also need to be multiplied by the DRAG_PSEUDOREYNOLDS value corresponding to the current density * velocity (see the Physics.cfg file for details) as well as dynamic pressure.

Expect to see this feature around version 1.4.

Arrowstar commented 2 years ago

That's great to hear!

Assuming you're going to just have one file for drag, please let the user pick the minimums, maximums, and step size for each quantity, which I haven't been able to figure out how to do on the chart as-is.

I know you mentioned having "wing drag" and "body drag", but it would certainly be nice to only have one drag coefficient file to worry about, or if there's more than one, at least it being the same "kind" of drag. From my perspective, I just need a look up table to interpolate to find Cd*A so I can plug it into the drag equation. Anything you can do to keep that task easy from the perspective of someone trying to use the data your code generates would be much appreciated!