Repository navigation
PSG: FAR's automatic Cd and Aref at zero angle of attack - #2796
Merged
Merged
Conversation
PSG plans with one Cd and no lift, so the table takes the airflow along the nose instead of 2 degrees off it. The frontal area comes from the same drag cube read.
Contributor
✅ Build Artifact 🚀MechJeb2-7aba370.zip (built from e383881) |
Collaborator
|
I'm digesting that finding about stock drag cubes |
Collaborator
Stock is broken--you do need the AoA there because body lift is useless at ~2 degrees and drag dominates. Plus you've got the thick atmosphere and smaller rockets, and so drag losses are a much higher percentage of the budget. |
Collaborator
|
I think the answer is that PSG needs to fly zero-AoA through the atmosphere, which I'm already planning on doing, and that makes even more sense on stock-aero-physics where that should actually be entirely optimal. So that mean-angle-of-attack is what is affecting the optimality of the Kerbal X flight. That should get driven down as close to zero as possible. But until then, stock-aero probably needs the 2 degree hack. |
…first Stock's drag cubes give drag linear in |α| near zero angle of attack and body lift only in α|α|, so at the 2° an ascent flies the drag dominates and PSG, with no lift, needs it in the plan. FAR is read nose first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2795 (launch towers), which must be merged first: this branch is stacked on it.
Part of #2476 (audit epic, PSG)
With FAR, the automatic Cd and Aref read the vessel at zero angle of attack, as suggested in lamont-granquist's review of the estimate. Stock aerodynamics keeps the 2° (
FLOW_AOA), as lamont-granquist asked in this PR's review: until PSG flies a zero-AoA gravity turn through the atmosphere, stock needs it.Change, in
PSGAeroEstimateonly (+12 −10):Flow()renamedStockFlow(), its comment says why stock alone).Behaviour change: with FAR the planned drag area changes by under 1 %. Stock is unchanged from #2795.
Why stock keeps the 2°: near zero angle of attack, stock drag cubes give drag linear in |α| and body lift in α|α|. At the 2° an ascent flies, the drag dominates and PSG has no lift, so leaving it out made the plan 36 % short on Kerbal X (table below, from this branch's first version, which also read stock at zero). A later α model needs a smoothed |sin α| term there: a fit in α² through the cardinal directions misses nearly all of the rise at small angles.
Tested in game (Debug build, development player; stock on the 3.2x system), before stock was put back: all three flights reached orbit, with no MechJeb exception. The stock code is now the same as #2795's (reflown below); the FAR column is this PR's code.
The Falcon 9 was not reflown on #2795. Its flight on #2749's build, with the 2°, planned 3.397 m² and ended with 26.185 t.
Stock reflown on this PR's code (e383881, same setup): Kerbal X planned the same 3.189 m² as #2795 and flew the same, within the spread between runs. Drag area in flight 3.415 m² (plan −6.6 %), mean angle of attack 2.1°, max Q 47.0 kPa, drag losses 120 m/s, 373.6 LF left, orbit 144.4 × 145.0 km, no MechJeb exception. 0 ReSharper warnings on the changed lines.
Not tested: FAR on the final commit (its code path is the first version's, flown above), other craft, stock at 1x scale, and a craft with a launch tower on this branch.
Unit tests: 16,683 pass with CI's filter (Debug build, first version).