buffalo_wings.wing.WingCanonical
- class buffalo_wings.wing.WingCanonical(spec)[source]
Bases:
objectCanonical 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
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:
- 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:
- evaluate_distribution(distribution, eta)[source]
Evaluate a scalar distribution at
eta.- Parameters:
distribution (
DistributionSpec) – Distribution definition to evaluate.eta (
buffalo_wings.type_aliases.FloatScalar) – Spanwise parameter at which to evaluate the distribution.
- Returns:
Interpolated scalar value at
eta.- Return type:
- Raises:
ValueError – If
etalies 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
etavalues.- Return type:
- Raises:
KeyError – If
panel_iddoes not match a known panel.ValueError – If
count < 2orspacingis unsupported.
- evaluate_panel(panel_id, eta)[source]
Evaluate the spanwise panel properties at
eta.- Parameters:
panel_id (
str) – Identifier of the panel to evaluate.eta (
buffalo_wings.type_aliases.FloatScalar) – Spanwise parameter within the paneleta_range.
- Returns:
Evaluated reference-line position, chord, and twist at
eta.- Return type:
- Raises:
KeyError – If
panel_iddoes not match a known panel.ValueError – If
etalies outside the paneleta_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 paneleta_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:
- Raises:
KeyError – If
panel_idor the referenced airfoil name is unknown.ValueError – If
etalies outside the panel range orchordwise_samplesis not a one-dimensional array in[0, 1].NotImplementedError – If the panel uses an unsupported airfoil reference or airfoil type.