Skip to content

Land #167 on develop (polar tables as CasADi inputs) - #168

Merged
ocayon merged 2 commits into
developfrom
feature/quarter-chord-xp-kernels
Nov 3, 2026
Merged

ocayon merged 2 commits into
developfrom
feature/quarter-chord-xp-kernels

Conversation

@ocayon

@ocayon ocayon commented Nov 3, 2026

Copy link
Copy Markdown
Member

#167 (polar tables as inputs of the CasADi panel functions) was merged into its stacked base feature/quarter-chord-xp-kernels (merge commit bdce11a) about 15 s after #166 had merged that branch into develop, before GitHub retargeted it. Its change therefore never reached develop.

This PR brings it in. The diff is exactly #167's reviewed commit 3cb7bd0:

  • src/VSM/core/Solver.py
  • tests/Solver/test_casadi_polar_table_inputs.py

It merges cleanly into develop. See #167 for the description, the validation (all solve outputs bit-identical, 208 passed / 5 skipped) and the timings.

Written by Claude, reviewed by Oriol Cayon

ocayon and others added 2 commits November 3, 2026 14:54
On a deforming wing each panel's blended polar changes slightly every
coupled iteration. The CasADi residual and panel-force functions embedded
the tables as constants and were cached per table set, so a caller that
re-trims deformed shapes (AWETrim's CasadiTrim) rebuilt its graph every
iteration and could not afford to SX-expand it.

- _casadi_newton_function(table_inputs=False) and
  casadi_panel_force_function(table_inputs=False): with True the functions
  take cl_table, cd_table, cm_table, each (n_panels, n_alpha), as extra
  inputs and are cached per (panel count, alpha grid, settings), not per
  table values. The lookup is one 1-D parametric linear interpolant on the
  shared grid, mapped over panels: same nodes and clamping, so the outputs
  equal the embedded-table ones to round-off. Omitted tables default to
  NaN, never to a silently zero polar.
- Solver.casadi_polar_table_inputs() and casadi_stall_angle_inputs(): the
  current tables and stall-gate angles in the input layout.
- Linear polars on one shared alpha grid only (a parametric cubic spline
  refits per call, ~0.1 s); other cases raise a clear ValueError.

VSM's own loops keep the embedded-table functions and are unchanged: all
solve outputs are bit-identical to a801b5b (4 loop types, both
is_aoa_corrected settings, viscosity on/off). Expanded to SX, the table
function evaluates as fast as the embedded one (+2% at 135 panels).

Generated with Claude Code
CasADi panel functions: polar tables as inputs, so one graph serves every deformed shape
Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@ocayon
ocayon merged commit ae5515c into develop Nov 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants