Add control-surface support to VortexLatticeMethod#180
Open
gaoflow wants to merge 1 commit into
Open
Conversation
Control-surface deflections (defined on the Airplane geometry, as with the AVL and LiftingLine backends) are now applied by the differentiable VortexLatticeMethod. Each deflected panel's flow-tangency normal is rotated about its local spanwise hinge axis by the deflection angle (trailing-edge-down positive). This is the standard linearized treatment of control surfaces in a thin-surface vortex-lattice method; the vortex lattice itself is held fixed. Trailing- and leading-edge surfaces, as well as symmetric and antisymmetric (e.g. aileron) surfaces, are supported. Deflection magnitudes may be Opti variables, so the analysis stays differentiable for trim/control optimization. Airplanes without control surfaces are unaffected (the result is bit-for-bit unchanged). Adds regression and physics tests covering: zero-deflection equivalence to the no-control-surface baseline, monotonic CL increase from a symmetric flap with zero net roll, an antisymmetric aileron producing roll with zero net lift, and differentiability of the deflection angle. Resolves peterdsharpe#134.
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.
Overview
This adds control-surface support to
VortexLatticeMethod, which was previously unported to the differentiable VLM (#134). Control surfaces defined on theAirplanegeometry — exactly as they already are for the AVL andLiftingLinebackends — are now honored by the VLM.Approach
In a thin-surface vortex-lattice method, a control-surface deflection enters the problem only through the flow-tangency boundary condition — i.e. by rotating the affected panels' normal vectors about their local (spanwise) hinge axis. The vortex lattice itself is held fixed. This is the standard linearized treatment of control surfaces in a VLM, and it keeps the implementation fully vectorized and differentiable.
Concretely:
LiftingLinealready uses (a control surface is associated with the inboard cross-section of each strip; symmetric surfaces deflect both sides of a symmetric wing identically, antisymmetric surfaces deflect the mirrored side oppositely). A new helper,_compute_control_surface_deflections(wing), returns a per-panel deflection angle in the exact panel order thatWing.mesh_thin_surfaceproduces. A trailing-edge surface deflects every panel whose chordwise center lies aft of itshinge_point; a leading-edge surface (trailing_edge=False) deflects every panel forward of it.n' = cos(δ)·n + sin(δ)·ĉ, withδ > 0trailing-edge-down andĉthe aft chordwise direction projected perpendicular ton, so the rotated normal stays a unit vector).Optivariables for differentiable trim/control optimization.Verification
Added four tests in
test_vortex_lattice_method.py, all passing (full module: 8 passed):test_control_surface_zero_deflection_matches_baseline— a control surface atdeflection=0reproduces the no-control-surface result to within1e-12acrossCL,CD,Cl,Cm,Cn.test_control_surface_symmetric_flap_increases_lift— a downward symmetric flap monotonically increasesCL(0 → 0.23 → 0.47 → 0.96 for δ = 0°, 5°, 10°, 20° at α=0) with zero net roll.test_control_surface_aileron_produces_roll— an antisymmetric aileron produces a nonzero rolling moment with zero net lift.test_control_surface_deflection_is_differentiable— the deflection angle solves as anOptivariable (trimming a flap to a targetCL), confirming the analysis stays differentiable.ruff check/ruff format --checkclean on both changed files. The four pre-existing VLM tests still pass unchanged.Note: I don't have an
avlbinary in this environment, so I verified against physical expectations (sign, monotonicity, symmetry, and exact baseline reproduction) rather than a numerical AVL cross-check. Happy to add an AVL comparison if useful.Resolves #134.