pyflightstream.fsi.nodes (stable)¶
Generated from the docstrings at build time: every one of the 26 names in the __all__ of pyflightstream.fsi.nodes has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
Structural node file and FSIDisp ordering map, from one generator (WP5).
Pipeline role: FlightStream imports a structural node list per blade
and later applies FSIDisp.txt translations to the nodes in exactly
the import order (RPT-005 finding 5). Any disagreement between the
file that was imported and the order the displacements are written in
is a silent geometry corruption, so both come from the same generator
reading the same configuration: :func:generate_node_layout builds
the :class:NodeOrderingMap, and the node file, the serialized map,
and the FSIDisp.txt writer all derive from it (FSI-R14).
Layout: three nodes per radial station (elastic axis, leading-edge
offset, trailing-edge offset; DLV-007 Section 4.4), stations from root
to tip. Every blade shares the same local coordinates in its own
rotating frame, so one node file serves all blades: the import is
repeated once per blade frame, in blade order, and the flat
FSIDisp.txt rows follow that same blade-major order.
Geometric embedding: the beam solution lives in the section axes of
:mod:pyflightstream.fsi.config (chordwise toward the leading edge,
normal toward the suction side, span root to tip), but the import
frame of a spinning blade is the rotor convention of the WP7 pilot
evidence (RPT-006 finding 3): X along the rotor axis, Y in-plane, Z
spanwise, with the section rotated by the local blade angle beta(r)
about the span axis. The per-station triad (toward-LE, toward-suction,
span) is therefore (-sin b, -cos b, 0), (-cos b, sin b, 0),
(0, 0, 1); positions and translations embed as components along
it, which keeps the scalar twist encoding dy = w + theta d exact
(nose-up is the rotation about -Z for this geometry, and
-theta z x (d toward-LE) = +theta d toward-suction). At Omega zero the
embedding is the identity (section_frame), the frame of the wing
case and of the dry-run node fixture. A fixed wing (FSI-G)
embeds in the package's reference frame, x aft, y right, z up
(wing_frame): toward the leading edge is -x and toward the suction
side +z, turned nose up by the station's pitch, the span along +y or -y
from the wing's origin. The rule choosing the embedding
is :func:pyflightstream.fsi.config.frame_embedding, shared with the
loads projection so both sides of the interface always agree.
Nodes inside the blade (FSI-1). When the configuration carries the
blade's section at every station (BladeProperties.section_contours_m,
the contours a calculated blade is generated from), the nodes are placed
on that section's camber line: the elastic-axis node at the configured
elastic-axis chord fraction (:data:ELASTIC_AXIS_FALLBACK_CHORD_FRACTION
when the configured one lies outside
:data:ELASTIC_AXIS_CHORD_FRACTION_WINDOW), the leading-edge and
trailing-edge nodes at :data:LEADING_EDGE_NODE_CHORD_FRACTION and
:data:TRAILING_EDGE_NODE_CHORD_FRACTION. A node moved to the fallback
is no longer on the elastic axis the beam is solved about, so the map
then keeps the configured elastic axis
(NodeOrderingMap.ea_configured_chordwise_m) and the node's flap is
written as the rigid section moves it, w + theta (e_node - e_true)
(_elastic_axis_node_flap). The embedding at the local
twist is unchanged, and so are the node order, the roles and the row
count, so the FSIDisp rows keep their meaning. A node set with any node
outside its section, or inside it by less than
max(:data:MIN_NODE_CLEARANCE_CHORD_FRACTION times chord,
:data:MIN_NODE_CLEARANCE_THICKNESS_FRACTION
of the local thickness), is refused naming the node
(:func:refuse_nodes_outside_sections): a structural node the solver
finds outside the surface it morphs is a node the interpolation reads
from the wrong side of the skin. Without section geometry the layout
is the offset layout described above and no check can be made.
File formats, per the dry-run evidence (RPT-005 finding 5): both the
node CSV and FSIDisp.txt are comma separated three-column files,
one row per node, no header.
Advanced¶
pyflightstream.fsi.nodes.ELASTIC_AXIS_CHORD_FRACTION_WINDOW
module-attribute
¶
ELASTIC_AXIS_CHORD_FRACTION_WINDOW = (0.2, 0.5)
pyflightstream.fsi.nodes.ELASTIC_AXIS_FALLBACK_CHORD_FRACTION
module-attribute
¶
ELASTIC_AXIS_FALLBACK_CHORD_FRACTION = 0.3
pyflightstream.fsi.nodes.EMBEDDINGS
module-attribute
¶
EMBEDDINGS = ('section_frame', 'rotor_frame', 'wing_frame')
pyflightstream.fsi.nodes.LEADING_EDGE_NODE_CHORD_FRACTION
module-attribute
¶
LEADING_EDGE_NODE_CHORD_FRACTION = 0.1
pyflightstream.fsi.nodes.MIN_NODE_CLEARANCE_CHORD_FRACTION
module-attribute
¶
MIN_NODE_CLEARANCE_CHORD_FRACTION = 0.001
pyflightstream.fsi.nodes.MIN_NODE_CLEARANCE_THICKNESS_FRACTION
module-attribute
¶
MIN_NODE_CLEARANCE_THICKNESS_FRACTION = 0.1
pyflightstream.fsi.nodes.NodeClearance
dataclass
¶
NodeClearance(
row: int,
station: int,
radius_m: float,
role: str,
inside: bool,
clearance_m: float,
thickness_m: float,
required_m: float,
)
Where one structural node sits against its station's section.
Attributes:
| Name | Type | Description |
|---|---|---|
row |
int
|
The node's 0-based row in the node file (one blade's import). |
station |
int
|
Station index, 0-based from the root. |
radius_m |
float
|
The station's radius [m]. |
role |
str
|
One of :data: |
inside |
bool
|
Whether the node lies inside the section outline. |
clearance_m |
float
|
Distance from the node to the outline [m]. |
thickness_m |
float
|
Local section thickness at the node's chord fraction [m]; zero where the chord-normal line there misses the section. |
required_m |
float
|
The clearance the node must keep:
max(:data: |
pyflightstream.fsi.nodes.NodeOrderingMap
¶
Bases: BaseModel
Single source of truth for node identity and FSIDisp row order.
Serialized into the run folder under the node_map_file name of
the configuration, so every consumer (the driver, the replay
harness, post-processing) reads the same bookkeeping that
generated the imported node file (FSI-R14).
Attributes:
| Name | Type | Description |
|---|---|---|
blade_count |
int
|
Number of blades; the node file is imported once per blade, in blade order, and the FSIDisp rows are blade-major. |
station_radii_m |
list of float
|
Radial stations [m], root to tip, as in the configuration. |
roles |
list of str
|
Per-station node roles in row order; fixed to
:data: |
ea_offset_chordwise_m, ea_offset_normal_m |
list of float
|
Elastic-axis position per station [m] in the section plane; the elastic-axis node sits there. |
le_offset_m, te_offset_m |
list of float
|
Chordwise offsets [m] of the leading-edge (positive) and trailing-edge (negative) nodes from the elastic axis. |
le_offset_normal_m, te_offset_normal_m |
list of float or None
|
Normal position [m] of the leading-edge and trailing-edge nodes in the section plane, when they sit on the camber line of a section-generated layout. None places them at the elastic axis's normal position (the offset layout), and is then not serialised, so a map written before the fields existed reads back and dumps exactly as it did. |
embedding |
str
|
Geometric embedding of the section frame in the import frame
(module docstring): |
blade_angle_deg |
list of float or None
|
Local blade angle beta per station [deg] of the rotor-frame embedding, or the nose-up section pitch of the wing-frame one; None normalizes to zeros (identity sections). |
span_sign |
{1, -1} or None
|
Which way a |
origin_m |
tuple of float or None
|
The reference-frame point a |
ea_configured_chordwise_m |
list of float or None
|
The configured elastic axis's chordwise position per station
[m], stated when a section-generated layout moved an
elastic-axis node off it (a configured axis outside
:data: |
row_index
¶
row_index(blade: int, station: int, role: str) -> int
Flat FSIDisp row of one node (blade-major, station, role).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blade
|
int
|
Blade index, 0-based, in import (creation) order. |
required |
station
|
int
|
Station index, 0-based from the root. |
required |
role
|
str
|
One of :data: |
required |
pyflightstream.fsi.nodes.TRAILING_EDGE_NODE_CHORD_FRACTION
module-attribute
¶
TRAILING_EDGE_NODE_CHORD_FRACTION = 0.9
pyflightstream.fsi.nodes.camber_point
¶
camber_point(
polygon: ndarray, fraction: float
) -> tuple[np.ndarray, float]
Return the camber-line point of a section at a chord fraction, and its thickness.
The line normal to the chord at fraction crosses the section's
outline; the camber point is the midpoint of its outermost two
crossings and the thickness is their distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polygon
|
ndarray
|
One section, shape |
required |
fraction
|
float
|
Chord fraction from the leading edge, strictly between 0 and 1. |
required |
Returns:
| Type | Description |
|---|---|
tuple of (numpy.ndarray, float)
|
The (chordwise, normal) point [m] and the local thickness [m]. |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If the chord-normal line at |
pyflightstream.fsi.nodes.config_triads
¶
config_triads(cfg: FsiConfig) -> np.ndarray
Per-station section axes in the import frame, from the configuration.
The rule of :func:station_triads, asked of a configuration without
placing any node, so a caller that needs only the axes (the wing's
weight, :func:pyflightstream.fsi.wing.weight_loads) reads the same
embedding the node file is written in.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
FsiConfig
|
The configuration whose embedding and pitch give the axes. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Shape |
pyflightstream.fsi.nodes.flatten_blade_translations
¶
flatten_blade_translations(
node_map: NodeOrderingMap,
per_blade_translations: list[ndarray],
) -> np.ndarray
Order per-blade station translations into flat FSIDisp rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
Layout defining the row order. |
required |
per_blade_translations
|
list of numpy.ndarray
|
One array per blade in import order, each shaped
|
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Shape |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If the number of blades differs from the map's, or a blade's array is not shaped
|
pyflightstream.fsi.nodes.generate_node_layout
¶
generate_node_layout(cfg: FsiConfig) -> NodeOrderingMap
Build the node layout of a configuration (FSI-R14 single source).
Three nodes per station. With the blade's sections known
(BladeProperties.section_contours_m) they sit on each section's
camber line at the chord fractions of the module docstring, and the
layout is checked inside its sections before it is returned
(:func:refuse_nodes_outside_sections). Without them, the
elastic-axis node sits at e(r) in the section plane and the
leading-edge and trailing-edge nodes are offset chordwise from it
by plus and minus node_offset_chord_fraction of the local chord
(DLV-007 Section 4.4). The embedding follows
:func:pyflightstream.fsi.config.frame_embedding: a spinning
blade embeds its sections at the local blade angle, taken from the
geometric pitch distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
FsiConfig
|
Validated configuration. |
required |
Returns:
| Type | Description |
|---|---|
NodeOrderingMap
|
The map every node-related file derives from. |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If a section-generated node lies outside its section, or inside it by less than the clearance, naming the node. |
pyflightstream.fsi.nodes.load_node_map
¶
load_node_map(path: str | Path) -> NodeOrderingMap
Load and validate a serialized ordering map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
JSON written by :func: |
required |
Returns:
| Type | Description |
|---|---|
NodeOrderingMap
|
The validated map. |
pyflightstream.fsi.nodes.node_clearances
¶
node_clearances(
node_map: NodeOrderingMap,
sections_m: Sequence[Sequence[Sequence[float]]],
) -> list[NodeClearance]
Measure every serialized node of one blade against its station's section.
The six-decimal import coordinates are projected back to the section plane so rounding cannot turn a passing clearance into an exterior node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
The layout whose nodes are measured, in the section plane (before the embedding at the local twist, which turns the section and its nodes together). |
required |
sections_m
|
sequence of polygons
|
One section per station, (chordwise, normal) points [m] in the
section frame ( |
required |
Returns:
| Type | Description |
|---|---|
list of NodeClearance
|
One entry per node row, in the node file's row order. |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If the number of sections differs from the map's station count. |
pyflightstream.fsi.nodes.node_positions
¶
node_positions(node_map: NodeOrderingMap) -> np.ndarray
Local node coordinates of one blade, in file row order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
Layout from :func: |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Shape |
pyflightstream.fsi.nodes.read_fsidisp
¶
read_fsidisp(
path: str | Path, expected_rows: int | None = None
) -> np.ndarray
Read an FSIDisp.txt back into translation rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Displacement file, comma separated dx,dy,dz per node. |
required |
expected_rows
|
int
|
When given (normally |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Shape |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If the file is not UTF-8, a line does not hold three values, a field is
empty, not a number or not finite, or
|
pyflightstream.fsi.nodes.refuse_nodes_outside_sections
¶
refuse_nodes_outside_sections(
node_map: NodeOrderingMap,
sections_m: Sequence[Sequence[Sequence[float]]],
) -> None
Refuse a node set with any node outside its section or too near its skin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
The layout to check. |
required |
sections_m
|
sequence of polygons
|
One section per station, as :func: |
required |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
Naming the offending nodes: row, station, radius, role, and the clearance against the one required. |
pyflightstream.fsi.nodes.render_node_file
¶
render_node_file(node_map: NodeOrderingMap) -> str
Render the existing import CSV without writing a planning-time file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
The layout whose nodes are rendered. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The node CSV :func: |
pyflightstream.fsi.nodes.section_chord_fraction
¶
section_chord_fraction(
polygon: ndarray, point: ndarray
) -> float
Chord fraction from the leading edge of a point projected on the chord line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polygon
|
ndarray
|
One section, shape |
required |
point
|
ndarray
|
A point of the section plane, (chordwise, normal) [m]. |
required |
Returns:
| Type | Description |
|---|---|
float
|
0 at the leading edge, 1 at the trailing edge. |
pyflightstream.fsi.nodes.station_triads
¶
station_triads(node_map: NodeOrderingMap) -> np.ndarray
Per-station section axes in the import frame (module docstring).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
Layout from :func: |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Shape |
pyflightstream.fsi.nodes.unflatten_translations
¶
unflatten_translations(
node_map: NodeOrderingMap, flat: ndarray
) -> list[np.ndarray]
Split flat FSIDisp rows back into per-blade station translations.
The exact inverse of :func:flatten_blade_translations; the
replay harness and the round-trip verification use it to
reconstruct (w, theta) from an archived FSIDisp.txt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
Layout defining the row order. |
required |
flat
|
ndarray
|
Shape |
required |
Returns:
| Type | Description |
|---|---|
list of numpy.ndarray
|
One |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If |
pyflightstream.fsi.nodes.write_fsidisp
¶
write_fsidisp(
path: str | Path, translations: ndarray
) -> None
Write FSIDisp.txt: one dx,dy,dz row per node, import order.
Comma separated per the dry-run evidence (RPT-005 finding 5); written at full float64 precision so an archived file replays the exact displacements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
Destination file inside the working directory. |
required |
translations
|
ndarray
|
Shape |
required |
Raises:
| Type | Description |
|---|---|
FsiInputError
|
If |
pyflightstream.fsi.nodes.write_node_file
¶
write_node_file(
node_map: NodeOrderingMap, path: str | Path
) -> None
Write the structural node CSV FlightStream imports per blade.
Comma separated X,Y,Z per node, no header, the format the dry run imported cleanly (RPT-005 finding 5). The same file is imported once per blade, each time in that blade's rotating frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
Layout from :func: |
required |
path
|
str or Path
|
Destination CSV; overwritten if present. |
required |
pyflightstream.fsi.nodes.write_node_map
¶
write_node_map(
node_map: NodeOrderingMap, path: str | Path
) -> None
Serialize the ordering map next to the node file (FSI-R14).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_map
|
NodeOrderingMap
|
Layout to persist. |
required |
path
|
str or Path
|
Destination JSON, normally the |
required |