Surface Panel Method (aerodynamics/cfd/panel-method)
Use when the task is a surface panel method for incompressible
potential flow: discretizing an airfoil or body into source or doublet
panels, applying the Neumann or Dirichlet boundary condition, enforcing
the Kutta condition, or computing the pressure distribution and force
coefficients.
Domain quick reference
- Panel methods replace the body surface with flat panels carrying
constant-strength singularities. Source panels model thickness and
non-lifting bodies; doublet panels (or vortex panels) model lifting
surfaces; the singularity strengths are the unknowns of a linear
system assembled from influence coefficients.
- Neumann boundary condition (source panel method): the total velocity
normal to the surface is zero at each control point (panel midpoint),
sum_j A_ij sigma_j = -(V_inf dot n_i), with the source self-influence
A_ii = 1/2. The source panel method reproduces the analytic cylinder
pressure coefficient Cp = 1 - 4 sin^2(theta) to machine precision
for an inscribed polygon.
- Dirichlet boundary condition (doublet panel method): the interior
velocity potential is zero at each control point, sum_j D_ij mu_j =
-phi_inf_i with D_ii = 1/2. The doublet strength equals the surface
velocity potential, so the surface velocity is the surface derivative
of the doublet distribution.
- Kutta condition: for a lifting body with a sharp trailing edge, the
tangential velocities on the upper and lower trailing-edge panels
must be equal, which fixes the circulation. Thin-airfoil theory gives
the flat plate result Gamma = pi c V_inf sin(alpha), so
c_l = 2 pi sin(alpha); the Kutta-Joukowski relation converts
circulation to lift with c_l = 2 Gamma / (c V_inf).
- Pressure: the Bernoulli relation for incompressible potential flow
gives Cp = 1 - (V/V_inf)^2. Integrating Cp times the panel outward
normal over the closed surface yields the lift and drag coefficients;
d'Alembert's paradox states the drag is zero in inviscid potential
flow, so a symmetric body at zero angle of attack must show zero lift
and near-zero drag.
- 3D bodies: the sphere is the standard validation anchor for 3D panel
codes. Potential flow over a sphere gives Cp = 1 - (9/4) sin^2(theta)
and the exact source strength 2 V_inf cos(theta). Quadrilateral
surface panels need area, centroid, and unit normal checks.
Workflow
- Build the panel geometry with build_panels from a closed,
counter-clockwise point list (first point equals last). Each panel
gets its midpoint, length, outward normal, and tangent.
- For a non-lifting body, assemble the influence matrix with
source_influence_matrix and solve for the source strengths with
neumann_source_solution, which applies the Neumann boundary
condition at the control points.
- For the Dirichlet form, assemble the doublet influence matrix with
dirichlet_doublet_matrix and solve with dirichlet_doublet_solution,
then recover the surface velocity with
surface_velocity_from_doublets.
- Evaluate the surface velocity and pressure coefficient with
surface_velocity_and_cp, then integrate with force_coefficients for
the lift and drag coefficients.
- For lifting cases, apply the Kutta condition: check trailing-edge
velocity equality with kutta_condition_check and estimate the
circulation with flat_plate_circulation and cl_from_circulation.
- For 3D bodies, check the panel bookkeeping with
quad_panel_properties and validate against the sphere solution with
sphere_potential_flow_cp and sphere_source_strength.
- Solve any assembled system with solve_linear_system (Gaussian
elimination with partial pivoting).
Pitfalls
- Wrong boundary condition: the Neumann form works on velocities
(zero normal velocity), the Dirichlet form works on potentials (zero
interior potential); mixing the two assemblies produces a wrong
system.
- Forgetting the doublet self-influence: the half-space solid angle
D_ii = 1/2 is required for the Dirichlet matrix, and the source
self-influence A_ii = 1/2 for the Neumann matrix.
- Computing the subtended panel angle from principal-value atan2
differences: endpoint directions wrap at 180 degrees and break the
influence matrix; use the signed cross and dot product angle instead.
- Ignoring the Kutta condition on a lifting airfoil: without it the
circulation is undetermined and the lift is wrong.
- Treating potential-flow drag as physical: the panel method returns
zero inviscid drag by construction (d'Alembert); viscous drag needs
a boundary-layer or CFD treatment.
- Clockwise point ordering flips the normals inward and inverts the
boundary condition signs; require a positive signed area.
Behavior contract (gate 3)
The panel geometry, influence, boundary condition, Kutta, pressure, and
3D body logic is exercised by the gate 3 contract test:
scripts/test_panel_method.py against scripts/panel_method_logic.py
(stdlib unittest, offline). Run:
python3 scripts/test_panel_method.py
Compliance
- NACA Report 824 is US government work (public domain); summary and
reference data only, per standards-map.yaml. The panel method
methodology here is common potential-flow practice, not reproduced
text.
- compliance: STANDARDS-REF, gated: false.
1---2name: panel-method3description: Use when the task is panel method setup, source or doublet panels, Neumann or Dirichlet boundary conditions, Kutta condition enforcement, pressure distribution on an airfoil or fuselage, or potential flow over 3D bodies. Compute the surface pressure distribution and force coefficients for an airfoil or body in incompressible potential flow with a panel method: build panel geometry from a closed point list, assemble the source panel influence matrix for the Neumann boundary condition, assemble the doublet panel influence matrix for the Dirichlet boundary condition, solve the linear system, evaluate the surface velocity and pressure coefficient, integrate pressure for lift and drag, and apply the Kutta condition to fix trailing-edge circulation. Trigger: panel method, source panel, doublet panel, kutta condition, neumann boundary condition, dirichlet boundary condition, pressure coefficient, potential flow, 3d body.4license: Apache-2.05---67# Surface Panel Method (aerodynamics/cfd/panel-method)89Use when the task is a surface panel method for incompressible10potential flow: discretizing an airfoil or body into source or doublet11panels, applying the Neumann or Dirichlet boundary condition, enforcing12the Kutta condition, or computing the pressure distribution and force13coefficients.1415## Domain quick reference1617- Panel methods replace the body surface with flat panels carrying18 constant-strength singularities. Source panels model thickness and19 non-lifting bodies; doublet panels (or vortex panels) model lifting20 surfaces; the singularity strengths are the unknowns of a linear21 system assembled from influence coefficients.22- Neumann boundary condition (source panel method): the total velocity23 normal to the surface is zero at each control point (panel midpoint),24 sum_j A_ij sigma_j = -(V_inf dot n_i), with the source self-influence25 A_ii = 1/2. The source panel method reproduces the analytic cylinder26 pressure coefficient Cp = 1 - 4 sin^2(theta) to machine precision27 for an inscribed polygon.28- Dirichlet boundary condition (doublet panel method): the interior29 velocity potential is zero at each control point, sum_j D_ij mu_j =30 -phi_inf_i with D_ii = 1/2. The doublet strength equals the surface31 velocity potential, so the surface velocity is the surface derivative32 of the doublet distribution.33- Kutta condition: for a lifting body with a sharp trailing edge, the34 tangential velocities on the upper and lower trailing-edge panels35 must be equal, which fixes the circulation. Thin-airfoil theory gives36 the flat plate result Gamma = pi c V_inf sin(alpha), so37 c_l = 2 pi sin(alpha); the Kutta-Joukowski relation converts38 circulation to lift with c_l = 2 Gamma / (c V_inf).39- Pressure: the Bernoulli relation for incompressible potential flow40 gives Cp = 1 - (V/V_inf)^2. Integrating Cp times the panel outward41 normal over the closed surface yields the lift and drag coefficients;42 d'Alembert's paradox states the drag is zero in inviscid potential43 flow, so a symmetric body at zero angle of attack must show zero lift44 and near-zero drag.45- 3D bodies: the sphere is the standard validation anchor for 3D panel46 codes. Potential flow over a sphere gives Cp = 1 - (9/4) sin^2(theta)47 and the exact source strength 2 V_inf cos(theta). Quadrilateral48 surface panels need area, centroid, and unit normal checks.4950## Workflow51521. Build the panel geometry with build_panels from a closed,53 counter-clockwise point list (first point equals last). Each panel54 gets its midpoint, length, outward normal, and tangent.552. For a non-lifting body, assemble the influence matrix with56 source_influence_matrix and solve for the source strengths with57 neumann_source_solution, which applies the Neumann boundary58 condition at the control points.593. For the Dirichlet form, assemble the doublet influence matrix with60 dirichlet_doublet_matrix and solve with dirichlet_doublet_solution,61 then recover the surface velocity with62 surface_velocity_from_doublets.634. Evaluate the surface velocity and pressure coefficient with64 surface_velocity_and_cp, then integrate with force_coefficients for65 the lift and drag coefficients.665. For lifting cases, apply the Kutta condition: check trailing-edge67 velocity equality with kutta_condition_check and estimate the68 circulation with flat_plate_circulation and cl_from_circulation.696. For 3D bodies, check the panel bookkeeping with70 quad_panel_properties and validate against the sphere solution with71 sphere_potential_flow_cp and sphere_source_strength.727. Solve any assembled system with solve_linear_system (Gaussian73 elimination with partial pivoting).7475## Pitfalls7677- Wrong boundary condition: the Neumann form works on velocities78 (zero normal velocity), the Dirichlet form works on potentials (zero79 interior potential); mixing the two assemblies produces a wrong80 system.81- Forgetting the doublet self-influence: the half-space solid angle82 D_ii = 1/2 is required for the Dirichlet matrix, and the source83 self-influence A_ii = 1/2 for the Neumann matrix.84- Computing the subtended panel angle from principal-value atan285 differences: endpoint directions wrap at 180 degrees and break the86 influence matrix; use the signed cross and dot product angle instead.87- Ignoring the Kutta condition on a lifting airfoil: without it the88 circulation is undetermined and the lift is wrong.89- Treating potential-flow drag as physical: the panel method returns90 zero inviscid drag by construction (d'Alembert); viscous drag needs91 a boundary-layer or CFD treatment.92- Clockwise point ordering flips the normals inward and inverts the93 boundary condition signs; require a positive signed area.9495## Behavior contract (gate 3)9697The panel geometry, influence, boundary condition, Kutta, pressure, and983D body logic is exercised by the gate 3 contract test:99scripts/test_panel_method.py against scripts/panel_method_logic.py100(stdlib unittest, offline). Run:101python3 scripts/test_panel_method.py102103## Compliance104105- NACA Report 824 is US government work (public domain); summary and106 reference data only, per standards-map.yaml. The panel method107 methodology here is common potential-flow practice, not reproduced108 text.109- compliance: STANDARDS-REF, gated: false.