You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The :curved reference wing does not converge: LOOP returns NaN gamma at 5.7° and 10° #395
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 = 40set_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).
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.
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.
Done in 8c8db26: halves while above 1e-3 with a warning every time, stops at the first non-finite residual, throw_on_fail still raises SolveFailure. df5f85a adds a per-panel relaxation cap, so the curved wing no longer needs the halving.
Fixed in c580837, df5f85a and f7afff7: the test polar now crosses cl = 0, the unrefined coefficients are area-weighted, moment_unrefined_dist is summed, and the testset checks run exactly behind FEASIBLE asserts. What and why is in the PR description.
Activity
1-Bart-1 commentedon Sep 30, 2026
Check if it does converge in the python version
1-Bort-1 commentedon Sep 30, 2026
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.
1-Bort-1 commentedon Sep 30, 2026
Question from
VortexStepMethod.jl-395Which 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
:curvedgeometry test withsolver_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
:curvedsolve with the default solver, so it goes red today and green after the fix.1-Bart-1 commentedon Sep 30, 2026
A, should warn when halving, and it errors when NaN already right? SymAWE catches this error.
6 remaining items
1-Bort-1 commentedon Sep 30, 2026
Done in 8c8db26: halves while above 1e-3 with a warning every time, stops at the first non-finite residual, throw_on_fail still raises SolveFailure. df5f85a adds a per-panel relaxation cap, so the curved wing no longer needs the halving.
1-Bort-1 commentedon Sep 30, 2026
Fixed in c580837, df5f85a and f7afff7: the test polar now crosses cl = 0, the unrefined coefficients are area-weighted, moment_unrefined_dist is summed, and the testset checks run exactly behind FEASIBLE asserts. What and why is in the PR description.