Repository navigation
Map a refined panel midway between two sections to the outboard one - #407
Conversation
compute_refined_panel_mapping! kept the first section on a tie, so a mirror-symmetric three-section wing put both midway panels on the same side. Distances within 1e-9 relative now tie, and the tie goes to the section farther from the middle of the span along spanwise_direction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anel mapping allocates nothing refine! on the 20-panel LINEAR wing of test/bench.jl was back at 133 allocations (limit 70): the generator sum and extrema in the span-position tie-break allocated 64 per mapping. Now 0 per mapping and 69 per refine!. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Wouldn't it be better to do a weighted mapping with two weights to the two nearest ones? Or does that break upstream? |
|
Yes, it would be better physically, but not in this PR, because it breaks what reads the mapping.
Two weights per panel means a new pair of fields, like the A weighted split also has no ties: a panel midway gives 50/50 and stays symmetric with no rule needed. So I'd merge #407 as the fix for #397 and do the weighted mapping as its own VSM issue, with the SAM side following. Shall I open it? |
TL;DR
compute_refined_panel_mapping!gave an exact tie to the first section, so a mirror-symmetric three-section wing mapped its two midway panels to the same side and yawed with no deformation. A tie now goes to the section farther from the middle of the span, so mirror panels map to mirror sections.What was wrong
Each refined panel maps to the unrefined section whose centre is nearest, with a strict
<. Three sections at y = 1, 0, −1 and ten LINEAR panels put panel 3 (centre y = 0.5) and panel 8 (y = −0.5) exactly midway between two sections. Both ties went to the lower index, giving[1, 1, 1, 2, 2, 2, 2, 2, 3, 3]: panel 3 to the left tip, panel 8 to the centre.It surfaced in OpenSourceAWE/SymbolicAWEModels.jl#397. There the 2-plate particle kite, perfectly mirror-symmetric, gets its point forces from this mapping. With the lopsided map its flat case yaws with Mz = 2.15 N·m where 0 is right, and
test_aero_modes' yaw antisymmetry and pose-sweep checks fail. On SymbolicAWEModelsmainthe same kite passes only because its last-digit rounding happened to break both ties outward. #397 changes those digits, and the mapping flips.The change
Sections within
1e-9of the nearest distance, relative, count as tied. A tie goes to the section whose centre is farther from the middle of the span, measured alongspanwise_direction. Without a tie nothing changes. The three existing mapping testsets, which rebuild the nearest section by hand, pass unchanged. The span positions are summed by hand rather than through generators, so the mapping allocates nothing.Verification
test/wing_geometry/test_wing_geometry.jl"a panel midway between two sections maps outboard": red on v6.0.0 (Int16[1, 1, 1, 2, 2, 2, 2, 2, 3, 3]), green after (302 + 1 passed). Run in SymbolicAWEModels' juliaserver session with this branch developed in.test_aero_modes.jlwith this mapping: direct particle yaw Mz(±d) = ∓0.581, flat 5.8e-9, the same as SymbolicAWEModels main.test/bench.jl"Refinement Allocation Tests": the first push (1d6fb24) took LINEARrefine!to 133 allocations against a limit of 70, red in this PR's CI. That was 64 allocations inside the mapping, from a generatorsumandextrema. With scalar arithmetic the mapping makes 0 andrefine!makes 69 / 69 / 92 / 4 / 132 (LINEAR, COSINE, SPLIT_PROVIDED, UNCHANGED, BILLOWING; limits 70 / 70 / 100 / 5 / 140).bench.jlplustest_wing_geometry.jl: 324 of 324 pass, in this repo'stestenvironment.test/solver/test_unrefined_dist.jl(40) andtest/test_refinement_validation.jl(15): 55 of 55 pass, same environment.Scope
+58 / −8 in
src/wing_geometry.jl, its test,private_functions.mdand the changelog. SymbolicAWEModels#397 needs it released before its CI can pass.Opened by
1-Bort-1, an AI agent working for @1-Bart-1.From OpenSourceAWE/SymbolicAWEModels.jl#376 · task
SymbolicAWEModels.jl-376