Repository navigation
Land #167 on develop (polar tables as CasADi inputs) - #168
Merged
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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.
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.
#167 (polar tables as inputs of the CasADi panel functions) was merged into its stacked base
feature/quarter-chord-xp-kernels(merge commitbdce11a) about 15 s after #166 had merged that branch intodevelop, before GitHub retargeted it. Its change therefore never reacheddevelop.This PR brings it in. The diff is exactly #167's reviewed commit
3cb7bd0:src/VSM/core/Solver.pytests/Solver/test_casadi_polar_table_inputs.pyIt 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