pyflightstream.cases (stable)¶
Generated from the docstrings at build time: every one of the 84 names in the __all__ of pyflightstream.cases has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
Simulation and campaign definitions.
Pipeline role: describes what to run. A :class:SimCase (identified
by sim_id) is one solver configuration with its sweep; a
:class:Campaign groups cases with the FlightStream version and the
executable path, both required and explicit: nothing is read from
environment variables or guessed (SAD Section 5). The pipe-delimited
matrix.fs run matrix is the campaign declaration, read by
:mod:pyflightstream.cases.matrix. Campaign files are refused; ordinary
Python model construction remains available.
Script recipes are explicitly imported functions satisfying the
:class:ScriptRecipe protocol: build(case, script) -> None. The
campaign loop specializes the case per sweep point (filling
:attr:SimCase.point) and the recipe translates it into script
emissions, usually through the curated helpers. Recipe references are
"package.module:function" strings, replacing the historical
import-by-number system (PP-7, FR-12).
The workflow keeps unit conversion at the command boundary. Physical
metre-labelled inputs and explicitly SI reference normalizations use the
shared :mod:pyflightstream._lengths floor; the direct Python reference
API retains its native-unit default. Saved FSM units are decoded only for
measured METER/MILLIMETER heads. CAD conversion extends the existing mesh
import route, and unproved formats remain named refusals.
Custom inflow preserves the user's physical orientation. An explicit SI declaration prepares a separate solver-unit file with source and effective hashes; an undeclared file keeps its bytes. The final emitted transforms and rotor sweep feed conservative spatial bounds, not a guarantee of interpolation support inside an unstructured field. These controls do not automatically rotate a field or accept a nonzero incidence beside it.
The quasi-steady rotor (the qsteady_rotor run type of
:mod:pyflightstream.cases.workflows) keeps its own arithmetic in
:mod:pyflightstream.cases.qsteady: the clockings of a wheel, the 1P
reduced frequency and its validity figures, and the harmonic content of a
custom inflow as one blade meets it. The plan and the post both read it.
The correction routes of a wheel, the pproc's [qsteady_correction]
table and the calibration file it names, are
:mod:pyflightstream.cases.corrections, which the plan validates and the
post applies; none of them is validated.
:mod:pyflightstream.cases.fsi_workspace states which workflows may couple
and wires the fixed-wing and quasi-steady sector routes.
The modules of this layer: :mod:pyflightstream.cases.acoustics emits
the solver's acoustic sources, observers and signals export on an unsteady
row and states the contract of the export the post stage reads;
:mod:pyflightstream.cases.ccs_wing, :mod:pyflightstream.cases.ccs_fuselage
and :mod:pyflightstream.cases.ccs_revolution have the solver make a mesh of
a row's CCS file, by the curve route or the file route, with the vocabulary of
the sidecar's [import.ccs] table in the private cases._ccs; and
:mod:pyflightstream.cases.setup_surfaces removes the surfaces a setup names,
renumbering the inventory as the solver does, and emits the slipstream wake
stabilization of each rotor motion.
The layout of this layer: :mod:pyflightstream.cases.workflows is a
package. Its root keeps every public name and nothing else, and its private
modules import one another only in a declared order, from the extraction
script of a saved simulation and the run-type registry at the top, through
the builders of each run type, the script skeleton, the post-processing,
probe, clock, export, reduction, free-stream, settings, frame, geometry,
name, timing, motion and actuator emission, down to the typed readers of a
row's keys, the conventions and the row vocabulary at the bottom. The
run-type table is one object created empty below the builders and filled by
the registry when the package is imported. A new run type is a builder
module and one registry entry; a row key is registered in the vocabulary and
read by the row readers. Four private modules carry the features of
this layer: cases._setup_keys (the setup keys of a preset and the
command each reaches), cases._setup_link (the analysis settings of a
setup: the loads selections, the moments model and its rotor link, the
unsteady solver actions), cases._skipped_families (each family a row's
geometry does not carry, named once per matrix at plan) and
cases._unsteady_actions (the step counter and the per-step actions every
unsteady march registers). The unit that names no length has one home, the
floor :mod:pyflightstream._lengths, and the flag phases one home, this
package.
The models live in six public modules (AD-16), and the root re-exports them with the same object
identity. :mod:pyflightstream.cases.pproc holds the
exports vocabulary and the post-processing artifact;
:mod:pyflightstream.cases.reference_blocks the rotor, actuator and blade
blocks of a reference and the two errors of a case definition;
:mod:pyflightstream.cases.settings the solver settings, the flight-condition
state and the reference data; :mod:pyflightstream.cases.mesh the mesh import
and the mesh-side boundary models; :mod:pyflightstream.cases.naming the point
and sweep names; :mod:pyflightstream.cases.selection the family and alias
selection. The six import one another in one order, reference_blocks,
selection, pproc, naming, mesh, settings, each only those
before it. None of the six imports this root, so the root keeps the input keys,
the recipes, the sweep, the flags and raw commands, the frames, the case and
the campaign, and a field a release adds to a model lands in the model's own
module.
Used in the guides¶
pyflightstream.cases.Campaign
¶
Bases: BaseModel
A named group of cases bound to one FlightStream installation.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Campaign name; prefixes every |
fs_version |
str
|
FlightStream version, canonical identifier (26.120); a vendor release name works only where it names exactly one registered build. Validated against the registered versions at load time and STORED canonical (PFS-2009.04): a name accepted today is resolved today, so what the model holds, and what a converted matrix writes, is the build and never the name. |
fs_exe |
str
|
Explicit path of the FlightStream executable; existence is checked by the executor at construction, not here, so a campaign can be built away from the licensed machine. |
sims |
list of SimCase
|
The cases of the campaign. |
derived_from |
(DerivedFrom, optional)
|
Present only on a campaign the package GENERATED, naming the matrix it came from and digesting both files. None means nobody generated this campaign, which is the ordinary case and is not a lesser one: an authored campaign is the source of its study and the package says nothing about it. |
matrix_stem |
(str, optional)
|
The stem of the run matrix this campaign was converted from, for
example |
Notes
:attr:source_path is retained for existing in-memory provenance
consumers. New campaigns have no campaign-file source: the retired
reader refuses files before reading their contents.
source_path
property
¶
source_path: str | None
The campaign file this was loaded from, or None.
Returns:
| Type | Description |
|---|---|
str or None
|
Historical campaign-file provenance, or None for a newly built campaign. The retired file reader does not populate it. |
is_derived
property
¶
is_derived: bool
Whether the package generated this campaign from a matrix.
Returns:
| Type | Description |
|---|---|
bool
|
True when the file carries the |
pyflightstream.cases.SimCase
¶
Bases: BaseModel
One solver configuration with its sweep (SAD Section 5).
Attributes:
| Name | Type | Description |
|---|---|---|
sim_id |
str
|
Case identity; also names the managed folder
|
aircraft |
str
|
Aircraft or configuration name. |
description |
str
|
Free-text description. |
reynolds |
(float, optional)
|
Chord Reynolds number of the condition. |
mach |
(float, optional)
|
Free-stream Mach number. |
velocity |
(float, optional)
|
Free-stream velocity in m/s. |
freestream_profile |
(str, optional)
|
The ABSOLUTE path of a custom free-stream file (G15): a
velocity field over the YZ plane of the global frame, in metres and
metres per second, which the run writes as |
geometry |
(str, optional)
|
Path of the saved simulation the workflow opens. Matrix rows require
an |
boundaries_file |
(str, optional)
|
The selected inventory file, reported by the matrix plan. |
sweep |
SweepAxis
|
The sweep of this case. |
flight_condition_defaults |
(dict, optional)
|
The pins the row's setup artifact supplied for keys the row did
not state (PFS-2030.08). Beside |
flight_condition_defaults_from |
(str, optional)
|
Which setup supplied them, id and path. |
flight_condition |
(dict, optional)
|
The FLIGHT_CONDITION cell of the row this case came from, as WRITTEN: canonical key to value, in the units the keys name (PFS-2027.01). Empty when the case states none. It travels on the case UNINTERPRETED, and that is the layering
rather than laziness. Turning a constraint set into a flow state
needs the reference LENGTH, which lives in the reference
artifact, and binding that artifact is workspace work one layer
above this one. So this layer carries the constraints verbatim
and :func: |
fluid |
(FluidState, optional)
|
The RESOLVED air state, where a flight condition was resolved into one. Absent on a case whose row stated none and on every hand-written campaign that does not set it, which is what keeps such a case rendering exactly what it always rendered. |
reference |
(ReferenceData, optional)
|
Coefficient normalization references. |
solver |
SolverSettings
|
Runtime settings; defaults apply when omitted. |
recipe |
str
|
Script recipe reference, |
variables |
dict
|
Free per-case variables for the recipe (strings, numbers, or booleans), for example a symmetry declaration. |
outputs |
list of str
|
Output files the recipe's script exports, relative to the
execution directory; the loop collects them into that point's own
|
point |
dict of str to float
|
The current sweep point; filled by the campaign loop before the recipe builds, empty on the authored case. |
fs_build |
(str, optional)
|
Solver build this case runs on, named as a key of the It exists because a campaign declares ONE installation while a
study across two solver builds is a real question, and until
this field there was no way to state one at all: the run matrix
refused a second FS_BUILD value outright. The build id is
indirect on purpose. Putting the executable path here would put
a machine path in every stored |
pyflightstream.cases.SolverSettings
¶
Bases: BaseModel
Solver runtime settings of one case.
Runtime fields generally match the keywords of
:func:pyflightstream.script.helpers.solver_settings. Geometry controls
are applied by the workflow after import/open and before dimensional
frames or edge detection; they must not be forwarded to a late runtime call.
Attributes:
| Name | Type | Description |
|---|---|---|
iterations |
int
|
Solver iteration limit. |
convergence |
float
|
Residual threshold declaring convergence (FSM-26.120 p.200). |
forced_iterations |
(bool, optional)
|
Run the full iteration count regardless of convergence. The solver's own words are accepted too (see below). |
boundary_layer |
(str, optional)
|
The boundary layer model: |
viscous_coupling |
(bool, optional)
|
Couple the boundary layer model to the potential solution. The solver's own words are accepted too (see below). |
max_threads |
(int, optional)
|
Parallel core count; a row's |
runtime |
(RuntimeSettings, optional)
|
Launch-machine thread and affinity request; unset preserves existing behavior. |
timeout_s |
(float, optional)
|
Wall-clock limit for one point's solver process; enforced by the executor, not by FlightStream. |
walltime_margin_s |
(float, optional)
|
How much of a row's |
solver_model |
(str, optional)
|
The flow model the solver is initialized with, |
wall_collision_avoidance |
(bool, optional)
|
The wall-collision avoidance argument of |
convergence_iterations |
(int, optional)
|
Iterations the residual must hold under the threshold before the solver calls the run converged. |
minimum_cp |
(float, optional)
|
Floor applied to the pressure coefficient. |
farfield_layers |
(int, optional)
|
Farfield layer count, 1 to 5 as the command database documents; every run is expected to state 5. |
mesh_induced_wake_velocity |
(bool, optional)
|
Switches the solver's mesh-induced wake velocity. This toggle and the four below it are advanced settings, and the solver's own ENABLE and DISABLE are read as well as Python booleans. |
unsteady_pressure_and_kutta |
(bool, optional)
|
Switches the unsteady Bernoulli and Kutta terms of the unsteady solver. |
wake_on_wake_induction |
(bool, optional)
|
Switches the wake-on-wake induced velocity computation. |
additional_wake_relaxation |
(bool, optional)
|
Asks for one additional wake relaxation iteration. |
reynolds_averaged_drag |
(bool, optional)
|
Switches the Reynolds-averaged (flat plate) boundary layer calculations. |
solver_stabilization |
(float, optional)
|
Stabilization strength from 0 to 1 (FSM-26.120 p.346, documented range). A preset that gates it with a separate ENABLE/DISABLE key resolves the pair before it arrives here: disabled means None, not zero. |
laminar_separation |
(bool, optional)
|
Switches laminar boundary layer separation. |
kutta_joukowski_lift |
(bool, optional)
|
Computes the inviscid lift by the Kutta-Joukowski theorem, from the bound circulation, instead of integrating the surface pressure. |
aeroelastic_rbf_type |
(str, optional)
|
The radial basis function of the aeroelastic mesh morphing. |
aeroelastic_convergence_threshold |
(float, optional)
|
The convergence threshold of an aeroelastic coupling run
( |
solver_time_averaging |
list of int, optional
|
The first and the last time iteration the solver averages the
surface flow over ( |
print_rotor_induced_velocities |
(bool, optional)
|
Prints the rotor-induced velocities to the log at every time step of an unsteady run. |
adaptive_field_grid_refinement |
(bool, optional)
|
Refines the field-source grid where the solution needs it; the manual marks it transonic only. |
rotor_induced_velocity_blending |
(float, optional)
|
Blending factor for wake stabilization, dimensionless, between 0 and 1. |
wake_numerical_relaxation |
(float, optional)
|
Relaxation factor applied to the wake between iterations, dimensionless, between 0 and 1. |
wake_relaxation |
(bool, optional)
|
Relaxes the wake geometry between solver iterations. |
wake_decay_constant_per_m |
(float, optional)
|
Rate at which wake vorticity decays with distance, per metre. |
wake_streamwise_agglomeration |
(bool, optional)
|
Agglomerates wake filament edges along the streamwise direction, so the solver carries fewer wake elements. |
jet_wake_decay_normalized_length |
(float, optional)
|
Distance at which a jet wake decays to a tenth of its strength, in jet wake diameters. |
jet_wake_filaments_grid_induction |
(bool, optional)
|
Whether the jet wake filaments induce velocity on the mesh. |
adverse_gradient_boundary_layer |
(bool, optional)
|
Switches the adverse-pressure-gradient treatment of the boundary-layer model. |
vortex_ring_normalization |
(bool, optional)
|
Normalizes the vortex-ring strengths on the wake panels. |
wake_termination_revolutions |
(float, optional)
|
Wake termination stated in revolutions, negative counting backwards from the end of the run. Converted to time steps by the rotor builder, which is the only layer that knows how many steps a revolution is. |
wake_termination_steps |
(int, optional)
|
Wake termination stated in time steps, negative counting backwards from the end of the run, for a run type with a clock and no rotor. |
wake_termination_length |
(float, optional)
|
Wake termination stated as a length of wake in rotor radii (FR-321), converted by the rotor builder into time steps from the axial convection speed, the rotor speed and the step angle. A rotor row stating no termination keeps 4.0. At most one of this key and the two above reaches a row (FR-322). |
wake_termination_thrust_n |
(float, optional)
|
The rotor thrust in newtons whose momentum-theory induced velocity convects the wake where it exceeds the free-stream speed (FR-323). |
wake_termination_revolutions_cap |
(float, optional)
|
A revolution count the steps converted from a length never exceed (FR-323). |
wake_termination_x_m |
(float or 'DEFAULT', optional)
|
The X of the solver's wake end plane in metres in the simulation's
reference frame, the |
significant_digits |
(int, optional)
|
Output precision from 1 to 8 (FSM-26.120 p.284, documented range). |
reference_velocity_m_per_s |
(float, optional)
|
The velocity the coefficients are normalised on, in m/s; unstated, the free-stream velocity. |
vorticity_drag_families |
list of str, optional
|
The families whose induced drag comes from vorticity integration, by family name. |
axial_separation_families |
list of str, optional
|
The families on the axial flow separation list, by family name. |
delete_surfaces |
list of str, optional
|
The surfaces removed with |
slipstream_wake_stabilization |
(bool, optional)
|
The slipstream wake stabilization of each rotor motion the row
creates, |
load_solver_initialization |
(bool, optional)
|
Whether |
analysis_families |
list of str, optional
|
The families that enter the loads, by family name; every other boundary leaves the analysis. |
load_units |
(str, optional)
|
The unit the loads table prints its forces and moments in. |
inviscid_loads |
(bool, optional)
|
Reports the loads and moments without their viscous part. |
vorticity_lift_model |
(bool, optional)
|
Computes the lift from the vorticity field rather than from the integrated surface pressure. |
unsteady_viscous_coupling_iteration |
(int, optional)
|
The time step at which an unsteady run switches the viscous coupling on. |
Notes
The toggles accept the solver's own vocabulary as well as Python
booleans: viscous_coupling = 'DISABLE' in a settings file means
False, the same as viscous_coupling = false. A settings preset
carried over from the solver speaks ENABLE and DISABLE, and a
preset is often mixed (one flag in each vocabulary), so the model
reads both and stores the bool
(:func:pyflightstream.script.toggles.resolve_toggle). Any other
string is refused by name.
Examples:
>>> settings = SolverSettings(iterations=800, forced_iterations="ENABLE")
>>> settings.iterations, settings.forced_iterations, settings.convergence
(800, True, 1e-05)
pyflightstream.cases.SweepAxis
¶
Bases: BaseModel
The sweep of one case: which axis varies and its values.
Attributes:
| Name | Type | Description |
|---|---|---|
type |
str
|
The axis that varies: |
values |
list
|
Axis values; for |
held |
dict of str to float
|
Coordinates the row HOLDS at every point, in deg, keyed like the
swept axis and of the free stream, as |
points
¶
points() -> Iterator[dict[str, float]]
Iterate the sweep as named point coordinates.
Yields:
| Type | Description |
|---|---|
dict of str to float
|
One mapping per point, keyed |
Advanced¶
pyflightstream.cases.AXES_PLOT_COMPONENTS
module-attribute
¶
AXES_PLOT_COMPONENTS: tuple[str, ...] = (
"FX",
"FY",
"FZ",
"MX",
"MY",
"MZ",
)
pyflightstream.cases.AXIS_UNIT_VECTORS
module-attribute
¶
AXIS_UNIT_VECTORS: dict[str, tuple[float, float, float]] = {
"X": (1.0, 0.0, 0.0),
"Y": (0.0, 1.0, 0.0),
"Z": (0.0, 0.0, 1.0),
}
pyflightstream.cases.ActuatorBlock
¶
Bases: BaseModel
One actuator disc, declared as one block of the reference artifact (G06).
The linearized propeller slipstream the solver models with an actuator
(FSM-26.120 pp.185-187). Its GEOMETRY is the configuration's, so it lives in
the reference beside the rotors and the frames, as a top-level table with
kind = "actuator" whose NAME is the disc's name; its LOADING is the
condition's, so a row states it (ACTUATOR, ACTUATOR_RPM and one of
ACTUATOR_THRUST or PROFILE). A reference declaring a disc moves
nothing on a row that names none.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
str
|
|
frame |
str
|
The frame the disc's axis belongs to: a name the reference's
|
axis |
{'X', 'Y', 'Z'}
|
The frame's axis the disc turns about. |
offset_m |
float
|
The disc's position along that axis, from the frame's origin. |
tip_radius_m |
float
|
The disc's outer radius. |
hub_radius_m |
float
|
The disc's inner radius, |
rpm_sign |
int
|
|
blades |
(int, optional)
|
The blade count a profile file's distribution is read per; required
by a row stating |
swirl |
(float, optional)
|
The fraction, 0 to 1, of the swirl velocity kept downstream
( |
profile_units |
str
|
The force unit a profile file is written in, as the command database
spells |
pyflightstream.cases.AliasCycleError
¶
Bases: PyflightstreamError, ValueError
An alias resolves through itself, and both sides are named (FR-59).
An alias may name another alias, resolved to the end. That is what makes a cycle possible, so the reader refuses one rather than recursing: the message names the alias that closed the ring and the member that closed it, because a reader holding only one of the two names has to open the file to find the other.
pyflightstream.cases.BaseRegionOperation
¶
Bases: BaseModel
One explicit base-region action, executed in its declared order before initialization.
pyflightstream.cases.BladeDatum
¶
Bases: BaseModel
Where blade one sits, and the axis its azimuth is measured from (FR-60).
An azimuth needs a declared zero axis. The datum states both: { azimuth_deg = 45.0, zero =
"X" }. The zero is an axis letter with an optional sign and is refused when it lies within
about 5 degrees of the rotor axis (the refusal states the angle), because an angle from
that axis locates no radial direction.
Attributes:
| Name | Type | Description |
|---|---|---|
azimuth_deg |
float
|
Where blade one is, measured from |
zero |
str
|
The axis letter the azimuth is measured from, with at most one sign. |
pyflightstream.cases.BoundaryAliases
module-attribute
¶
BoundaryAliases = Annotated[
dict[str, list[str]], AfterValidator(_check_aliases)
]
pyflightstream.cases.CadImportOptions
¶
Bases: BaseModel
Native CAD tessellation and conversion declared under [import.cad].
The source file supplies its own units. These controls select how its bodies become a mesh; successful conversion does not establish mesh quality.
Examples:
>>> options = CadImportOptions(body_index=2)
>>> options.tessellation_density, options.num_curvature, options.body_index
('MEDIUM', 80, 2)
pyflightstream.cases.CampaignConfigError
¶
Bases: PyflightstreamError, ValueError
A campaign or case definition cannot be used as written.
A sweep point that cannot be tagged, a campaign file that does not
load, a recipe that does not resolve to a callable or whose
signature the loop cannot call. Distinct from
:class:~pyflightstream.cases.matrix.MatrixError, which is about
the pipe-delimited run-matrix format specifically.
Also inherits from ValueError.
pyflightstream.cases.CustomFlag
¶
Bases: BaseModel
One solver command a setup exposes to the matrix under a name (PFS-2035.20).
a setup declares the FlightStream command and the word a row uses for it, and the row then states the VALUE. RAW states a whole line and every row citing that setup emits the same one; a flag states the command and lets the row sweep what it is set to, which is what makes RAW the escape for a particular case rather than the ordinary way to reach a setting.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The word a matrix row writes in its VAR_NAMES_VALUES cell. It is read case folded, as every other row key is. |
command |
str
|
The FlightStream command the flag becomes, bare: the row supplies the arguments. A line with arguments is refused, because the value would then be stated twice and the two could disagree. |
before |
str or None
|
The phase the command is emitted before. None takes the phase the command's own database entry declares, which is the answer for every command that has one; state it only to move a CONTROL command, whose phase the database leaves open. |
setup |
str or None
|
The artifact the declaration came from, bound by the workspace for the run record and for the refusal. |
pyflightstream.cases.DerivedFrom
¶
Bases: BaseModel
Where a generated campaign.toml came from, recorded in itself.
A campaign the package wrote is otherwise byte-indistinguishable from one a user authored, and will be edited by someone who believes it is input. This marker is what makes the rule enforceable rather than conventional, and it lives IN the file rather than beside it because a file gets copied out of its folder.
Attributes:
| Name | Type | Description |
|---|---|---|
matrix |
str
|
The run-matrix path exactly as it was given to the conversion. Relative paths resolve against the campaign file's own folder when the marker is checked. |
matrix_sha256 |
str
|
sha256 of the matrix file's bytes at the moment of conversion, so a matrix edited afterwards makes the campaign stale. |
generated_at |
str
|
When the campaign was written, UTC, ISO 8601, ending in |
content_sha256 |
str
|
sha256 of this campaign's own canonical body
(:func: |
pyflightstream.cases.EXPANDING_SELECTORS
module-attribute
¶
EXPANDING_SELECTORS = ('all', 'each', 'each_blade')
pyflightstream.cases.EXPORT_KINDS
module-attribute
¶
EXPORT_KINDS: tuple[tuple[str, str, str, bool], ...] = (
("simulation", ".fsm", "SAVEAS", False),
(
"loads",
".txt",
"EXPORT_SOLVER_ANALYSIS_SPREADSHEET",
False,
),
(
"tecplot",
".dat",
"EXPORT_SOLVER_ANALYSIS_TECPLOT",
False,
),
("vtk", ".vtk", "EXPORT_SOLVER_ANALYSIS_VTK", False),
("csv", ".csv", "EXPORT_SOLVER_ANALYSIS_CSV", False),
(
"force_distributions",
"_force_distributions.txt",
"EXPORT_SOLVER_ANALYSIS_FORCE_DISTRIBUTIONS",
False,
),
(
"volume_section_vtk",
"_vsec.vtk",
"EXPORT_VOLUME_SECTION_VTK",
False,
),
(
"volume_section_tecplot",
"_vsec.dat",
"EXPORT_VOLUME_SECTION_TECPLOT",
False,
),
(
"sections",
"_cp.txt",
"EXPORT_ALL_SURFACE_SECTIONS",
False,
),
(
"sectional_loads",
"_sloads.txt",
"EXPORT_SURFACE_SECTIONAL_LOADS",
False,
),
("probes", "_probes.txt", "EXPORT_PROBE_POINTS", False),
(
"farfield_probes",
"_farfield_survey.txt",
"EXPORT_PROBE_POINTS",
False,
),
(
"plots",
"_plots.txt",
"UNSTEADY_SOLVER_EXPORT_PLOTS",
True,
),
(
"plot_residuals",
"_plot_residuals.txt",
"SAVE_PLOT_TO_FILE",
False,
),
(
"plot_loads",
"_plot_loads.txt",
"SAVE_PLOT_TO_FILE",
False,
),
(
"plot_sections_cp",
"_plot_cp_sections.txt",
"SAVE_PLOT_TO_FILE",
False,
),
(
"streamlines_surface",
"_sls.txt",
"EXPORT_ALL_SURFACE_STREAMLINES",
False,
),
(
"streamlines_off_body",
"_slo.txt",
"EXPORT_ALL_OFF_BODY_STREAMLINES",
False,
),
(
"trajectory_6dof",
"_trajectory_6dof.txt",
"EXPORT_6DOF_TRAJECTORY",
True,
),
("debug_fsm", "_debug.fsm", "SAVEAS", False),
("log", "_log.txt", "EXPORT_LOG", False),
)
pyflightstream.cases.EXPORT_KIND_MEANINGS
module-attribute
¶
EXPORT_KIND_MEANINGS: dict[str, str] = {
"simulation": "The point's final saved simulation, its solver state after the solve.",
"debug_fsm": "The solver state before output setup, for inspection only.",
"loads": "The loads table, the export every run is judged by.",
"tecplot": "The surface solution in Tecplot format, written by the package from the VTK export, preserving panel values in the reference frame; the native nodal singularity strength is carried only where the pproc sets singularity_strength = true.",
"vtk": "The surface solution in VTK format, as the solver writes it; the Tecplot is written from this same file.",
"csv": "The surface solution as a CSV table.",
"force_distributions": "The per-panel force distribution, saved once at the end of the run.",
"sections": "The pressure distribution of every surface section the pproc declares.",
"sectional_loads": "The sectional loads of every surface section the pproc declares.",
"probes": "The flow quantities at the probe points, after a steady solve.",
"plots": "The force and fluid plot histories of an unsteady run, one row per time step.",
"plot_residuals": "The solver's residual history as a text series, one row per iteration.",
"plot_loads": "The solver's load history as a text series, one row per iteration.",
"plot_sections_cp": "The section Cp plot as a text series, one x and Cp pair per section.",
"log": "The solver log, which turns a run into a residual verdict.",
}
pyflightstream.cases.EXPORT_KIND_SINCE
module-attribute
¶
EXPORT_KIND_SINCE: dict[str, tuple[int, int]] = {
"force_distributions": (0, 27),
"volume_section_vtk": (0, 27),
"volume_section_tecplot": (0, 27),
"plot_residuals": (0, 27),
"plot_loads": (0, 27),
"plot_sections_cp": (0, 27),
"streamlines_surface": (0, 40),
"streamlines_off_body": (0, 40),
"trajectory_6dof": (0, 40),
}
pyflightstream.cases.FAMILY_SELECTORS
module-attribute
¶
FAMILY_SELECTORS = (
"all",
"airframe",
"blades",
"each",
"each_blade",
)
pyflightstream.cases.FLUID_PLOT_PARAMETERS
module-attribute
¶
FLUID_PLOT_PARAMETERS = (
"CP_FREE",
"CP_REF",
"MACH",
"VELOCITY",
"VX",
"VY",
"VZ",
"STATIC_PRESSURE_RATIO",
"BL_MOMENTUM_THICKNESS",
"BL_DISPLACEMENT_THICKNESS",
"BL_TOTAL_THICKNESS",
"BL_SHAPE_FACTOR",
"BL_SKIN_FRICTION",
"BL_TRANSITION_MARKER",
)
pyflightstream.cases.FORCE_PLOT_PARAMETERS
module-attribute
¶
FORCE_PLOT_PARAMETERS: dict[str, tuple[str, str]] = {
"CL": ("CL", "COEFFICIENTS"),
"CDI": ("CDI", "COEFFICIENTS"),
"CDO": ("CDO", "COEFFICIENTS"),
"CDP": ("CDP", "COEFFICIENTS"),
"CDV": ("CDV", "COEFFICIENTS"),
"CD": ("CD", "COEFFICIENTS"),
"FX": ("FORCE_X", "NEWTONS"),
"FY": ("FORCE_Y", "NEWTONS"),
"FZ": ("FORCE_Z", "NEWTONS"),
"MX": ("MOMENT_X", "NEWTONS"),
"MY": ("MOMENT_Y", "NEWTONS"),
"MZ": ("MOMENT_Z", "NEWTONS"),
}
pyflightstream.cases.FluidState
¶
Bases: BaseModel
The resolved air state a case runs at (PFS-2027.05, PFS-2025.02.05).
Every field carries its unit in its name. It is the OUTPUT of resolving a flight condition, and it rides on the case so that a builder can emit it: the resolver lives in the workspace layer, which a builder cannot import, so the value travels rather than the computation.
source records WHICH branch produced the density, and it is not
decoration. A density solved to meet a Reynolds number is not a
point in any atmosphere, deliberately, and this field is what stops
a later reader treating it as an altitude and "fixing" it into one.
THIS IS THE RESOLVED STATE WITHOUT ITS INPUTS, and the distinction
matters for one claim. PFS-2027.05 says a reader can RECOMPUTE the
resolution rather than trust it; that is true of
ResolvedMatrix.conditions, which carries the condition as
written, the altitude and the ISA deviation, and it is NOT true of
this object, which carries none of the three.
Concretely: a FluidState cannot tell sea level at ISA+15 from an
altitude that happens to give the same temperature. Read the
resolved condition when the inputs matter; read this when the state
does.
pyflightstream.cases.ForcePlotGroup
¶
Bases: _LocatedSpec
One group of unsteady force plots: a name, a frame and the families summed.
THE FRAME DECIDES HOW MANY GROUPS THIS ENTRY IS (FR-65). One citing
MRP or a frame the reference declares is ONE group over the whole
cited set; one citing SMRP or RMRP is one per ROTOR, in that
rotor's own frame; one citing LOCAL_AXIS is one per BLADE. The
each selector stays beside them, because one group per family in a
COMMON frame is a reading no frame implies.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The group's name, which names its plots |
frame |
str
|
The frame the loads are measured in, which decides how many groups the entry is. |
families |
str or list of str
|
The families summed: a selector word, an alias, a family name, or a list of those. |
emits_per
property
¶
emits_per: Literal['once', 'rotor', 'blade', 'family']
What this entry is one of: once, rotor, blade or family.
The frame is asked first, because it is the statement that cannot be a second home for the same fact: a quantity measured in a blade's own axes is one per blade whatever the families say.
pyflightstream.cases.FrameSpec
¶
Bases: BaseModel
One custom coordinate system the reference's [[frames]] defines (PFS-2034.01, FR-72).
The row's rotation names an axis as <frame>-<X|Y|Z>, and the frame
is one the reference defines here or one the package creates (MRP). The origin
is in the geometry's own frame, the solver's reference frame, in metres, and the two
axes are direction vectors in that frame, free in length, refused when zero, parallel
or not orthogonal (cosine beyond 1e-8), naming the frame and both vectors; the third
axis is their right-handed cross product, as
:func:pyflightstream.script.helpers.coordinate_frame computes it.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The frame's name, which a row's |
origin |
tuple of three floats
|
The frame's origin, in the geometry's own frame, in metres. |
x_axis |
tuple of three floats
|
The direction of the frame's first axis. |
y_axis |
tuple of three floats
|
The direction of the frame's second axis; the third is their right-handed cross product. |
pyflightstream.cases.InputKey
¶
Bases: NamedTuple
One key of an input artifact, with what it means (G08).
The registries of keys that are not the fields of a model carry one of
these per key, beside the key: the matrix columns, the row keys of the run
types, the reserved keys of a setup preset and the tables of a geometry
sidecar. The generated input glossary, INPUTS.md, is written from them
and from the models, whose fields state their meaning in their own
docstrings. So a key added to one of these registries arrives WITH its
meaning, and a key that arrives without one fails the glossary's test.
Attributes:
| Name | Type | Description |
|---|---|---|
meaning |
str
|
What the key sets, in one sentence. |
values |
str
|
Its unit, or the values it takes; empty where the meaning says it. |
command |
str
|
The solver command it reaches, or several separated by |
accepted |
str
|
Where the key is accepted, for a key whose registry does not say it. |
unscripted |
str
|
For a key whose VALUE no line of the run's script carries: what takes the value instead, or that nothing applies it. The glossary writes it after the meaning, behind "No line of the script carries its value", so a row cannot read as a solver input the script never states. Empty for a key whose value reaches the script. |
pyflightstream.cases.MeshImport
¶
Bases: BaseModel
How a raw mesh is imported: the [import] table of its sidecar (G01).
A raw mesh (.obj, .stl) carries no length unit, so the file
that names its boundaries, <stem>.boundaries.toml beside it,
states the unit it is written in, and a workflow row naming the mesh
is refused without it rather than imported under an assumed one.
units goes to IMPORT and nowhere else. The simulation's own
length unit is always metres, because every length the reference and
the row state is in metres; the builder sets it after the import
(:data:pyflightstream.cases.workflows.SIMULATION_LENGTH_UNIT). The
value is only normalised here: which spellings a build takes is read
from the command database by the builder, per build.
CAD files additionally declare cad and units="FILE" because
IMPORT_CAD has no units argument. CAD translations after conversion are
in metres; tessellation is followed by explicit conversion to a mesh.
operations are the mesh operations applied right after the import,
in the order written (G03, :class:MeshOperation); empty when the
table declares none.
Attributes:
| Name | Type | Description |
|---|---|---|
units |
str
|
The raw mesh length unit, or FILE for CAD metadata; never assumed. |
operations |
tuple of MeshOperation
|
The mesh operations applied right after the import, in the order written. |
Examples:
>>> imported = MeshImport(units="mm")
>>> imported.units, imported.operations
('MM', ())
moving_operations
property
¶
moving_operations: tuple[MeshOperation, ...]
The operations that move, scale or copy the body: every one but rename.
A trailing-edge points file names edges of the mesh as the FILE holds it, and is checked against that file; one of these would carry the body's edges away from the points (G02).
names_after_renames
¶
names_after_renames(
names: Sequence[str],
) -> tuple[str, ...]
Return the boundary names as this import's renames leave them, in order.
The inventory a row cites for a raw mesh is the sidecar's
boundaries as the rename operations leave them (G03), which
is what the builder declares. This applies them and judges nothing:
a rename whose surface is absent at its step, or carried twice, is
passed over here and refused by the builder.
pyflightstream.cases.MeshOperation
¶
Bases: BaseModel
One mesh operation applied right after a raw mesh is imported (G03).
Declared in the geometry's sidecar, beside the unit, as one
[[import.operations]] table each, and applied in the order written,
in the reference frame:
scale:factors = [fx, fy, fz], each greater than zero;rename:surfaceandto, the new name;mirror:surfaceandplane(YZ,XZorXY); the mirrored copy joins its source, so the surface count is unchanged;translate:vector = [x, y, z], in the[import]unit;rotate:axis(X,YorZ) andangle_deg.
surface names the surface acted on by the name the file gives it,
or by a name an earlier rename gave; never by position. It is
:data:EVERY_SURFACE by default, which rename and mirror do not
take: each acts on one named surface.
Attributes:
| Name | Type | Description |
|---|---|---|
op |
{'scale', 'rename', 'mirror', 'translate', 'rotate'}
|
Which operation, and so which of the keys below it states. |
surface |
str
|
The surface acted on, by the file's name or an earlier rename's;
|
factors |
tuple of three floats, optional
|
A scale's factor along each axis, each greater than zero. |
vector |
tuple of three floats, optional
|
A translation's vector, in the |
axis |
({'X', 'Y', 'Z'}, optional)
|
The axis a rotation turns about. |
angle_deg |
(float, optional)
|
The angle of a rotation, in degrees. |
plane |
({'YZ', 'XZ', 'XY'}, optional)
|
The plane a mirror reflects in; the copy joins its source. |
to |
(str, optional)
|
A rename's new name, one word. |
pyflightstream.cases.NameField
dataclass
¶
NameField(
code: str,
scale: float,
width: int,
signed: bool,
magnitude: bool = False,
)
How one flight-condition variable is written in a point name.
code then the value times scale, rounded, zero-padded to
width characters; a signed field counts its sign in the width.
magnitude writes the field WITHOUT a sign and refuses a negative value
rather than dropping its sign. It lives here, beside signed, because it is the same kind of
fact about the same field, and a reader adding a variable reads this
dataclass and the table below. Held in a second table keyed by the same
keys, it had to be remembered at each call site and was remembered at one of
three: the sweep name and the duplicate-identity guard were writing the sign
the point name had just dropped (the architect lens, FIX-0220).
pyflightstream.cases.OPT_IN_EXPORT_KINDS
module-attribute
¶
OPT_IN_EXPORT_KINDS: tuple[str, ...] = (
"vtk",
"csv",
"force_distributions",
"debug_fsm",
)
pyflightstream.cases.PLOT_TYPES
module-attribute
¶
PLOT_TYPES: dict[str, str] = {
"plot_residuals": "RESIDUALS",
"plot_loads": "LOADS",
"plot_sections_cp": "SECTIONS_CP",
}
pyflightstream.cases.POINT_AXIS_KEYS
module-attribute
¶
POINT_AXIS_KEYS: dict[str, str] = {
"MACH": "MACH",
"TASmps": "TASmps",
"REmi": "REmi",
"ALTFT": "ALTFT",
"dISA": "dISA",
"RHOkgm3": "RHOkgm3",
"MUPas": "MUPas",
"ASMPS": "ASMPS",
"TK": "TK",
"PPA": "PPA",
"alpha": "ALPHA",
"beta": "BETA",
"advance_ratio": "ADVANCE_RATIO",
"RPM": "RPM",
"roll_rate": "roll_rate",
"pitch_rate": "pitch_rate",
"yaw_rate": "yaw_rate",
}
pyflightstream.cases.POINT_NAME_FIELDS
module-attribute
¶
POINT_NAME_FIELDS: dict[str, NameField] = {
"MACH": NameField("M", 1000.0, 3, False),
"TASmps": NameField("V", 10.0, 4, False),
"REmi": NameField("RE", 100.0, 3, False),
"ALTFT": NameField("ALT", 1.0, 5, False),
"dISA": NameField("DT", 10.0, 4, True),
"RHOkgm3": NameField("RHO", 10000.0, 5, False),
"MUPas": NameField("MU", 1000000000.0, 5, False),
"ASMPS": NameField("A", 10.0, 4, False),
"TK": NameField("T", 10.0, 4, False),
"PPA": NameField("PS", 1.0, 6, False),
"ALPHA": NameField("AL", 10.0, 4, True),
"BETA": NameField("BE", 10.0, 4, True),
"ADVANCE_RATIO": NameField("J", 100.0, 4, True),
"RPM": NameField("RPM", 1.0, 5, False, magnitude=True),
"roll_rate": NameField("P", 10.0, 4, True),
"pitch_rate": NameField("Q", 10.0, 4, True),
"yaw_rate": NameField("R", 10.0, 4, True),
}
pyflightstream.cases.PlotsSpec
¶
Bases: _SuggestsKeys
The [plots] table: which parameters, over which groups of families.
Attributes:
| Name | Type | Description |
|---|---|---|
parameters |
list of str
|
The force and moment parameters plotted for every group; unstated, all of them but CDP and CDV, the 26.125 drag split, named to be plotted. |
groups |
list of ForcePlotGroup
|
The groups of families, one plot per parameter each. |
pyflightstream.cases.PointState
¶
Bases: BaseModel
The flow state ONE point of a swept flight condition resolved to.
A row that sweeps a flow variable -- MACH:sweep, REmi:sweep, an
altitude -- states a DIFFERENT condition at every point, and the condition
is resolved where the reference length lives, one layer above this one. So
each point's resolved state travels here, keyed by the point, and
:func:case_at_point puts it on the case the builder is handed. A row that
sweeps an angle or a ratio resolves once and carries none of these.
Attributes:
| Name | Type | Description |
|---|---|---|
mach, velocity, reynolds |
float or None
|
The three the case has fields for, at this point. |
fluid |
FluidState or None
|
The whole resolved state, which is what a builder emits. |
flight_condition |
dict
|
The condition as stated for this point: the row's cell with the swept key at this point's value. |
flight_condition_defaults |
dict
|
The pins the setup supplied at this point. |
flight_condition_defaults_from |
str
|
Where those pins came from, in words a reader can act on. |
pyflightstream.cases.PprocSpec
¶
Bases: _SuggestsKeys
The post-processing specification a matrix row's PPROC cell names.
PFS-2029.07.01, the groups artifact IS the
home of post-processing and is renamed pproc. Twelve tables. groups
is exactly what the groups file held, a number to the families it
aggregates, and the polar tables are written per group of it; a
member is resolved by :func:select_group_members, and a group names ONE
alias as a string (a list, an empty one included, is refused); exports says which of
the export kinds a point writes, with VTK and CSV opt-in and the
existing kinds enabled unless set to false (the per-panel
force_distributions is opt-in too, and a steady point
also saves the solver's residual and load plots, and its section Cp plot
where sections declares any: plot_residuals, plot_loads and
plot_sections_cp); sections, plots and
probes are the solver definitions the builders emit before the solver runs; products
says which post-processed files are written after it. phase_locked gates and shapes the
phase-locked reduction, equations
adds derived columns to the unsteady polar, glossary says what the
user's own symbols mean, and names renames the unsteady polar's plot
columns for a downstream tool. The four ship together, because the model
forbids unknown keys and an artifact written for one of them is refused by
an install that lacks it. time_averaging asks for time-averaged
surfaces, and volume_section declares the one flow-field
plane a steady point cuts and exports (G05).
Attributes:
| Name | Type | Description |
|---|---|---|
groups |
dict of str to str
|
The groups the polar tables are written per, each naming ONE alias of the reference. |
phase_locked |
(PhaseLockedSpec, optional)
|
When the phase-locked reduction is generated, and over how many revolutions; absent, it is the series of blade passages. |
per_revolution |
(PerRevolutionSpec, optional)
|
The drift limit, in per cent, of the per-revolution product; absent, 1. |
qsteady_correction |
(QsteadyCorrectionSpec, optional)
|
The correction route and the diagnostic of a quasi-steady wheel's post; absent, none. Every route is off by default and not validated. |
equations |
dict of str to EquationSpec
|
Coefficients the post stage derives into the unsteady polar, keyed by the derived coefficient's name. |
glossary |
dict of str to str
|
What each of the user's own symbols means, listed in |
names |
dict of str to str
|
Renames a plot column of the unsteady polar and of the reductions, from the name the export prints to the one a reader's tool expects. |
exports |
dict of str to bool
|
Which of the export kinds a point writes. |
time_averaging |
(SurfaceTimeAveragingSpec, optional)
|
Asks the solver for surface exports averaged over the last iterations or revolutions of the run. |
vtk_variables |
list of str, optional
|
The variables the VTK surface export writes. |
singularity_strength |
bool
|
Whether the Tecplot surface carries the nodal |
sections |
SectionsSpec
|
The surface-section distributions the script declares before the solve. |
volume_section |
(VolumeSectionSpec, optional)
|
The one flow-field plane each point of a steady row cuts after its solve and exports. |
plots |
PlotsSpec
|
The unsteady force plots: which parameters, over which groups of families. |
probes |
list of ProbesSpec
|
The fluid probe entries, one per frame sampled. |
farfields |
list of FarfieldSpec
|
Named far-field entries, one variant and optional window each (FR-454); absent, the artifact plans and posts as before. |
products |
ProductsSpec
|
Which post-processed tables the campaign writes. |
blade_pattern |
str
|
How a blade family is told from the airframe: a regular expression over the family name. |
Notes
A base region is declared by the boundaries file's [base_regions.<family>],
by a row's BASE_REGIONS column for a per-row choice, or by the setup's
base_region_operations on an opened simulation; base_regions here is
refused by name (PFS-2252).
farfield
property
¶
farfield: FarfieldSpec | None
Return the entry of an analysis-specific planning or post context.
group_alias
¶
group_alias(name: str) -> str | None
Return the ONE alias group name names, or None where it names several.
equation_order
¶
equation_order() -> list[str]
Return the order the equations must be evaluated in.
An equation may name another equation, and the user writes them in a TOML table, which has no order anyone may rely on. So chaining is a feature only if the package can say WHICH ORDER, and an order exists only if a cycle is refused, because a cycle has none.
A symbol the table does not define is a BASE VARIABLE and not a missing
dependency. That direction matters more than it looks: the generated
guide's own worked example is expression = "CT * 2", and treating
every unknown symbol as unresolved would refuse the first equation any
user writes.
The expression is PARSED rather than searched, so CT inside
CTX_WIND is not read as a reference to CT. A substring reader
invents dependencies and then invents cycles out of pairs that have
none.
Returns:
| Type | Description |
|---|---|
list of str
|
Every equation name exactly once, each after every equation its expression names. Ties keep declaration order, so the answer is stable across runs and a diff of two products is about the numbers. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
When the equations are circular, naming the members of the cycle. "Circular" alone would send the user back to a TOML table to find the loop by eye. |
is_blade
¶
is_blade(family: str) -> bool
Whether one family name is a blade by this artifact's pattern.
outputs
¶
outputs(unsteady: bool) -> list[str]
Return the output names a row naming this artifact declares.
A volume section adds no file of its own: it adds only the sampling
source the probes or plots export already writes ({name}_probes.txt,
or {name}_plots.txt on an unsteady row).
samples_normal_probes
¶
samples_normal_probes() -> bool
Whether an unsteady row has entries sampled as normal probe points.
True when the artifact declares at least one [[probes]] entry and
at least one entry states kind = "default". Mixed entries keep their
independent sampling routes. Steady callers do not ask this question.
Returns:
| Type | Description |
|---|---|
bool
|
Whether any entry needs the final probe-points export. |
pyflightstream.cases.ProbeLine
¶
Bases: _SuggestsKeys
One line of fluid probes, from one vertex to another, sampled at points.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
tuple of three floats
|
The first vertex, in the entry's frame and scale. |
end |
tuple of three floats
|
The last vertex, in the entry's frame and scale. |
pyflightstream.cases.ProbesSpec
¶
Bases: _LocatedSpec
One [[probes]] entry: fluid plots along lines, in a frame, per parameter.
Each line is sampled at points vertices from start to end. Every vertex gets one
UNSTEADY_SOLVER_NEW_FLUID_PLOT per parameter, named {parameter}{n}, with n counting
vertices across lines in input order. scale specifies metres or rotor radii.
propeller_radius is refused with the replacement rotor_radius.
An entry drawing or citing points must state nonempty parameters;
otherwise loading refuses it. field_formats and reusable_inflow
supply VX, VY and VZ automatically: the validator appends them to
parameters when either is set. On steady and normal entries the
parameters enable the fixed native probe export rather than filtering it.
Attributes:
| Name | Type | Description |
|---|---|---|
frame |
str
|
The frame the lines and planes are laid out in; empty, the rotor's own hub frame. |
parameters |
list of str
|
The fluid parameters sampled at every point; VX, VY and VZ are appended when
|
points |
int
|
The vertices each line is sampled at, both ends included. |
scale |
{'m', 'rotor_radius'}
|
What the coordinates are in: metres, or radii of the row's rotor. |
lines |
list of ProbeLine
|
Lines of probes, each from one vertex to another. |
rectangles |
list of ProbeRectangle
|
Rectangular probe planes, each gridded point by point. |
circles |
list of ProbeCircle
|
Circular probe planes, each gridded in polar coordinates. |
lattices |
list of LatticeShape
|
Cylindrical survey lattices, each laid out by |
points_file |
(str, optional)
|
The name of a points file of |
kind |
{'default', 'instantaneous'}
|
How an unsteady row samples the entry: |
pyflightstream.cases.ProductsSpec
¶
Bases: _SuggestsKeys
The [products] table: which post-processed CSV tables the campaign writes.
polars: one table per group of [groups], the coefficients of the
group per point; sections: one table per point from its sectional
loads export; plots: one table per unsteady point from its plots
export. All CSV, one header line and one row per record.
custom_polar_format: beside every polar table, the same rows in the
fixed-width text format the existing tooling opens
(PFS-2014.01.01), <polar>_M<mach code>_g<group>.dat. Off by
default, since it is a second serialization of the polar table for
one reader.
Attributes:
| Name | Type | Description |
|---|---|---|
polars |
bool
|
Writes one polar table per group of |
sections |
bool
|
Writes one sections table per point, from its sectional loads export. |
plots |
bool
|
Writes one plots table per unsteady point, from its plots export. |
custom_polar_format |
bool
|
Writes, beside every polar table, the same rows in the fixed-width custom polar format. |
trimmed_polar |
bool
|
Writes, beside every polar table, |
rotor_cn_slope |
bool
|
Writes, beside every rotor table, |
merged_polar |
bool
|
Writes, beside the unsteady polar, |
rotate_columns |
dict of str to str
|
The ROTATE angles the merged polar writes as columns, in degrees: each column's
name to |
polar_format |
str
|
The format the FAM and group files of |
settings_codebook |
bool
|
Writes, per matrix, the all-numeric settings table of every recorded
point and its codebook under |
installed_frame |
list of str
|
The families of table copied mirrored through y = 0 beside their
source, from |
pyflightstream.cases.RAW_PHASES
module-attribute
¶
RAW_PHASES: tuple[str, ...] = (
Phase.CONTROL.value,
*(
phase.value
for phase in Phase
if phase is not Phase.CONTROL
),
)
pyflightstream.cases.RESERVED_FRAME_NAMES
module-attribute
¶
RESERVED_FRAME_NAMES: tuple[str, ...] = ('MRP',)
pyflightstream.cases.RawCommand
¶
Bases: BaseModel
One solver command a setup artifact states verbatim (PFS-2033.01).
(design/69): the user writes the command
line as the solver reads it, arguments included, and names the phase
it goes before; the builders emit it through the same emitter every
curated helper uses, so the database's grammar, version, argument
and phase checks apply to it unchanged. setup is the artifact
the entry came from, bound by the workspace for the run record.
Attributes:
| Name | Type | Description |
|---|---|---|
command |
str
|
The command line as the solver reads it, arguments included. |
before |
str
|
The phase the line is emitted before: |
setup |
str or None
|
The artifact the entry came from, bound by the workspace. |
source |
str or None
|
Where the line came from, for the run record and a refusal. |
pyflightstream.cases.RawMeshConditions
¶
Bases: BaseModel
The boundary conditions a raw mesh's sidecar declares (G02, Q1).
trailing_edges is required of every raw mesh a workflow imports,
and the builder refuses one without it. wake_termination detects
wake-termination nodes, "auto" over every surface or by the
surfaces named; base_regions = "auto" detects base regions over
the whole mesh. Both are None unless written.
Examples:
>>> conditions = RawMeshConditions(
... trailing_edges=TrailingEdgeMarking(route="detect"), base_regions="auto"
... )
>>> conditions.trailing_edges.route, conditions.wake_termination, conditions.base_regions
('detect', None, 'auto')
pyflightstream.cases.ReferenceData
¶
Bases: BaseModel
Reference quantities for coefficient normalization.
Attributes:
| Name | Type | Description |
|---|---|---|
area |
float
|
Reference area S_ref in simulation length units squared by default; square metres when normalization_units is SI. |
length |
float
|
Reference length L_ref in simulation length units by default; metres when normalization_units is SI. |
velocity |
(float, optional)
|
Reference velocity in m/s; None lets the recipe default it to the free-stream velocity (steady runs) or a characteristic velocity such as the rotor tip speed (FSM-26.120 p.201). |
rotor_diameter |
(float, optional)
|
Rotor diameter D in simulation length units, carried from
the reference artifact's |
pyflightstream.cases.RotorBlock
¶
Bases: BaseModel
One rotor, declared as one block of the reference artifact (FR-60).
The block's NAME is an alias over
everything the rotor owns, the union of :attr:families_general and
:attr:families_blades in that order: what a row moves when it cites
it, and what a group summing the rotor sums.
THE NAME IS FREE, AND A TRAILING DIGIT IS FINE: the eight lifters of
a four-a-side aircraft are LIFT_L1 to LIFT_R4. What it may
not carry is _SMRP or _RMRP, the radical of the frames the
package builds from it (the static and rotating moment reference
points of the rotor), because then a rotor and a frame spell the
same. PFS-2035.02 said a name ending in a digit is refused, which was
true of the frame names and would refuse the reference study
under these: the number in <ALIAS>_RMRP<k> follows RMRP, never
the alias.
Attributes:
| Name | Type | Description |
|---|---|---|
alias |
str
|
The word a row moves. It is the block's NAME, and this field is a restatement of it: a reference file may leave it out and the reader fills it in from the name before the block is built; stated, it must equal the name, case folded, and a block whose two names disagree is refused naming both. IT IS REQUIRED ON THE MODEL even though a file may omit it,
because everything downstream reads it as the rotor's identity:
it is the radical of the frames, the word written back into
MOVING_BC_ALIAS, and what a refusal names. An optional field left
None built frames called |
x_m, y_m, z_m |
float
|
The hub, in the geometry's own frame. |
axis |
str or mapping
|
A shaft letter or |
rpm_sign |
int
|
|
diameter_m |
float
|
The length an ADVANCE_RATIO resolves against, PER ROTOR: one ratio written once in the flight condition gives each rotor a speed of its own (FR-63). |
families_general |
list of str
|
What turns with the rotor and is NOT a blade, the spinner and the hub. It has no local axis of its own: its local frame IS the rotor's. |
families_blades |
list of str
|
One entry per blade, in positive right-hand order about the shaft. Planning checks readable mesh centroids against this order and names the list to write on a mismatch greater than a quarter blade pitch. RPM sign does not change this order. THE BLADE COUNT IS THE LENGTH OF THIS LIST, so a row states no blade count and a sector mesh carrying one blade of four still reduces over four. |
blade1 |
BladeDatum
|
Where blade one sits, and the axis its azimuth is measured from. |
id |
int
|
The rotor's integer id, 0 or more, unique within the reference,
default 0: the |
kind |
str
|
|
blade_count
property
¶
blade_count: int
The number of blades, which is the length of :attr:families_blades.
members
property
¶
members: list[str]
Everything the rotor owns, general families first, in the order written.
origin
property
¶
origin: tuple[float, float, float]
The hub, as the three coordinates a motion is built on.
axis_vector
property
¶
axis_vector: tuple[float, float, float]
The shaft direction as a UNIT vector, whichever way it was written.
Every frame the package builds for this rotor uses its declared axis rather than assuming zero pitch and toe.
pyflightstream.cases.SOLVER_SETTING_COMMANDS
module-attribute
¶
SOLVER_SETTING_COMMANDS: dict[str, str] = {
"simulation_length_unit": "SET_SIMULATION_LENGTH_UNITS",
"vertex_merge_tolerance_m": "SET_VERTEX_MERGE_TOLERANCE",
"geometric_edge_bluntness_angle_deg": "SET_GEOMETRIC_EDGE_BLUNTNESS_ANGLE",
"iterations": "SOLVER_SET_ITERATIONS",
"convergence": "SOLVER_SET_CONVERGENCE",
"forced_iterations": "SOLVER_SET_FORCED_ITERATIONS",
"boundary_layer": "SET_BOUNDARY_LAYER_TYPE",
"viscous_coupling": "SET_SOLVER_VISCOUS_COUPLING",
"viscous_excluded": "SET_VISCOUS_EXCLUDED_BOUNDARIES",
"surface_roughness": "SET_SURFACE_ROUGHNESS",
"bulk_separation": "CREATE_BULK_SEPARATION",
"airfoil_separation": "CREATE_AIRFOIL_SEPARATION",
"axial_vortex_separation": "CREATE_AXIAL_VORTEX_SEPARATION",
"cylindrical_bulk_separation": "CREATE_CYLINDRICAL_BULK_SEPARATION",
"stratford_bulk_separation": "CREATE_STRATFORD_BULK_SEPARATION",
"delete_separations": "DELETE_SEPARATION",
"valarezo_criterion": "VALAREZO_CRITERION",
"valarezo_separation_boundaries": "SET_VALAREZO_SEPARATION_BOUNDARIES",
"crossflow_separation_boundaries": "SET_CROSSFLOW_SEPARATION_BOUNDARIES",
"crossflow_separation_diameter": "SET_CROSSFLOW_SEPARATION_DIAMETER",
"crossflow_separation_mean_diameter": "SET_CROSSFLOW_SEPARATION_CP",
"crossflow_separation_axisymmetric": "SET_CROSSFLOW_SEPARATION_AXISYMMETRIC",
"legacy_solver_model": "SET_SOLVER_MODEL",
"trailing_edge_types": "SET_TRAILING_EDGE_TYPE",
"disabled_wake_trailing_edges": "DISABLE_WAKE_NODES_ON_TRAILING_EDGE",
"leading_edge_wake_boundaries": "DETECT_LEADING_EDGES_WAKES_BY_SURFACE",
"mark_wake_termination_nodes": "MARK_WAKE_TERMINATION_NODES",
"delete_inlets": "DELETE_INLET",
"delete_outlets": "DELETE_OUTLET",
"proximal_boundaries": "SOLVER_PROXIMAL_BOUNDARIES",
"remove_initialization": "REMOVE_INITIALIZATION",
"base_region_bending_angle_deg": "SET_BASE_REGION_BENDING_ANGLE",
"delete_transition_trips": "DELETE_TRANSITION_TRIP",
"clear_vorticity_drag_boundaries": "DELETE_VORTICITY_DRAG_BOUNDARIES",
"max_threads": "SET_MAX_PARALLEL_THREADS",
"runtime": "SET_MAX_PARALLEL_THREADS",
"solver_model": "INITIALIZE_SOLVER",
"wall_collision_avoidance": "INITIALIZE_SOLVER",
"convergence_iterations": "SET_SOLVER_CONVERGENCE_ITERATIONS",
"minimum_cp": "SOLVER_MINIMUM_CP",
"farfield_layers": "SOLVER_SET_FARFIELD_LAYERS",
"mesh_induced_wake_velocity": "SOLVER_SET_MESH_INDUCED_WAKE_VELOCITY",
"unsteady_pressure_and_kutta": "SOLVER_UNSTEADY_PRESSURE_AND_KUTTA",
"wake_on_wake_induction": "SET_WAKE_ON_WAKE_INDUCTION",
"additional_wake_relaxation": "ADDITIONAL_WAKE_RELAXATION_ITERATION",
"reynolds_averaged_drag": "REYNOLDS_AVERAGED_DRAG_FORCES",
"solver_stabilization": "SOLVER_STABILIZATION",
"laminar_separation": "LAMINAR_SEPARATION",
"kutta_joukowski_lift": "KUTTA_JOUKOWSKI_LIFT_FORCES",
"aeroelastic_rbf_type": "AEROELASTIC_RBF_TYPE",
"print_rotor_induced_velocities": "PRINT_ROTOR_INDUCED_VELOCITIES",
"adaptive_field_grid_refinement": "SET_ADAPTIVE_FIELD_GRID_REFINEMENT",
"rotor_induced_velocity_blending": "ROTOR_INDUCED_VELOCITY_BLENDING",
"wake_numerical_relaxation": "SET_WAKE_NUMERICAL_RELAXATION",
"wake_relaxation": "SET_WAKE_RELAXATION",
"wake_decay_constant_per_m": "SET_WAKE_DECAY_CONSTANT",
"wake_streamwise_agglomeration": "SET_WAKE_STREAMWISE_AGGLOMERATION",
"jet_wake_decay_normalized_length": "SET_JET_WAKE_DECAY_NORMALIZED_LENGTH",
"jet_wake_filaments_grid_induction": "SET_JET_WAKE_FILAMENTS_GRID_INDUCTION",
"adverse_gradient_boundary_layer": "SOLVER_SET_ADVERSE_GRADIENT_BOUNDARY_LAYER",
"vortex_ring_normalization": "SOLVER_VORTEX_RING_NORMALIZATION",
"wake_termination_revolutions": "SET_WAKE_TERMINATION_TIME_STEPS",
"wake_termination_steps": "SET_WAKE_TERMINATION_TIME_STEPS",
"wake_termination_length": "SET_WAKE_TERMINATION_TIME_STEPS",
"wake_termination_thrust_n": "SET_WAKE_TERMINATION_TIME_STEPS",
"wake_termination_revolutions_cap": "SET_WAKE_TERMINATION_TIME_STEPS",
"wake_termination_x_m": "INITIALIZE_SOLVER",
"significant_digits": "SET_SIGNIFICANT_DIGITS",
"reference_velocity_m_per_s": "SOLVER_SET_REF_VELOCITY",
"freestream_input": "SOLVER_SET_MACH_NUMBER",
"reference_mach": "SOLVER_SET_REF_MACH_NUMBER",
"disable_reference_velocity": "DISABLE_SOLVER_REF_VELOCITY",
"vorticity_drag_families": "SET_VORTICITY_DRAG_BOUNDARIES",
"axial_separation_families": "SET_AXIAL_SEPARATION_BOUNDARIES",
"delete_surfaces": "DELETE_SURFACES",
"slipstream_wake_stabilization": "SET_MOTION_SLIPSTREAM_WAKE_STABILIZATION",
"load_solver_initialization": "OPEN",
"analysis_families": "SET_SOLVER_ANALYSIS_BOUNDARIES",
"load_units": "SET_LOADS_AND_MOMENTS_UNITS",
"inviscid_loads": "SET_INVISCID_LOADS",
"vorticity_lift_model": "SET_VORTICITY_LIFT_MODEL",
"unsteady_viscous_coupling_iteration": "SET_UNSTEADY_VISCOUS_COUPLING_ITERATION",
"moments_model": "SET_ANALYSIS_MOMENTS_MODEL",
"unsteady_solver_actions": "SET_NEW_UNSTEADY_SOLVER_ACTION",
"aeroelastic_convergence_threshold": "SET_AEROELASTIC_CONVERGENCE_THRESHOLD",
"solver_time_averaging": "ENABLE_SOLVER_TIME_AVERAGING",
}
pyflightstream.cases.STEADY_ONLY_EXPORT_KINDS
module-attribute
¶
STEADY_ONLY_EXPORT_KINDS: frozenset[str] = frozenset(
{"probes"}
)
pyflightstream.cases.ScriptRecipe
¶
Bases: Protocol
A function that turns one case point into script emissions.
Implementations receive the per-point specialized case (the
campaign loop fills :attr:SimCase.point and stages the geometry)
and an empty :class:~pyflightstream.script.Script bound to the
campaign's FlightStream version; they emit the whole script,
usually through the curated helpers. Output files must use paths
relative to the execution directory, so the collected evidence
stays inside the managed simulation folder, and must be the names
the loop rendered into :attr:SimCase.outputs: those are the ones
it collects, and they carry the sweep point.
pyflightstream.cases.SectionDistribution
¶
Bases: _LocatedSpec
One surface-section distribution: families, frame and planes.
Attributes:
| Name | Type | Description |
|---|---|---|
families |
str or list of str
|
What the sections cut: a selector word, an alias, a family name, or a list of those. |
frame |
str
|
The frame the planes belong to: |
planes |
list of {'XY', 'XZ', 'YZ'}
|
The planes of that frame the sections lie in, one distribution each. |
count |
(int, optional)
|
The number of sections of this entry; unstated, the |
plot_direction |
({1, 2}, optional)
|
The plot direction of this entry; unstated, the |
integrate |
bool
|
Appends the midpoint-strip integrals of the sectional loads to this distribution's CSV. |
pyflightstream.cases.SectionsSpec
¶
Bases: _SuggestsKeys
The [sections] table: NEW_SURFACE_SECTION_DISTRIBUTION per entry and plane.
Attributes:
| Name | Type | Description |
|---|---|---|
count |
int
|
The number of sections of every distribution that states none. |
plot_direction |
{1, 2}
|
The plot direction of every distribution that states none. |
include_symmetry |
bool
|
The command's INCLUDE_SYMMETRY argument, one value for the whole artifact, because symmetry is a property of the case. |
distributions |
list of SectionDistribution
|
The distributions, one command per entry and plane. |
split |
{'point', 'family', 'both'}
|
The files the post writes of the sections and Cp tables: one per point
( |
pyflightstream.cases.SolverToggle
module-attribute
¶
SolverToggle = Annotated[
bool,
BeforeValidator(
_resolve_settings_toggle,
json_schema_input_type=Toggle,
),
]
pyflightstream.cases.SurfaceProbeSpec
¶
Bases: _LocatedSpec
One surface property recorded at a named-frame point during an unsteady march.
pyflightstream.cases.SurfaceTimeAveragingSpec
¶
Bases: _SuggestsKeys
The last iterations or revolutions used for solver surface averaging.
Attributes:
| Name | Type | Description |
|---|---|---|
last_revs |
(float, optional)
|
Averages the surface exports over the last revolutions of the rotor clock. |
last_iters |
(int, optional)
|
Averages the surface exports over the last time iterations; a table states exactly one of the two. |
pyflightstream.cases.TEMPLATE_SETTINGS_LEFT_OUT
module-attribute
¶
TEMPLATE_SETTINGS_LEFT_OUT: tuple[str, ...] = (
"runtime",
"apply_trailing_edges",
"apply_wake_termination",
"apply_base_regions",
"simulation_length_unit",
"vertex_merge_tolerance_m",
"geometric_edge_bluntness_angle_deg",
"actuator_operations",
"base_region_operations",
"base_region_bending_angle_deg",
"delete_inlets",
"delete_outlets",
"proximal_boundaries",
"remove_initialization",
"delete_transition_trips",
"clear_vorticity_drag_boundaries",
"viscous_excluded",
"surface_roughness",
"legacy_solver_model",
"trailing_edge_types",
"bulk_separation",
"airfoil_separation",
"axial_vortex_separation",
"cylindrical_bulk_separation",
"stratford_bulk_separation",
"delete_separations",
"valarezo_criterion",
"valarezo_separation_boundaries",
"crossflow_separation_boundaries",
"crossflow_separation_diameter",
"crossflow_separation_mean_diameter",
"crossflow_separation_axisymmetric",
"disabled_wake_trailing_edges",
"leading_edge_wake_boundaries",
"mark_wake_termination_nodes",
"forced_iterations",
"max_threads",
"timeout_s",
"walltime_margin_s",
"solver_model",
"convergence_iterations",
"minimum_cp",
"mesh_induced_wake_velocity",
"unsteady_pressure_and_kutta",
"wake_on_wake_induction",
"additional_wake_relaxation",
"reynolds_averaged_drag",
"laminar_separation",
"kutta_joukowski_lift",
"aeroelastic_rbf_type",
"print_rotor_induced_velocities",
"adaptive_field_grid_refinement",
"rotor_induced_velocity_blending",
"wake_numerical_relaxation",
"wake_relaxation",
"wake_decay_constant_per_m",
"wake_streamwise_agglomeration",
"jet_wake_decay_normalized_length",
"jet_wake_filaments_grid_induction",
"adverse_gradient_boundary_layer",
"vortex_ring_normalization",
"wake_termination_revolutions",
"wake_termination_steps",
"wake_termination_length",
"wake_termination_thrust_n",
"wake_termination_revolutions_cap",
"wake_termination_x_m",
"significant_digits",
"reference_velocity_m_per_s",
"freestream_input",
"reference_mach",
"disable_reference_velocity",
"vorticity_drag_families",
"axial_separation_families",
"load_solver_initialization",
"analysis_families",
"load_units",
"inviscid_loads",
"vorticity_lift_model",
"unsteady_viscous_coupling_iteration",
"delete_surfaces",
"slipstream_wake_stabilization",
"moments_model",
"unsteady_solver_actions",
"aeroelastic_convergence_threshold",
"solver_time_averaging",
)
pyflightstream.cases.TrailingEdgeMarking
¶
Bases: BaseModel
How a raw mesh's trailing edges are marked: its sidecar's [trailing_edges] (G02).
A raw mesh carries no trailing edge, and without one the solver makes no wake and runs and answers anyway, so a raw mesh declares one.
route = "file" is the default route. points_m are the mid-points
of the trailing-edge mesh edges, in metres, read
from the points file the table names and checked against the mesh when
the row is bound (:mod:pyflightstream.workspace.wake_edges); the
builder converts them, and tolerance, which is also in metres, into the
simulation's length unit the setup states, writes them as the solver's
node file in that unit and imports it with
IMPORT_WAKE_EDGES_FROM_FILE, giving every edge edge_type and
matching within tolerance. points_file is where they were read
from, for a refusal to name; it is kept out of every dump, since it is
a path on one machine.
route = "detect" marks by the solver's detection:
detect_surfaces names the surfaces to detect on, by the sidecar's
names, and is empty for every surface; sweep_angle_deg and
bluntness_angle_deg are set before the detection when stated.
Detection gives every edge the STANDARD type and reads no tolerance.
Examples:
>>> marking = TrailingEdgeMarking(route="detect")
>>> marking.route, marking.edge_type, marking.detect_surfaces
('detect', 'STANDARD', ())
points_m
property
¶
points_m: tuple[tuple[float, float, float], ...]
Return the first file's points in metres.
points_file
property
¶
points_file: str | None
Return the first file's local path, excluded from records.
model_copy
¶
model_copy(*, update=None, deep=False)
Preserve the legacy first-file update spelling for existing callers.
pyflightstream.cases.VOLUME_SECTION_KINDS
module-attribute
¶
VOLUME_SECTION_KINDS: dict[str, str] = {
"vtk": "volume_section_vtk",
"tecplot": "volume_section_tecplot",
}
pyflightstream.cases.VOLUME_SECTION_PRISMS
module-attribute
¶
VOLUME_SECTION_PRISMS: tuple[str, float, int, float] = (
"NONE",
0.1,
1,
1.2,
)
pyflightstream.cases.VolumeSectionSpec
¶
Bases: _LocatedSpec
A sampled flow plane, generated from explicit reference-frame probes.
New runs export samples and post converts them to VTK or Tecplot. Existing native section files retain their recorded meaning. Coordinates are meters in the declared frame; a frame with unknown placement is refused.
Attributes:
| Name | Type | Description |
|---|---|---|
shape |
{'rectangle', 'circle'}
|
Rectangular or annular sampling domain. |
frame |
str
|
Frame containing the plane; MRP by default, or explicit REFERENCE. |
plane |
{'XY', 'XZ', 'YZ'}
|
In-plane coordinate axes, in the written order. |
offset_m |
float
|
Distance along the remaining positive frame axis, in meters. |
corners_m |
tuple of four floats
|
Rectangle lower and upper diagonal coordinates u0, v0, u1, v1. |
refinement_layers |
int
|
Rectangle subdivisions: each extra layer bisects every grid interval. |
radii_m |
tuple of two floats
|
Circle inner and outer radii in meters. |
points |
tuple of two ints
|
Rectangle u/v counts (default 25 by 25); circle radial/azimuth counts. Rectangle endpoints are included; a circular center is sampled once. |
format |
{'vtk', 'tecplot'}
|
Post field format, with explicit point topology and SI provenance. |
kind |
{'default', 'instantaneous'}
|
How an unsteady or rotor row samples the plane: |
pyflightstream.cases.case_at_point
¶
case_at_point(
case: SimCase,
point: Mapping[str, float],
**update: object,
) -> SimCase
Return the case AT one point of its sweep, resolved state included.
Every point of a run passes through here: the point rides on the case, and when the row swept a flow variable the state that point resolved to replaces the row's. Without it a MACH sweep would emit the first point's Mach number on every point of the row, which is the defect that makes the feature a lie rather than a limitation.
pyflightstream.cases.check_recipe
¶
check_recipe(reference: str, recipe: Callable) -> None
Refuse a callable the campaign loop could not call.
The loose form of a script builder, build(workdir) -> Script,
is what everyone arriving from a driver script has; called by the
loop it raises a bare TypeError once per point, after the pre-flight
has already accepted the campaign. Refusing at resolution names the
protocol and the signature found, once, before anything runs.
Callables whose signature cannot be read (builtins, C extensions)
pass: the library does not refuse what it cannot inspect.
pyflightstream.cases.classify_outputs
¶
classify_outputs(
names: Sequence[str],
*,
package_version: str | None = None,
) -> dict[str, str]
Map each export kind to the declared output name that carries its suffix.
Longest suffix first, so _cp.txt is claimed by the sections kind
before the loads kind can see a .txt. A kind no name matches is
absent from the result; a second name matching an already claimed
kind is left unclassified rather than overwriting the first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
sequence of str
|
The output names, declared or recorded. |
required |
package_version
|
str
|
The |
None
|
Returns:
| Type | Description |
|---|---|
dict of str to str
|
Each export kind a name carries, mapped to that name. |
Examples:
>>> from pyflightstream.cases import classify_outputs
>>> classify_outputs(["P_vsec.vtk"])
{'volume_section_vtk': 'P_vsec.vtk'}
>>> classify_outputs(["P_vsec.vtk"], package_version="0.26.0")
{'vtk': 'P_vsec.vtk'}
pyflightstream.cases.default_outputs
¶
default_outputs(
unsteady: bool,
exports: Mapping[str, bool] | None = None,
*,
has_sections: bool = False,
normal_probes: bool = False,
) -> list[str]
Return the output names a workflow row gets when it declares none.
Every kind hangs off {name}, the point's rendered stem, so the
naming template decides the stem and this list decides the suffixes
(PFS-2029.19); a steady row leaves out the unsteady plots file. An unsteady
row leaves out the probe-points instant export unless normal_probes
is true (FR-417). Solver residual and load plots remain available on both
paths. exports is
the pproc artifact's
[exports] table (PFS-2029.14.02): a kind set to false is left
out. Unstated kinds are kept except those of :data:OPT_IN_EXPORT_KINDS,
so an empty table preserves the existing export set, and except the
section Cp plot, which is on where has_sections says the pproc declares
surface sections to plot. The
artifact cannot set loads or simulation to false
(:class:PprocSpec refuses both), so every row naming a run type
declares its loads table and its final saved simulation. The two
volume-section kinds are never here: :meth:PprocSpec.outputs adds the
one a declared [volume_section] names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unsteady
|
bool
|
Whether the row is unsteady. |
required |
exports
|
mapping of str to bool
|
The pproc artifact's |
None
|
has_sections
|
bool
|
Whether the pproc declares surface sections to plot. |
False
|
normal_probes
|
bool
|
Whether an unsteady row samples its pproc's probes as normal probe points (FR-417), whose probe-points export it then keeps. |
False
|
Returns:
| Type | Description |
|---|---|
list of str
|
The output names, each |
pyflightstream.cases.derived_body_sha256
¶
derived_body_sha256(text: str) -> str
Return the digest of a campaign text's canonical body.
The canonical form is stated here because the digest is compared against a value written into a file on another day, possibly on another platform:
- the line carrying the marker's own digest is DROPPED, so the digest can be written into the very text it describes;
- the text is split with
splitlines(), which drops the line TERMINATOR, so a file written throughopen(..., "w")on Windows, where every newline becomes CRLF on disk, still matches the digest taken before it was written; - every line is then right-stripped and trailing blank lines go, so trailing whitespace, which no reader can see and several editors add or remove on save, is not a reason to refuse a campaign;
- the surviving lines join on
\nand hash as UTF-8.
The two middle rules address distinct differences: line terminators and trailing whitespace. Splitting alone handles CRLF; stripping also handles spaces and tabs before the terminator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The whole decoded |
required |
Returns:
| Type | Description |
|---|---|
str
|
Lowercase hexadecimal sha256, through
:func: |
Examples:
>>> derived_body_sha256("[campaign]\nname = 'a'\n") == derived_body_sha256(
... "[campaign]\r\nname = 'a'\r\n\r\n"
... )
True
pyflightstream.cases.geometric_sweep_values
¶
geometric_sweep_values(
variables: Mapping[str, object],
) -> list[str]
Return the angles a case's geometric sweep variable declares.
The variable is :data:ROTATION_SWEEP_KEY, and its values are
comma separated because a case variable holds one scalar or one
string and never a list. Values are returned as written, in degrees,
without being converted: this function counts how many angles were
asked for, and whether each is a number is the recipe's or the
workflow's refusal to make, naming the key the user typed.
The key is matched CASE-INSENSITIVELY. Its spelling is settled elsewhere, and a limit that fires only for one casing is a limit a user gets past by shouting.
EVERY matching key is read and their values are POOLED, rather than
the first match winning. Two keys differing only in case are two
distinct entries in a variables mapping, so a first-match rule let a
one-angle angle_sweep_deg stand in front of a three-angle
ANGLE_SWEEP_DEG and carry the whole declaration past the limit.
Pooling closes that and is right on its own terms besides: two keys
naming one rotation is an ambiguity, and counting both is what makes
the ambiguous case meet a refusal rather than a coin toss.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variables
|
mapping of str to object
|
A case's free variables, as :attr: |
required |
Returns:
| Type | Description |
|---|---|
list of str
|
The declared angles in degrees, in the order written, pooled
across every key that spells :data: |
Examples:
>>> geometric_sweep_values({"angle_sweep_deg": "0.0,5.0,10.0"})
['0.0', '5.0', '10.0']
>>> geometric_sweep_values({"angle_sweep_deg": "5.0", "ANGLE_SWEEP_DEG": "7.5"})
['5.0', '7.5']
>>> geometric_sweep_values({"CONFIG": "NSX"})
[]
pyflightstream.cases.global_frame_plot_declarations
¶
global_frame_plot_declarations(
pproc: object,
) -> tuple[ForcePlotGroup, ...]
Read declarations of all six load components in the global MRP frame.
A {family} name counts: its emitted groups still measure global loads.
This reads declarations, not emitted names; post must separately reject
ambiguous names and cannot infer a template's expansion from its spelling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pproc
|
PprocSpec or object
|
The pproc artifact, or anything carrying its |
required |
Returns:
| Type | Description |
|---|---|
tuple of ForcePlotGroup
|
The force-plot groups declared in the MRP frame when the plots name
all of :data: |
pyflightstream.cases.load_campaign
¶
load_campaign(path: str | Path) -> Campaign
Refuse the retired campaign-file declaration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
The rejected campaign file; its contents are not read or executed. |
required |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
The matrix is the sole campaign declaration. Ordinary Python Campaign and SimCase construction remains available. |
pyflightstream.cases.multiplied_sweep
¶
multiplied_sweep(
sweep: _NamedSweep, variables: Mapping[str, object]
) -> list[str]
Return the geometric angles that would MULTIPLY with the sweep.
This is the single owner of the one-sweep-per-case limit, called from
both places a case can be declared: the campaign.toml model
(:class:SimCase) and the run matrix reader
(:func:pyflightstream.cases.matrix.read_matrix). Two owners would
be two rules, and the drift would be discovered by a user whose
hand-written campaign ran what the matrix refuses.
THE DECISION IT ENFORCES (design note DD-28): a geometric sweep does
NOT multiply with
the aerodynamic one. A case carries one aerodynamic sweep and at most
one FIXED geometric offset (:data:ROTATION_OFFSET_KEY); a study OF
the geometry is one case per geometry, each with its own sim_id.
Multiplication was rejected on identity rather than on taste. A run
is identified by :func:point_name, whose aerodynamic sweep axes are
:data:_TAG_PREFIXES, and none of the three is geometric, so the
three angles of a rotation sweep crossed with an eleven point alpha
sweep are thirty three runs wearing eleven identities: each group of
three renders one tag, one run_id and one set of output file
names. That is exactly the collision
:meth:SweepAxis._points_have_distinct_tags already refuses within
one axis, and it is not made safe by arriving from a second axis. The
same collapse reaches the evidence:
:class:pyflightstream.qa.cost.PointKey keys a cost row by
sim_id and the recorded point, so three geometries under one
sim_id average into one cell and the geometry that got slower
cannot be seen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sweep
|
SweepAxis
|
The case's aerodynamic sweep. |
required |
variables
|
mapping of str to object
|
The case's free variables. |
required |
Returns:
| Type | Description |
|---|---|
list of str
|
The geometric angles in degrees when BOTH sweeps carry two or more values, which is the multiplying shape. Empty otherwise, so a fixed offset beside a sweep, a rotation sweep on a single point case, and a case with no geometric variable at all all pass: each of those is one sweep, and one sweep is what a case may have. |
Examples:
>>> from pyflightstream.cases import SweepAxis
>>> sweep = SweepAxis(type="alpha", values=[0.0, 2.0, 4.0])
>>> multiplied_sweep(sweep, {"angle_sweep_deg": "0.0,5.0"})
['0.0', '5.0']
>>> multiplied_sweep(sweep, {"angle_deg": "5.0"})
[]
pyflightstream.cases.name_field
¶
name_field(key: str, value: float) -> str
Write one variable the way a point name carries it, for example M144 or AL-020.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
The FLIGHT_CONDITION key, a key of :data: |
required |
value
|
float
|
The variable's value on the point. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The field: its code, then the scaled value, zero-padded to its width. |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
If the key has no code, the value is not finite, a magnitude variable is negative, or an unsigned variable is negative. |
Examples:
>>> name_field("MACH", 0.144)
'M144'
>>> name_field("ALPHA", -2.0)
'AL-020'
pyflightstream.cases.point_name
¶
point_name(
case: _NamedCase, point: Mapping[str, float]
) -> str
Return the name of one point of a case: its identity, folder and file stem.
Every variable the row's FLIGHT_CONDITION declares, in the order the row
declares them, written as :data:POINT_NAME_FIELDS says, with the point's
own value for a swept one: M144RE438AL+000BE+000J+080. A case with no
cell (authored in Python) is named by its Mach number when it has one and
then by the axes of its point. It ends the run_id, names the datapoint
folder DP-<name> and is the stem of every file P<POL>-<name>.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
case
|
SimCase
|
The case the point belongs to. |
required |
point
|
mapping of str to float
|
The point's coordinates, as :meth: |
required |
Returns:
| Type | Description |
|---|---|
str
|
The point name, every field of :func: |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
If a declared variable has no value on this point or no code. |
Examples:
>>> from pyflightstream.cases import SimCase, SweepAxis
>>> case = SimCase(
... sim_id="7002",
... aircraft="Wing",
... recipe="steady",
... sweep=SweepAxis(type="alpha", values=[0.0, 2.0]),
... mach=0.144,
... )
>>> point_name(case, {"alpha": 2.0})
'M144AL+020'
pyflightstream.cases.point_state_key
¶
point_state_key(point: Mapping[str, float]) -> str
Return the key one point's resolved state is filed under.
The point itself, written to ten significant figures per axis and sorted, so the same point read from a matrix, a plan or a record finds its state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
mapping of str to float
|
The point's coordinates. |
required |
Returns:
| Type | Description |
|---|---|
str
|
|
Examples:
>>> point_state_key({"beta": 0.0, "alpha": 2.0})
'alpha=2|beta=0'
>>> point_state_key({"beta": -0.0})
'beta=0'
pyflightstream.cases.resolve_alias
¶
resolve_alias(
token: str,
inventory: Sequence[str],
aliases: Mapping[str, Sequence[str]] | None,
) -> list[str] | None
Resolve one cited name as an alias of the setup, or None when it is not one.
An alias is a name the setup's
[aliases] table gives to a list of boundary names or families,
and it is read wherever a boundary is cited, the exact spelling
first and case folded second, as a family is. Each member resolves as
a name does, an exact name of the inventory first and a family (the
label without its trailing number) second; a member the inventory
does not carry is ignored, which is how one setup serves a wing-body
and a rotor. A NUMBERED member is that exact name and never its
numbered siblings: Hub1 over a mesh carrying Hub2 and Hub3
selects nothing, and is not refused. The names come back in member
order, each once; an alias every member of which is absent resolves to
an empty list, and
the caller says what that means for its key.
A member may be another alias, and the reader follows it to the end. A member the inventory carries is that boundary first, whatever else shares its spelling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
The cited name. |
required |
inventory
|
sequence of str
|
The boundary names the row's geometry carries. |
required |
aliases
|
mapping of str to sequence of str or None
|
The |
required |
Returns:
| Type | Description |
|---|---|
list of str or None
|
The boundary names the alias resolves to, in member order, each once; None when the name is not an alias of the setup. |
Raises:
| Type | Description |
|---|---|
AliasCycleError
|
If following the members returns to an alias already on the path,
naming both sides. A member that names its OWN alias is not a
ring: it falls back to the FAMILY reading, exactly as it did
before aliases could nest, so |
pyflightstream.cases.resolve_recipe
¶
resolve_recipe(
reference: str,
) -> Callable[[SimCase, Script], None]
Import the recipe function a reference string names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
callable
|
The recipe function, satisfying :class: |
pyflightstream.cases.select_families
¶
select_families(
selection: str | Sequence[str],
inventory: Sequence[str],
is_blade: Callable[[str], bool],
aliases: Mapping[str, Sequence[str]] | None = None,
*,
strict: bool = True,
) -> list[list[str]]
Expand one families entry over the geometry's inventory.
The selectors and each give inventory order; a literal list or an alias keeps the order
in which its members were written.
Returns a list of family lists, one per emitted entry: a single list
for a selector or a literal list, one list per family for each
and each_blade. A family the geometry does not carry is left out,
as the reference driver filtered its tables to the components it opened; an
entry that resolves to nothing is an empty result and the caller
skips it. all is the empty list standing for the command's own
every-boundary form, which the caller spells as -1; as a list member it
adds every surface of the inventory. A cited word is read as a
[groups] member is: an exact boundary name of the inventory first,
then an ALIAS of the row's setup,
then a family, and only then as a selector word (all, each and
each_blade, which this function expands, and the retired airframe
and blades), as the bare string and as a list member. So an exact
boundary wins over an alias of the same spelling, and airframe and
blades are the setup's own where it defines them and refused as
selectors where it does not.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
selection
|
str or sequence of str
|
The entry's |
required |
inventory
|
sequence of str
|
The boundary names the row's geometry carries, in its order. |
required |
is_blade
|
callable
|
Whether a boundary name is a blade's. |
required |
aliases
|
mapping of str to sequence of str
|
The |
None
|
strict
|
bool
|
Refuse, at plan, a numbered boundary the entry cites ALONE (a bare word, or a list of that one word) that the geometry lacks while it carries the family; False warns and skips it in post. A member of a longer list or of an alias selects its exact name only and is never refused here: one the geometry lacks is the caller's to warn about (FR-320) or refuse (FR-435). |
True
|
Returns:
| Type | Description |
|---|---|
list of list of str
|
One family list per emitted entry; empty when the entry resolves to nothing. |
pyflightstream.cases.select_group_members
¶
select_group_members(
members: Sequence[int | str],
inventory: Sequence[str],
aliases: Mapping[str, Sequence[str]] | None = None,
*,
strict: bool = True,
) -> list[str]
Resolve one [groups] entry's members against an inventory, in member order.
An EMPTY group is every
name of the inventory. Otherwise each member is, tried in this order,
an exact name of the inventory; an ALIAS of the row's setup
(:func:resolve_alias), so airframe and blades are whatever
the setup says and nothing is hardcoded; or a FAMILY, the label
without its trailing number, selecting every member of it the
inventory carries (Blade is Blade1 to Blade6). A member
resolving to nothing is left out, which is how one artifact serves a
wing-body and an isolated rotor; a POSITION is not a name and is left
to the caller, which is the motion path that has an index to give it.
The inventory is whatever the caller judges by: the boundary labels
of the opened file on the script path, the surface rows of the loads
table at products time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
members
|
sequence of int or str
|
The group's members as written; a position is left to the caller. |
required |
inventory
|
sequence of str
|
The names the caller judges by. |
required |
aliases
|
mapping of str to sequence of str
|
The |
None
|
strict
|
bool
|
Refuse, during planning, a numbered boundary a ONE-MEMBER entry cites (a matrix cell's reading) that the geometry lacks while it carries the family. Post-processing passes False to warn and leave it out instead. A member of a longer entry selects its exact name only and is left out without a refusal (FR-320, FR-435). |
True
|
Returns:
| Type | Description |
|---|---|
list of str
|
The selected names, in member order, each once. |
pyflightstream.cases.sweep_name
¶
sweep_name(case: _NamedCase) -> str
Return the name of a case's whole sweep, each swept field written <code>+sweep.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
case
|
SimCase
|
The case whose sweep is named. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The name of the case's first point with every swept field written
:data: |