pyflightstream.fsi.loads (stable)¶
Generated from the docstrings at build time: every one of the 8 names in the __all__ of pyflightstream.fsi.loads has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
Sectional loads parser and elastic-axis moment transfer (WP2, DLV-007).
Pipeline role: per coupling call FlightStream's post-processing script
exports FS_SurfaceSection_Loads.txt (sectional forces in Newtons
and moments); this module parses that file
(through :mod:pyflightstream.results.sectional_loads, where the parser
is defined and which this module re-exports), splits the
flat table into per-blade blocks, and transfers the moments
from the pitch axis to the elastic axis, delivering the aerodynamic
load set the beam solve consumes.
Everything here is anchored on the WP1 dry-run evidence
(reports/RPT-005, fixtures in tests/tier1_offline/fixtures/fsi/):
- The file carries the standard labeled FlightStream header; the SI
assertion (FSI-R03) anchors on the unit-carrying labels
(
Freestream velocity (m/s),Reference area (m^2)) and on theForce Units/Moment Unitsfooter, which must read Newtons and Newton-Meter because the post-processing script computes the loads withCOMPUTE_SURFACE_SECTIONAL_LOADS NEWTONS. - The data table is
Offset, Chord, X_QC, Z_QC, Fx, Fz, Momentper section. The moment's point is stated in docs/definitions/the-sections-table-and-which-row-is-which.md: not the section's quarter chord where it was measured, a wing's XZ cut, so that route moves it there (:func:project_wing_frame_loads); a rotating blade is not measured. The rows are line densities along the span: despite the footer naming the computation unit (Newtons versus coefficients), integrating the force columns over the tributary widths reproduces the integrated axial force of the same run to a few percent, while summing them overshoots by the inverse width (WP7 near-rigid pilot evidence, RPT-006). Forces are therefore [N/m] and moments [N m / m], and the totals cross-check integrates, never sums. - Section-plane axes, on the same pilot evidence: the export
Fxis the axial (rotor axis) component, invariant under the blade rotation and matching the integrated Cx, andFzis the in-plane component in the rotating blade frame. The mapping onto the chordwise/normal axes of :mod:pyflightstream.fsi.configtherefore involves the local blade angle; the rotor moment sign is corroborated by the soft-blade pilot response (RPT-007), as :func:project_rotor_frame_loadsstates. - Blade attribution follows the family-per-blade convention
(RPT-005 finding 6): one geometry family per blade, one section
distribution per blade boundary, and the flat export concatenates
the families in creation order. Attribution is therefore bookkeeping
owned by the code that creates the distributions, serialized as a
:class:
SectionFamilyMap; the offset and chord discontinuities at the block boundaries are the parser's cross-check.
Unlike the loads spreadsheet, this export's footer carries no version or build line (observed in the committed fixtures); build traceability of a coupled run lives in the run manifest (FR-19).
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.fsi.loads.ElasticAxisLoads
dataclass
¶
ElasticAxisLoads(
radius_m: ndarray,
chord_m: ndarray,
force_chordwise_n_per_m: ndarray,
force_normal_n_per_m: ndarray,
moment_pa_nm_per_m: ndarray,
moment_ea_nm_per_m: ndarray,
ea_offset_chordwise_m: ndarray,
ea_offset_normal_m: ndarray,
tributary_width_m: ndarray,
)
Per-section aerodynamic load densities of one blade, about its EA.
All arrays share the block's section count and are line densities along the span (RPT-006), ready for the beam's distributed-load interface; the tributary widths integrate them back to totals.
Attributes:
| Name | Type | Description |
|---|---|---|
radius_m |
ndarray
|
Section radii [m] from the rotation axis along the pitch axis. |
chord_m |
ndarray
|
Local chords [m]. |
force_chordwise_n_per_m |
ndarray
|
Force densities [N/m] projected toward the section leading edge; section-frame exports are unprojected unless station rotation is supplied. |
force_normal_n_per_m |
ndarray
|
Force densities [N/m] toward the section suction side, with the same frame rule. |
moment_pa_nm_per_m |
ndarray
|
Nose-up moment densities about the pitch axis [N m / m]. The export moment is negated in the rotor-frame projection, moved to the pitch axis in the wing-frame route and retained in the section-frame one. With station rotation, it is additionally scaled by cos(arctan(slope)), where slope is the interpolated deflection gradient; twist rotates the forces but does not scale this moment. |
moment_ea_nm_per_m |
ndarray
|
Moment densities about the elastic axis [N m / m] (FSI-R04). |
ea_offset_chordwise_m, ea_offset_normal_m |
ndarray
|
Interpolated elastic-axis offsets e(r) [m], from the pitch axis to the elastic axis as configured; the transfer uses their negative, the offset from the elastic axis to the pitch axis where the forces act. |
tributary_width_m |
ndarray
|
Spanwise width [m] of each section's midpoint strip; integrates the densities back to totals for cross-checks. |
pyflightstream.fsi.loads.SectionFamily
¶
Bases: BaseModel
One section distribution of the flat export, in creation order.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Family label, for example the blade name; unique within a map. |
count |
int
|
Number of sections the distribution creates (its block size in the flat export). |
is_blade |
bool
|
Whether the family is a blade the structural solve consumes; non-blade families (a hub, a nacelle) are split and cross-checked but never fed to a beam. |
pyflightstream.fsi.loads.SectionFamilyMap
¶
Bases: BaseModel
Creation-order bookkeeping of the section distributions.
The flat loads export concatenates the per-boundary families in creation order (RPT-005 finding 6), so the code that creates the distributions is the single source of truth for attribution. That code emits this map; the parser only splits and cross-checks.
Attributes:
| Name | Type | Description |
|---|---|---|
families |
list of SectionFamily
|
Families in creation order. |
uniform
classmethod
¶
uniform(
blade_count: int, sections_per_blade: int
) -> SectionFamilyMap
Build the map of identical per-blade distributions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blade_count
|
int
|
Number of blades, one family each, created in blade order. |
required |
sections_per_blade
|
int
|
Sections of every distribution. |
required |
pyflightstream.fsi.loads.cross_check_totals
¶
cross_check_totals(
block: SectionBlock,
integrated_fx_n: float,
integrated_fz_n: float,
rel_tol: float = 0.05,
) -> dict[str, float]
Cross-check a block's integrated densities against total forces.
The force densities integrated over the tributary widths must
reproduce the loads FlightStream reports for the same boundary in
the same run, in Newtons and in a comparable frame component
(RPT-006: the axial component is the frame-invariant one for a
rotating blade); a disagreement beyond rel_tol means the
sections do not cover the boundary, the attribution is wrong, or
the per-span unit finding no longer holds, and raises instead of
letting a mis-scaled load set into the structural solve. The coupling
driver invokes this check when matching totals are staged in
fsi_totals.json; without that file this remains an offline utility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
SectionBlock
|
One family block. |
required |
integrated_fx_n
|
float
|
Integrated forces [N] of the matching boundary from the same run, in the components matching the export axes. |
required |
integrated_fz_n
|
float
|
Integrated forces [N] of the matching boundary from the same run, in the components matching the export axes. |
required |
rel_tol
|
float
|
Allowed relative disagreement, on the larger of the compared magnitudes; the default reflects the few-percent closure of the pilot evidence (tip and root strips, frame effects). |
0.05
|
Returns:
| Type | Description |
|---|---|
dict of str to float
|
Relative deltas per component ( |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If a component's integrated density disagrees with the export's total beyond |
pyflightstream.fsi.loads.project_rotor_frame_loads
¶
project_rotor_frame_loads(
fx_n_per_m: ndarray,
fz_n_per_m: ndarray,
moment_qc_nm_per_m: ndarray,
blade_angle_rad: ndarray,
) -> tuple[np.ndarray, np.ndarray, np.ndarray]
Project cut-plane load densities onto the section axes (rotor frame).
f_chordwise = -Fx sin b - Fz cos b (toward the leading edge), f_normal = -Fx cos b + Fz sin b (toward the suction side), and m_nose_up = -Moment. In the rotor import frame (X axial, Y in-plane, Z span; RPT-006 finding 3) the section chordwise and suction directions at local blade angle b are (-sin b, -cos b) and (-cos b, sin b); nose-up is the rotation about -Z for this geometry, and the export's moment column is positive about +Z, physically nose-down (the dry-run fixture's +7 to +13 N m/m match the nose-down |Cm| q c^2 of the cambered generic section). The sign is corroborated by the soft-blade pilot response (RPT-007). Inputs broadcast; densities in N/m and N m / m, angles in rad.
Source: rigid-section geometry of the rotor-frame embedding (RPT-006 finding 3); load assembly of DLV-007 Section 4.2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fx_n_per_m
|
ndarray
|
The cut-plane Fx force density [N/m]. |
required |
fz_n_per_m
|
ndarray
|
The cut-plane Fz force density [N/m]. |
required |
moment_qc_nm_per_m
|
ndarray
|
The export's moment density [N m / m], positive about +Z, read as the moment about the pitch axis: the blade's frame holds that axis, and whether the export's point is on it is not measured for a rotating blade. |
required |
blade_angle_rad
|
ndarray
|
The local blade angle b [rad]. |
required |
Returns:
| Type | Description |
|---|---|
tuple of numpy.ndarray
|
|
Warns:
| Type | Description |
|---|---|
PyflightstreamWarning
|
The rotating blade's moment reference relative to its pitch axis is unverified. |
pyflightstream.fsi.loads.project_wing_frame_loads
¶
project_wing_frame_loads(
fx_n_per_m: ndarray,
fz_n_per_m: ndarray,
moment_qc_nm_per_m: ndarray,
section_pitch_rad: ndarray,
*,
x_qc_m: ndarray | float = 0.0,
z_qc_m: ndarray | float = 0.0,
) -> tuple[np.ndarray, np.ndarray, np.ndarray]
Project a wing's XZ-cut load densities onto its section axes (FSI-G).
f_chordwise = -Fx cos b + Fz sin b (toward the leading edge),
f_normal = Fx sin b + Fz cos b (toward the suction side), and
m_nose_up = +Moment + X_QC Fz - Z_QC Fx, the moment about the section's
quarter chord. The cut is the reference XZ plane in a frame with
the reference axes (x aft, y right, z up; the wiring refuses any other),
so Fx and Fz are the x and z force densities, and the section
axes at nose-up pitch b are (-cos b, sin b) and (sin b, cos b) in (x, z)
(:func:pyflightstream.fsi.nodes.station_triads). The moment column is
read as positive about +y, the axis the XZ plane leaves out, as the
rotor's XY cut is read about +z; +y turns the leading edge up on either
wing, so it is nose up. THAT SIGN IS THE ONE READING HERE NOT YET
CORROBORATED ON THIS CUT: the rotor's was, by the soft-blade pilot
(RPT-007); the wing's agrees in sign at the integral on 26.124 and
not in magnitude (+7.49 against +17.13 N m, 44 %, RPT-092). The export's
moment is not about the quarter chord on this cut: it is about the origin
of the frame the cut and the loads share where that was measured, no
separation model on, and X_QC and Z_QC are in that frame, so the
transfer is the lever of the section's forces. It is zero for a frame on
the section, and a cut frame other than the loads frame is not measured.
:func:to_elastic_axis then moves it to the pitch axis where the blade has contours.
Inputs broadcast; densities in N/m and N m / m, angles in rad.
Source: rigid-section geometry of the wing-frame embedding; the moment
convention by analogy with :func:project_rotor_frame_loads.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fx_n_per_m
|
ndarray
|
The x force density of the XZ cut [N/m]. |
required |
fz_n_per_m
|
ndarray
|
The z force density of the XZ cut [N/m]. |
required |
moment_qc_nm_per_m
|
ndarray
|
The export's moment density [N m / m], read as positive about +y. |
required |
section_pitch_rad
|
ndarray
|
The section's nose-up pitch b [rad]. |
required |
x_qc_m
|
ndarray or float
|
The section's quarter chord in the cut's frame [m]; zero keeps the export's moment. |
0.0
|
z_qc_m
|
ndarray or float
|
The section's quarter chord in the cut's frame [m]; zero keeps the export's moment. |
0.0
|
Returns:
| Type | Description |
|---|---|
tuple of numpy.ndarray
|
|
pyflightstream.fsi.loads.to_elastic_axis
¶
to_elastic_axis(
block: SectionBlock,
cfg: FsiConfig,
*,
deflection_m: ndarray | None = None,
twist_rad: ndarray | None = None,
) -> ElasticAxisLoads
Transfer one blade block to elastic-axis load densities (FSI-R04).
The elastic-axis offsets e(r) come from the configuration, interpolated linearly at the section radii, so refining the elastic axis estimate never touches the FlightStream setup (DLV-007 Section 4.3).
Axes (RPT-006 finding 3): the export columns are the cut-plane
axes. At Omega zero (section_frame embedding, the wing case)
they are the section chordwise/normal axes and pass through
unchanged. On a spinning blade (rotor_frame) they are the
axial and in-plane axes, so the loads are projected onto the
section axes with the local blade angle interpolated from the
geometric pitch distribution
(:func:project_rotor_frame_loads); the embedding rule is shared
with the node generator through
:func:pyflightstream.fsi.config.frame_embedding, so loads and
displacements always live in the same triad.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
block
|
SectionBlock
|
One blade family from :meth: |
required |
cfg
|
FsiConfig
|
Configuration whose blade the sections were cut on. |
required |
deflection_m
|
ndarray
|
Applied station deflection and twist. When supplied together, project the cut-plane forces onto the bent and twisted station triad before transferring moments. The export supplies no spanwise force; that component is zero in this spatial-cut fallback. |
None
|
twist_rad
|
ndarray
|
Applied station deflection and twist. When supplied together, project the cut-plane forces onto the bent and twisted station triad before transferring moments. The export supplies no spanwise force; that component is zero in this spatial-cut fallback. |
None
|
Returns:
| Type | Description |
|---|---|
ElasticAxisLoads
|
Load densities about the elastic axis at the section radii, in section components. |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If the family's sections span a range other than the configured blade's, or cover too little of it. |
Warns:
| Type | Description |
|---|---|
PyflightstreamWarning
|
If the moment's pitch-axis reference is unverified (rotor or section frame), the blade lacks contours, or a wing relies on the single-element quarter-chord assumption. |
pyflightstream.fsi.loads.transfer_moment_to_elastic_axis
¶
transfer_moment_to_elastic_axis(
moment_pa_nm: ndarray,
force_chordwise_n: ndarray,
force_normal_n: ndarray,
ea_offset_chordwise_m: ndarray,
ea_offset_normal_m: ndarray,
) -> np.ndarray
Transfer a sectional moment to the elastic axis.
M_EA = M_P + e_c F_n - e_n F_c: the spanwise component of
M_P + e x F, where F = (F_c, F_n) is the section force acting at a
point P, M_P the moment about P, and e = (e_c, e_n) the
section-plane offset FROM the elastic axis TO P, in the
right-handed blade triad of :mod:pyflightstream.fsi.config
(chordwise toward the leading edge, normal completing the triad,
moments positive nose up about the spanwise axis). All inputs
broadcast. The identity holds per unit span exactly as for
totals, so it applies unchanged to the line densities of the
sectional export (forces in N/m, moments in N m / m, offsets in m).
The direction of e is the whole content of the sign, so each call
site states its own vector. The aerodynamic loads act at the pitch
axis and the configuration's elastic_axis_offset_* runs from
the pitch axis to the elastic axis, so :func:to_elastic_axis
passes its negative. A wing's weight acts at the centre of gravity
and cg_offset_* already runs from the elastic axis to it
(:mod:pyflightstream.fsi.wing). Check: lift (F_n > 0) at a
pitch axis ahead of the elastic axis (e_c > 0 from the elastic
axis to it) twists the section nose up.
Source: DLV-007 Section 4.3 (FSI-R04); elementary statics, M_EA = M_P + (r_P - r_EA) x F.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
moment_pa_nm
|
ndarray
|
The moment M_P about the point the force acts at, positive nose up [N m, or N m / m for a density]. |
required |
force_chordwise_n
|
ndarray
|
The chordwise force F_c [N, or N/m]. |
required |
force_normal_n
|
ndarray
|
The normal force F_n [N, or N/m]. |
required |
ea_offset_chordwise_m
|
ndarray
|
The chordwise offset e_c from the elastic axis to the point the force acts at [m]. |
required |
ea_offset_normal_m
|
ndarray
|
The normal offset e_n from the elastic axis to the point the force acts at [m]. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The elastic-axis moment M_EA = M_P + e_c F_n - e_n F_c, in the unit of |