pyflightstream.fsi (stable)¶
Generated from the docstrings at build time: every one of the 4 names in the __all__ of pyflightstream.fsi has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
Fluid-structure interaction coupling for rotating blades.
Pipeline role: this subpackage implements the external structural executable of the FlightStream Aeroelastic Toolbox loop (M6, DLV-007; FR-23a). Per coupling call FlightStream exports sectional loads on user-defined surface sections; the executable reads them together with its configuration and persisted state, solves one beam per blade, converts the solution to nodal translations, and writes the displacement file back for the solver to deform the mesh. All exchange happens in the rotating blade frames; this package never handles azimuth or global-frame transforms (FSI-R02).
the same executable couples a fixed wing, one clamped
beam in the reference frame loaded by its own weight besides the
aerodynamic loads (:mod:pyflightstream.fsi.wing).
The structural backend is PyNite (PyPI distribution PyNiteFEA,
import name Pynite), pulled in only by the optional [fsi]
extra; importing :mod:pyflightstream.fsi itself stays dependency
free so the core package works without the extra installed.
The evidence status of the structural model is recorded in DLV-007 Section 2: formulas live in small isolated functions with their source cited in the docstring, so a later primary-source correction stays a localized change.
Advanced¶
pyflightstream.fsi.FsiConfig
¶
Bases: BaseModel
Complete per-run configuration of the coupling executable.
Attributes:
| Name | Type | Description |
|---|---|---|
blade_count |
int
|
Number of blades; node sets, section groups, and solves are replicated per blade (FSI-R08). |
omega_rad_per_s |
float
|
Rotor angular speed Omega [rad/s], constant over the run; source of the centrifugal tension and the propeller moment. |
time_increment_s |
float or None
|
Unsteady time step of the coupled run [s]. The loads export header prints the increment with three decimals only (RPT-006: 0.003525 prints as .004, skewing the revolution bookkeeping), so a configured value takes precedence in the driver's phase schedule, with the printed value cross-checked against it at print precision. None falls back to the printed value. |
blade |
BladeProperties
|
Shared per-station structural distributions. |
stiffness_scale_factor |
float
|
Multiplier applied to EI and GJ at solve time. The near-rigid regression of the coupled pilot (WP7) scales a synthetic blade stiff with this knob instead of editing distributions. |
node_offset_chord_fraction |
float
|
Chord fraction of the leading-edge and trailing-edge node offsets from the elastic axis used to encode twist as differential translations (DLV-007 Section 4.4). |
phases |
PhaseSchedule
|
Driver phase parameters. |
node_map_file |
str
|
Name, inside the run folder, of the node ordering map written by the node generator; the same generator emits the node file imported into FlightStream, keeping a single source of truth for the FSIDisp ordering (FSI-R14). |
wing |
FixedWing or None
|
The fixed wing this structure is (FSI-G): its placement
in the reference frame and its own weight. None for a rotor blade,
and then it is not serialised, for the reason given for
|
morphing |
str
|
How the solver moves the surface (FR-341): |
export_surface_before_call |
bool
|
Off by default (FR-3408). On an |
solver_frame_compensation |
bool
|
Off by default. On an |
Examples:
>>> from pyflightstream.fsi.config import FsiConfig
>>> from pyflightstream.fsi.sections import blade_properties_from_sections
>>> plate = [(0.02, 0.002), (-0.02, 0.002), (-0.02, -0.002), (0.02, -0.002)]
>>> blade = blade_properties_from_sections(
... [0.1, 0.3, 0.5], sections_m=[plate] * 3, chord_m=[0.04] * 3,
... geometric_pitch_deg=[10.0] * 3, material="ti-6al-4v-grade5-annealed",
... geometry_source="a flat 40 x 4 mm plate",
... )
>>> cfg = FsiConfig(blade_count=2, omega_rad_per_s=0.0, blade=blade)
>>> cfg.blade_count, frame_embedding(cfg)
(2, 'section_frame')
pyflightstream.fsi.StructuralSolver
¶
Bases: Protocol
Contract of one structural coupling call (HND-008 loop).
FlightStream calls the executable between coupling iterations; the
executable is stateless per call (FSI-R01) and all state persists
in files inside the run folder. An implementation reads the
exported sectional loads, config.json and state.json from
run_dir, solves the structure, and writes FSIDisp.txt plus
the updated state.json atomically (FSI-R13).
step
¶
step(run_dir: Path) -> None
Execute one coupling call inside run_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_dir
|
Path
|
Run folder managed by :mod: |
required |
pyflightstream.fsi.config_sha256
¶
config_sha256(cfg: FsiConfig) -> str
Return the canonical sha256 of a configuration.
The digest is computed over the JSON serialization with sorted keys and no whitespace, so it is independent of field order and formatting. Every convergence-log row carries it (FSI-R15).
The name states the algorithm, as RunRecord.script_sha256 and
outputs_sha256 do: a reader meeting the value in a
state.json or in a convergence-log row can tell what it is
without opening this module, and the day the algorithm moves the
data can say so. Renamed off a name that said only "hash";
the persisted state still ACCEPTS the legacy key on load, and
:class:pyflightstream.fsi.state.FsiState is the one place that
spells it, so the retired name has exactly one home.
This is NOT the manifest checksum of
:mod:pyflightstream._digest, and the difference is the canonical
form rather than the algorithm: that module hashes raw file bytes
or a UTF-8 encoded string, where this one first renders a
configuration into a canonical JSON text, which is a domain rule
about what makes two configurations the same.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
FsiConfig
|
Configuration to hash. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Lowercase hexadecimal sha256 digest. |
Examples:
>>> from pyflightstream.fsi.config import FsiConfig
>>> from pyflightstream.fsi.sections import blade_properties_from_sections
>>> plate = [(0.02, 0.002), (-0.02, 0.002), (-0.02, -0.002), (0.02, -0.002)]
>>> blade = blade_properties_from_sections(
... [0.1, 0.3, 0.5], sections_m=[plate] * 3, chord_m=[0.04] * 3,
... geometric_pitch_deg=[10.0] * 3, material="ti-6al-4v-grade5-annealed",
... geometry_source="a flat 40 x 4 mm plate",
... )
>>> cfg = FsiConfig(blade_count=2, omega_rad_per_s=0.0, blade=blade)
>>> digest = config_sha256(cfg)
>>> len(digest), digest == config_sha256(cfg.model_copy())
(64, True)
pyflightstream.fsi.load_config
¶
load_config(path: str | Path) -> FsiConfig
Load and validate a config.json.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
JSON file with the :class: |
required |
Returns:
| Type | Description |
|---|---|
FsiConfig
|
Validated configuration. |
Examples:
>>> from pyflightstream.fsi.config import FsiConfig
>>> from pyflightstream.fsi.sections import blade_properties_from_sections
>>> plate = [(0.02, 0.002), (-0.02, 0.002), (-0.02, -0.002), (0.02, -0.002)]
>>> blade = blade_properties_from_sections(
... [0.1, 0.3, 0.5], sections_m=[plate] * 3, chord_m=[0.04] * 3,
... geometric_pitch_deg=[10.0] * 3, material="ti-6al-4v-grade5-annealed",
... geometry_source="a flat 40 x 4 mm plate",
... )
>>> cfg = FsiConfig(blade_count=2, omega_rad_per_s=0.0, blade=blade)
>>> import tempfile
>>> from pathlib import Path
>>> path = Path(tempfile.mkdtemp()) / "config.json"
>>> dump_config(cfg, path)
>>> config_sha256(load_config(path)) == config_sha256(cfg)
True