Skip to content

pyflightstream.post.rotor_table (provisional)

Generated from the docstrings at build time: every one of the 7 names in the __all__ of pyflightstream.post.rotor_table has an entry below. The names a guide or an example uses come first; the others follow under Advanced.

The rotor table: one coefficient table per rotor the reference declares.

One of the product families of :mod:pyflightstream.post, written by the post stage of :mod:pyflightstream.post.products, which re-exports every name here.

polars/P<sim>-<sweep>_<ROTOR>_rotor.csv: one row per point, the rotor's loads in its own shaft frame (:class:RotorShaftLoads, :func:rotor_shaft_loads) and its thrust, torque and power coefficients with the in-plane ones (:func:_rotor_coefficients, :data:ROTOR_COEFFICIENT_COLUMNS, :data:ROTOR_IN_PLANE_COLUMNS, :func:_rotor_coefficient_columns), written by the retired write_rotor_table. The geometry comes from the resolved reference definition retained with the run record, including the shaft, hub and diameter. An unsteady row reads the rotor's plot group, time-averaged over the row's window (the plan of :mod:pyflightstream.post._rotor_plan names the group a rotor's history is read from); a steady row reads its loads export.

The rotor products of the backlog that are tables of a rotor per point (a trimmed rotor, a further coefficient set) join this module beside the writer they extend.

Advanced

pyflightstream.post.rotor_table.ROTOR_COEFFICIENT_COLUMNS module-attribute

ROTOR_COEFFICIENT_COLUMNS: tuple[str, ...] = (
    "J",
    "CT",
    "CQ",
    "CP",
    "ETA",
    "ETAW",
)

pyflightstream.post.rotor_table.ROTOR_DECLARED_AFT_WARNING module-attribute

ROTOR_DECLARED_AFT_WARNING = "Rotor {alias} declares its axis aft; 0.58.0 counts thrust positive forward, so CT, CQ, ETA, T and the in-plane signs of this rotor are opposite to 0.57.0. See docs/upgrading.md#0580-post-tree."

pyflightstream.post.rotor_table.ROTOR_IN_PLANE_COLUMNS module-attribute

ROTOR_IN_PLANE_COLUMNS: tuple[str, ...] = (
    "CN",
    "CS",
    "CMN",
    "CMS",
)

pyflightstream.post.rotor_table.RotorShaftLoads dataclass

RotorShaftLoads(
    thrust_n: float,
    torque_nm: float,
    shaft_angle_deg: float,
    wind_force_n: float,
    families_used: tuple[str, ...],
    force_n: tuple[float, float, float] | None = None,
    moment_hub_nm: tuple[float, float, float] | None = None,
)

One rotor's thrust and torque about its OWN shaft, in newtons and N m.

wind_force_n is the rotor's force along the FREE STREAM, which is what ETAW is built on. shaft_angle_deg is the angle between the shaft and that same stream; it is kept because it is a fact a reader of the table may want, and it is NO LONGER what ETAW is computed from.

WHY BOTH, AND WHY THE ANGLE IS NOT ENOUGH. A cosine projects the SHAFT direction and therefore keeps only the thrust that lies along the shaft -- it discards every component of the rotor's force that does not, which on an installed rotor is exactly the part the definition keeps. The definition:

[Fx_rotor_axis Fy_rotor_axis Fz_rotor_axis] * R^T(rotor axes ->
airframe body axes) * R(alpha) = Fx_W

with both alpha AND beta applied by the AIAA axis convention, and ETAW still a dimensionless efficiency.

pyflightstream.post.rotor_table.rotor_frame_coefficients

rotor_frame_coefficients(
    *,
    force_n: Sequence[float],
    moment_hub_nm: Sequence[float],
    frame: RotorFrame,
    rotations: Mapping[str, NDArray[float64]],
    rpm: float | None,
    diameter_m: float,
    density_kg_m3: float,
    vinf_m_s: float | None,
    sref_m2: float,
    cref_m: float,
    bref_m: float,
) -> dict[str, float | str]

Return the RCOEF values of one family or group inside rotor frame.

THE DEFINITIONS (docs/definitions/rotor-coefficients.md). F_R and M_R are the force and the moment about the hub in the frame R; n is the rate in rev/s signed about x_R (sense RPM / 60), D the diameter, A = pi D^2 / 4, q = 0.5 RHO VINF^2 and J = VINF / (|n| D)::

T = F_R,x    Y = F_R,y    Z = -F_R,z    Q = M_R,x    M = M_R,y    N = M_R,z
P  = 2 pi n Q / 1000                       (kW)
CT = T / (RHO n^2 D^4)    CQ = Q / (RHO n^2 D^5)    CP = 2 pi CQ sign(n)
CFZ, CFY = Z, Y / (RHO n^2 D^4)            CMZ, CMY = N, M / (RHO n^2 D^5)
ETA = J CT / CP
TC, YC, ZC = T, Y, Z / (q A)               QC, NC, MC = Q, N, M / (q A D)
TCA, YCA, ZCA = T, Y, Z / (q SREF)         QCA, NCA = Q, N / (q SREF BREF)
MCA = M / (q SREF CREF)
CT<f> = F_f,x / (RHO n^2 D^4)   CQ<f> = M_f,x / (RHO n^2 D^5)   ETA<f> = J CT<f> / CP

THE NA RULES. A static point (VINF = 0) states no ETA, no ETA<f> and none of TC to MCA. A rotor not turning or of unknown speed states no coefficient over n^2 and no ETA; P is 0 at RPM = 0 and NA when the speed is unknown. A load that is not a number gives NA wherever it enters.

