pyflightstream.cases.qsteady (stable)¶
Generated from the docstrings at build time: every one of the 43 names in the __all__ of pyflightstream.cases.qsteady has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
The quasi-steady rotor's own arithmetic: clocking, validity and the inflow.
The qsteady_rotor run type solves an isolated rotor with its blades held
still and the rotation carried by the free stream (SET_FREESTREAM ROTATION;
the command database's boundary_conditions.yaml entry cites FSM-26.124
p.326 and the RPT-052 rotating-free-stream sense measurement). Three questions it asks are
arithmetic and live here, below the builder that asks them:
- where the wheel is clocked for each steady solve (:func:
clocking_angles); - how far the quasi-steady assumption is from the flow, read as the 1P reduced
frequency along the blade (:func:
reduced_frequencies), from stations the mesh gives (:func:blade_stations, :func:obj_group_vertices) or the sectional loads export gives after the run; - whether a custom inflow varies with the radius alone (:func:
azimuthal_variation), which is what a periodic sector can stand for; - the momentum-theory induced inflow of a rotor state
(:func:
glauert_induced_inflow), which the wheel's correction routes read.
It also holds the point's quasi-steady record, <point>_qsteady.json, as one
type (:class:QsteadyRecord) with one reader (:func:read_qsteady_record) and
one refusal (:class:QsteadyRecordError), beside the name of the file
(:func:record_file_name): the builder writes it, the run and the post read it.
The 1P reduced frequency of a blade station at radius r with chord c is::
Omega = 2 pi RPM / 60 (rad/s)
V_rel = sqrt(V^2 + (Omega r)^2)
k = Omega c / (2 V_rel)
the once-per-revolution frequency of the load a non-uniform inflow puts on the
blade, made dimensionless by the time the relative flow takes to cross half a
chord. The 1P is counted in the blade's own frame: how many times ONE blade
meets the non-uniformity in one of its revolutions. It is not the blade-passing
excitation a fixed surface near the rotor feels, nor what a balance summing
every blade reads. Below about 0.05 the flow at the station follows the load's change as
it happens and a steady solution stands for it; above about 0.1 the lag of the
unsteady wake is no longer small and the quasi-steady load is an estimate.
This module imports nothing from a higher layer; the builder in
:mod:pyflightstream.cases.workflows, the run and the post stage call it.
Advanced¶
pyflightstream.cases.qsteady.AXISYMMETRY_RADIUS_TOLERANCE
module-attribute
¶
AXISYMMETRY_RADIUS_TOLERANCE = 0.0001
pyflightstream.cases.qsteady.AXISYMMETRY_SPEED_TOLERANCE
module-attribute
¶
AXISYMMETRY_SPEED_TOLERANCE = 0.001
pyflightstream.cases.qsteady.HARMONIC_AMPLITUDE_FLOOR_DEG
module-attribute
¶
HARMONIC_AMPLITUDE_FLOOR_DEG = 0.001
pyflightstream.cases.qsteady.HARMONIC_VARIANCE_SHARE
module-attribute
¶
HARMONIC_VARIANCE_SHARE = 0.95
pyflightstream.cases.qsteady.InflowHarmonics
dataclass
¶
InflowHarmonics(
radii_m: tuple[float, ...],
n95: tuple[int, ...],
k_1p: tuple[float, ...] | None,
strips_m: tuple[float, ...],
blades: int,
)
The harmonic content of a custom inflow as one blade of a wheel meets it.
Attributes:
| Name | Type | Description |
|---|---|---|
radii_m, n95 |
tuple
|
Per station: its radius and the harmonic order holding 95 per cent of
its angle-of-attack perturbation (:func: |
k_1p |
tuple of float or None
|
Per station, the 1P reduced frequency, where the chord is known. |
strips_m |
tuple of float
|
The span each station stands for (:func: |
blades |
int
|
|
pyflightstream.cases.qsteady.QsteadyClocking
dataclass
¶
QsteadyClocking(
index: int,
clocking_deg: float,
rotated_deg: float,
loads: str,
section_exports: Mapping[str, str] | None = None,
)
One clocking a quasi-steady point was solved at, as its record states it.
clocking_deg is where blade one was turned to, in the sense of the
rotation; rotated_deg is the signed angle the surfaces were rotated
by; loads is the loads export that clocking's solve wrote.
section_exports is, for a wheel that declares section
distributions only, the file of each section export that clocking wrote,
keyed by its export kind (sectional_loads, sections,
plot_sections_cp); None for every other record, which then holds no
such key.
pyflightstream.cases.qsteady.QsteadyRecord
dataclass
¶
QsteadyRecord(
case: str,
rotor_alias: str,
blades: int,
rpm: float,
shaft_frame_axis: str,
hub_m: tuple[float, float, float],
axis_vector: tuple[float, float, float],
diameter_m: float,
families_general: tuple[str, ...],
families_blades: tuple[str, ...],
blade1_azimuth_deg: float,
positions: tuple[QsteadyClocking, ...],
validity: Mapping[str, Any] | None,
moment_point_m: tuple[float, float, float]
| None = None,
)
The point's quasi-steady record, <point>_qsteady.json, as one type.
The builder makes one and parks :meth:to_text beside the point's loads
export; the run and the post read it back with :func:read_qsteady_record.
One field per key of the file, except rotor, held as
:attr:rotor_alias because it is the ALIAS of the rotor block the point
was built for, a name, and not that block (see
:func:qsteady_record_rotor_alias). validity is the plan's validity
record as the builder computed it, kept as it was written, or None where
the plan estimated none (a sector).
Examples:
>>> record = QsteadyRecord(
... case="sector", rotor_alias="PROP", blades=3, rpm=1200.0, shaft_frame_axis="X",
... hub_m=(0.0, 0.0, 0.0), axis_vector=(1.0, 0.0, 0.0), diameter_m=2.0,
... families_general=(), families_blades=("Blade1", "Blade2", "Blade3"),
... blade1_azimuth_deg=0.0,
... positions=(QsteadyClocking(0, 0.0, 0.0, "DP.txt"),), validity=None,
... )
>>> [clocking.index for clocking in record.solve_order()]
[0]
>>> record.as_json()["rotor"]
'PROP'
solve_order
¶
solve_order() -> tuple[QsteadyClocking, ...]
Return the clockings in the order the run solved them: 1 to k - 1, then 0.
Clocking 0 is solved LAST, with the point's full export set, so that
the solver log and the loads export the run judges the point by are
of one solve (cases/workflows/_qsteady_rotor.py::_build_qsteady_rotor).
as_json
¶
as_json() -> dict[str, Any]
Return the record as its file holds it, key for key and in the file's order.
to_text
¶
to_text() -> str
Return the record's file: the JSON of :meth:as_json, indented by two, one newline.
pyflightstream.cases.qsteady.QsteadyRecordError
¶
Bases: PyflightstreamError, ValueError
A point's quasi-steady record is missing, unreadable, or of no schema this package writes.
The one refusal of :func:read_qsteady_record, whatever is wrong with the
file, so that the callers, and not the reader, decide what the point
loses: the run judges the point's solver log as one solve and records a
warning on the point; the post leaves out each product that needs the
record and names it in products.json and post.log.
pyflightstream.cases.qsteady.RECORD_CASES
module-attribute
¶
RECORD_CASES: tuple[str, ...] = ('sector', 'wheel')
pyflightstream.cases.qsteady.REDUCED_FREQUENCY_LIMIT
module-attribute
¶
REDUCED_FREQUENCY_LIMIT = 0.1
pyflightstream.cases.qsteady.REDUCED_FREQUENCY_WATCH
module-attribute
¶
REDUCED_FREQUENCY_WATCH = 0.05
pyflightstream.cases.qsteady.ReducedFrequencies
dataclass
¶
ReducedFrequencies(
radii_m: tuple[float, ...],
chords_m: tuple[float, ...],
k: tuple[float, ...],
strips_m: tuple[float, ...],
source: str,
)
The 1P reduced frequency of every station of one blade, and its summaries.
Attributes:
| Name | Type | Description |
|---|---|---|
radii_m, chords_m, k, strips_m |
tuple of float
|
Per station, in ascending radius: where it is, its chord, its reduced
frequency and the span it stands for (:func: |
source |
str
|
Where the chords came from: |
pyflightstream.cases.qsteady.VALIDITY_FILE_SUFFIX
module-attribute
¶
VALIDITY_FILE_SUFFIX = '_qsteady_validity.json'
pyflightstream.cases.qsteady.azimuthal_variation
¶
azimuthal_variation(
rows: Sequence[Sequence[float]],
*,
hub: Sequence[float],
axis: Sequence[float],
relative: float = AXISYMMETRY_SPEED_TOLERANCE,
radius_relative: float = AXISYMMETRY_RADIUS_TOLERANCE,
) -> str | None
Say why an inflow field varies with azimuth, or None when it varies with radius alone.
The field's rows are x y z vx vy vz in one frame. Each row's velocity
is read in the shaft's cylindrical frame, axial, radial and swirl; rows at
the same radius, to radius_relative of the largest radius, must state
the same three components, to relative of the largest speed. A field
in which no two rows share a radius cannot show that it varies with the
radius alone and is named too, because a row is refused rather than
guessed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
sequence of (x, y, z, vx, vy, vz)
|
The field, in metres and metres per second. |
required |
hub
|
(x, y, z)
|
A point of the shaft and its direction. |
required |
axis
|
(x, y, z)
|
A point of the shaft and its direction. |
required |
relative
|
float
|
The speed tolerance, a fraction of the field's largest speed; by
default :data: |
AXISYMMETRY_SPEED_TOLERANCE
|
radius_relative
|
float
|
The ring tolerance, a fraction of the largest radius; by default
:data: |
AXISYMMETRY_RADIUS_TOLERANCE
|
Returns:
| Type | Description |
|---|---|
str or None
|
The reason, naming the two rows' radius and components and the tolerance, or None. |
pyflightstream.cases.qsteady.blade_inflow_angles
¶
blade_inflow_angles(
rows: Sequence[Sequence[float]],
*,
hub: Sequence[float],
axis: Sequence[float],
omega_rad_s: float,
radius_m: float,
samples: int = AZIMUTH_SAMPLES,
) -> tuple[Any, Any]
Return the inflow angle and the relative speed one blade meets round one revolution.
The reading :func:blade_inflow_harmonics takes at each radius, public
so the tools that go beyond n95 (the per-harmonic shares and
the reduced frequency of :mod:pyflightstream.post.inflow_tools) read
the field ONE way. At each of samples azimuths the TOTAL velocity is
read, the velocity relative to the turning blade composed,
w = v - Omega axis x (p - hub), and phi = atan2(w_axial,
w_tangential) taken with the tangential component counted against the
blade's motion. The azimuth is positive in the sense of omega_rad_s.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
sequence of (x, y, z, vx, vy, vz)
|
The field, in metres and metres per second, in one frame. |
required |
hub
|
(x, y, z)
|
A point of the shaft, in metres, in that frame. |
required |
axis
|
(x, y, z)
|
The shaft's direction in that frame. |
required |
omega_rad_s
|
float
|
The rotor's angular speed in radians per second, signed by its hand about |
required |
radius_m
|
float
|
The radius the blade section is carried round at, in metres. |
required |
samples
|
int
|
Azimuths per revolution, :data: |
AZIMUTH_SAMPLES
|
Returns:
| Type | Description |
|---|---|
(ndarray, ndarray)
|
|
pyflightstream.cases.qsteady.blade_inflow_harmonics
¶
blade_inflow_harmonics(
rows: Sequence[Sequence[float]],
*,
hub: Sequence[float],
axis: Sequence[float],
omega_rad_s: float,
radii_m: Sequence[float],
samples: int = AZIMUTH_SAMPLES,
) -> tuple[int, ...]
Return n95 of the angle-of-attack perturbation one blade meets at each radius.
At each radius the blade is carried once round the disc: at every one of
samples azimuths the field's TOTAL velocity v there is read (a
quadratic fitted to its twelve nearest rows in the disc plane,
:func:_sample_velocities, an estimate that smooths a feature finer than
the field's own spacing), the velocity relative to the turning blade is
composed, w = v - Omega axis x (p - hub), and its inflow angle is
taken, phi = atan2(w_axial, w_tangential) with the tangential
component counted against the blade's motion. The perturbation is phi
less its mean over the revolution (the angle of attack moves by minus
that), and :func:harmonic_order counts its harmonics of at least
:data:HARMONIC_AMPLITUDE_FLOOR_DEG, so a field the blade meets as a
constant gives 0. The count is in the BLADE's frame (the section's
comment above says what it is not).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
sequence of (x, y, z, vx, vy, vz)
|
The field, in metres and metres per second, in one frame. |
required |
hub
|
(x, y, z)
|
A point of the shaft and its direction, in that frame. |
required |
axis
|
(x, y, z)
|
A point of the shaft and its direction, in that frame. |
required |
omega_rad_s
|
float
|
The rotor's angular speed, signed by its hand about |
required |
radii_m
|
sequence of float
|
The stations. |
required |
samples
|
int
|
Azimuths per revolution. |
AZIMUTH_SAMPLES
|
Returns:
| Type | Description |
|---|---|
tuple of int
|
|
pyflightstream.cases.qsteady.blade_stations
¶
blade_stations(
vertices: Iterable[Sequence[float]],
*,
hub: Sequence[float],
axis: Sequence[float],
count: int = DEFAULT_STATIONS,
) -> tuple[
tuple[float, ...], tuple[float, ...], tuple[float, ...]
]
Estimate a blade's chord at count radial stations from its surface vertices.
The blade's span, from its innermost to its outermost vertex measured from
the shaft, is cut into count equal bands; each band's vertices are laid
on the plane of the shaft and the band's tangential direction, and the
chord is the section's largest width in that plane, measured over
:data:_WIDTH_DIRECTIONS directions. A band holding fewer than two
vertices gives no station. It is a GEOMETRIC ESTIMATE: the largest width
of a cambered, twisted section approximates its leading-edge to trailing-edge
distance for a thin section; thickness and camber can change that width. The band's radial
width adds nothing because it is removed by the projection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vertices
|
iterable of (x, y, z)
|
One blade's surface vertices, in metres. |
required |
hub
|
(x, y, z)
|
A point of the shaft and its direction, in the same frame. |
required |
axis
|
(x, y, z)
|
A point of the shaft and its direction, in the same frame. |
required |
count
|
int
|
How many bands the span is cut into. |
DEFAULT_STATIONS
|
Returns:
| Type | Description |
|---|---|
tuple of (radii, chords, band_widths)
|
Per station with two vertices or more, the band's mid radius and the chord estimate and full band width, in metres, in ascending radius. |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
No vertex, a span of no length, or a count other than an integer of at least one. |
pyflightstream.cases.qsteady.clocking_angles
¶
clocking_angles(
blades: int, positions: int
) -> tuple[float, ...]
Return the clocking of each steady solve, theta_i = i * (360 / N) / k, in deg.
The positions are uniform inside ONE blade passage, the arc 360 / N
between two blades, because an axisymmetric wheel of N identical blades
repeats itself every passage: a clocking outside it is one inside it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blades
|
int
|
|
required |
positions
|
int
|
|
required |
Returns:
| Type | Description |
|---|---|
tuple of float
|
|
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
A count that is not a positive integer. |
Examples:
>>> clocking_angles(6, 3)
(0.0, 20.0, 40.0)
pyflightstream.cases.qsteady.glauert_induced_inflow
¶
glauert_induced_inflow(
ct: float,
mu: float,
lambda_c: float,
*,
tolerance: float = INFLOW_TOLERANCE,
iterations: int | None = None,
) -> float | None
Return the momentum-theory induced inflow lambda_i of a rotor state, or None.
Glauert's relation for a rotor of thrust coefficient ct (rotor
convention, T / (rho A (Omega R)^2)), advance ratio mu and climb
inflow lambda_c, both over the tip speed Omega R::
lambda_i = ct / (2 sqrt(mu^2 + (lambda_c + lambda_i)^2))
solved by Newton's method on
f(l) = l - ct / (2 sqrt(mu^2 + (lambda_c + l)^2)) from the hover value
sign(ct) sqrt(|ct| / 2), until both the step and the equation residual
at the updated iterate are no larger than tolerance
(:data:INFLOW_TOLERANCE). A thrust of zero induces nothing and is 0.
None where it does not converge in iterations steps
(:data:INFLOW_ITERATIONS where not given), where a step is not a finite
number, or where an input is not one: momentum theory then states no
inflow, which is typical of a rotor descending into its own wake, and a
caller writes NA rather than the last iterate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ct
|
float
|
Thrust coefficient in rotor convention, |
required |
mu
|
float
|
Advance ratio over the tip speed. |
required |
lambda_c
|
float
|
Climb inflow over the tip speed. |
required |
tolerance
|
float
|
The largest step and residual taken as converged, :data: |
INFLOW_TOLERANCE
|
iterations
|
int
|
The most Newton steps taken, :data: |
None
|
Returns:
| Type | Description |
|---|---|
float or None
|
|
Examples:
Axial climb, mu = 0: l (lambda_c + l) = ct / 2, so
l = -lambda_c / 2 + sqrt(lambda_c^2 / 4 + ct / 2).
>>> round(glauert_induced_inflow(0.01, 0.0, 0.05), 12)
0.05
>>> glauert_induced_inflow(0.0, 0.2, 0.01)
0.0
>>> glauert_induced_inflow(0.01, 0.1, 0.0, iterations=1) is None
True
pyflightstream.cases.qsteady.harmonic_order
¶
harmonic_order(
signal: Sequence[float],
*,
share: float = HARMONIC_VARIANCE_SHARE,
floor: float = 0.0,
) -> int
Return n95: the smallest n whose harmonics 1 to n hold share of the variance.
signal is one revolution sampled uniformly in azimuth; its mean is
removed first. The variance of each harmonic is read off the discrete
Fourier transform (Parseval: 2 |X_n|^2 for every bin below Nyquist,
|X_n|^2 at it, over N^2). A harmonic whose amplitude (2 |X_n| /
N, |X_n| / N at Nyquist, in the signal's units) is below floor is
not counted, and the share is of the harmonics that are. A signal with no
variation, or none above floor, holds no harmonic and gives 0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signal
|
sequence of float
|
One revolution sampled uniformly in azimuth. |
required |
share
|
float
|
The share of the variance to hold, :data: |
HARMONIC_VARIANCE_SHARE
|
floor
|
float
|
The amplitude below which a harmonic is not counted, in the signal's units. |
0.0
|
Returns:
| Type | Description |
|---|---|
int
|
|
Examples:
>>> import math
>>> psi = [2 * math.pi * i / 360 for i in range(360)]
>>> harmonic_order([math.cos(3 * p) for p in psi])
3
>>> harmonic_order([math.cos(3 * p) + 1e-4 * math.cos(40 * p) for p in psi], floor=1e-3)
3
>>> harmonic_order([1e-4 * math.cos(40 * p) for p in psi], floor=1e-3)
0
pyflightstream.cases.qsteady.harmonic_variance_shares
¶
harmonic_variance_shares(
signal: Sequence[float], *, floor: float = 0.0
) -> Any
Return the share of the variance each harmonic 1, 2, ... holds, as an array.
The rule of :func:harmonic_order (Parseval on the discrete Fourier
transform of the mean-removed revolution, a harmonic below floor in
amplitude not counted, the shares of those counted adding to 1), split
out so the per-harmonic shares and n95 are one computation. A signal
with no variation, or none above floor, gives all zeros; fewer than
two samples give an empty array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signal
|
sequence of float
|
One revolution sampled uniformly in azimuth. |
required |
floor
|
float
|
The amplitude below which a harmonic is not counted, in the signal's units. |
0.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The share of the counted variance each harmonic 1, 2, ... holds; all zeros with no counted harmonic, empty for fewer than two samples. |
Examples:
>>> import math
>>> psi = [2 * math.pi * i / 360 for i in range(360)]
>>> [round(float(s), 3) for s in harmonic_variance_shares(
... [math.cos(p) + math.cos(2 * p) for p in psi])[:3]]
[0.5, 0.5, 0.0]
pyflightstream.cases.qsteady.obj_group_vertices
¶
obj_group_vertices(
path: str | Path, *, metres_per_unit: float
) -> dict[str, list[Vector]]
Return each o/g group of an OBJ file with the vertices its faces use, in metres.
A vertex belongs to a group when a face of that group cites it; a vertex cited by two groups is in both. Negative (relative) face indices are read as the format defines them. A line the reader does not use is passed over.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
The OBJ file. |
required |
metres_per_unit
|
float
|
The file's length unit in metres; every vertex is multiplied by it. |
required |
Returns:
| Type | Description |
|---|---|
dict of str to list of (float, float, float)
|
Group name to the vertices its faces cite, in metres, in index order. |
Raises:
| Type | Description |
|---|---|
(OSError, UnicodeError)
|
The file cannot be read. |
ValueError
|
A vertex or a face index is not a number. |
CampaignConfigError
|
A face index is out of range; this is also a ValueError. |
pyflightstream.cases.qsteady.position_export_name
¶
position_export_name(
name: str, suffix: str, index: int
) -> str
Return export name of clocking index: the position before its kind's suffix.
A wheel exports its section distributions at every clocking, and each
clocking's file keeps the suffix that says which kind of export it is, so
_qs<i> goes in front of that suffix and never after it: a sectional
loads export of clocking 2 still ends _sloads.txt. For the loads table
(suffix .txt) this is :func:position_loads_name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The point's export name. |
required |
suffix
|
str
|
The suffix that says which kind of export it is. |
required |
index
|
int
|
The clocking's index, written with two digits. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The name with |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
If |
Examples:
>>> position_export_name("DP_AL+050_sloads.txt", "_sloads.txt", 2)
'DP_AL+050_qs02_sloads.txt'
>>> position_export_name("DP_AL+050.txt", ".txt", 3) == position_loads_name("DP_AL+050.txt", 3)
True
pyflightstream.cases.qsteady.position_loads_name
¶
position_loads_name(loads: str, index: int) -> str
Return the loads export of clocking index, beside the point's own loads export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loads
|
str
|
The point's own loads export. |
required |
index
|
int
|
The clocking's index, written with two digits. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The loads export's name with |
Examples:
>>> position_loads_name("DP_AL+050.txt", 3)
'DP_AL+050_qs03.txt'
pyflightstream.cases.qsteady.qsteady_record_rotor_alias
¶
qsteady_record_rotor_alias(data: Mapping[str, Any]) -> str
Return the rotor alias a quasi-steady record's JSON object names.
rotor in <point>_qsteady.json is the alias the builder
(cases/workflows/_qsteady_rotor.py::_park_the_qsteady_record) wrote, the NAME of the
rotor block the point was built for; it is not a read of the recorded
rotor block itself and shares that word by coincidence of vocabulary
(PFS-2030.03.02). The record's reader takes it here, and every other
module reads :attr:QsteadyRecord.rotor_alias.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
mapping of str to object
|
The record's JSON object. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The rotor alias under |
Raises:
| Type | Description |
|---|---|
QsteadyRecordError
|
The object names no alias: the key is absent, or not a non-empty string. |
Examples:
>>> qsteady_record_rotor_alias({"rotor": "PROP"})
'PROP'
pyflightstream.cases.qsteady.read_qsteady_record
¶
read_qsteady_record(
loads_path: str | Path,
) -> QsteadyRecord
Return the quasi-steady record the run wrote beside a point's loads export.
The one reader of <point>_qsteady.json (:func:record_file_name of the
loads export's name, in the loads export's folder), for the run and the
post alike.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loads_path
|
str or Path
|
The point's own loads export; the record is read from beside it. |
required |
Returns:
| Type | Description |
|---|---|
QsteadyRecord
|
The parsed record. |
Raises:
| Type | Description |
|---|---|
QsteadyRecordError
|
The record is not on disk, cannot be read or parsed as JSON, is of
another schema than :data: |
pyflightstream.cases.qsteady.record_file_name
¶
record_file_name(loads: str) -> str
Return the quasi-steady record's name, beside the point's own loads export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loads
|
str
|
The point's own loads export. |
required |
Returns:
| Type | Description |
|---|---|
str
|
|
Examples:
>>> record_file_name("DP_AL+050.txt")
'DP_AL+050_qsteady.json'
pyflightstream.cases.qsteady.reduced_frequencies
¶
reduced_frequencies(
radii_m: Sequence[float],
chords_m: Sequence[float],
*,
omega_rad_s: float,
velocity_m_per_s: float,
source: str,
band_widths_m: Sequence[float] | None = None,
) -> ReducedFrequencies
Return the reduced frequency of every station, sorted by radius.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radii_m
|
sequence of float
|
The stations' radii, in metres. |
required |
chords_m
|
sequence of float
|
The chord at each station, in metres. |
required |
omega_rad_s
|
float
|
The rotor's angular speed in radians per second. |
required |
velocity_m_per_s
|
float
|
The free-stream speed in metres per second. |
required |
source
|
str
|
Where the chords came from, |
required |
band_widths_m
|
sequence of float
|
Full widths of mesh bands, in station order. Nodal sections omit this and retain midpoint strips with half-width end stations. |
None
|
Returns:
| Type | Description |
|---|---|
ReducedFrequencies
|
The stations sorted by radius with their chords, reduced frequencies and strip lengths. |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
No station, or radii and chords of different counts. |
pyflightstream.cases.qsteady.reduced_frequency
¶
reduced_frequency(
*,
omega_rad_s: float,
chord_m: float,
radius_m: float,
velocity_m_per_s: float,
) -> float
Return the 1P reduced frequency k = Omega c / (2 V_rel) of one station.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
omega_rad_s
|
float
|
The rotor's angular speed; its sign is the hand and is not read. |
required |
chord_m
|
float
|
The station's chord, zero or more. |
required |
radius_m
|
float
|
The station's distance from the shaft. |
required |
velocity_m_per_s
|
float
|
The free-stream speed. |
required |
Returns:
| Type | Description |
|---|---|
float
|
|
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
A quantity that is not finite, a negative chord, or a station the flow
does not reach ( |
Examples:
>>> round(reduced_frequency(omega_rad_s=100.0, chord_m=0.2, radius_m=1.0,
... velocity_m_per_s=0.0), 6)
0.1
pyflightstream.cases.qsteady.strip_lengths
¶
strip_lengths(radii: Sequence[float]) -> tuple[float, ...]
Return the length of span each station stands for, by the midpoint rule.
A strip runs from the midpoint to the previous station to the midpoint to the next; the first and the last are half strips. The stations are read in the order given, which is ascending radius.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radii
|
sequence of float
|
The stations' radii, ascending, in any length unit. |
required |
Returns:
| Type | Description |
|---|---|
tuple of float
|
The span each station stands for, in the radii's unit; |
pyflightstream.cases.qsteady.suggested_passage_positions
¶
suggested_passage_positions(n_max: int, blades: int) -> int
Return the fewest clockings holding the rotor total's harmonics: n_max / N + 1, up.
The rotor total carries only the multiples of N of one blade's
harmonics, and the clockings sample one blade passage, so k clockings
integrate the mean exactly through harmonic (k - 1) N. This does not
resolve those harmonics' sine and cosine amplitudes; the count
that reaches n_max is the smallest whole k >= n_max / N + 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_max
|
int
|
The highest per-blade harmonic to hold. |
required |
blades
|
int
|
The blade count N. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The smallest whole |
Examples:
>>> suggested_passage_positions(1, 3), suggested_passage_positions(6, 6)
(2, 2)
>>> suggested_passage_positions(0, 6), suggested_passage_positions(7, 6)
(1, 3)
pyflightstream.cases.qsteady.summarise
¶
summarise(record: Mapping[str, object]) -> str
Return the four values the plan shows for one point, in one line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
mapping of str to object
|
One point's reduced-frequency record, with |
required |
Returns:
| Type | Description |
|---|---|
str
|
The four values in one line. |
Examples:
>>> summarise({"span_pct_k_gt_0_1": 12.5, "k_min": 0.01, "k_max": 0.2, "k_mean": 0.05})
'k > 0.1 over 12.5 % of the span, k min 0.0100, k max 0.2000, k mean 0.0500'
pyflightstream.cases.qsteady.summarise_inflow_harmonics
¶
summarise_inflow_harmonics(
record: Mapping[str, object],
) -> str
Return the words the plan prints for one point's inflow_fft record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
mapping of str to object
|
One point's |
required |
Returns:
| Type | Description |
|---|---|
str
|
The harmonic order and the suggested clockings, then the effective reduced frequency or why it was not computed, separated by a semicolon. |
Examples:
>>> words = summarise_inflow_harmonics({"n_max": 4, "suggested_passage_positions": 2,
... "passage_positions": 2, "span_pct_k_eff_gt_0_1": 25.0, "k_eff_min": 0.02,
... "k_eff_max": 0.3, "k_eff_mean": 0.1})
>>> for part in words.split("; "):
... print(part)
inflow harmonics (per blade, nP): n_max 4, suggested PASSAGE_POSITIONS >= 2 (stated 2)
k_eff > 0.1 over 25.0 % of the span, k_eff min 0.0200, k_eff max 0.3000, k_eff mean 0.1000
pyflightstream.cases.qsteady.validity_file_name
¶
validity_file_name(loads: str) -> str
Return the post's per-point validity file's name, beside the point's own loads export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
loads
|
str
|
The point's own loads export. |
required |
Returns:
| Type | Description |
|---|---|
str
|
|
Examples:
>>> validity_file_name("DP_AL+050.txt")
'DP_AL+050_qsteady_validity.json'