Skip to content

Add control-surface support to VortexLatticeMethod#180

Open
gaoflow wants to merge 1 commit into
peterdsharpe:developfrom
gaoflow:feature/vlm-control-surfaces
Open

Add control-surface support to VortexLatticeMethod#180
gaoflow wants to merge 1 commit into
peterdsharpe:developfrom
gaoflow:feature/vlm-control-surfaces

Conversation

@gaoflow

@gaoflow gaoflow commented May 27, 2026

Copy link
Copy Markdown

Overview

This adds control-surface support to VortexLatticeMethod, which was previously unported to the differentiable VLM (#134). Control surfaces defined on the Airplane geometry — exactly as they already are for the AVL and LiftingLine backends — are now honored by the VLM.

wing = asb.Wing(
    name="Wing",
    symmetric=True,
    xsecs=[
        asb.WingXSec(
            xyz_le=[0, 0, 0], chord=1, airfoil=asb.Airfoil("naca0008"),
            control_surfaces=[
                asb.ControlSurface(name="flap", symmetric=True, hinge_point=0.75, deflection=10),
            ],
        ),
        asb.WingXSec(xyz_le=[0, 5, 0], chord=1, airfoil=asb.Airfoil("naca0008")),
    ],
)
aero = asb.VortexLatticeMethod(airplane=asb.Airplane(wings=[wing]), op_point=asb.OperatingPoint(velocity=10, alpha=0)).run()
# Before: deflection ignored (CL ~ 0).   After: CL > 0, as expected for a deflected flap.

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:

  • Panel → control-surface mapping. Reusing the same per-spanwise-strip bookkeeping that LiftingLine already 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 that Wing.mesh_thin_surface produces. A trailing-edge surface deflects every panel whose chordwise center lies aft of its hinge_point; a leading-edge surface (trailing_edge=False) deflects every panel forward of it.
  • Applying the deflection. Each affected panel's normal is rotated toward the panel's aft chordwise direction by its deflection angle (n' = cos(δ)·n + sin(δ)·ĉ, with δ > 0 trailing-edge-down and ĉ the aft chordwise direction projected perpendicular to n, so the rotated normal stays a unit vector).
  • The rotation branch is guarded by a purely structural check (does any control surface exist at all?), so airplanes with no control surfaces produce bit-for-bit identical results, and deflection magnitudes may be Opti variables 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 at deflection=0 reproduces the no-control-surface result to within 1e-12 across CL, CD, Cl, Cm, Cn.
  • test_control_surface_symmetric_flap_increases_lift — a downward symmetric flap monotonically increases CL (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 an Opti variable (trimming a flap to a target CL), confirming the analysis stays differentiable.

ruff check / ruff format --check clean on both changed files. The four pre-existing VLM tests still pass unchanged.

Note: I don't have an avl binary 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.

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.
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.

1 participant