pyflightstream.results.sectional_loads (provisional)¶
Generated from the docstrings at build time: every one of the 6 names in the __all__ of pyflightstream.results.sectional_loads has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
Sectional loads export parser: FS_SurfaceSection_Loads.txt (AD-10).
Pipeline role: the results row, beside the other export parsers. It reads
the sectional loads export FlightStream's post-processing script writes
(EXPORT_SURFACE_SECTIONAL_LOADS): the labeled header, the SI units the
file must assert, and the table Offset, Chord, X_QC, Z_QC, Fx, Fz,
Moment of line densities along the span, split into per-family blocks by
the creation-order bookkeeping of the code that made the distributions.
Why it lives here. It was defined in
:mod:pyflightstream.fsi.loads, the coupling's module, while
:mod:pyflightstream.results.tables tabulates the report it returns: the
two modules then imported each other, the one cycle between the results row
and a side branch. The parser is output parsing, which is this row's
subject, so it moved down; :mod:pyflightstream.fsi.loads re-exports every
name it had, and the coupling's refusal, :class:FsiInputError, is
defined in :mod:pyflightstream._errors because two layers now name it.
The results row imports nothing of fsi.
The physics of the file (line densities, the section-plane axes, the blade
attribution) is documented in :mod:pyflightstream.fsi.loads, which uses
the parsed report; parsing is anchor-based on the primitives of
:mod:pyflightstream.results (FR-16): labels and header rows, never line
offsets, and a missing structural terminator raises instead of returning a
silently shorter table (FR-17).
Advanced¶
pyflightstream.results.sectional_loads.EXPECTED_COLUMNS
module-attribute
¶
EXPECTED_COLUMNS = (
"Offset",
"Chord",
"X_QC",
"Z_QC",
"Fx",
"Fz",
"Moment",
)
pyflightstream.results.sectional_loads.FamilyMap
¶
Bases: Protocol
What :meth:SectionalLoadsReport.split reads of a family map.
:class:pyflightstream.fsi.loads.SectionFamilyMap is the one the
coupling builds; this row names it by the two things it reads, so it
imports nothing of fsi.
pyflightstream.results.sectional_loads.SectionBlock
dataclass
¶
SectionBlock(
family: str,
offset_m: ndarray,
chord_m: ndarray,
x_qc_m: ndarray,
z_qc_m: ndarray,
fx_n_per_m: ndarray,
fz_n_per_m: ndarray,
moment_qc_nm_per_m: ndarray,
)
The rows of one family, split out of the flat export.
All arrays share the family's section count. The force and moment rows are line densities along the span (RPT-006, module docstring): the SI assertion fixes the unit basis (Newtons), and integrating over the tributary widths recovers the integrated loads.
Attributes:
| Name | Type | Description |
|---|---|---|
family |
str
|
Family name from the :class: |
offset_m |
ndarray
|
Spanwise section positions [m], the radius from the rotation axis along the pitch axis. |
chord_m |
ndarray
|
Local chord [m]. |
x_qc_m, z_qc_m |
ndarray
|
Quarter-chord position in the section plane [m], export axes. |
fx_n_per_m, fz_n_per_m |
ndarray
|
Sectional force densities [N/m] along the two in-plane axes of the distribution's cut plane, in plane-name order (for the blade-frame XY distribution: axial, then in-plane). |
moment_qc_nm_per_m |
ndarray
|
The export's sectional moment density |
pyflightstream.results.sectional_loads.SectionalLoadsReport
dataclass
¶
SectionalLoadsReport(
angle_of_attack_deg: float,
sideslip_deg: float,
freestream_velocity_m_s: float,
time_increment_s: float | None,
solver_mode: str,
current_iteration: int,
reference_velocity_m_s: float | None,
reference_length_m: float | None,
reference_area_m2: float | None,
declared_section_count: int,
force_units: str,
moment_units: str,
columns: tuple[str, ...],
values: ndarray,
)
Typed content of one FS_SurfaceSection_Loads.txt export.
Attributes:
| Name | Type | Description |
|---|---|---|
angle_of_attack_deg, sideslip_deg |
float
|
Freestream angles [deg]. |
freestream_velocity_m_s |
float
|
Freestream velocity [m/s]; its label is an SI anchor. |
time_increment_s |
float or None
|
Unsteady time step [s], when printed. |
solver_mode |
str
|
|
current_iteration |
int
|
Solver iteration at export time; advancing values across coupling calls are the per-step freshness evidence (RPT-005). |
reference_velocity_m_s, reference_length_m, reference_area_m2 |
float or None
|
Coefficient normalization references, when printed. |
declared_section_count |
int
|
Count printed in the header; asserted equal to the table rows. |
force_units, moment_units |
str
|
Units printed in the footer, asserted SI at parse time. |
columns |
tuple of str
|
Table column names as printed. |
values |
ndarray
|
Full table, shape |
moment_qc_nm_per_m
property
¶
moment_qc_nm_per_m: ndarray
The export's sectional moment densities Moment [N m / m].
split
¶
split(family_map: FamilyMap) -> dict[str, SectionBlock]
Split the flat table into per-family blocks and cross-check.
The map's counts partition the rows in creation order; the offset and chord discontinuities expected at every block boundary are validated, so a map that places a boundary where the offsets and chords continue smoothly fails loudly instead of silently attributing sections to the wrong blade (RPT-005 finding 6). The check reads the geometry only: two blades with identical geometry (the same offsets and chords) cannot be told apart by it, so a map that swaps them is NOT detected, and the caller's creation order is the only authority for which blade is which.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family_map
|
SectionFamilyMap
|
Creation-order bookkeeping from the distribution-creating code. |
required |
Returns:
| Type | Description |
|---|---|
dict of str to SectionBlock
|
Blocks keyed by family name, in creation order. |
pyflightstream.results.sectional_loads.UnitsError
¶
Bases: PyflightstreamError, ValueError
The export does not carry the asserted SI units (FSI-R03).
Unit errors in the coupling loop are silent and produce plausible
wrong answers, so the parser refuses the file instead of scaling:
the post-processing script must compute the sectional loads with
COMPUTE_SURFACE_SECTIONAL_LOADS NEWTONS and the solver setup
must stay in SI.
pyflightstream.results.sectional_loads.parse_sectional_loads
¶
parse_sectional_loads(text: str) -> SectionalLoadsReport
Parse one FS_SurfaceSection_Loads.txt export.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Complete file text. |
required |
Returns:
| Type | Description |
|---|---|
SectionalLoadsReport
|
Typed table plus metadata. The SI assertions (FSI-R03) and the structural completeness checks (declared count, closing separator, units footer) run here; a file failing any of them raises instead of returning less. |
Raises:
| Type | Description |
|---|---|
AnchorNotFoundError
|
If the table header, or a labeled value other than the SI ones, is missing. |
UnitsError
|
If an SI label of the header is missing, the force unit is not Newtons or the moment unit is not Newton-Meter. |
IncompleteOutputError
|
If the units footer is missing or the table holds fewer rows than the file declares. |
FsiInputError
|
If the table columns are not the expected ones, or a row has the wrong width or an empty field. |
MalformedOutputError
|
If a printed number or count cannot be read, or the file prints
|