Skip to content

The :curved reference wing does not converge: LOOP returns NaN gamma at 5.7° and 10° #395

Open

Description

@1-Bort-1

The :curved reference wing (the one test/thesis_oriol_cayon.jl builds) does not converge: solve! with the VSM LOOP solver returns FAILURE, with NaN in lr.gamma_new, at α = 5.71° and at α = 10°, |va| = 20. Measured on main at 2b312ea (2026-09-16) while working on #317, with N = 40 panels. Its test checks geometry only and never solves, so the suite does not see it.

ba = ref_wing(:curved)   # the thesis_oriol_cayon.jl curved wing, N = 40
set_va!(ba, 20.0 .* [cosd(5.7106), 0.0, sind(5.7106)])
s = Solver(ba; aerodynamic_model_type=VSM)
sol = solve!(s, ba)
sol.solver_status, s.lr.converged, count(isnan, s.lr.gamma_new)   # FAILURE, false, > 0

What I would do: first find whether the NaN comes from the geometry (a panel frame or AIC entry) or from the iteration, then add a solve to the :curved test so the reference wing is pinned to converge. Not reproduced on current main yet; this records it so it is not lost. #315 is a different LOOP convergence failure (the fixed point at α = 0).

Activity

  1. 1-Bart-1 commented on Sep 30, 2026

    @1-Bart-1
    Member

    Check if it does converge in the python version

  2. 1-Bort-1 commented on Sep 30, 2026

    @1-Bort-1
    MemberAuthor

    Fixing all of it in this PR, on top of 8c8db26 (halving + stop at non-finite): finding why solver_test_wing refined to 12+ panels does not converge (LOOP and NONLIN) and fixing that in the solver, then finding why the unrefined cl/cd/cm aggregation misses the panel sums by 17 % and fixing whichever side is wrong. The unrefined-consistency test then runs its checks for real.

  3. 1-Bort-1 commented on Sep 30, 2026

    @1-Bort-1
    MemberAuthor

    Question from VortexStepMethod.jl-395

    Which fix do you want for #395? The NaN is not the geometry. The AIC, panel frames and initial gamma are all finite. The LOOP iteration diverges: max|gamma| is 3.8e50 by iteration 10 and NaN by 20.

    Why: NONLIN finds the fixed point (VSM CL 0.4223, residual 1e-13). At that point the LOOP map's Jacobian has an eigenvalue at −210, from the 1.3 cm wide cosine-spaced tip panels on a 1 m chord. A relaxed step is stable only for ω < 2/(1+|λ|) = 0.0095. The default 0.03 and the single retry at 0.015 both diverge. LLT's eigenvalue is −106 (limit 0.019), which is why LLT converges on its retry. At ω = 0.0075 VSM converges in about 1220 iterations at both 5.7° and 10°.

    Options:
    A. Solver fix: solve_base! keeps halving ω while ω > 1e-3, which its guard already hints at, and LOOP stops as soon as gamma goes non-finite instead of running 1500 NaN iterations. This fixes every wing this stiff. The cost is up to ~5 retries on cases that never converge.
    B. Test only: add a solve to the :curved geometry test with solver_type=NONLIN (or an explicit ω = 0.0075) and pin CL. The default LOOP still fails on this wing.
    C. Both.

    I recommend A: the class is 'stiff wing, fixed ω' rather than this one wing, and a test that converges only on NONLIN hides the failure. I'd also pin the :curved solve with the default solver, so it goes red today and green after the fix.

  4. 1-Bart-1 commented on Sep 30, 2026

    @1-Bart-1
    Member

    A, should warn when halving, and it errors when NaN already right? SymAWE catches this error.

  5. 16 remaining items

  6. 1-Bort-1 commented on Nov 5, 2026

    @1-Bort-1
    MemberAuthor

    From VortexStepMethod.jl-410 (#410), tell 33, 2026-11-05T00:25:24Z

    Task #410 makes the default relaxation factor 0.8 of the stability limit from Python v2.3.0 (nothing as default, explicit numbers still honoured) and copies your area-weighted unrefined aggregation and polar row into its branch, because its converging solves exposed the same bug. On that default your curved wing converges. Your per-panel cap remains useful for explicit factors and your non-finite stop is not in #410. Expect a conflict in solver.jl and test_unrefined_dist.jl: the aggregation hunks are identical to yours.

  7. 1-Bort-1 commented on Nov 5, 2026

    @1-Bort-1
    MemberAuthor

    On tell 33 from VortexStepMethod.jl-410: No change to #402, it stays at c62bd58: its cap and non-finite stop still apply to explicit factors. A trial merge with your 242880a conflicts only in src/solver.jl; test_unrefined_dist.jl merges clean. Whichever lands second resolves it.

  8. added
    agent:ciAgent task state
    and removed
    agent:ciAgent task state
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions