Repository navigation
Test solve! on a body built from two wings - #339
Merged
Merged
Conversation
Two copies of a rectangular wing far apart must each reproduce the isolated wing (circulation, unrefined distribution, force, coefficients); one chord apart they must induce on each other. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1-Bort-1
commented
Sep 16, 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 card's scope: one test file, +56/-0, no
src/changes; the diff is exactly the two helpers and the one testset the card describes - The far-apart case compares against the same wing solved alone, with
rtol=1e-6, so a bookkeeping break shows up as a clear mismatch; the card's mutant runs show it fails forunrefined_idxandprojected_area - The one-chord case checks mirror symmetry and more circulation at the facing tips; the zeroed cross-AIC mutant shows these fail when the wings stop inducing on each other
- Testset names say what behaviour they protect (
wings far apart each act as the isolated wing); only three small solves, so it adds no real CI time - Checked for conflicts:
rgfinds no otherrectangular_wingorsolve_wingsfunction intest/orexamples/, so the top-level helpers cannot clash in runtests' shared scope - No line in the new block is over 92 characters (checked by grep for 93+ character lines)
- The card explains why
flat_plate_wingintest/solver/test_solver.jlcan't be reused (stalling LEI polar, no y offset), and that holds up
Not good
test/body_aerodynamics/test_body_aerodynamics.jl:516— The same file already builds this flat 3-section INVISCID wing by hand three times (lines ~123, ~446, ~474–482, including the existing two-wingset_va!test), and the new helper doesn't replace any of them. That leaves two ways to build the same wing in one file, which the §7 compaction pass should have merged.test/body_aerodynamics/test_body_aerodynamics.jl:538— Every call passesn_panels=6, span=4.0, the same as the defaults, andchordandvaare never passed. That is flexibility no caller uses (§6/§7), and 6 and 4.0 now live in two places that can drift apart.- The single-wing baseline's
solver_statusis never checked; if the reference solve stopped converging, the far-apart comparisons would pass or fail against a bad baseline - The card says it broke the source 'three ways, one run per mutant' but lists two runs, and the first run combined two changes, so which assertion catches which change is inferred, not measured
- Five real defects found on the way (
wing_span/aspect_ratio_projectedusingwings[1], lift and side directions fromwings[1], ELLIPTIC/linearize/dual-shadow throwing for more than one wing, smoothing across the gap, asymmetriccl_unrefined_dist) are only PR notes;Closes #143will close the one open multi-wing thread, so they need their own issues or they get lost - The far-apart test compares against
single.cl_unrefined_dist, which the card itself says looks wrong on a symmetric wing, so the test locks in current output, not correct output - The
rectangular_wingdocstring gives no units fory_center,spanandchord([m]), which §4 asks for when the name doesn't carry them
claude, rubric CLEAN_CODE.md. A different lab from the implementer
on purpose: a reviewer sharing its blind spots would not flag its mistakes.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The file built the same three-section INVISCID wing by hand in three testsets beside rectangular_wing; inviscid_wing(section_y; n_panels) now builds all four. solve_wings drops its unused va keyword, and the single-wing baseline checks its own solver status. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Member
Author
|
Local full suite: PASS (9 min, Julia 1.12.7, one cell of the matrix) |
This was referenced Sep 18, 2026
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.
TL;DR
A new testset solves a
BodyAerodynamicsbuilt from two wings and checks the result against the same wing on its own. Until now the only multi-wing test checkedset_va!, so nothing would have caught a break in how the solver or the result bookkeeping steps from one wing's panels to the next.What the test checks
solve! on a two-wing bodyintest/body_aerodynamics/test_body_aerodynamics.jluses a 4 m × 1 m flatINVISCIDwing: 3 sections, 6 panels,va = [10, 0, 1]. The single-wing baseline must itself come outFEASIBLE.FEASIBLE, projected area ×2, circulation andcl_unrefined_distequal to the single wing's repeated twice, force ×2 and the same force coefficients, all tortol=1e-6. The largest relative circulation difference measured was 6.3e-9.Nothing in
src/changed. Bart confirmed on the issue that the feature works, and the test agrees.Does it catch a break?
There was no bug to reproduce, so I broke the source on purpose in two runs and reverted each afterwards. The first run carried two changes at once, so which assertion caught which of those two is inferred, not measured:
calc_forces!from advancingunrefined_idxbetween wings (src/solver.jl:520) and tookprojected_areafromwings[1]only (src/body_aerodynamics.jl:316). 3 failures: projected area,cl_unrefined_dist(wing 2 came out as zeros), force coefficients (0.787 vs 0.394).Found on the way, not changed here
These all change behaviour, so they are not in this PR. They are why the test uses equal
n_panels, the defaultZEROSinitial circulation, and no artificial damping or viscosity.results["wing_span"]andresults["aspect_ratio_projected"]usewings[1].spanover the projected area summed over all wings (src/body_aerodynamics.jl:997). For a multi-wing body both numbers are wrong.calc_forces!andcalculate_resultstake the lift and side directions fromwings[1].spanwise_directionfor every panel (src/solver.jl:393,src/body_aerodynamics.jl:860). Wings pointing different ways would get wrong directions.type_initial_gamma_distribution=ELLIPTIC,linearizeandmake_dual_shadowthrow for more than one wing.smooth_circulation!treat all panels as one span, so they smooth across the gap between wings.cl_unrefined_distis not symmetric on a symmetric single wing:[0.371, 0.435, 0.327]while the circulation is symmetric to 1e-15. This looks like how panels are mapped to unrefined sections, not a multi-wing issue. I did not dig further.Verification
test/body_aerodynamics/test_body_aerodynamics.jlafter the helper merge: 4870 pass, 0 fail, 0 error (juliaserver, Julia 1.12.7)agent ci-local, Julia 1.12.7, fail-fast): PASS in 8 min, exit 0 on 7f2d15f · GitHub CI: all 7 checks green on 7f2d15forigin/main· docs and changelog: n/a (test only) · no REUSE in this repoScope
+63 / -25 in one test file: the new testset, a
solve_wingshelper, andinviscid_wing(section_y; n_panels). That helper also replaces the same three-section wing the file built by hand inOrigin Translation, the distributed-inflowset_va!test and the multi-wingset_va!test. The multi-wingset_va!test now refines withLINEARinstead ofUNCHANGED. Its sections are evenly spaced, and its assertions compare each panel'svawith its own control point, so what it checks is unchanged. I searchedtest/andexamples/for an existing flat-wing helper.flat_plate_wingintest/solver/test_solver.jluses a stalling LEI polar,flat_wingintest_backend_comparison.jlis local to its testset and takes polar matrices, andbuild_flat_wingintest_billowing.jlhas its chord pointing to -x. None of them fits.Closes #143 · task
VortexStepMethod.jl-143