buffalo_wings.wing.WingCanonical

class buffalo_wings.wing.WingCanonical(spec)[source]

Bases: WingCanonicalDistributionMixin, WingCanonicalSectionMixin

Canonical evaluator for wing-section placement and sampling.

Parameters:

spec (WingSpec) – Parsed wing schema used for panel evaluation and section sampling.

Raises:

ValueError – If the configured reference-axis and twist-axis combination is not supported by the current implementation.

Methods

evaluate_distribution(distribution, eta)

Evaluate a scalar distribution at eta.

evaluate_panel(panel_id, eta)

Evaluate the spanwise panel properties at eta.

from_spec(spec)

Build a canonical evaluator from a parsed WingSpec.

sample_span_stations(panel_id, count, *[, ...])

Generate span stations over a panel eta_range.

section_curves(panel_id, *, eta, ...)

Generate sampled upper and lower 3D curves for one section.

Attributes

spec

Return the underlying wing specification.

classmethod from_spec(spec)[source]

Build a canonical evaluator from a parsed WingSpec.

Parameters:

spec (WingSpec) – Parsed wing schema used for panel evaluation and section sampling.

Returns:

Canonical evaluator backed by spec.

Return type:

WingCanonical

Raises:

ValueError – If the configured reference-axis and twist-axis combination is not supported by the current implementation.

property spec: WingSpec

Return the underlying wing specification.

Returns:

Wing schema used by the evaluator.

Return type:

WingSpec

evaluate_distribution(distribution, eta)

Evaluate a scalar distribution at eta.

Parameters:
  • distribution (DistributionSpec) – Distribution definition to evaluate.

  • eta (buffalo_core.typing.FloatScalar) – Spanwise parameter at which to evaluate the distribution.

Returns:

Interpolated scalar value at eta.

Return type:

buffalo_core.typing.FloatScalar

Raises:

ValueError – If eta lies outside the distribution support or the distribution data are invalid.

evaluate_panel(panel_id, eta)

Evaluate the spanwise panel properties at eta.

Parameters:
  • panel_id (str) – Identifier of the panel to evaluate.

  • eta (buffalo_core.typing.FloatScalar) – Spanwise parameter within the panel eta_range.

Returns:

Evaluated reference-line position, chord, and twist at eta.

Return type:

EvaluatedStation

Raises:
  • KeyError – If panel_id does not match a known panel.

  • ValueError – If eta lies outside the panel eta_range.

sample_span_stations(panel_id, count, *, spacing='uniform')

Generate span stations over a panel eta_range.

Parameters:
  • panel_id (str) – Identifier of the panel to sample.

  • count (int) – Number of stations to generate.

  • spacing (str, default "uniform") – Spacing rule used between the panel endpoints. Supported values are "uniform" and "cosine".

Returns:

One-dimensional array of sampled eta values.

Return type:

buffalo_core.typing.FloatArray

Raises:
  • KeyError – If panel_id does not match a known panel.

  • ValueError – If count < 2 or spacing is unsupported.

section_curves(panel_id, *, eta, chordwise_samples)

Generate sampled upper and lower 3D curves for one section.

Parameters:
  • panel_id (str) – Identifier of the panel to sample.

  • eta (float) – Spanwise parameter within the panel eta_range.

  • chordwise_samples (buffalo_core.typing.FloatArray) – One-dimensional normalized chordwise coordinates in [0, 1].

Returns:

Sampled upper and lower section curves in the canonical wing frame.

Return type:

SectionCurves

Raises:
  • KeyError – If panel_id or the referenced airfoil name is unknown.

  • ValueError – If eta lies outside the panel range or chordwise_samples is not a one-dimensional array in [0, 1].

  • NotImplementedError – If the panel uses an unsupported airfoil reference or airfoil type.