pyflightstream.cases.reference_blocks (provisional)¶
Generated from the docstrings at build time: every one of the 7 names in the __all__ of pyflightstream.cases.reference_blocks has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
The reference blocks of a geometry: rotors, actuator discs and blade datums.
Pipeline role: describes what the reference artifact declares about the moving
parts of a geometry. A :class:RotorBlock names a rotor's families, axis,
origin and hand; an :class:ActuatorBlock an actuator disc; a
:class:BladeDatum the in-plane direction a blade's frame is built from; and
:func:frame_basis_for_shaft turns a shaft axis into the frame the workflows
emit. The two errors a case definition raises live here too:
:class:CampaignConfigError, which every model of the package raises for a
definition that cannot be used as written, and :class:AliasCycleError.
The package root re-exports these models (AD-16). This module is the floor of the six model modules: it imports none of them and never the package root.
Advanced¶
pyflightstream.cases.reference_blocks.AXIS_UNIT_VECTORS
module-attribute
¶
AXIS_UNIT_VECTORS: dict[str, tuple[float, float, float]] = {
"X": (1.0, 0.0, 0.0),
"Y": (0.0, 1.0, 0.0),
"Z": (0.0, 0.0, 1.0),
}
pyflightstream.cases.reference_blocks.ActuatorBlock
¶
Bases: BaseModel
One actuator disc, declared as one block of the reference artifact (G06).
The linearized propeller slipstream the solver models with an actuator
(FSM-26.120 pp.185-187). Its GEOMETRY is the configuration's, so it lives in
the reference beside the rotors and the frames, as a top-level table with
kind = "actuator" whose NAME is the disc's name; its LOADING is the
condition's, so a row states it (ACTUATOR, ACTUATOR_RPM and one of
ACTUATOR_THRUST or PROFILE). A reference declaring a disc moves
nothing on a row that names none.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
str
|
|
frame |
str
|
The frame the disc's axis belongs to: a name the reference's
|
axis |
{'X', 'Y', 'Z'}
|
The frame's axis the disc turns about. |
offset_m |
float
|
The disc's position along that axis, from the frame's origin. |
tip_radius_m |
float
|
The disc's outer radius. |
hub_radius_m |
float
|
The disc's inner radius, |
rpm_sign |
int
|
|
blades |
(int, optional)
|
The blade count a profile file's distribution is read per; required
by a row stating |
swirl |
(float, optional)
|
The fraction, 0 to 1, of the swirl velocity kept downstream
( |
profile_units |
str
|
The force unit a profile file is written in, as the command database
spells |
pyflightstream.cases.reference_blocks.AliasCycleError
¶
Bases: PyflightstreamError, ValueError
An alias resolves through itself, and both sides are named (FR-59).
An alias may name another alias, resolved to the end. That is what makes a cycle possible, so the reader refuses one rather than recursing: the message names the alias that closed the ring and the member that closed it, because a reader holding only one of the two names has to open the file to find the other.
pyflightstream.cases.reference_blocks.BladeDatum
¶
Bases: BaseModel
Where blade one sits, and the axis its azimuth is measured from (FR-60).
An azimuth needs a declared zero axis. The datum states both: { azimuth_deg = 45.0, zero =
"X" }. The zero is an axis letter with an optional sign and is refused when it lies within
about 5 degrees of the rotor axis (the refusal states the angle), because an angle from
that axis locates no radial direction.
Attributes:
| Name | Type | Description |
|---|---|---|
azimuth_deg |
float
|
Where blade one is, measured from |
zero |
str
|
The axis letter the azimuth is measured from, with at most one sign. |
pyflightstream.cases.reference_blocks.CampaignConfigError
¶
Bases: PyflightstreamError, ValueError
A campaign or case definition cannot be used as written.
A sweep point that cannot be tagged, a campaign file that does not
load, a recipe that does not resolve to a callable or whose
signature the loop cannot call. Distinct from
:class:~pyflightstream.cases.matrix.MatrixError, which is about
the pipe-delimited run-matrix format specifically.
Also inherits from ValueError.
pyflightstream.cases.reference_blocks.ROTOR_BLADE_ROTATION_AXIS
module-attribute
¶
ROTOR_BLADE_ROTATION_AXIS = 'Z'
pyflightstream.cases.reference_blocks.RotorBlock
¶
Bases: BaseModel
One rotor, declared as one block of the reference artifact (FR-60).
The block's NAME is an alias over
everything the rotor owns, the union of :attr:families_general and
:attr:families_blades in that order: what a row moves when it cites
it, and what a group summing the rotor sums.
THE NAME IS FREE, AND A TRAILING DIGIT IS FINE: the eight lifters of
a four-a-side aircraft are LIFT_L1 to LIFT_R4. What it may
not carry is _SMRP or _RMRP, the radical of the frames the
package builds from it (the static and rotating moment reference
points of the rotor), because then a rotor and a frame spell the
same. PFS-2035.02 said a name ending in a digit is refused, which was
true of the frame names and would refuse the reference study
under these: the number in <ALIAS>_RMRP<k> follows RMRP, never
the alias.
Attributes:
| Name | Type | Description |
|---|---|---|
alias |
str
|
The word a row moves. It is the block's NAME, and this field is a restatement of it: a reference file may leave it out and the reader fills it in from the name before the block is built; stated, it must equal the name, case folded, and a block whose two names disagree is refused naming both. IT IS REQUIRED ON THE MODEL even though a file may omit it,
because everything downstream reads it as the rotor's identity:
it is the radical of the frames, the word written back into
MOVING_BC_ALIAS, and what a refusal names. An optional field left
None built frames called |
x_m, y_m, z_m |
float
|
The hub, in the geometry's own frame. |
axis |
str or mapping
|
A shaft letter or |
rpm_sign |
int
|
|
diameter_m |
float
|
The length an ADVANCE_RATIO resolves against, PER ROTOR: one ratio written once in the flight condition gives each rotor a speed of its own (FR-63). |
families_general |
list of str
|
What turns with the rotor and is NOT a blade, the spinner and the hub. It has no local axis of its own: its local frame IS the rotor's. |
families_blades |
list of str
|
One entry per blade, in positive right-hand order about the shaft. Planning checks readable mesh centroids against this order and names the list to write on a mismatch greater than a quarter blade pitch. RPM sign does not change this order. THE BLADE COUNT IS THE LENGTH OF THIS LIST, so a row states no blade count and a sector mesh carrying one blade of four still reduces over four. |
blade1 |
BladeDatum
|
Where blade one sits, and the axis its azimuth is measured from. |
id |
int
|
The rotor's integer id, 0 or more, unique within the reference,
default 0: the |
kind |
str
|
|
blade_count
property
¶
blade_count: int
The number of blades, which is the length of :attr:families_blades.
members
property
¶
members: list[str]
Everything the rotor owns, general families first, in the order written.
origin
property
¶
origin: tuple[float, float, float]
The hub, as the three coordinates a motion is built on.
axis_vector
property
¶
axis_vector: tuple[float, float, float]
The shaft direction as a UNIT vector, whichever way it was written.
Every frame the package builds for this rotor uses its declared axis rather than assuming zero pitch and toe.