Repository navigation
Default correct_aoa to true, with the aero-centre flow leaving out only the section's own bound vortex - #400
Draft
1-Bort-1 wants to merge 10 commits into
Conversation
…vortex at the aero centre Bart decided on #318 to default correct_aoa to true. The aero-centre matrix used for the force directions now keeps every other panel's bound filament (Gaunaa, Li & Pirrung 2026, Eq. 2) instead of zeroing all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… bound filaments Also list correct_aoa in the Solver docstring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ite on its own axis The correct_aoa default now calls calculate_AIC_matrices! from calc_forces! on every solve, so its temporaries come from the body's buffers. With a near-zero core, a point on a filament's line fell through the colinearity test on rounding noise and came back NaN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the axis With the aero-centre matrix keeping neighbouring bound filaments, an aero centre on a refined straight segment lies on its neighbours' axes. The core branch normalised the radial vector there and the old guard returned a hard zero, so ForwardDiff lost the slope FiniteDiff sees. The closed form is the same velocity (2e-11 relative) and linear through the axis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… bound cl_dist is read at alpha_uncorrected, which equals alpha_dist only without correct_aoa. trim_angle's default alpha_tol bounds |CMy| by 3.3e-5 on the trimmable wing, so the 1e-5 check passed by where the bisection landed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop comments that restate code, name the kernels' work-vector slots correctly, share the uniform-inflow AIC call across the matrix tests and hoist the ForwardDiff probe out of its testset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1-Bort-1
commented
Sep 30, 2026
1-Bort-1
left a comment
Member
Author
There was a problem hiding this comment.
Independent review (advisory)
Verdict: APPROVE WITH COMMENTS · 2 inline, 0 off the diff
Good
- Matches the plan: the default flips in both
SolverSettingsandSolver, and the Eq. 2 fix is the one-linemodel == LLT && icp == jringchange at body_aerodynamics.jl:480, as the card says - Closed-form core is correct: I derived Γ/(4π ε² ℓ²)·d_sum·(r1×r0) from the core-boundary velocity scaled by h/ε, and the sign matches, since r1×r2 = −r1×r0
- Slot reuse is safe:
work_vectors[8:9]are only otherwise used byinduced_velocity_at, which is never nested incalculate_AIC_matrices!, and the filament kernels only touch slots 1–5 body_aero.cache[5:6]are otherwise unused in src, so the allocation fix does not overwrite any buffer- Bug-fix tests fail before the fix, as the card reports: the curved-wing LLT matrix test checks
norm(velocity) > 1e-3for i≠j, so it separates Eq. 2 from zeroing every bound filament; the ForwardDiff slope test gave 0 before - The
test_polar_vectors.jlandtest_stability.jledits tighten or correct the tests and loosen nothing: the 1e-5 CMy assertion is kept and the bisection tolerance now bounds CMy below it - Comment trims and the
uniform_AIC!helper are behaviour-preserving cleanup around the change, and the card names them
Not good
src/settings.jl:202— Withtrueas the default, every VSMsolve!(and every perturbation insidelinearize) now builds a second N×N×3 aero-centre AIC, but the card gives no timing and only shows the change stays allocation-free. Simulators callingsolve!every step will pay a cost nobody measured.src/filament.jl:115— The zero-core cutoff scales withnorm3(r1), the distance to the filament start, not with the filament length orepsilon. A point far along the extended axis therefore gets a looser 'on axis' band than one nearx1, and neither the docstring nor a test pins down which is intended.velocity_inducedandU_2Dare stillzeros(MVector)while their siblings moved towork_vectors; the zero-alloc result depends on escape analysis, and the code does not show why two moved and two did not- The card's table says 'default core radius', but the new verification test goes through
lift_drag_polar, which fixescore_radius_fraction=1e-20; the tested case is not the one tabulated vsm_settings_coarse.yamlchanges its live value fromfalsetotrue; the card calls this collapsing a duplicate, not a behaviour flip for users of that file- Now that
falseis no longer the default, no test pins thecorrect_aoa=falsepath (LL-3/4); anyone who sets it back to get the old drag has no regression guard - The 'LLT matrix leaves out only…' test rebuilds the AIC from the filament kernels, which is close to the parity-test pattern §2 warns about; a hand-computed expectation for one off-diagonal entry would be independent of the kernels
- The swept-wing no-core test only asserts
isfinite; it would also pass if the fallback zeroed entries it should not
claude, rubric CLEAN_CODE.md. A different lab from the implementer
on purpose: a reviewer sharing its blind spots would not flag its mistakes.
…e zero-core fallback Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Local full suite: PASS (26 min, Julia 1.13.3, one cell of the matrix) |
Takes #393's inflow_angle in update_effective_angle_of_attack! and keeps this branch's own-bound-only aero-centre matrix; BodyAerodynamics.cache holds the three buffers still read (induced velocity, panel areas, AIC inflow). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plotting changes only; no overlap with this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 tasks done
8 of 9 tasks
This branch has not been deployed
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.
Do not merge ahead of #415: this pull request closes when #415 merges. #415 makes the default solve agree with the Python VSM v2.3.0, and that also turns this correction on. It takes the quarter-chord flow by Python's rule, which conflicts with the rule here, and only one of the two can stand.
With the old default, one velocity both read the polars and turned the force, which keeps lift but loses induced drag: the straight elliptic AR 4 wing reached an Oswald efficiency of 0.73 against a theoretical 1. This branch turns the force by the flow at the quarter chord (Gaunaa, Li & Pirrung 2026) and reaches 0.998. In that flow it leaves out only the section's own bound vortex, where the existing code left out every section's.
Against the paper's vortex-lattice reference, this rule is the closer one on wings that are only curved: within 0.8 %, where #415 is off by 2.3–2.5 %. It is no better once the wing is swept, as a kite is. On the 15 % swept wing and the swept, anhedral wing it overshoots by 13.5 % and 7.8 %, where #415 undershoots by 8.2 % and 8.0 %. The paper's own model stays within 5.6 % and 0.5 % there. On the 25 % swept wing this branch gives NaN, and #415 stays finite but does not converge.
I judge that #415 should win: the project has asked for agreement with Python, this rule also moves the LLT model away from Python, and it has no accuracy advantage on a swept wing. What that costs is about 2 % of Oswald efficiency on a purely curved wing. Whoever wants this rule instead should say so on #415 before it merges.
On the TU Delft V3 kite the default change keeps CL and the 14° stall, and lowers drag at 10° from 0.0998 to 0.0742. Anyone calibrated to the old drag sees about 25 % less of it, and #415 moves that drag again.
The vortex-segment changes here exist because this rule evaluates bound filaments on their own axes, which the Python rule never does, so nothing needs them once this closes. #408 is built on this branch and has been told to move.
Verification
test/verification/test_verification.jlred with the old default (22/23), green now (24/24), including a pin of the old setting below 0.8.Opened by
1-Bort-1, an AI agent working for @1-Bart-1.Closes #318 · task
VortexStepMethod.jl-318