buffalo_wings.wing.WingCanonical

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

Bases: object

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.

__init__(spec)[source]

Store the parsed wing specification and validate axis choices.

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.

Return type:

None

Methods

__init__(spec)

Store the parsed wing specification and validate axis choices.

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)[source]

Evaluate a scalar distribution at eta.

Parameters:
Returns:

Interpolated scalar value at eta.

Return type:

buffalo_wings.type_aliases.FloatScalar

Raises:

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

sample_span_stations(panel_id, count, *, spacing='uniform')[source]

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_wings.type_aliases.FloatArray

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

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

evaluate_panel(panel_id, eta)[source]

Evaluate the spanwise panel properties at eta.

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

section_curves(panel_id, *, eta, chordwise_samples)[source]

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