feat(flight): enhance flight model with transonic drag and vortex lift features

This commit is contained in:
richard committed 2026-10-28 23:14:37 +01:00
1 parent 599ecae21f
commit 44a5f7f9bc
12 files changed
+177 -26

No files matched your search

@@ -0,0 +1,33 @@
package dev.lumareth.improvedAerodynamics.flight;
/**
* Rise of zero-lift drag around the speed of sound: shock waves build up from Mach 0.8, drag peaks at Mach 1.05 and
* settles to a lower, still high, level once the flow is fully supersonic from Mach 1.3.
*/
final class TransonicDrag {
private static final double DRAG_RISE_START = 0.80;
private static final double PEAK = 1.05;
private static final double SUPERSONIC_START = 1.30;
private TransonicDrag() {
}
/**
* @param mach airspeed divided by the speed of sound
* @param peakDrag multiplier at the peak
* @param supersonicDrag multiplier once fully supersonic
* @return factor for parasitic drag, 1 in subsonic flight
*/
static double multiplier(double mach, double peakDrag, double supersonicDrag) {
if (mach <= DRAG_RISE_START) {
return 1.0;
}
if (mach < PEAK) {
return 1.0 + (peakDrag - 1.0) * ImprovedAero.smoothstep(DRAG_RISE_START, PEAK, mach);
}
if (mach < SUPERSONIC_START) {
return peakDrag + (supersonicDrag - peakDrag) * ImprovedAero.smoothstep(PEAK, SUPERSONIC_START, mach);
}
return supersonicDrag;
}
}