Parameters:

Name Type Description Default
force_n sequence of float

The force in N, in the export frame.

required
moment_hub_nm sequence of float

The moment about the rotor's hub in N m, in the export frame.

required
frame RotorFrame

The frame of the rotor the family or group sits in.

required
rotations mapping of str to numpy.ndarray

The export-to-frame matrices of every frame, as :func:pyflightstream.post.axes.frame_rotations returns them; the per-frame set runs over them in their order.

required
rpm float or None

The rotor's speed signed about its declared axis; None when unknown.

required
diameter_m float

The rotor's diameter.

required
density_kg_m3 float

The point's density.

required
vinf_m_s float or None

The free-stream speed; None when unknown.

required
sref_m2 float

The airframe reference area, chord and span.

required
cref_m float

The airframe reference area, chord and span.

required
bref_m float

The airframe reference area, chord and span.

required

Returns:

Type Description
dict of str to float or str

The rotor-frame columns of :data:pyflightstream.post._family_columns.ROTOR_FRAME_COLUMNS in their order, then CT<f>, CQ<f>, ETA<f> per frame; NA where a value does not exist.

Examples:

>>> from pyflightstream.post.axes import frame_rotations, rotor_frame
>>> frame = rotor_frame((-1.0, 0.0, 0.0))
>>> row = rotor_frame_coefficients(
...     force_n=(-100.0, 0.0, 0.0), moment_hub_nm=(-5.0, 0.0, 0.0), frame=frame,
...     rotations=frame_rotations(0.0, 0.0, [frame]), rpm=600.0, diameter_m=1.0,
...     density_kg_m3=1.0, vinf_m_s=10.0, sref_m2=1.0, cref_m=1.0, bref_m=1.0)
>>> row["T"], row["CT"], row["CTR0"] == row["CT"]
(100.0, 1.0, True)

pyflightstream.post.rotor_table.rotor_shaft_loads

rotor_shaft_loads(
    surfaces: Mapping[str, Mapping[str, float]],
    *,
    rotor: object,
    reference: ReferenceValues,
    density_kg_m3: float,
    speed_m_s: float,
    aliases: Mapping[str, Sequence[str]] | None = None,
    alpha_deg: float = 0.0,
    beta_deg: float = 0.0,
    analysis_frame: str | None = None,
) -> RotorShaftLoads

Return one rotor's THRUST and TORQUE from the loads the run already left.

NO RE-RUN IS NEEDED, which is what puts this inside the release's acceptance rule: an item that requires re-running the solver is not ready. Everything here is read from what a finished campaign already holds: the loads export's per-surface Cx, Cy, Cz, CMx, CMy, CMz, the reference area, length and MOMENT POINT, and the rotor's hub, diameter and shaft.

THE MOMENT TRANSFER IS THE ONE STEP THAT IS NOT ARITHMETIC. The export's moments are about the moment reference point; a rotor's torque is about its own shaft through its HUB, and the two differ by the moment of the force about the offset between them::

M_hub = M_mrp + (r_mrp - r_hub) x F

That is elementary statics rather than a convention, so it is implemented rather than asked: choosing the other reading reports a torque no rotor produces. The DEFINITION of ETAW is not made here: it is stated where it is computed, in :func:_rotor_coefficients.

ONLY THE ROTOR'S OWN FAMILIES ARE SUMMED. The airframe sits in the same table, and a rotor's thrust is its own -- which is the same reason item 6 suffixes every column with the alias.

Parameters:

Name Type Description Default
surfaces mapping of str to mapping of str to float

The loads table by surface name: the coefficients Cx, Cy, Cz, CMx, CMy, CMz of each surface.

required
rotor object

The rotor, read for its axis_vector, members (families), and hub position x_m, y_m and z_m.

required
reference ReferenceValues

Reference area, length and moment point the export's coefficients were taken against.

required
density_kg_m3 float

Air density in kg/m^3.

required
speed_m_s float

The export's reference velocity in m/s, the speed its coefficients are divided by; zero or below gives NaN loads. A static free stream with a positive reference velocity gives dimensional loads.

required
aliases mapping of str to sequence of str

The boundary aliases a rotor member may name.

None
alpha_deg float

Angle of attack in degrees, for the angle to the free stream.

0.0
beta_deg float

Sideslip angle in degrees.

0.0
analysis_frame str

The frame the export states its loads in; one that is not the geometry's axes gives NaN loads.

None

Returns:

Type Description
RotorShaftLoads

Thrust and torque about the shaft in N and N m, the angle between the shaft and the stream, the force along the stream, and the surfaces summed. The loads are NaN at rest and in a frame other than the geometry's.

pyflightstream.post.rotor_table.warn_rotor_declared_aft

warn_rotor_declared_aft(
    alias: str, frame: RotorFrame
) -> bool

Warn that a rotor declared aft reads with the thrust sign opposite to the rotor table.

Parameters:

Name Type Description Default
alias str

The rotor's alias.

required
frame RotorFrame

Its frame, from :func:pyflightstream.post.axes.rotor_frame.

required

Returns:

Type Description
bool

Whether the warning was given (the rotor's declared axis points aft).

Examples:

>>> from pyflightstream.post.axes import rotor_frame
>>> warn_rotor_declared_aft("TRACTOR", rotor_frame((-1.0, 0.0, 0.0)))
False