pyflightstream.fsi.config (stable)¶
Generated from the docstrings at build time: every one of the 15 names in the __all__ of pyflightstream.fsi.config has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
FSI configuration schema, validation, and round-trip IO.
Pipeline role: config.json is the single per-run configuration of
the structural coupling executable (DLV-007 Section 5). It is staged
into the run folder and hashed; every convergence-log row carries the
hash (FSI-R15) so any later result is traceable to its exact
configuration, the same discipline as the run manifest (FR-19).
All geometry lives in the rotating blade frame: the spanwise axis
points from root to tip along the pitch axis, the chordwise axis
points toward the leading edge, and the normal axis completes the
right-handed triad. Per-station distributions are sampled at
station_radii_m and interpolated linearly in between.
Advanced¶
pyflightstream.fsi.config.BladeProperties
¶
Bases: BaseModel
Per-station structural distributions of one blade.
All blades share these distributions; node sets and solves are
replicated per blade (FSI-R08). Every list is sampled at
station_radii_m and must have the same length.
Attributes:
| Name | Type | Description |
|---|---|---|
station_radii_m |
list of float
|
Radial stations measured from the rotation axis along the pitch axis [m]; strictly increasing; the first entry is the root (clamp) station and the last is the tip. |
chord_m |
list of float
|
Local chord [m]; sets the lever arm of the leading-edge and trailing-edge twist-encoding nodes (DLV-007 Section 4.4). |
mass_per_length_kg_per_m |
list of float
|
Running mass mu(r) [kg/m]; source of the centrifugal tension. |
inertia_major_kg_m |
list of float
|
Sectional mass moment of inertia per unit length about the section major principal axis, I1(r) [kg m]. |
inertia_minor_kg_m |
list of float
|
Sectional mass moment of inertia per unit length about the section minor principal axis, I2(r) [kg m]. The difference I1 - I2 drives the propeller moment. |
bending_stiffness_n_m2 |
list of float
|
Flapwise bending stiffness EI(r) [N m^2]. |
torsion_stiffness_n_m2 |
list of float
|
Torsional stiffness GJ(r) [N m^2]. |
elastic_axis_offset_chordwise_m, elastic_axis_offset_normal_m |
list of float
|
Offset e(r) from the pitch axis to the elastic axis [m], in section-plane components (chordwise positive toward the leading edge, normal completing the triad). Loads are exported about the pitch axis and transferred to the elastic axis with this offset (FSI-R04), so refining the elastic axis estimate never touches the FlightStream setup. |
cg_offset_chordwise_m, cg_offset_normal_m |
list of float
|
Offset from the elastic axis to the sectional center of gravity [m], section-plane components. A fixed wing reads it for its own weight. A rotating blade does not carry it: the static solve has no centrifugal moment of the offset and no bend-twist coupling, and the modal problem holds it only as the parallel-axis term of the twist inertia (a warning says so). |
geometric_pitch_deg |
list of float
|
Built-in geometric pitch distribution [deg] about the pitch axis; the total pitch is geometric plus elastic twist. |
provenance |
BladePropertiesProvenance or None
|
Where the distributions came from, when they were generated
from the blade's sections and a material
(:func: |
section_contours_m |
list of list of list of float or None
|
The blade's section at every station, one closed polygon of
(chordwise toward the leading edge, normal toward the suction
side) points [m] per station, in the section frame, origin on
the pitch axis: the geometry the structural nodes are placed in
and checked against
(:func: |
Examples:
>>> from pyflightstream.fsi.config import BladeProperties
>>> blade = BladeProperties(
... station_radii_m=[0.1, 0.5], chord_m=[0.04] * 2,
... mass_per_length_kg_per_m=[0.7] * 2, inertia_major_kg_m=[1e-4] * 2,
... inertia_minor_kg_m=[1e-6] * 2, bending_stiffness_n_m2=[25.0] * 2,
... torsion_stiffness_n_m2=[35.0] * 2, elastic_axis_offset_chordwise_m=[0.0] * 2,
... elastic_axis_offset_normal_m=[0.0] * 2, cg_offset_chordwise_m=[0.0] * 2,
... cg_offset_normal_m=[0.0] * 2, geometric_pitch_deg=[20.0, 10.0],
... )
>>> blade.station_radii_m
[0.1, 0.5]
pyflightstream.fsi.config.BladePropertiesProvenance
¶
Bases: BaseModel
Where the numbers of a generated :class:BladeProperties came from.
Written by
:func:pyflightstream.fsi.sections.blade_properties_from_sections
beside the distributions it computes, and absent from every
configuration typed by hand. It is part of the configuration, so it
enters :func:config_sha256 when present and is not serialised at
all when absent, which keeps the digest of every configuration
written before it existed unchanged.
Attributes:
| Name | Type | Description |
|---|---|---|
generator |
str
|
Dotted name of the function that produced the distributions. |
material |
MaterialProvenance
|
The material entry and its source. |
geometry_source |
str
|
What the section contours were read or built from, in words. |
geometry_file_name |
str or None
|
Name (never the path, which would tie the digest to one machine) of the file the contours were read from, None when they were built in code. |
geometry_sha256 |
str or None
|
sha256 of the geometry file's bytes when the contours came from a file, None otherwise. |
section_model |
str
|
The structural hypothesis on the section: solid and homogeneous. |
elastic_axis |
str
|
How the elastic axis was located, stated as the hypothesis it is. |
bending_stiffness |
str
|
Which second moment of area the bending stiffness multiplies. |
torsion_method |
str
|
How the torsion constant J was computed. |
torsion_grid_cells |
list of list of int
|
Per station, the grid |
thin_section_torsion_ratio |
list of float
|
Per station, the thin-section estimate (1/3) integral t^3 ds divided by the computed J. A cross-check only, never the value: near 1 for a thin section, and it drifts from 1 as the section thickens or its thickness varies along the chord. |
pyflightstream.fsi.config.DIRECT_MORPHING_DEFLECTED
module-attribute
¶
DIRECT_MORPHING_DEFLECTED: Final = 'direct_deflected'
pyflightstream.fsi.config.DIRECT_NODE_TYPES
module-attribute
¶
DIRECT_NODE_TYPES: Final = {
DIRECT_MORPHING: "RIGID",
DIRECT_MORPHING_DEFLECTED: "DEFLECTED",
}
pyflightstream.fsi.config.FixedWing
¶
Bases: BaseModel
A fixed wing: where its beam sits and whether it carries its own weight (FSI-G).
Present on a configuration whose structure is a wing on a steady or an
unsteady workflow without rotor motion, and absent (not serialised) on
a rotor blade's, so every configuration written before it existed keeps
its dump and its :func:config_sha256. A fixed wing does not turn: its
configuration states omega_rad_per_s = 0 and one structure, so no
centrifugal term reaches its solve; the dynamic load its structural
solver applies is the wing's weight.
The wing is one cantilever, clamped at its first station. The package's
geometry frame is x aft, y right, z up (:mod:pyflightstream.post.axes),
and the beam lies along span_axis through origin_m: station s
of BladeProperties.station_radii_m is the point origin_m + s along
that axis, so a station is a distance along the span, never a signed
coordinate. The section axes are the toward-leading-edge direction
(-x, turned nose up by the station's geometric_pitch_deg about the
span) and the toward-suction direction (+z, turned with it); the node
embedding and the load projection share that rule
(:func:pyflightstream.fsi.nodes.station_triads,
:func:pyflightstream.fsi.loads.to_elastic_axis).
Attributes:
| Name | Type | Description |
|---|---|---|
self_weight |
bool
|
Whether the structural solve applies the wing's own weight, the
running mass under |
gravity_m_per_s2 |
tuple of float
|
The acceleration of gravity in the REFERENCE frame [m/s^2]. The
angle of attack and the sideslip turn the free stream, never the
body, so gravity stays -z of the reference frame at every attitude;
a configuration states another vector only for a model mounted in
another orientation. Default |
span_axis |
{+Y, -Y}
|
The reference axis the span runs along from the root: |
origin_m |
tuple of float
|
The reference-frame point [m] the stations are measured from, on the beam's pitch axis; the section contours and the elastic-axis offsets are drawn about that axis. |
pyflightstream.fsi.config.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.config.MaterialProvenance
¶
Bases: BaseModel
The material a generated blade was computed with, and its source.
A copy of the :class:pyflightstream.fsi.materials.Material entry
rather than a reference to it, so the configuration stays readable
and hashable on its own after the database moves to a new version.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
Database key of the entry. |
name |
str
|
Material name with its condition. |
density_kg_per_m3, youngs_modulus_pa, shear_modulus_pa |
float
|
rho [kg/m^3], E [Pa] and G [Pa] as used. |
poisson_ratio |
float
|
nu [-] as tabulated. |
shear_modulus_basis |
str
|
Whether G was tabulated by the source or derived from E and nu. |
source |
str
|
One-line citation of the data set all four numbers come from. |
database_version |
str
|
:data: |
notes |
str
|
The source material's suitability limitation (for example "not for design"), copied unchanged. Serialised only when non-empty, so the digest of every configuration without a note is unchanged. |
pyflightstream.fsi.config.PhaseSchedule
¶
Bases: BaseModel
Parameters of the four-phase coupling driver (DLV-007 Section 4.5).
Attributes:
| Name | Type | Description |
|---|---|---|
wake_development_revolutions |
float
|
Phase 1 length [revolutions]: zero displacements are written while the wake develops on the rigid blade. |
coupling_relaxation |
float
|
Relaxation factor lambda of phases 2 and 3, in (0, 1]. The update is d_new = d_old + lambda (d_calc - d_old) (FSI-R07). Phase 4 records instantaneous loads with lambda = 1 by design: relaxing there would low-pass exactly the 1P amplitude and phase being measured. |
averaging_window_revolutions |
float
|
Load-averaging window of phases 2 and 3 [revolutions]. |
tip_twist_tolerance_deg |
float
|
Phase 3 convergence, first of two criteria: tip elastic twist change per revolution below this value [deg] (FSI-R09). |
thrust_tolerance_fraction |
float
|
Phase 3 convergence, second criterion: relative change of the integrated total normal force between consecutive revolutions, below this fraction. Phase 4 begins only when both the force and twist criteria hold. |
recording_revolutions |
float
|
Phase 4 length [revolutions] recording theta(r, psi) per blade. |
pyflightstream.fsi.config.SOLVER_FRAME_COMPENSATION_BUILDS
module-attribute
¶
SOLVER_FRAME_COMPENSATION_BUILDS: Final = ('26.127',)
pyflightstream.fsi.config.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.config.dump_config
¶
dump_config(cfg: FsiConfig, path: str | Path) -> None
Write a configuration as pretty-printed JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
FsiConfig
|
Configuration to persist. |
required |
path
|
str or Path
|
Destination file; overwritten if present. |
required |
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)
>>> load_config(path) == cfg
True
pyflightstream.fsi.config.frame_embedding
¶
frame_embedding(cfg: FsiConfig) -> str
Return the geometric embedding of the blade section frame.
"wing_frame" for a fixed wing (:class:FixedWing: the section
axes are -x and +z of the reference frame turned nose up by the
local geometric_pitch_deg, the span along span_axis);
"rotor_frame" for a spinning blade (RPT-006 finding 3: the
import frame is rotor-axis X, in-plane Y, span Z, and the section
chordwise/normal axes rotate with the local blade angle, taken
from geometric_pitch_deg); "section_frame" at Omega zero
without a wing, where the import frame is the section frame itself.
One rule shared by the node generator and the loads projection, so
both sides of the interface always agree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
FsiConfig
|
Validated configuration. |
required |
Returns:
| Type | Description |
|---|---|
str
|
|
pyflightstream.fsi.config.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